@itwin/presentation-frontend 4.5.0-dev.0 → 4.5.0-dev.16

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 (112) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/LICENSE.md +1 -1
  3. package/README.md +1 -1
  4. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
  5. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +10 -6
  6. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  7. package/lib/cjs/presentation-frontend/Diagnostics.d.ts.map +1 -1
  8. package/lib/cjs/presentation-frontend/Diagnostics.js +18 -13
  9. package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
  10. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +3 -3
  11. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
  12. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
  13. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +3 -3
  14. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  15. package/lib/cjs/presentation-frontend/LocalizationHelper.js +3 -3
  16. package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
  17. package/lib/cjs/presentation-frontend/Presentation.d.ts.map +1 -1
  18. package/lib/cjs/presentation-frontend/Presentation.js +24 -14
  19. package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
  20. package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
  21. package/lib/cjs/presentation-frontend/PresentationManager.js +57 -30
  22. package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
  23. package/lib/cjs/presentation-frontend/RulesetManager.d.ts.map +1 -1
  24. package/lib/cjs/presentation-frontend/RulesetManager.js +11 -7
  25. package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
  26. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
  27. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +53 -31
  28. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  29. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  30. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +111 -66
  31. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  32. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
  33. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +54 -25
  34. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  35. package/lib/cjs/presentation-frontend/selection/HiliteRules.json +172 -172
  36. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
  37. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +16 -10
  38. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  39. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +3 -3
  40. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  41. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
  42. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +3 -3
  43. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  44. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
  45. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +15 -9
  46. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  47. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
  48. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +7 -5
  49. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  50. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
  51. package/lib/cjs/presentation-frontend/selection/SelectionManager.js +31 -16
  52. package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
  53. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
  54. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +25 -14
  55. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  56. package/lib/cjs/presentation-frontend.js +3 -3
  57. package/lib/cjs/presentation-frontend.js.map +1 -1
  58. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
  59. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +10 -6
  60. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  61. package/lib/esm/presentation-frontend/Diagnostics.d.ts.map +1 -1
  62. package/lib/esm/presentation-frontend/Diagnostics.js +18 -13
  63. package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
  64. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +3 -3
  65. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
  66. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
  67. package/lib/esm/presentation-frontend/IpcRequestsHandler.js +3 -3
  68. package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  69. package/lib/esm/presentation-frontend/LocalizationHelper.js +3 -3
  70. package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
  71. package/lib/esm/presentation-frontend/Presentation.d.ts.map +1 -1
  72. package/lib/esm/presentation-frontend/Presentation.js +24 -14
  73. package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
  74. package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
  75. package/lib/esm/presentation-frontend/PresentationManager.js +57 -30
  76. package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
  77. package/lib/esm/presentation-frontend/RulesetManager.d.ts.map +1 -1
  78. package/lib/esm/presentation-frontend/RulesetManager.js +11 -7
  79. package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
  80. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
  81. package/lib/esm/presentation-frontend/RulesetVariablesManager.js +53 -31
  82. package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  83. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  84. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +111 -66
  85. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  86. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
  87. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +54 -25
  88. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  89. package/lib/esm/presentation-frontend/selection/HiliteRules.json +172 -172
  90. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
  91. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +17 -11
  92. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  93. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +3 -3
  94. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  95. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
  96. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +3 -3
  97. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  98. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
  99. package/lib/esm/presentation-frontend/selection/SelectionHandler.js +15 -9
  100. package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  101. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
  102. package/lib/esm/presentation-frontend/selection/SelectionHelper.js +7 -5
  103. package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  104. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
  105. package/lib/esm/presentation-frontend/selection/SelectionManager.js +31 -16
  106. package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
  107. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
  108. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +25 -14
  109. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  110. package/lib/esm/presentation-frontend.js +3 -3
  111. package/lib/esm/presentation-frontend.js.map +1 -1
  112. package/package.json +19 -16
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
6
  /** @packageDocumentation
7
7
  * @module Core
8
8
  */
@@ -33,7 +33,9 @@ class PresentationManager {
33
33
  get activeUnitSystem() {
34
34
  return this._explicitActiveUnitSystem ?? core_frontend_1.IModelApp.quantityFormatter.activeUnitSystem;
35
35
  }
36
- set activeUnitSystem(value) { this._explicitActiveUnitSystem = value; }
36
+ set activeUnitSystem(value) {
37
+ this._explicitActiveUnitSystem = value;
38
+ }
37
39
  constructor(props) {
38
40
  /**
39
41
  * An event raised when hierarchies created using specific ruleset change
@@ -54,7 +56,8 @@ class PresentationManager {
54
56
  // eslint-disable-next-line deprecation/deprecation
55
57
  this._explicitActiveUnitSystem = props.activeUnitSystem;
56
58
  }
57
- this._requestsHandler = props?.rpcRequestsHandler ?? new presentation_common_1.RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);
59
+ this._requestsHandler =
60
+ props?.rpcRequestsHandler ?? new presentation_common_1.RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);
58
61
  this._rulesetVars = new Map();
59
62
  this._rulesets = RulesetManager_1.RulesetManagerImpl.create();
60
63
  this._localizationHelper = new LocalizationHelper_1.FrontendLocalizationHelper(props?.activeLocale);
@@ -68,8 +71,12 @@ class PresentationManager {
68
71
  }
69
72
  }
70
73
  /** Get / set active locale used for localizing presentation data */
71
- get activeLocale() { return this._localizationHelper.locale; }
72
- set activeLocale(locale) { this._localizationHelper.locale = locale; }
74
+ get activeLocale() {
75
+ return this._localizationHelper.locale;
76
+ }
77
+ set activeLocale(locale) {
78
+ this._localizationHelper.locale = locale;
79
+ }
73
80
  dispose() {
74
81
  if (this._clearEventListener) {
75
82
  this._clearEventListener();
@@ -77,8 +84,9 @@ class PresentationManager {
77
84
  }
78
85
  }
79
86
  async onConnection(imodel) {
80
- if (!this._connections.has(imodel))
87
+ if (!this._connections.has(imodel)) {
81
88
  this._connections.set(imodel, this.initializeIModel(imodel));
89
+ }
82
90
  await this._connections.get(imodel);
83
91
  }
84
92
  async initializeIModel(imodel) {
@@ -91,18 +99,22 @@ class PresentationManager {
91
99
  async handleUpdateAsync(report) {
92
100
  for (const imodelKey in report) {
93
101
  // istanbul ignore if
94
- if (!report.hasOwnProperty(imodelKey))
102
+ if (!report.hasOwnProperty(imodelKey)) {
95
103
  continue;
104
+ }
96
105
  const imodelReport = report[imodelKey];
97
106
  for (const rulesetId in imodelReport) {
98
107
  // istanbul ignore if
99
- if (!imodelReport.hasOwnProperty(rulesetId))
108
+ if (!imodelReport.hasOwnProperty(rulesetId)) {
100
109
  continue;
110
+ }
101
111
  const updateInfo = imodelReport[rulesetId];
102
- if (updateInfo.content)
112
+ if (updateInfo.content) {
103
113
  this.onIModelContentChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.content, imodelKey });
104
- if (updateInfo.hierarchy)
114
+ }
115
+ if (updateInfo.hierarchy) {
105
116
  this.onIModelHierarchyChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.hierarchy, imodelKey });
117
+ }
106
118
  }
107
119
  }
108
120
  }
@@ -119,13 +131,19 @@ class PresentationManager {
119
131
  return new PresentationManager(props);
120
132
  }
121
133
  /** @internal */
122
- get rpcRequestsHandler() { return this._requestsHandler; }
134
+ get rpcRequestsHandler() {
135
+ return this._requestsHandler;
136
+ }
123
137
  /** @internal */
124
- get ipcRequestsHandler() { return this._ipcRequestsHandler; }
138
+ get ipcRequestsHandler() {
139
+ return this._ipcRequestsHandler;
140
+ }
125
141
  /**
126
142
  * Get rulesets manager
127
143
  */
128
- rulesets() { return this._rulesets; }
144
+ rulesets() {
145
+ return this._rulesets;
146
+ }
129
147
  /**
130
148
  * Get ruleset variables manager for specific ruleset
131
149
  * @param rulesetId Id of the ruleset to get the vars manager for
@@ -142,8 +160,9 @@ class PresentationManager {
142
160
  // 2. put all `requestOptions` members (if `locale` or `unitSystem` are set, they'll override the defaults put at #1)
143
161
  // 3. put `imodel` of type `IModelRpcProps` which overwrites the `imodel` from `requestOptions` put at #2
144
162
  const defaultOptions = {};
145
- if (this.activeLocale)
163
+ if (this.activeLocale) {
146
164
  defaultOptions.locale = this.activeLocale;
165
+ }
147
166
  defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line deprecation/deprecation
148
167
  const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;
149
168
  return {
@@ -163,13 +182,14 @@ class PresentationManager {
163
182
  const foundRuleset = await this._rulesets.get(rulesetOrId);
164
183
  foundRulesetOrId = foundRuleset ? foundRuleset.toJSON() : rulesetOrId;
165
184
  }
166
- const rulesetId = (typeof foundRulesetOrId === "object") ? foundRulesetOrId.id : foundRulesetOrId;
185
+ const rulesetId = typeof foundRulesetOrId === "object" ? foundRulesetOrId.id : foundRulesetOrId;
167
186
  // All Id64Array variable values must be sorted for serialization to JSON to work. RulesetVariablesManager
168
187
  // sorts them before storing, so that part is taken care of, but we need to ensure that variables coming from
169
188
  // request options are also sorted.
170
189
  const variables = (rulesetVariables ?? []).map((variable) => {
171
- if (variable.type === presentation_common_1.VariableValueTypes.Id64Array)
190
+ if (variable.type === presentation_common_1.VariableValueTypes.Id64Array) {
172
191
  return { ...variable, value: core_bentley_1.OrderedId64Iterable.sortArray(variable.value) };
192
+ }
173
193
  return variable;
174
194
  });
175
195
  if (!this._ipcRequestsHandler) {
@@ -284,7 +304,7 @@ class PresentationManager {
284
304
  keys: stripTransientElementKeys(requestOptions.keys).toJSON(),
285
305
  ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),
286
306
  });
287
- let descriptor = (requestOptions.descriptor instanceof presentation_common_1.Descriptor) ? requestOptions.descriptor : undefined;
307
+ let descriptor = requestOptions.descriptor instanceof presentation_common_1.Descriptor ? requestOptions.descriptor : undefined;
288
308
  const result = await (0, exports.buildPagedArrayResponse)(options.paging, async (partialPageOptions, requestIndex) => {
289
309
  if (0 === requestIndex && !descriptor) {
290
310
  const content = await this._requestsHandler.getPagedContent({ ...rpcOptions, paging: partialPageOptions });
@@ -296,9 +316,10 @@ class PresentationManager {
296
316
  }
297
317
  return this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging: partialPageOptions });
298
318
  });
299
- if (!descriptor)
319
+ if (!descriptor) {
300
320
  return undefined;
301
- const items = result.items.map((itemJson) => presentation_common_1.Item.fromJSON(itemJson)).filter((item) => (item !== undefined));
321
+ }
322
+ const items = result.items.map((itemJson) => presentation_common_1.Item.fromJSON(itemJson)).filter((item) => item !== undefined);
302
323
  const resultContent = new presentation_common_1.Content(descriptor, items);
303
324
  if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {
304
325
  const koqPropertyFormatter = new presentation_common_1.KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);
@@ -334,8 +355,9 @@ class PresentationManager {
334
355
  await this.onConnection(requestOptions.imodel);
335
356
  const results = await this._requestsHandler.getElementProperties(this.toRpcTokenOptions(requestOptions));
336
357
  // istanbul ignore if
337
- if (!results)
358
+ if (!results) {
338
359
  return undefined;
360
+ }
339
361
  return this._localizationHelper.getLocalizedElementProperties(results);
340
362
  }
341
363
  /**
@@ -378,7 +400,7 @@ class PresentationManager {
378
400
  await this.onConnection(requestOptions.imodel);
379
401
  const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });
380
402
  const result = await (0, exports.buildPagedArrayResponse)(undefined, async (partialPageOptions) => {
381
- const partialKeys = (!partialPageOptions.start) ? rpcOptions.keys : rpcOptions.keys.slice(partialPageOptions.start);
403
+ const partialKeys = !partialPageOptions.start ? rpcOptions.keys : rpcOptions.keys.slice(partialPageOptions.start);
382
404
  return this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });
383
405
  });
384
406
  return this._localizationHelper.getLocalizedLabelDefinitions(result.items);
@@ -386,8 +408,9 @@ class PresentationManager {
386
408
  }
387
409
  exports.PresentationManager = PresentationManager;
388
410
  const getDescriptorOverrides = (descriptorOrOverrides) => {
389
- if (descriptorOrOverrides instanceof presentation_common_1.Descriptor)
411
+ if (descriptorOrOverrides instanceof presentation_common_1.Descriptor) {
390
412
  return descriptorOrOverrides.createDescriptorOverrides();
413
+ }
391
414
  return descriptorOrOverrides;
392
415
  };
393
416
  async function createPagedGeneratorResponse(props) {
@@ -405,14 +428,17 @@ async function createPagedGeneratorResponse(props) {
405
428
  }
406
429
  const receivedItemsCount = partialResult.items.length;
407
430
  if (partialResult.total !== 0 && receivedItemsCount === 0) {
408
- if (pageStart >= partialResult.total)
431
+ if (pageStart >= partialResult.total) {
409
432
  throw new Error(`Requested page with start index ${pageStart} is out of bounds. Total number of items: ${partialResult.total}`);
433
+ }
410
434
  throw new Error("Paged request returned non zero total count but no items");
411
435
  }
412
- if (pageSize !== 0 && receivedItemsCount >= pageSize || receivedItemsCount >= (partialResult.total - pageStart))
436
+ if ((pageSize !== 0 && receivedItemsCount >= pageSize) || receivedItemsCount >= partialResult.total - pageStart) {
413
437
  break;
414
- if (pageSize !== 0)
438
+ }
439
+ if (pageSize !== 0) {
415
440
  pageSize -= receivedItemsCount;
441
+ }
416
442
  pageStart += receivedItemsCount;
417
443
  partialResult = await props.get({ start: pageStart, size: pageSize }, requestIndex++);
418
444
  }
@@ -430,15 +456,16 @@ const buildPagedArrayResponse = async (requestedPage, getter) => {
430
456
  };
431
457
  exports.buildPagedArrayResponse = buildPagedArrayResponse;
432
458
  const stripTransientElementKeys = (keys) => {
433
- if (!keys.some((key) => presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME))
459
+ if (!keys.some((key) => presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME)) {
434
460
  return keys;
461
+ }
435
462
  const copy = new presentation_common_1.KeySet();
436
463
  copy.add(keys, (key) => {
437
464
  // the callback is not going to be called with EntityProps as KeySet converts them
438
465
  // to InstanceKeys, but we want to keep the EntityProps case for correctness
439
466
  // istanbul ignore next
440
- const isTransient = presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME
441
- || presentation_common_1.Key.isEntityProps(key) && key.classFullName === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME;
467
+ const isTransient = (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) ||
468
+ (presentation_common_1.Key.isEntityProps(key) && key.classFullName === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME);
442
469
  return !isTransient;
443
470
  });
444
471
  return copy;
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmG;AACnG,wDAA2E;AAG3E,oEAQoC;AACpC,6DAA0D;AAC1D,6DA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,4BAA4B,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACrF,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,EAAE;QACpC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAClB;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC;AAEF,MAAM,yBAAyB,GAAG,CAAC,IAAY,EAAE,EAAE;IACjD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B,CAAC;QAC9F,OAAO,IAAI,CAAC;IAEd,MAAM,IAAI,GAAG,IAAI,4BAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,kFAAkF;QAClF,4EAA4E;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GAAG,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B;eACtF,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,8CAA2B,CAAC;QACjF,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent, CompressedId64Set, IDisposable, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { IModelApp, IModelConnection, IpcApp } from \"@itwin/core-frontend\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\nimport {\n ClientDiagnosticsAttribute, Content, ContentDescriptorRequestOptions, ContentFormatter, ContentInstanceKeysRequestOptions,\n ContentPropertyValueFormatter, ContentRequestOptions, ContentSourcesRequestOptions, ContentUpdateInfo, Descriptor, DescriptorOverrides,\n DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DisplayValueGroup, DistinctValuesRequestOptions, ElementProperties,\n FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, FormatsMap, HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions, HierarchyUpdateInfo, InstanceKey, Item, Key, KeySet, KoqPropertyValueFormatter, LabelDefinition, Node, NodeKey,\n NodePathElement, Paged, PagedResponse, PageOptions, PresentationIpcEvents, RpcRequestsHandler, Ruleset, RulesetVariable, SelectClassInfo,\n SingleElementPropertiesRequestOptions, UpdateInfo, VariableValueTypes,\n} from \"@itwin/presentation-common\";\nimport { IpcRequestsHandler } from \"./IpcRequestsHandler\";\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper\";\nimport { RulesetManager, RulesetManagerImpl } from \"./RulesetManager\";\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./selection/SelectionManager\";\n\n/**\n * Data structure that describes IModel hierarchy change event arguments.\n * @alpha\n */\nexport interface IModelHierarchyChangeEventArgs {\n /** Id of ruleset that was used to create hierarchy. */\n rulesetId: string;\n /** Hierarchy changes info. */\n updateInfo: HierarchyUpdateInfo;\n /** Key of iModel that was used to create hierarchy. It matches [[IModelConnection.key]] property. */\n imodelKey: string;\n}\n\n/**\n * Data structure that describes iModel content change event arguments.\n * @alpha\n */\nexport interface IModelContentChangeEventArgs {\n /** Id of ruleset that was used to create content. */\n rulesetId: string;\n /** Content changes info. */\n updateInfo: ContentUpdateInfo;\n /** Key of iModel that was used to create content. It matches [[IModelConnection.key]] property. */\n imodelKey: string;\n}\n\n/**\n * Properties used to configure [[PresentationManager]]\n * @public\n */\nexport interface PresentationManagerProps {\n /**\n * Sets the active locale to use when localizing presentation-related\n * strings. It can later be changed through [[PresentationManager]].\n */\n activeLocale?: string;\n\n /**\n * Sets the active unit system to use for formatting property values with\n * units. The value can later be changed through [[PresentationManager.activeUnitSystem]] setter or\n * overriden for each request through request parameters. If not set, `IModelApp.quantityFormatter.activeUnitSystem`\n * is used by default.\n *\n * @deprecated in 4.0. Use [IModelApp.quantityFormatter]($core-frontend) to set the active unit system.\n */\n activeUnitSystem?: UnitSystemKey;\n\n /**\n * ID used to identify client that requests data. Generally, clients should\n * store this ID in their local storage so the ID can be reused across\n * sessions - this allows reusing some caches.\n *\n * Defaults to a unique GUID as a client id.\n */\n clientId?: string;\n\n /**\n * Timeout (in milliseconds) for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n *\n * Defaults to 10 minutes.\n */\n requestTimeout?: number;\n\n /**\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelConnection]($core-frontend).\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\n * @alpha\n */\n schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\n\n /**\n * A map of default unit formats to use for formatting properties that don't have a presentation format\n * in requested unit system.\n *\n * @note Only has effect when frontend value formatting is enabled by supplying the `schemaContextProvider` prop.\n * @alpha\n */\n defaultFormats?: FormatsMap;\n\n /** @internal */\n rpcRequestsHandler?: RpcRequestsHandler;\n\n /** @internal */\n ipcRequestsHandler?: IpcRequestsHandler;\n}\n\n/**\n * Frontend Presentation manager which basically just forwards all calls to\n * the backend implementation.\n *\n * @public\n */\nexport class PresentationManager implements IDisposable {\n private _requestsHandler: RpcRequestsHandler;\n private _rulesets: RulesetManager;\n private _localizationHelper: FrontendLocalizationHelper;\n private _explicitActiveUnitSystem: UnitSystemKey | undefined;\n private _rulesetVars: Map<string, RulesetVariablesManager>;\n private _clearEventListener?: () => void;\n private _connections: Map<IModelConnection, Promise<void>>;\n private _schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\n private _defaultFormats?: FormatsMap;\n private _ipcRequestsHandler?: IpcRequestsHandler;\n\n /**\n * An event raised when hierarchies created using specific ruleset change\n * @alpha\n */\n public onIModelHierarchyChanged = new BeEvent<(args: IModelHierarchyChangeEventArgs) => void>();\n\n /**\n * An event raised when content created using specific ruleset changes\n * @alpha\n */\n public onIModelContentChanged = new BeEvent<(args: IModelContentChangeEventArgs) => void>();\n\n /**\n * Get / set active unit system used to format property values with units.\n *\n * @deprecated in 4.0. `IModelApp.quantityFormatter` should be used to get/set the active unit system. At the moment\n * [[PresentationManager]] allows overriding it, but returns `IModelApp.quantityFormatter.activeUnitSystem` if override\n * is not set.\n */\n public get activeUnitSystem(): UnitSystemKey {\n return this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem;\n }\n public set activeUnitSystem(value: UnitSystemKey | undefined) { this._explicitActiveUnitSystem = value; }\n\n private constructor(props?: PresentationManagerProps) {\n if (props) {\n // eslint-disable-next-line deprecation/deprecation\n this._explicitActiveUnitSystem = props.activeUnitSystem;\n }\n\n this._requestsHandler = props?.rpcRequestsHandler ?? new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);\n this._rulesetVars = new Map<string, RulesetVariablesManager>();\n this._rulesets = RulesetManagerImpl.create();\n this._localizationHelper = new FrontendLocalizationHelper(props?.activeLocale);\n this._connections = new Map<IModelConnection, Promise<void>>();\n this._schemaContextProvider = props?.schemaContextProvider;\n this._defaultFormats = props?.defaultFormats;\n\n if (IpcApp.isValid) {\n // Ipc only works in ipc apps, so the `onUpdate` callback will only be called there.\n this._clearEventListener = IpcApp.addListener(PresentationIpcEvents.Update, this.onUpdate);\n this._ipcRequestsHandler = props?.ipcRequestsHandler ?? new IpcRequestsHandler(this._requestsHandler.clientId);\n }\n }\n\n /** Get / set active locale used for localizing presentation data */\n public get activeLocale(): string | undefined { return this._localizationHelper.locale; }\n public set activeLocale(locale: string | undefined) { this._localizationHelper.locale = locale; }\n\n public dispose() {\n if (this._clearEventListener) {\n this._clearEventListener();\n this._clearEventListener = undefined;\n }\n }\n\n private async onConnection(imodel: IModelConnection) {\n if (!this._connections.has(imodel))\n this._connections.set(imodel, this.initializeIModel(imodel));\n await this._connections.get(imodel);\n }\n\n private async initializeIModel(imodel: IModelConnection) {\n imodel.onClose.addOnce(() => {\n this._connections.delete(imodel);\n });\n await this.onNewiModelConnection(imodel);\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private onUpdate = (_evt: Event, report: UpdateInfo) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.handleUpdateAsync(report);\n };\n\n /** @note This is only called in native apps after changes in iModels */\n private async handleUpdateAsync(report: UpdateInfo) {\n for (const imodelKey in report) {\n // istanbul ignore if\n if (!report.hasOwnProperty(imodelKey))\n continue;\n\n const imodelReport = report[imodelKey];\n for (const rulesetId in imodelReport) {\n // istanbul ignore if\n if (!imodelReport.hasOwnProperty(rulesetId))\n continue;\n\n const updateInfo = imodelReport[rulesetId];\n if (updateInfo.content)\n this.onIModelContentChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.content, imodelKey });\n if (updateInfo.hierarchy)\n this.onIModelHierarchyChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.hierarchy, imodelKey });\n }\n }\n }\n\n /**\n * Function that is called when a new IModelConnection is used to retrieve data.\n * @internal\n */\n public async onNewiModelConnection(_: IModelConnection) { }\n\n /**\n * Create a new PresentationManager instance\n * @param props Optional properties used to configure the manager\n */\n public static create(props?: PresentationManagerProps) {\n return new PresentationManager(props);\n }\n\n /** @internal */\n public get rpcRequestsHandler() { return this._requestsHandler; }\n\n /** @internal */\n public get ipcRequestsHandler() { return this._ipcRequestsHandler; }\n\n /**\n * Get rulesets manager\n */\n public rulesets() { return this._rulesets; }\n\n /**\n * Get ruleset variables manager for specific ruleset\n * @param rulesetId Id of the ruleset to get the vars manager for\n */\n public vars(rulesetId: string) {\n if (!this._rulesetVars.has(rulesetId)) {\n const varsManager = new RulesetVariablesManagerImpl(rulesetId, this._ipcRequestsHandler);\n this._rulesetVars.set(rulesetId, varsManager);\n }\n return this._rulesetVars.get(rulesetId)!;\n }\n\n private toRpcTokenOptions<TOptions extends { imodel: IModelConnection, locale?: string, unitSystem?: UnitSystemKey, rulesetVariables?: RulesetVariable[] }>(requestOptions: TOptions) {\n // 1. put default `locale` and `unitSystem`\n // 2. put all `requestOptions` members (if `locale` or `unitSystem` are set, they'll override the defaults put at #1)\n // 3. put `imodel` of type `IModelRpcProps` which overwrites the `imodel` from `requestOptions` put at #2\n const defaultOptions: Pick<TOptions, \"locale\" | \"unitSystem\"> = {};\n if (this.activeLocale)\n defaultOptions.locale = this.activeLocale;\n defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line deprecation/deprecation\n\n const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;\n return {\n ...defaultOptions,\n ...rpcRequestOptions,\n ...(rulesetVariables ? { rulesetVariables: rulesetVariables.map(RulesetVariable.toJSON) } : {}),\n imodel: imodel.getRpcProps(),\n };\n }\n\n private async addRulesetAndVariablesToOptions<TOptions extends { rulesetOrId: Ruleset | string, rulesetVariables?: RulesetVariable[] }>(options: TOptions) {\n const { rulesetOrId, rulesetVariables } = options;\n let foundRulesetOrId: Ruleset | string;\n if (typeof rulesetOrId === \"object\") {\n foundRulesetOrId = rulesetOrId;\n } else {\n const foundRuleset = await this._rulesets.get(rulesetOrId);\n foundRulesetOrId = foundRuleset ? foundRuleset.toJSON() : rulesetOrId;\n }\n const rulesetId = (typeof foundRulesetOrId === \"object\") ? foundRulesetOrId.id : foundRulesetOrId;\n\n // All Id64Array variable values must be sorted for serialization to JSON to work. RulesetVariablesManager\n // sorts them before storing, so that part is taken care of, but we need to ensure that variables coming from\n // request options are also sorted.\n const variables = (rulesetVariables ?? []).map((variable) => {\n if (variable.type === VariableValueTypes.Id64Array)\n return { ...variable, value: OrderedId64Iterable.sortArray(variable.value) };\n return variable;\n });\n if (!this._ipcRequestsHandler) {\n // only need to add variables from variables manager if there's no IPC\n // handler - if there is one, the variables are already known by the backend\n variables.push(...this.vars(rulesetId).getAllVariables());\n }\n\n return { ...options, rulesetOrId: foundRulesetOrId, rulesetVariables: variables };\n }\n\n /** Retrieves nodes */\n public async getNodes(requestOptions: Paged<HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<Node[]> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions) => this._requestsHandler.getPagedNodes({ ...rpcOptions, paging: partialPageOptions }));\n // eslint-disable-next-line deprecation/deprecation\n return this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON));\n }\n\n /** Retrieves nodes count. */\n public async getNodesCount(requestOptions: HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute): Promise<number> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n return this._requestsHandler.getNodesCount(rpcOptions);\n }\n\n /** Retrieves total nodes count and a single page of nodes. */\n public async getNodesAndCount(requestOptions: Paged<HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<{ count: number, nodes: Node[] }> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions) => this._requestsHandler.getPagedNodes({ ...rpcOptions, paging: partialPageOptions }));\n return {\n count: result.total,\n // eslint-disable-next-line deprecation/deprecation\n nodes: this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON)),\n };\n }\n\n /**\n * Retrieves hierarchy level descriptor.\n * @beta\n */\n public async getNodesDescriptor(requestOptions: HierarchyLevelDescriptorRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute): Promise<Descriptor | undefined> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n const result = await this._requestsHandler.getNodesDescriptor(rpcOptions);\n const descriptor = Descriptor.fromJSON(result);\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n }\n\n /** Retrieves paths from root nodes to children nodes according to specified keys. Intersecting paths will be merged. */\n public async getNodePaths(requestOptions: FilterByInstancePathsHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute): Promise<NodePathElement[]> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n const result = await this._requestsHandler.getNodePaths(rpcOptions);\n // eslint-disable-next-line deprecation/deprecation\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /** Retrieves paths from root nodes to nodes containing filter text in their label. */\n public async getFilteredNodePaths(requestOptions: FilterByTextHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute): Promise<NodePathElement[]> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));\n // eslint-disable-next-line deprecation/deprecation\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /**\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\n * its related instances for loading related and navigation properties.\n * @public\n */\n public async getContentSources(requestOptions: ContentSourcesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<SelectClassInfo[]> {\n await this.onConnection(requestOptions.imodel);\n const rpcOptions = this.toRpcTokenOptions(requestOptions);\n const result = await this._requestsHandler.getContentSources(rpcOptions);\n return SelectClassInfo.listFromCompressedJSON(result.sources, result.classesMap);\n }\n\n /** Retrieves the content descriptor which describes the content and can be used to customize it. */\n public async getContentDescriptor(requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<Descriptor | undefined> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({\n ...options,\n keys: stripTransientElementKeys(options.keys).toJSON(),\n });\n const result = await this._requestsHandler.getContentDescriptor(rpcOptions);\n const descriptor = Descriptor.fromJSON(result);\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n }\n\n /** Retrieves overall content set size. */\n public async getContentSetSize(requestOptions: ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<number> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({\n ...options,\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\n });\n return this._requestsHandler.getContentSetSize(rpcOptions);\n }\n\n /** Retrieves content which consists of a content descriptor and a page of records. */\n public async getContent(requestOptions: Paged<ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<Content | undefined> {\n return (await this.getContentAndSize(requestOptions))?.content;\n }\n\n /** Retrieves content set size and content which consists of a content descriptor and a page of records. */\n public async getContentAndSize(requestOptions: Paged<ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<{ content: Content, size: number } | undefined> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({\n ...options,\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\n ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),\n });\n let descriptor = (requestOptions.descriptor instanceof Descriptor) ? requestOptions.descriptor : undefined;\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions, requestIndex) => {\n if (0 === requestIndex && !descriptor) {\n const content = await this._requestsHandler.getPagedContent({ ...rpcOptions, paging: partialPageOptions });\n if (content) {\n descriptor = Descriptor.fromJSON(content.descriptor);\n return content.contentSet;\n }\n return { total: 0, items: [] };\n }\n return this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging: partialPageOptions });\n });\n if (!descriptor)\n return undefined;\n\n const items = result.items.map((itemJson) => Item.fromJSON(itemJson)).filter<Item>((item): item is Item => (item !== undefined));\n const resultContent = new Content(descriptor, items);\n if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {\n const koqPropertyFormatter = new KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);\n const contentFormatter = new ContentFormatter(\n new ContentPropertyValueFormatter(koqPropertyFormatter),\n requestOptions.unitSystem ?? this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem,\n );\n await contentFormatter.formatContent(resultContent);\n }\n\n return {\n size: result.total,\n content: this._localizationHelper.getLocalizedContent(resultContent),\n };\n }\n\n /** Retrieves distinct values of specific field from the content. */\n public async getPagedDistinctValues(requestOptions: DistinctValuesRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<PagedResponse<DisplayValueGroup>> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = {\n ...this.toRpcTokenOptions(options),\n descriptor: getDescriptorOverrides(options.descriptor),\n keys: stripTransientElementKeys(options.keys).toJSON(),\n };\n const result = await buildPagedArrayResponse(requestOptions.paging, async (partialPageOptions) => this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging: partialPageOptions }));\n return {\n ...result,\n // eslint-disable-next-line deprecation/deprecation\n items: result.items.map(DisplayValueGroup.fromJSON).map((g) => this._localizationHelper.getLocalizedDisplayValueGroup(g)),\n };\n }\n\n /**\n * Retrieves property data in a simplified format for a single element specified by ID.\n * @public\n */\n public async getElementProperties(requestOptions: SingleElementPropertiesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<ElementProperties | undefined> {\n await this.onConnection(requestOptions.imodel);\n const results = await this._requestsHandler.getElementProperties(this.toRpcTokenOptions(requestOptions));\n // istanbul ignore if\n if (!results)\n return undefined;\n return this._localizationHelper.getLocalizedElementProperties(results);\n }\n\n /**\n * Retrieves content item instance keys.\n * @public\n */\n public async getContentInstanceKeys(requestOptions: ContentInstanceKeysRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<{ total: number, items: () => AsyncGenerator<InstanceKey> }> {\n await this.onConnection(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = {\n ...this.toRpcTokenOptions(options),\n keys: stripTransientElementKeys(options.keys).toJSON(),\n };\n\n const props = {\n page: requestOptions.paging,\n get: async (page: Required<PageOptions>) => {\n const keys = await this._requestsHandler.getContentInstanceKeys({ ...rpcOptions, paging: page });\n return {\n total: keys.total,\n items: keys.items.instanceKeys.reduce((instanceKeys, entry) => {\n for (const id of CompressedId64Set.iterable(entry[1])) {\n instanceKeys.push({ className: entry[0], id });\n }\n return instanceKeys;\n }, new Array<InstanceKey>()),\n };\n },\n };\n return createPagedGeneratorResponse(props);\n }\n\n /** Retrieves display label definition of specific item. */\n public async getDisplayLabelDefinition(requestOptions: DisplayLabelRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute): Promise<LabelDefinition> {\n await this.onConnection(requestOptions.imodel);\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\n const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);\n return this._localizationHelper.getLocalizedLabelDefinition(result);\n }\n\n /** Retrieves display label definition of specific items. */\n public async getDisplayLabelDefinitions(requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute): Promise<LabelDefinition[]> {\n await this.onConnection(requestOptions.imodel);\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\n const result = await buildPagedArrayResponse(undefined, async (partialPageOptions) => {\n const partialKeys = (!partialPageOptions.start) ? rpcOptions.keys : rpcOptions.keys.slice(partialPageOptions.start);\n return this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });\n });\n return this._localizationHelper.getLocalizedLabelDefinitions(result.items);\n }\n\n}\n\nconst getDescriptorOverrides = (descriptorOrOverrides: Descriptor | DescriptorOverrides): DescriptorOverrides => {\n if (descriptorOrOverrides instanceof Descriptor)\n return descriptorOrOverrides.createDescriptorOverrides();\n return descriptorOrOverrides;\n};\n\ninterface PagedGeneratorCreateProps<TPagedResponseItem> {\n page: PageOptions | undefined;\n get: (pageStart: Required<PageOptions>, requestIndex: number) => Promise<{ total: number, items: TPagedResponseItem[] }>;\n}\nasync function createPagedGeneratorResponse<TPagedResponseItem>(props: PagedGeneratorCreateProps<TPagedResponseItem>) {\n let pageStart = props.page?.start ?? 0;\n let pageSize = props.page?.size ?? 0;\n let requestIndex = 0;\n\n const firstPage = await props.get({ start: pageStart, size: pageSize }, requestIndex++);\n return {\n total: firstPage.total,\n async *items() {\n let partialResult = firstPage;\n while (true) {\n for (const item of partialResult.items) {\n yield item;\n }\n\n const receivedItemsCount = partialResult.items.length;\n if (partialResult.total !== 0 && receivedItemsCount === 0) {\n if (pageStart >= partialResult.total)\n throw new Error(`Requested page with start index ${pageStart} is out of bounds. Total number of items: ${partialResult.total}`);\n throw new Error(\"Paged request returned non zero total count but no items\");\n }\n\n if (pageSize !== 0 && receivedItemsCount >= pageSize || receivedItemsCount >= (partialResult.total - pageStart))\n break;\n\n if (pageSize !== 0)\n pageSize -= receivedItemsCount;\n pageStart += receivedItemsCount;\n\n partialResult = await props.get({ start: pageStart, size: pageSize }, requestIndex++);\n }\n },\n };\n}\n\n/** @internal */\nexport const buildPagedArrayResponse = async <TItem>(requestedPage: PageOptions | undefined, getter: (page: Required<PageOptions>, requestIndex: number) => Promise<PagedResponse<TItem>>): Promise<PagedResponse<TItem>> => {\n const items = new Array<TItem>();\n const gen = await createPagedGeneratorResponse({ page: requestedPage, get: getter });\n for await (const item of gen.items()) {\n items.push(item);\n }\n return { total: gen.total, items };\n};\n\nconst stripTransientElementKeys = (keys: KeySet) => {\n if (!keys.some((key) => Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME))\n return keys;\n\n const copy = new KeySet();\n copy.add(keys, (key) => {\n // the callback is not going to be called with EntityProps as KeySet converts them\n // to InstanceKeys, but we want to keep the EntityProps case for correctness\n // istanbul ignore next\n const isTransient = Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME\n || Key.isEntityProps(key) && key.classFullName === TRANSIENT_ELEMENT_CLASSNAME;\n return !isTransient;\n });\n return copy;\n};\n"]}
1
+ {"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAmG;AACnG,wDAA2E;AAG3E,oEA2CoC;AACpC,6DAA0D;AAC1D,6DAAkE;AAClE,qDAAsE;AACtE,uEAAiG;AACjG,mEAA2E;AAyF3E;;;;;GAKG;AACH,MAAa,mBAAmB;IAwB9B;;;;;;OAMG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,yB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AAE,MAAM,EAAE,CAAC,CAAC;IACrF,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,EAAE;QACpC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAClB;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC;AAEF,MAAM,yBAAyB,GAAG,CAAC,IAAY,EAAE,EAAE;IACjD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B,CAAC,EAAE;QAChG,OAAO,IAAI,CAAC;KACb;IAED,MAAM,IAAI,GAAG,IAAI,4BAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,kFAAkF;QAClF,4EAA4E;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GACf,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B,CAAC;YACzE,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,8CAA2B,CAAC,CAAC;QAChF,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,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 ClientDiagnosticsAttribute,\r\n Content,\r\n ContentDescriptorRequestOptions,\r\n ContentFormatter,\r\n ContentInstanceKeysRequestOptions,\r\n ContentPropertyValueFormatter,\r\n ContentRequestOptions,\r\n ContentSourcesRequestOptions,\r\n ContentUpdateInfo,\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 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 { TRANSIENT_ELEMENT_CLASSNAME } from \"./selection/SelectionManager\";\r\n\r\n/**\r\n * Data structure that describes IModel hierarchy change event arguments.\r\n * @alpha\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 * @alpha\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 * 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 * @alpha\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 * @alpha\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 _connections: Map<IModelConnection, Promise<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 * @alpha\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 * @alpha\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 deprecation/deprecation\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._connections = new Map<IModelConnection, Promise<void>>();\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 async onConnection(imodel: IModelConnection) {\r\n if (!this._connections.has(imodel)) {\r\n this._connections.set(imodel, this.initializeIModel(imodel));\r\n }\r\n await this._connections.get(imodel);\r\n }\r\n\r\n private async initializeIModel(imodel: IModelConnection) {\r\n imodel.onClose.addOnce(() => {\r\n this._connections.delete(imodel);\r\n });\r\n await this.onNewiModelConnection(imodel);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\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 async onNewiModelConnection(_: 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 deprecation/deprecation\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 /** Retrieves nodes */\r\n public async getNodes(\r\n requestOptions: Paged<HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable>> & ClientDiagnosticsAttribute,\r\n ): Promise<Node[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions) =>\r\n this._requestsHandler.getPagedNodes({ ...rpcOptions, paging: partialPageOptions }),\r\n );\r\n // eslint-disable-next-line deprecation/deprecation\r\n return this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON));\r\n }\r\n\r\n /** Retrieves nodes count. */\r\n public async getNodesCount(\r\n requestOptions: HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<number> {\r\n await this.onConnection(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 /** Retrieves total nodes count and a single page of nodes. */\r\n public async getNodesAndCount(\r\n requestOptions: Paged<HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable>> & ClientDiagnosticsAttribute,\r\n ): Promise<{ count: number; nodes: Node[] }> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions) =>\r\n this._requestsHandler.getPagedNodes({ ...rpcOptions, paging: partialPageOptions }),\r\n );\r\n return {\r\n count: result.total,\r\n // eslint-disable-next-line deprecation/deprecation\r\n nodes: this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON)),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves hierarchy level descriptor.\r\n * @beta\r\n */\r\n public async getNodesDescriptor(\r\n requestOptions: HierarchyLevelDescriptorRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<Descriptor | undefined> {\r\n await this.onConnection(requestOptions.imodel);\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 }\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 await this.onConnection(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 deprecation/deprecation\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 await this.onConnection(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 deprecation/deprecation\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 await this.onConnection(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 await this.onConnection(requestOptions.imodel);\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 }\r\n\r\n /** Retrieves overall content set size. */\r\n public async getContentSetSize(\r\n requestOptions: ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<number> {\r\n await this.onConnection(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 /** Retrieves content which consists of a content descriptor and a page of records. */\r\n public async getContent(\r\n requestOptions: Paged<ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>> & ClientDiagnosticsAttribute,\r\n ): Promise<Content | undefined> {\r\n return (await this.getContentAndSize(requestOptions))?.content;\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 public async getContentAndSize(\r\n requestOptions: Paged<ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>> & ClientDiagnosticsAttribute,\r\n ): Promise<{ content: Content; size: number } | undefined> {\r\n await this.onConnection(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 ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),\r\n });\r\n let descriptor = requestOptions.descriptor instanceof Descriptor ? requestOptions.descriptor : undefined;\r\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions, requestIndex) => {\r\n if (0 === requestIndex && !descriptor) {\r\n const content = await this._requestsHandler.getPagedContent({ ...rpcOptions, paging: partialPageOptions });\r\n if (content) {\r\n descriptor = Descriptor.fromJSON(content.descriptor);\r\n return content.contentSet;\r\n }\r\n return { total: 0, items: [] };\r\n }\r\n return this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging: partialPageOptions });\r\n });\r\n if (!descriptor) {\r\n return undefined;\r\n }\r\n\r\n const items = result.items.map((itemJson) => Item.fromJSON(itemJson)).filter<Item>((item): item is Item => item !== undefined);\r\n const resultContent = new Content(descriptor, items);\r\n if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {\r\n const koqPropertyFormatter = new KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);\r\n const contentFormatter = new ContentFormatter(\r\n new ContentPropertyValueFormatter(koqPropertyFormatter),\r\n requestOptions.unitSystem ?? this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem,\r\n );\r\n await contentFormatter.formatContent(resultContent);\r\n }\r\n\r\n return {\r\n size: result.total,\r\n content: this._localizationHelper.getLocalizedContent(resultContent),\r\n };\r\n }\r\n\r\n /** Retrieves distinct values of specific field from the content. */\r\n public async getPagedDistinctValues(\r\n requestOptions: DistinctValuesRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> & ClientDiagnosticsAttribute,\r\n ): Promise<PagedResponse<DisplayValueGroup>> {\r\n await this.onConnection(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 const result = await buildPagedArrayResponse(requestOptions.paging, async (partialPageOptions) =>\r\n this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging: partialPageOptions }),\r\n );\r\n return {\r\n ...result,\r\n // eslint-disable-next-line deprecation/deprecation\r\n items: result.items.map(DisplayValueGroup.fromJSON).map((g) => this._localizationHelper.getLocalizedDisplayValueGroup(g)),\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(\r\n requestOptions: SingleElementPropertiesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute,\r\n ): Promise<ElementProperties | undefined> {\r\n await this.onConnection(requestOptions.imodel);\r\n const results = await this._requestsHandler.getElementProperties(this.toRpcTokenOptions(requestOptions));\r\n // istanbul ignore if\r\n if (!results) {\r\n return undefined;\r\n }\r\n return this._localizationHelper.getLocalizedElementProperties(results);\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,\r\n ): Promise<{ total: number; items: () => AsyncGenerator<InstanceKey> }> {\r\n await this.onConnection(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 props = {\r\n page: requestOptions.paging,\r\n get: async (page: Required<PageOptions>) => {\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 return createPagedGeneratorResponse(props);\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 await this.onConnection(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 getDisplayLabelDefinitions(\r\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<LabelDefinition[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const result = await buildPagedArrayResponse(undefined, async (partialPageOptions) => {\r\n const partialKeys = !partialPageOptions.start ? rpcOptions.keys : rpcOptions.keys.slice(partialPageOptions.start);\r\n return this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });\r\n });\r\n return this._localizationHelper.getLocalizedLabelDefinitions(result.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\ninterface PagedGeneratorCreateProps<TPagedResponseItem> {\r\n page: PageOptions | undefined;\r\n get: (pageStart: Required<PageOptions>, requestIndex: number) => Promise<{ total: number; items: TPagedResponseItem[] }>;\r\n}\r\nasync function createPagedGeneratorResponse<TPagedResponseItem>(props: PagedGeneratorCreateProps<TPagedResponseItem>) {\r\n let pageStart = props.page?.start ?? 0;\r\n let pageSize = props.page?.size ?? 0;\r\n let requestIndex = 0;\r\n\r\n const firstPage = await props.get({ start: pageStart, size: pageSize }, requestIndex++);\r\n return {\r\n total: firstPage.total,\r\n async *items() {\r\n let partialResult = firstPage;\r\n while (true) {\r\n for (const item of partialResult.items) {\r\n yield item;\r\n }\r\n\r\n const receivedItemsCount = partialResult.items.length;\r\n if (partialResult.total !== 0 && receivedItemsCount === 0) {\r\n if (pageStart >= partialResult.total) {\r\n throw new Error(`Requested page with start index ${pageStart} is out of bounds. Total number of items: ${partialResult.total}`);\r\n }\r\n throw new Error(\"Paged request returned non zero total count but no items\");\r\n }\r\n\r\n if ((pageSize !== 0 && receivedItemsCount >= pageSize) || receivedItemsCount >= partialResult.total - pageStart) {\r\n break;\r\n }\r\n\r\n if (pageSize !== 0) {\r\n pageSize -= receivedItemsCount;\r\n }\r\n pageStart += receivedItemsCount;\r\n\r\n partialResult = await props.get({ start: pageStart, size: pageSize }, requestIndex++);\r\n }\r\n },\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport const buildPagedArrayResponse = async <TItem>(\r\n requestedPage: PageOptions | undefined,\r\n getter: (page: Required<PageOptions>, requestIndex: number) => Promise<PagedResponse<TItem>>,\r\n): Promise<PagedResponse<TItem>> => {\r\n const items = new Array<TItem>();\r\n const gen = await createPagedGeneratorResponse({ page: requestedPage, get: getter });\r\n for await (const item of gen.items()) {\r\n items.push(item);\r\n }\r\n return { total: gen.total, items };\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IAExD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAElD;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE9F;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG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AC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IAExD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAElD;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE9F;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAExE;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,gBAAgB;AAChB,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,eAAe,CAA0C;IAC1D,iBAAiB,iBAAsB,iBAAiB,QAAQ,OAAO,KAAK,IAAI,EAAI;WAE7E,MAAM;IAIpB;;OAEG;IACU,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAQpE;;OAEG;IACU,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS9D;;OAEG;IACU,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAO1G;;OAEG;IACU,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IA2BpF;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAOpC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
6
  /** @packageDocumentation
7
7
  * @module Core
8
8
  */
@@ -24,8 +24,9 @@ class RulesetManagerImpl {
24
24
  */
25
25
  async get(id) {
26
26
  const m = this._clientRulesets.get(id);
27
- if (!m)
27
+ if (!m) {
28
28
  return undefined;
29
+ }
29
30
  return m[0];
30
31
  }
31
32
  /**
@@ -33,8 +34,9 @@ class RulesetManagerImpl {
33
34
  */
34
35
  async add(ruleset) {
35
36
  const registered = new presentation_common_1.RegisteredRuleset(ruleset, core_bentley_1.Guid.createValue(), async (r) => this.remove(r));
36
- if (!this._clientRulesets.has(ruleset.id))
37
+ if (!this._clientRulesets.has(ruleset.id)) {
37
38
  this._clientRulesets.set(ruleset.id, []);
39
+ }
38
40
  this._clientRulesets.get(ruleset.id).push(registered);
39
41
  return registered;
40
42
  }
@@ -61,8 +63,9 @@ class RulesetManagerImpl {
61
63
  uniqueIdentifier = ruleset.uniqueIdentifier;
62
64
  }
63
65
  const m = this._clientRulesets.get(rulesetId);
64
- if (!m)
66
+ if (!m) {
65
67
  return false;
68
+ }
66
69
  let didRemove = false;
67
70
  for (let i = 0; i < m.length; ++i) {
68
71
  if (m[i].uniqueIdentifier === uniqueIdentifier) {
@@ -77,8 +80,9 @@ class RulesetManagerImpl {
77
80
  * Remove all rulesets registered in this session.
78
81
  */
79
82
  async clear() {
80
- if (0 === this._clientRulesets.size)
83
+ if (0 === this._clientRulesets.size) {
81
84
  return;
85
+ }
82
86
  this._clientRulesets.clear();
83
87
  }
84
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oEAA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jE,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9D,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM,CAAC,OAA6C;QAC/D,IAAI,SAAS,EAAE,gBAAwB,CAAC;QACxC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC1B,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;SAC/B;aAAM;YACL,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;YACvB,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;SAC7C;QAED,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC;YACJ,OAAO,KAAK,CAAC;QAEf,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACjC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,KAAK,gBAAgB,EAAE;gBAC9C,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACf,SAAS,GAAG,IAAI,CAAC;gBACjB,MAAM;aACP;SACF;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,IAAI;YACjC,OAAO;QAET,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CAEF;AA/ED,gDA+EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\nimport { RegisteredRuleset, Ruleset } from \"@itwin/presentation-common\";\n\n/**\n * Presentation ruleset registry.\n * @public\n */\nexport interface RulesetManager {\n /**\n * An event invoked one a ruleset is modified using [[modify]] function.\n * @beta\n */\n onRulesetModified: BeEvent<(curr: RegisteredRuleset, prev: Ruleset) => void>;\n\n /**\n * Get a ruleset with the specified id.\n */\n get(id: string): Promise<RegisteredRuleset | undefined>;\n\n /**\n * Register the supplied ruleset\n */\n add(ruleset: Ruleset): Promise<RegisteredRuleset>;\n\n /**\n * Modify the given pre-registered ruleset\n * @beta\n */\n modify(ruleset: RegisteredRuleset, newRules: Omit<Ruleset, \"id\">): Promise<RegisteredRuleset>;\n\n /**\n * Unregister the supplied ruleset\n */\n remove(ruleset: RegisteredRuleset | [string, string]): Promise<boolean>;\n\n /**\n * Remove all rulesets registered in this session.\n */\n clear(): Promise<void>;\n}\n\n/** @internal */\nexport class RulesetManagerImpl implements RulesetManager {\n\n private _clientRulesets = new Map<string, RegisteredRuleset[]>();\n public onRulesetModified = new BeEvent<(curr: RegisteredRuleset, prev: Ruleset) => void>();\n\n public static create() {\n return new RulesetManagerImpl();\n }\n\n /**\n * Get a ruleset with the specified id.\n */\n public async get(id: string): Promise<RegisteredRuleset | undefined> {\n const m = this._clientRulesets.get(id);\n if (!m)\n return undefined;\n return m[0];\n }\n\n /**\n * Register the supplied ruleset\n */\n public async add(ruleset: Ruleset): Promise<RegisteredRuleset> {\n const registered = new RegisteredRuleset(ruleset, Guid.createValue(), async (r: RegisteredRuleset) => this.remove(r));\n if (!this._clientRulesets.has(ruleset.id))\n this._clientRulesets.set(ruleset.id, []);\n this._clientRulesets.get(ruleset.id)!.push(registered);\n return registered;\n }\n\n /**\n * Modifies the given pre-registered ruleset\n */\n public async modify(ruleset: RegisteredRuleset, newRules: Omit<Ruleset, \"id\">): Promise<RegisteredRuleset> {\n await this.remove(ruleset);\n const modified = await this.add({ ...newRules, id: ruleset.id });\n this.onRulesetModified.raiseEvent(modified, ruleset.toJSON());\n return modified;\n }\n\n /**\n * Unregister the supplied ruleset\n */\n public async remove(ruleset: RegisteredRuleset | [string, string]): Promise<boolean> {\n let rulesetId, uniqueIdentifier: string;\n if (Array.isArray(ruleset)) {\n rulesetId = ruleset[0];\n uniqueIdentifier = ruleset[1];\n } else {\n rulesetId = ruleset.id;\n uniqueIdentifier = ruleset.uniqueIdentifier;\n }\n\n const m = this._clientRulesets.get(rulesetId);\n if (!m)\n return false;\n\n let didRemove = false;\n for (let i = 0; i < m.length; ++i) {\n if (m[i].uniqueIdentifier === uniqueIdentifier) {\n m.splice(i, 1);\n didRemove = true;\n break;\n }\n }\n\n return didRemove;\n }\n\n /**\n * Remove all rulesets registered in this session.\n */\n public async clear(): Promise<void> {\n if (0 === this._clientRulesets.size)\n return;\n\n this._clientRulesets.clear();\n }\n\n}\n"]}
1
+ {"version":3,"file":"RulesetManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAoD;AACpD,oEAAwE;AAwCxE,gBAAgB;AAChB,MAAa,kBAAkB;IAA/B;QACU,oBAAe,GAAG,IAAI,GAAG,EAA+B,CAAC;QAC1D,sBAAiB,GAAG,IAAI,sBAAO,EAAoD,CAAC;IA+E7F,CAAC;IA7EQ,MAAM,CAAC,MAAM;QAClB,OAAO,IAAI,kBAAkB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,GAAG,CAAC,EAAU;QACzB,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACd,CAAC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OAAO,CAAC,gBAAgB,CAAC;SAC7C;QAED,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,KAAK,CAAC;SACd;QAED,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACjC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,KAAK,gBAAgB,EAAE;gBAC9C,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACf,SAAS,GAAG,IAAI,CAAC;gBACjB,MAAM;aACP;SACF;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;YACnC,OAAO;SACR;QAED,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACF;AAjFD,gDAiFC","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, Guid } from \"@itwin/core-bentley\";\r\nimport { RegisteredRuleset, Ruleset } from \"@itwin/presentation-common\";\r\n\r\n/**\r\n * Presentation ruleset registry.\r\n * @public\r\n */\r\nexport interface RulesetManager {\r\n /**\r\n * An event invoked one a ruleset is modified using [[modify]] function.\r\n * @beta\r\n */\r\n onRulesetModified: BeEvent<(curr: RegisteredRuleset, prev: Ruleset) => void>;\r\n\r\n /**\r\n * Get a ruleset with the specified id.\r\n */\r\n get(id: string): Promise<RegisteredRuleset | undefined>;\r\n\r\n /**\r\n * Register the supplied ruleset\r\n */\r\n add(ruleset: Ruleset): Promise<RegisteredRuleset>;\r\n\r\n /**\r\n * Modify the given pre-registered ruleset\r\n * @beta\r\n */\r\n modify(ruleset: RegisteredRuleset, newRules: Omit<Ruleset, \"id\">): Promise<RegisteredRuleset>;\r\n\r\n /**\r\n * Unregister the supplied ruleset\r\n */\r\n remove(ruleset: RegisteredRuleset | [string, string]): Promise<boolean>;\r\n\r\n /**\r\n * Remove all rulesets registered in this session.\r\n */\r\n clear(): Promise<void>;\r\n}\r\n\r\n/** @internal */\r\nexport class RulesetManagerImpl implements RulesetManager {\r\n private _clientRulesets = new Map<string, RegisteredRuleset[]>();\r\n public onRulesetModified = new BeEvent<(curr: RegisteredRuleset, prev: Ruleset) => void>();\r\n\r\n public static create() {\r\n return new RulesetManagerImpl();\r\n }\r\n\r\n /**\r\n * Get a ruleset with the specified id.\r\n */\r\n public async get(id: string): Promise<RegisteredRuleset | undefined> {\r\n const m = this._clientRulesets.get(id);\r\n if (!m) {\r\n return undefined;\r\n }\r\n return m[0];\r\n }\r\n\r\n /**\r\n * Register the supplied ruleset\r\n */\r\n public async add(ruleset: Ruleset): Promise<RegisteredRuleset> {\r\n const registered = new RegisteredRuleset(ruleset, Guid.createValue(), async (r: RegisteredRuleset) => this.remove(r));\r\n if (!this._clientRulesets.has(ruleset.id)) {\r\n this._clientRulesets.set(ruleset.id, []);\r\n }\r\n this._clientRulesets.get(ruleset.id)!.push(registered);\r\n return registered;\r\n }\r\n\r\n /**\r\n * Modifies the given pre-registered ruleset\r\n */\r\n public async modify(ruleset: RegisteredRuleset, newRules: Omit<Ruleset, \"id\">): Promise<RegisteredRuleset> {\r\n await this.remove(ruleset);\r\n const modified = await this.add({ ...newRules, id: ruleset.id });\r\n this.onRulesetModified.raiseEvent(modified, ruleset.toJSON());\r\n return modified;\r\n }\r\n\r\n /**\r\n * Unregister the supplied ruleset\r\n */\r\n public async remove(ruleset: RegisteredRuleset | [string, string]): Promise<boolean> {\r\n let rulesetId, uniqueIdentifier: string;\r\n if (Array.isArray(ruleset)) {\r\n rulesetId = ruleset[0];\r\n uniqueIdentifier = ruleset[1];\r\n } else {\r\n rulesetId = ruleset.id;\r\n uniqueIdentifier = ruleset.uniqueIdentifier;\r\n }\r\n\r\n const m = this._clientRulesets.get(rulesetId);\r\n if (!m) {\r\n return false;\r\n }\r\n\r\n let didRemove = false;\r\n for (let i = 0; i < m.length; ++i) {\r\n if (m[i].uniqueIdentifier === uniqueIdentifier) {\r\n m.splice(i, 1);\r\n didRemove = true;\r\n break;\r\n }\r\n }\r\n\r\n return didRemove;\r\n }\r\n\r\n /**\r\n * Remove all rulesets registered in this session.\r\n */\r\n public async clear(): Promise<void> {\r\n if (0 === this._clientRulesets.size) {\r\n return;\r\n }\r\n\r\n this._clientRulesets.clear();\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetVariablesManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetVariablesManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAQ,UAAU,EAAuB,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEtC;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC;IAErI;;;OAGG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,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