@itwin/presentation-backend 5.0.0-dev.1 → 5.0.0-dev.100

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 (148) hide show
  1. package/CHANGELOG.md +73 -1
  2. package/lib/cjs/package.json +1 -0
  3. package/lib/cjs/presentation-backend/ElementPropertiesHelper.d.ts +31 -4
  4. package/lib/cjs/presentation-backend/ElementPropertiesHelper.d.ts.map +1 -1
  5. package/lib/cjs/presentation-backend/ElementPropertiesHelper.js +161 -56
  6. package/lib/cjs/presentation-backend/ElementPropertiesHelper.js.map +1 -1
  7. package/lib/cjs/presentation-backend/InternalSymbols.d.ts +5 -0
  8. package/lib/cjs/presentation-backend/InternalSymbols.d.ts.map +1 -0
  9. package/lib/cjs/presentation-backend/InternalSymbols.js +16 -0
  10. package/lib/cjs/presentation-backend/InternalSymbols.js.map +1 -0
  11. package/lib/cjs/presentation-backend/NativePlatform.d.ts +2 -2
  12. package/lib/cjs/presentation-backend/NativePlatform.d.ts.map +1 -1
  13. package/lib/cjs/presentation-backend/NativePlatform.js +5 -3
  14. package/lib/cjs/presentation-backend/NativePlatform.js.map +1 -1
  15. package/lib/cjs/presentation-backend/Presentation.d.ts +2 -7
  16. package/lib/cjs/presentation-backend/Presentation.d.ts.map +1 -1
  17. package/lib/cjs/presentation-backend/Presentation.js +40 -29
  18. package/lib/cjs/presentation-backend/Presentation.js.map +1 -1
  19. package/lib/cjs/presentation-backend/PresentationIpcHandler.d.ts +3 -3
  20. package/lib/cjs/presentation-backend/PresentationIpcHandler.d.ts.map +1 -1
  21. package/lib/cjs/presentation-backend/PresentationIpcHandler.js +5 -7
  22. package/lib/cjs/presentation-backend/PresentationIpcHandler.js.map +1 -1
  23. package/lib/cjs/presentation-backend/PresentationManager.d.ts +13 -90
  24. package/lib/cjs/presentation-backend/PresentationManager.d.ts.map +1 -1
  25. package/lib/cjs/presentation-backend/PresentationManager.js +79 -130
  26. package/lib/cjs/presentation-backend/PresentationManager.js.map +1 -1
  27. package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts +19 -10
  28. package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
  29. package/lib/cjs/presentation-backend/PresentationManagerDetail.js +83 -76
  30. package/lib/cjs/presentation-backend/PresentationManagerDetail.js.map +1 -1
  31. package/lib/cjs/presentation-backend/PresentationRpcImpl.d.ts +11 -11
  32. package/lib/cjs/presentation-backend/PresentationRpcImpl.d.ts.map +1 -1
  33. package/lib/cjs/presentation-backend/PresentationRpcImpl.js +111 -118
  34. package/lib/cjs/presentation-backend/PresentationRpcImpl.js.map +1 -1
  35. package/lib/cjs/presentation-backend/RulesetEmbedder.d.ts.map +1 -1
  36. package/lib/cjs/presentation-backend/RulesetEmbedder.js +23 -24
  37. package/lib/cjs/presentation-backend/RulesetEmbedder.js.map +1 -1
  38. package/lib/cjs/presentation-backend/RulesetManager.d.ts +1 -1
  39. package/lib/cjs/presentation-backend/RulesetManager.d.ts.map +1 -1
  40. package/lib/cjs/presentation-backend/RulesetManager.js +2 -1
  41. package/lib/cjs/presentation-backend/RulesetManager.js.map +1 -1
  42. package/lib/cjs/presentation-backend/RulesetVariablesManager.d.ts +1 -1
  43. package/lib/cjs/presentation-backend/RulesetVariablesManager.d.ts.map +1 -1
  44. package/lib/cjs/presentation-backend/RulesetVariablesManager.js +2 -0
  45. package/lib/cjs/presentation-backend/RulesetVariablesManager.js.map +1 -1
  46. package/lib/cjs/presentation-backend/SelectionScopesHelper.d.ts +2 -4
  47. package/lib/cjs/presentation-backend/SelectionScopesHelper.d.ts.map +1 -1
  48. package/lib/cjs/presentation-backend/SelectionScopesHelper.js +70 -83
  49. package/lib/cjs/presentation-backend/SelectionScopesHelper.js.map +1 -1
  50. package/lib/cjs/presentation-backend/TemporaryStorage.d.ts +2 -3
  51. package/lib/cjs/presentation-backend/TemporaryStorage.d.ts.map +1 -1
  52. package/lib/cjs/presentation-backend/TemporaryStorage.js +30 -28
  53. package/lib/cjs/presentation-backend/TemporaryStorage.js.map +1 -1
  54. package/lib/cjs/presentation-backend/Utils.d.ts.map +1 -1
  55. package/lib/cjs/presentation-backend/Utils.js +15 -21
  56. package/lib/cjs/presentation-backend/Utils.js.map +1 -1
  57. package/lib/cjs/presentation-backend/domain/PresentationRulesDomain.js +2 -2
  58. package/lib/cjs/presentation-backend/domain/PresentationRulesDomain.js.map +1 -1
  59. package/lib/cjs/presentation-backend/domain/RulesetElements.js +4 -4
  60. package/lib/cjs/presentation-backend/domain/RulesetElements.js.map +1 -1
  61. package/lib/cjs/presentation-backend-internal.d.ts +2 -0
  62. package/lib/cjs/presentation-backend-internal.d.ts.map +1 -0
  63. package/lib/cjs/presentation-backend-internal.js +12 -0
  64. package/lib/cjs/presentation-backend-internal.js.map +1 -0
  65. package/lib/cjs/presentation-backend.d.ts +7 -7
  66. package/lib/cjs/presentation-backend.d.ts.map +1 -1
  67. package/lib/cjs/presentation-backend.js +11 -21
  68. package/lib/cjs/presentation-backend.js.map +1 -1
  69. package/lib/esm/presentation-backend/BackendLoggerCategory.d.ts +62 -0
  70. package/lib/esm/presentation-backend/BackendLoggerCategory.d.ts.map +1 -0
  71. package/lib/esm/presentation-backend/BackendLoggerCategory.js +69 -0
  72. package/lib/esm/presentation-backend/BackendLoggerCategory.js.map +1 -0
  73. package/lib/esm/presentation-backend/ElementPropertiesHelper.d.ts +45 -0
  74. package/lib/esm/presentation-backend/ElementPropertiesHelper.d.ts.map +1 -0
  75. package/lib/esm/presentation-backend/ElementPropertiesHelper.js +187 -0
  76. package/lib/esm/presentation-backend/ElementPropertiesHelper.js.map +1 -0
  77. package/lib/esm/presentation-backend/InternalSymbols.d.ts +5 -0
  78. package/lib/esm/presentation-backend/InternalSymbols.d.ts.map +1 -0
  79. package/lib/esm/presentation-backend/InternalSymbols.js +13 -0
  80. package/lib/esm/presentation-backend/InternalSymbols.js.map +1 -0
  81. package/lib/esm/presentation-backend/NativePlatform.d.ts +89 -0
  82. package/lib/esm/presentation-backend/NativePlatform.d.ts.map +1 -0
  83. package/lib/esm/presentation-backend/NativePlatform.js +156 -0
  84. package/lib/esm/presentation-backend/NativePlatform.js.map +1 -0
  85. package/lib/esm/presentation-backend/Presentation.d.ts +97 -0
  86. package/lib/esm/presentation-backend/Presentation.d.ts.map +1 -0
  87. package/lib/esm/presentation-backend/Presentation.js +147 -0
  88. package/lib/esm/presentation-backend/Presentation.js.map +1 -0
  89. package/lib/esm/presentation-backend/PresentationIpcHandler.d.ts +12 -0
  90. package/lib/esm/presentation-backend/PresentationIpcHandler.d.ts.map +1 -0
  91. package/lib/esm/presentation-backend/PresentationIpcHandler.js +25 -0
  92. package/lib/esm/presentation-backend/PresentationIpcHandler.js.map +1 -0
  93. package/lib/esm/presentation-backend/PresentationManager.d.ts +387 -0
  94. package/lib/esm/presentation-backend/PresentationManager.d.ts.map +1 -0
  95. package/lib/esm/presentation-backend/PresentationManager.js +352 -0
  96. package/lib/esm/presentation-backend/PresentationManager.js.map +1 -0
  97. package/lib/esm/presentation-backend/PresentationManagerDetail.d.ts +74 -0
  98. package/lib/esm/presentation-backend/PresentationManagerDetail.d.ts.map +1 -0
  99. package/lib/esm/presentation-backend/PresentationManagerDetail.js +446 -0
  100. package/lib/esm/presentation-backend/PresentationManagerDetail.js.map +1 -0
  101. package/lib/esm/presentation-backend/PresentationRpcImpl.d.ts +63 -0
  102. package/lib/esm/presentation-backend/PresentationRpcImpl.d.ts.map +1 -0
  103. package/lib/esm/presentation-backend/PresentationRpcImpl.js +409 -0
  104. package/lib/esm/presentation-backend/PresentationRpcImpl.js.map +1 -0
  105. package/lib/esm/presentation-backend/RulesetEmbedder.d.ts +109 -0
  106. package/lib/esm/presentation-backend/RulesetEmbedder.d.ts.map +1 -0
  107. package/lib/esm/presentation-backend/RulesetEmbedder.js +269 -0
  108. package/lib/esm/presentation-backend/RulesetEmbedder.js.map +1 -0
  109. package/lib/esm/presentation-backend/RulesetManager.d.ts +54 -0
  110. package/lib/esm/presentation-backend/RulesetManager.d.ts.map +1 -0
  111. package/lib/esm/presentation-backend/RulesetManager.js +74 -0
  112. package/lib/esm/presentation-backend/RulesetManager.js.map +1 -0
  113. package/lib/esm/presentation-backend/RulesetVariablesManager.d.ts +141 -0
  114. package/lib/esm/presentation-backend/RulesetVariablesManager.d.ts.map +1 -0
  115. package/lib/esm/presentation-backend/RulesetVariablesManager.js +140 -0
  116. package/lib/esm/presentation-backend/RulesetVariablesManager.js.map +1 -0
  117. package/lib/esm/presentation-backend/SelectionScopesHelper.d.ts +27 -0
  118. package/lib/esm/presentation-backend/SelectionScopesHelper.d.ts.map +1 -0
  119. package/lib/esm/presentation-backend/SelectionScopesHelper.js +227 -0
  120. package/lib/esm/presentation-backend/SelectionScopesHelper.js.map +1 -0
  121. package/lib/esm/presentation-backend/TemporaryStorage.d.ts +123 -0
  122. package/lib/esm/presentation-backend/TemporaryStorage.d.ts.map +1 -0
  123. package/lib/esm/presentation-backend/TemporaryStorage.js +157 -0
  124. package/lib/esm/presentation-backend/TemporaryStorage.js.map +1 -0
  125. package/lib/esm/presentation-backend/Utils.d.ts +50 -0
  126. package/lib/esm/presentation-backend/Utils.d.ts.map +1 -0
  127. package/lib/esm/presentation-backend/Utils.js +101 -0
  128. package/lib/esm/presentation-backend/Utils.js.map +1 -0
  129. package/lib/esm/presentation-backend/domain/PresentationRulesDomain.d.ts +17 -0
  130. package/lib/esm/presentation-backend/domain/PresentationRulesDomain.d.ts.map +1 -0
  131. package/lib/esm/presentation-backend/domain/PresentationRulesDomain.js +31 -0
  132. package/lib/esm/presentation-backend/domain/PresentationRulesDomain.js.map +1 -0
  133. package/lib/esm/presentation-backend/domain/RulesetElements.d.ts +22 -0
  134. package/lib/esm/presentation-backend/domain/RulesetElements.d.ts.map +1 -0
  135. package/lib/esm/presentation-backend/domain/RulesetElements.js +38 -0
  136. package/lib/esm/presentation-backend/domain/RulesetElements.js.map +1 -0
  137. package/lib/esm/presentation-backend/primary-presentation-rules/ElementProperties.PresentationRuleSet.json +14 -0
  138. package/lib/esm/presentation-backend/supplemental-presentation-rules/BisCore.PresentationRuleSet.json +701 -0
  139. package/lib/esm/presentation-backend/supplemental-presentation-rules/Functional.PresentationRuleSet.json +139 -0
  140. package/lib/esm/presentation-backend-internal.d.ts +2 -0
  141. package/lib/esm/presentation-backend-internal.d.ts.map +1 -0
  142. package/lib/esm/presentation-backend-internal.js +8 -0
  143. package/lib/esm/presentation-backend-internal.js.map +1 -0
  144. package/lib/esm/presentation-backend.d.ts +20 -0
  145. package/lib/esm/presentation-backend.d.ts.map +1 -0
  146. package/lib/esm/presentation-backend.js +21 -0
  147. package/lib/esm/presentation-backend.js.map +1 -0
  148. package/package.json +43 -36
@@ -1,11 +1,10 @@
1
1
  /** @packageDocumentation
2
2
  * @module RPC
3
3
  */
4
- import { Id64String, IDisposable } from "@itwin/core-bentley";
5
4
  import { IModelRpcProps } from "@itwin/core-common";
6
- import { ComputeSelectionRpcRequestOptions, ContentDescriptorRpcRequestOptions, ContentInstanceKeysRpcRequestOptions, ContentRpcRequestOptions, ContentSourcesRpcRequestOptions, ContentSourcesRpcResult, DescriptorJSON, DisplayLabelRpcRequestOptions, DisplayLabelsRpcRequestOptions, DisplayValueGroupJSON, DistinctValuesRpcRequestOptions, ElementProperties, FilterByInstancePathsHierarchyRpcRequestOptions, FilterByTextHierarchyRpcRequestOptions, HierarchyLevelDescriptorRpcRequestOptions, HierarchyRpcRequestOptions, ItemJSON, KeySetJSON, LabelDefinition, NodeJSON, NodePathElementJSON, Paged, PagedResponse, PresentationRpcInterface, PresentationRpcResponse, SelectionScope, SelectionScopeRpcRequestOptions, SingleElementPropertiesRpcRequestOptions } from "@itwin/presentation-common";
7
- import { PresentationManager } from "./PresentationManager";
8
- import { TemporaryStorage } from "./TemporaryStorage";
5
+ import { ComputeSelectionRpcRequestOptions, ContentDescriptorRpcRequestOptions, ContentInstanceKeysRpcRequestOptions, ContentRpcRequestOptions, ContentSourcesRpcRequestOptions, ContentSourcesRpcResult, DescriptorJSON, DisplayLabelRpcRequestOptions, DisplayLabelsRpcRequestOptions, DisplayValueGroup, DistinctValuesRpcRequestOptions, ElementProperties, FilterByInstancePathsHierarchyRpcRequestOptions, FilterByTextHierarchyRpcRequestOptions, HierarchyLevelDescriptorRpcRequestOptions, HierarchyRpcRequestOptions, ItemJSON, KeySetJSON, LabelDefinition, Node, NodePathElement, Paged, PagedResponse, PresentationRpcInterface, PresentationRpcResponse, SelectionScope, SelectionScopeRpcRequestOptions, SingleElementPropertiesRpcRequestOptions } from "@itwin/presentation-common";
6
+ import { PresentationManager } from "./PresentationManager.js";
7
+ import { TemporaryStorage } from "./TemporaryStorage.js";
9
8
  /** @internal */
10
9
  export declare const MAX_ALLOWED_PAGE_SIZE = 1000;
11
10
  /** @internal */
@@ -16,14 +15,15 @@ export declare const MAX_ALLOWED_KEYS_PAGE_SIZE = 10000;
16
15
  *
17
16
  * @internal
18
17
  */
19
- export declare class PresentationRpcImpl extends PresentationRpcInterface implements IDisposable {
18
+ export declare class PresentationRpcImpl extends PresentationRpcInterface implements Disposable {
20
19
  private _requestTimeout;
21
20
  private _pendingRequests;
22
21
  private _cancelEvents;
22
+ private _statusHandler;
23
23
  constructor(props?: {
24
24
  requestTimeout?: number;
25
25
  });
26
- dispose(): void;
26
+ [Symbol.dispose](): void;
27
27
  get requestTimeout(): number;
28
28
  get pendingRequests(): TemporaryStorage<PresentationRpcResponse<any>>;
29
29
  /** Returns an ok response with result inside */
@@ -37,10 +37,10 @@ export declare class PresentationRpcImpl extends PresentationRpcInterface implem
37
37
  private getIModel;
38
38
  private makeRequest;
39
39
  getNodesCount(token: IModelRpcProps, requestOptions: HierarchyRpcRequestOptions): PresentationRpcResponse<number>;
40
- getPagedNodes(token: IModelRpcProps, requestOptions: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<NodeJSON>>;
40
+ getPagedNodes(token: IModelRpcProps, requestOptions: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<Node>>;
41
41
  getNodesDescriptor(token: IModelRpcProps, requestOptions: HierarchyLevelDescriptorRpcRequestOptions): PresentationRpcResponse<string | DescriptorJSON | undefined>;
42
- getNodePaths(token: IModelRpcProps, requestOptions: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]>;
43
- getFilteredNodePaths(token: IModelRpcProps, requestOptions: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]>;
42
+ getNodePaths(token: IModelRpcProps, requestOptions: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]>;
43
+ getFilteredNodePaths(token: IModelRpcProps, requestOptions: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]>;
44
44
  getContentSources(token: IModelRpcProps, requestOptions: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult>;
45
45
  getContentDescriptor(token: IModelRpcProps, requestOptions: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined>;
46
46
  getContentSetSize(token: IModelRpcProps, requestOptions: ContentRpcRequestOptions): PresentationRpcResponse<number>;
@@ -50,7 +50,7 @@ export declare class PresentationRpcImpl extends PresentationRpcInterface implem
50
50
  } | undefined>;
51
51
  getPagedContentSet(token: IModelRpcProps, requestOptions: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>>;
52
52
  getElementProperties(token: IModelRpcProps, requestOptions: SingleElementPropertiesRpcRequestOptions): PresentationRpcResponse<ElementProperties | undefined>;
53
- getPagedDistinctValues(token: IModelRpcProps, requestOptions: DistinctValuesRpcRequestOptions): PresentationRpcResponse<PagedResponse<DisplayValueGroupJSON>>;
53
+ getPagedDistinctValues(token: IModelRpcProps, requestOptions: DistinctValuesRpcRequestOptions): PresentationRpcResponse<PagedResponse<DisplayValueGroup>>;
54
54
  getContentInstanceKeys(token: IModelRpcProps, requestOptions: ContentInstanceKeysRpcRequestOptions): PresentationRpcResponse<{
55
55
  total: number;
56
56
  items: KeySetJSON;
@@ -58,6 +58,6 @@ export declare class PresentationRpcImpl extends PresentationRpcInterface implem
58
58
  getDisplayLabelDefinition(token: IModelRpcProps, requestOptions: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition>;
59
59
  getPagedDisplayLabelDefinitions(token: IModelRpcProps, requestOptions: DisplayLabelsRpcRequestOptions): PresentationRpcResponse<PagedResponse<LabelDefinition>>;
60
60
  getSelectionScopes(token: IModelRpcProps, requestOptions: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]>;
61
- computeSelection(token: IModelRpcProps, requestOptions: ComputeSelectionRpcRequestOptions | SelectionScopeRpcRequestOptions, ids?: Id64String[], scopeId?: string): PresentationRpcResponse<KeySetJSON>;
61
+ computeSelection(token: IModelRpcProps, requestOptions: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON>;
62
62
  }
63
63
  //# sourceMappingURL=PresentationRpcImpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationRpcImpl.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationRpcImpl.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAmB,UAAU,EAAE,WAAW,EAAU,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAIL,iCAAiC,EACjC,kCAAkC,EAElC,oCAAoC,EACpC,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EAEvB,cAAc,EAEd,6BAA6B,EAC7B,8BAA8B,EAE9B,qBAAqB,EACrB,+BAA+B,EAC/B,iBAAiB,EACjB,+CAA+C,EAC/C,sCAAsC,EACtC,yCAAyC,EAEzC,0BAA0B,EAE1B,QAAQ,EAER,UAAU,EACV,eAAe,EACf,QAAQ,EAIR,mBAAmB,EACnB,KAAK,EACL,aAAa,EAGb,wBAAwB,EACxB,uBAAuB,EAQvB,cA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C;IAOrB,+BAA+B,CACnD,KAAK,EAAE,cAAc,EACrB,cAAc,EAAE,8BAA8B,GAC7C,uBAAuB,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAgBpC,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,+BAA+B,GAAG,uBAAuB,CAAC,cAAc,EAAE,CAAC;IAMrI,gBAAgB,CACpC,KAAK,EAAE,cAAc,EACrB,cAAc,EAAE,iCAAiC,GAAG,+BAA+B,EACnF,GAAG,CAAC,EAAE,UAAU,EAAE,EAClB,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CAAC,UAAU,CAAC;CAavC"}
1
+ {"version":3,"file":"PresentationRpcImpl.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationRpcImpl.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,cAAc,EAAsB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAEL,iCAAiC,EACjC,kCAAkC,EAElC,oCAAoC,EACpC,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EAEvB,cAAc,EAEd,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,EACjB,+BAA+B,EAC/B,iBAAiB,EACjB,+CAA+C,EAC/C,sCAAsC,EAEtC,yCAAyC,EACzC,0BAA0B,EAC1B,QAAQ,EAER,UAAU,EACV,eAAe,EACf,IAAI,EACJ,eAAe,EACf,KAAK,EACL,aAAa,EAGb,wBAAwB,EACxB,uBAAuB,EAQvB,cAAc,EACd,+BAA+B,EAC/B,wCAAwC,EACzC,MAAM,4BAA4B,CAAC;AAOpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAIhD;;;;;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AC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,iCAAiC,GAAG,uBAAuB,CAAC,UAAU,CAAC;CAOtJ"}
@@ -6,16 +6,25 @@
6
6
  /** @packageDocumentation
7
7
  * @module RPC
8
8
  */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
9
12
  Object.defineProperty(exports, "__esModule", { value: true });
10
13
  exports.PresentationRpcImpl = exports.MAX_ALLOWED_KEYS_PAGE_SIZE = exports.MAX_ALLOWED_PAGE_SIZE = void 0;
11
14
  const core_backend_1 = require("@itwin/core-backend");
12
15
  const core_bentley_1 = require("@itwin/core-bentley");
16
+ const core_common_1 = require("@itwin/core-common");
13
17
  const presentation_common_1 = require("@itwin/presentation-common");
14
- const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
15
- const Presentation_1 = require("./Presentation");
16
- const TemporaryStorage_1 = require("./TemporaryStorage");
17
- // eslint-disable-next-line @typescript-eslint/no-require-imports
18
- const packageJsonVersion = require("../../../package.json").version;
18
+ const internal_1 = require("@itwin/presentation-common/internal");
19
+ // @ts-expect-error TS complains about `with` in CJS builds; The path is fine at runtime, but not at compile time
20
+ // eslint-disable-next-line @itwin/import-within-package
21
+ const package_json_1 = __importDefault(require("../../../package.json"));
22
+ const BackendLoggerCategory_js_1 = require("./BackendLoggerCategory.js");
23
+ const Presentation_js_1 = require("./Presentation.js");
24
+ const PresentationManagerDetail_js_1 = require("./PresentationManagerDetail.js");
25
+ const TemporaryStorage_js_1 = require("./TemporaryStorage.js");
26
+ const InternalSymbols_js_1 = require("./InternalSymbols.js");
27
+ const packageJsonVersion = package_json_1.default.version;
19
28
  /** @internal */
20
29
  exports.MAX_ALLOWED_PAGE_SIZE = 1000;
21
30
  /** @internal */
@@ -28,10 +37,14 @@ const DEFAULT_REQUEST_TIMEOUT = 5000;
28
37
  * @internal
29
38
  */
30
39
  class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface {
40
+ _requestTimeout;
41
+ _pendingRequests;
42
+ _cancelEvents;
43
+ _statusHandler;
31
44
  constructor(props) {
32
45
  super();
33
46
  this._requestTimeout = props?.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT;
34
- this._pendingRequests = new TemporaryStorage_1.TemporaryStorage({
47
+ this._pendingRequests = new TemporaryStorage_js_1.TemporaryStorage({
35
48
  // remove the pending request after request timeout + 10 seconds - this gives
36
49
  // frontend 10 seconds to re-send the request until it's removed from requests' cache
37
50
  unusedValueLifetime: this._requestTimeout > 0 ? this._requestTimeout + 10 * 1000 : undefined,
@@ -39,17 +52,20 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
39
52
  cleanupInterval: 1000,
40
53
  cleanupHandler: (id, _, reason) => {
41
54
  if (reason !== "request") {
42
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Cleaning up request without frontend retrieving it: ${id}.`);
43
- // istanbul ignore next
55
+ core_bentley_1.Logger.logTrace(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Cleaning up request without frontend retrieving it: ${id}.`);
56
+ /* c8 ignore next */
44
57
  this._cancelEvents.get(id)?.raiseEvent();
45
58
  }
46
59
  this._cancelEvents.delete(id);
47
60
  },
48
61
  });
49
62
  this._cancelEvents = new Map();
63
+ this._statusHandler = createStatusCategoryHandler();
64
+ core_bentley_1.StatusCategory.handlers.add(this._statusHandler);
50
65
  }
51
- dispose() {
52
- this._pendingRequests.dispose();
66
+ [Symbol.dispose]() {
67
+ this._pendingRequests[Symbol.dispose]();
68
+ core_bentley_1.StatusCategory.handlers.delete(this._statusHandler);
53
69
  }
54
70
  get requestTimeout() {
55
71
  return this._requestTimeout;
@@ -78,37 +94,28 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
78
94
  * Get the [[PresentationManager]] used by this RPC impl.
79
95
  */
80
96
  getManager(clientId) {
81
- return Presentation_1.Presentation.getManager(clientId);
97
+ return Presentation_js_1.Presentation.getManager(clientId);
82
98
  }
83
99
  async getIModel(token) {
84
- let imodel;
85
- try {
86
- imodel = core_backend_1.IModelDb.findByKey(token.key);
87
- // call refreshContainer, just in case this is a V2 checkpoint whose sasToken is about to expire, or its default transaction is about to be restarted.
88
- await imodel.refreshContainerForRpc(core_backend_1.RpcTrace.expectCurrentActivity.accessToken);
89
- }
90
- catch {
91
- throw new presentation_common_1.PresentationError(presentation_common_1.PresentationStatus.InvalidArgument, "IModelRpcProps doesn't point to a valid iModel");
92
- }
100
+ const imodel = core_backend_1.IModelDb.findByKey(token.key);
101
+ // call refreshContainer, just in case this is a V2 checkpoint whose sasToken is about to expire, or its default transaction is about to be restarted.
102
+ await imodel.refreshContainerForRpc(core_backend_1.RpcTrace.expectCurrentActivity.accessToken);
93
103
  return imodel;
94
104
  }
95
105
  async makeRequest(token, requestId, requestOptions, request) {
106
+ const serializedRequestOptionsForLogging = JSON.stringify({
107
+ ...(0, core_bentley_1.omit)(requestOptions, ["rulesetOrId"]),
108
+ ...(requestOptions.rulesetOrId ? { rulesetId: (0, PresentationManagerDetail_js_1.getRulesetIdObject)(requestOptions.rulesetOrId).uniqueId } : undefined),
109
+ });
110
+ core_bentley_1.Logger.logInfo(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Received '${requestId}' request. Params: ${serializedRequestOptionsForLogging}`);
111
+ const imodel = await this.getIModel(token);
96
112
  const requestKey = JSON.stringify({ iModelKey: token.key, requestId, requestOptions });
97
- core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Received '${requestId}' request. Params: ${requestKey}`);
98
- let imodel;
99
- try {
100
- imodel = await this.getIModel(token);
101
- }
102
- catch (e) {
103
- (0, core_bentley_1.assert)(e instanceof Error);
104
- return this.errorResponse(presentation_common_1.PresentationStatus.InvalidArgument, e.message);
105
- }
106
113
  let resultPromise = this._pendingRequests.getValue(requestKey);
107
114
  if (resultPromise) {
108
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Request already pending`);
115
+ core_bentley_1.Logger.logTrace(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Request already pending`);
109
116
  }
110
117
  else {
111
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Request not found, creating a new one`);
118
+ core_bentley_1.Logger.logTrace(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Request not found, creating a new one`);
112
119
  const { clientId: _, diagnostics: diagnosticsOptions, rulesetVariables, ...options } = requestOptions;
113
120
  const managerRequestOptions = {
114
121
  ...options,
@@ -147,91 +154,68 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
147
154
  };
148
155
  }
149
156
  // initiate request
150
- resultPromise = request(managerRequestOptions)
151
- .then((result) => this.successResponse(result, diagnostics))
152
- .catch((e) => this.errorResponse(e.errorNumber, e.message, diagnostics));
157
+ resultPromise = request(managerRequestOptions).then((result) => this.successResponse(result, diagnostics));
153
158
  // store the request promise
154
159
  this._pendingRequests.addValue(requestKey, resultPromise);
155
160
  this._cancelEvents.set(requestKey, managerRequestOptions.cancelEvent);
156
161
  }
157
162
  if (this._requestTimeout === 0) {
158
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Request timeout not configured, returning promise without a timeout.`);
163
+ core_bentley_1.Logger.logTrace(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Request timeout not configured, returning promise without a timeout.`);
159
164
  void resultPromise.finally(() => {
160
165
  this._pendingRequests.deleteValue(requestKey);
161
166
  });
162
167
  return resultPromise;
163
168
  }
164
- let timeout;
165
- const timeoutPromise = new Promise((_resolve, reject) => {
166
- timeout = setTimeout(() => {
167
- reject(new Error());
168
- }, this._requestTimeout);
169
- });
170
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Returning a promise with a timeout of ${this._requestTimeout}.`);
171
- return Promise.race([resultPromise, timeoutPromise])
172
- .catch(() => {
173
- // note: error responses from the manager get handled when creating `resultPromise`, so we can only get here due
174
- // to a timeout exception
175
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Request timeout, returning "BackendTimeout" status.`);
176
- return this.errorResponse(presentation_common_1.PresentationStatus.BackendTimeout);
177
- })
169
+ core_bentley_1.Logger.logTrace(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Returning a promise with a timeout of ${this._requestTimeout}.`);
170
+ const timeout = (0, internal_1.createCancellableTimeoutPromise)(this._requestTimeout);
171
+ return Promise.race([
172
+ resultPromise,
173
+ timeout.promise.then(() => {
174
+ // eslint-disable-next-line @typescript-eslint/only-throw-error
175
+ throw new core_common_1.RpcPendingResponse("Timeout");
176
+ }),
177
+ ])
178
178
  .then((response) => {
179
- if (response.statusCode !== presentation_common_1.PresentationStatus.BackendTimeout) {
180
- core_bentley_1.Logger.logTrace(BackendLoggerCategory_1.PresentationBackendLoggerCategory.Rpc, `Request completed, returning result.`);
181
- this._pendingRequests.deleteValue(requestKey);
182
- }
183
- clearTimeout(timeout);
179
+ core_bentley_1.Logger.logTrace(BackendLoggerCategory_js_1.PresentationBackendLoggerCategory.Rpc, `Request completed, returning result.`);
180
+ this._pendingRequests.deleteValue(requestKey);
184
181
  return response;
182
+ })
183
+ .finally(() => {
184
+ timeout.cancel();
185
185
  });
186
186
  }
187
187
  async getNodesCount(token, requestOptions) {
188
188
  return this.makeRequest(token, "getNodesCount", requestOptions, async (options) => {
189
- options = {
190
- ...options,
191
- parentKey: nodeKeyFromJson(options.parentKey),
192
- };
193
189
  return this.getManager(requestOptions.clientId).getNodesCount(options);
194
190
  });
195
191
  }
196
192
  async getPagedNodes(token, requestOptions) {
197
193
  return this.makeRequest(token, "getPagedNodes", requestOptions, async (options) => {
198
- options = enforceValidPageSize({
199
- ...options,
200
- parentKey: nodeKeyFromJson(options.parentKey),
201
- });
202
- const [serializedNodesJson, count] = await Promise.all([
203
- this.getManager(requestOptions.clientId).getDetail().getNodes(options),
194
+ options = enforceValidPageSize(options);
195
+ const [serializedHierarchyLevel, count] = await Promise.all([
196
+ this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getNodes(options),
204
197
  this.getManager(requestOptions.clientId).getNodesCount(options),
205
198
  ]);
206
- // eslint-disable-next-line @typescript-eslint/no-deprecated
207
- const nodesJson = JSON.parse(serializedNodesJson);
199
+ const hierarchyLevel = (0, internal_1.deepReplaceNullsToUndefined)(JSON.parse(serializedHierarchyLevel));
208
200
  return {
209
201
  total: count,
210
- items: nodesJson.nodes,
202
+ items: hierarchyLevel.nodes,
211
203
  };
212
204
  });
213
205
  }
214
206
  async getNodesDescriptor(token, requestOptions) {
215
207
  return this.makeRequest(token, "getNodesDescriptor", requestOptions, async (options) => {
216
- options = {
217
- ...options,
218
- parentKey: nodeKeyFromJson(options.parentKey),
219
- };
220
- return this.getManager(requestOptions.clientId).getDetail().getNodesDescriptor(options);
208
+ return this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getNodesDescriptor(options);
221
209
  });
222
210
  }
223
211
  async getNodePaths(token, requestOptions) {
224
212
  return this.makeRequest(token, "getNodePaths", requestOptions, async (options) => {
225
- const result = await this.getManager(requestOptions.clientId).getDetail().getNodePaths(options);
226
- // eslint-disable-next-line @typescript-eslint/no-deprecated
227
- return result.map(presentation_common_1.NodePathElement.toJSON);
213
+ return this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getNodePaths(options);
228
214
  });
229
215
  }
230
216
  async getFilteredNodePaths(token, requestOptions) {
231
217
  return this.makeRequest(token, "getFilteredNodePaths", requestOptions, async (options) => {
232
- const result = await this.getManager(requestOptions.clientId).getDetail().getFilteredNodePaths(options);
233
- // eslint-disable-next-line @typescript-eslint/no-deprecated
234
- return result.map(presentation_common_1.NodePathElement.toJSON);
218
+ return this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getFilteredNodePaths(options);
235
219
  });
236
220
  }
237
221
  async getContentSources(token, requestOptions) {
@@ -246,19 +230,12 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
246
230
  return this.makeRequest(token, "getContentDescriptor", requestOptions, async (options) => {
247
231
  options = {
248
232
  ...options,
249
- contentFlags: (options.contentFlags ?? 0) | presentation_common_1.ContentFlags.DescriptorOnly, // always append the "descriptor only" flag when handling request from the frontend
233
+ contentFlags: (options.contentFlags ?? 0) | PresentationManagerDetail_js_1.DESCRIPTOR_ONLY_CONTENT_FLAG, // always append the "descriptor only" flag when handling request from the frontend
250
234
  keys: presentation_common_1.KeySet.fromJSON(options.keys),
251
235
  };
252
- if (options.transport === "unparsed-json") {
253
- // Here we send a plain JSON string but we will parse it to DescriptorJSON on the frontend. This way we are
254
- // bypassing unnecessary deserialization and serialization.
255
- return Presentation_1.Presentation.getManager(requestOptions.clientId).getDetail().getContentDescriptor(options);
256
- }
257
- else {
258
- // Support for older frontends that still expect a parsed descriptor
259
- const descriptor = await Presentation_1.Presentation.getManager(requestOptions.clientId).getContentDescriptor(options);
260
- return descriptor?.toJSON();
261
- }
236
+ // Here we send a plain JSON string but we will parse it to DescriptorJSON on the frontend. This way we are
237
+ // bypassing unnecessary deserialization and serialization.
238
+ return Presentation_js_1.Presentation.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getContentDescriptor(options);
262
239
  });
263
240
  }
264
241
  async getContentSetSize(token, requestOptions) {
@@ -278,7 +255,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
278
255
  });
279
256
  const [size, content] = await Promise.all([
280
257
  this.getManager(requestOptions.clientId).getContentSetSize(options),
281
- this.getManager(requestOptions.clientId).getDetail().getContent(options),
258
+ this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getContent(options),
282
259
  ]);
283
260
  if (!content) {
284
261
  return undefined;
@@ -293,6 +270,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
293
270
  });
294
271
  }
295
272
  async getPagedContentSet(token, requestOptions) {
273
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
296
274
  const response = await this.getPagedContent(token, requestOptions);
297
275
  if (response.statusCode !== presentation_common_1.PresentationStatus.Success) {
298
276
  return this.errorResponse(response.statusCode, response.errorMessage, response.diagnostics);
@@ -309,7 +287,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
309
287
  return this.makeRequest(token, "getElementProperties", { ...requestOptions }, async (options) => {
310
288
  const manager = this.getManager(requestOptions.clientId);
311
289
  const { elementId, ...optionsNoElementId } = options;
312
- const content = await manager.getDetail().getContent({
290
+ const content = await manager[InternalSymbols_js_1._presentation_manager_detail].getContent({
313
291
  ...optionsNoElementId,
314
292
  descriptor: {
315
293
  displayType: presentation_common_1.DefaultContentDisplayTypes.PropertyPane,
@@ -321,7 +299,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
321
299
  if (!content || content.contentSet.length === 0) {
322
300
  return undefined;
323
301
  }
324
- return (0, presentation_common_1.buildElementProperties)(content.descriptor, content.contentSet[0]);
302
+ return (0, internal_1.buildElementProperties)(content.descriptor, content.contentSet[0]);
325
303
  });
326
304
  }
327
305
  async getPagedDistinctValues(token, requestOptions) {
@@ -330,12 +308,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
330
308
  ...options,
331
309
  keys: presentation_common_1.KeySet.fromJSON(options.keys),
332
310
  });
333
- const response = await this.getManager(requestOptions.clientId).getDetail().getPagedDistinctValues(options);
334
- return {
335
- ...response,
336
- // eslint-disable-next-line @typescript-eslint/no-deprecated
337
- items: response.items.map(presentation_common_1.DisplayValueGroup.toJSON),
338
- };
311
+ return this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getPagedDistinctValues(options);
339
312
  });
340
313
  }
341
314
  async getContentInstanceKeys(token, requestOptions) {
@@ -351,7 +324,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
351
324
  }, exports.MAX_ALLOWED_KEYS_PAGE_SIZE);
352
325
  const [size, content] = await Promise.all([
353
326
  this.getManager(requestOptions.clientId).getContentSetSize(options),
354
- this.getManager(requestOptions.clientId).getDetail().getContent(options),
327
+ this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getContent(options),
355
328
  ]);
356
329
  if (size === 0 || !content) {
357
330
  return { total: 0, items: new presentation_common_1.KeySet().toJSON() };
@@ -364,7 +337,7 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
364
337
  }
365
338
  async getDisplayLabelDefinition(token, requestOptions) {
366
339
  return this.makeRequest(token, "getDisplayLabelDefinition", requestOptions, async (options) => {
367
- const label = await this.getManager(requestOptions.clientId).getDetail().getDisplayLabelDefinition(options);
340
+ const label = await this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getDisplayLabelDefinition(options);
368
341
  return label;
369
342
  });
370
343
  }
@@ -374,27 +347,22 @@ class PresentationRpcImpl extends presentation_common_1.PresentationRpcInterface
374
347
  requestOptions.keys.splice(pageOpts.paging.size);
375
348
  }
376
349
  return this.makeRequest(token, "getPagedDisplayLabelDefinitions", requestOptions, async (options) => {
377
- const labels = await this.getManager(requestOptions.clientId)
378
- .getDetail()
379
- .getDisplayLabelDefinitions({ ...options, keys: options.keys });
350
+ const labels = await this.getManager(requestOptions.clientId)[InternalSymbols_js_1._presentation_manager_detail].getDisplayLabelDefinitions({
351
+ ...options,
352
+ keys: options.keys,
353
+ });
380
354
  return {
381
355
  total: options.keys.length,
382
356
  items: labels,
383
357
  };
384
358
  });
385
359
  }
360
+ /* eslint-disable @typescript-eslint/no-deprecated */
386
361
  async getSelectionScopes(token, requestOptions) {
387
362
  return this.makeRequest(token, "getSelectionScopes", requestOptions, async (options) => this.getManager(requestOptions.clientId).getSelectionScopes(options));
388
363
  }
389
- async computeSelection(token, requestOptions, ids, scopeId) {
364
+ async computeSelection(token, requestOptions) {
390
365
  return this.makeRequest(token, "computeSelection", requestOptions, async (options) => {
391
- if (!(0, presentation_common_1.isComputeSelectionRequestOptions)(options)) {
392
- options = {
393
- ...options,
394
- elementIds: ids,
395
- scope: { id: scopeId },
396
- };
397
- }
398
366
  const keys = await this.getManager(requestOptions.clientId).computeSelection(options);
399
367
  return keys.toJSON();
400
368
  });
@@ -412,12 +380,37 @@ const getValidPageSize = (size, maxPageSize) => {
412
380
  const requestedSize = size ?? 0;
413
381
  return requestedSize === 0 || requestedSize > maxPageSize ? maxPageSize : requestedSize;
414
382
  };
415
- // eslint-disable-next-line @typescript-eslint/no-deprecated
416
- const nodeKeyFromJson = (json) => {
417
- if (!json) {
383
+ // not testing temporary solution
384
+ /* c8 ignore start */
385
+ function createStatusCategoryHandler() {
386
+ return (e) => {
387
+ if (e instanceof presentation_common_1.PresentationError) {
388
+ switch (e.errorNumber) {
389
+ case presentation_common_1.PresentationStatus.NotInitialized:
390
+ return new (class extends core_bentley_1.ErrorCategory {
391
+ name = "Internal server error";
392
+ code = 500;
393
+ })();
394
+ case presentation_common_1.PresentationStatus.Canceled:
395
+ return new (class extends core_bentley_1.SuccessCategory {
396
+ name = "Cancelled";
397
+ code = 204;
398
+ })();
399
+ case presentation_common_1.PresentationStatus.ResultSetTooLarge:
400
+ return new (class extends core_bentley_1.ErrorCategory {
401
+ name = "Result set is too large";
402
+ code = 413;
403
+ })();
404
+ case presentation_common_1.PresentationStatus.Error:
405
+ case presentation_common_1.PresentationStatus.InvalidArgument:
406
+ return new (class extends core_bentley_1.ErrorCategory {
407
+ name = "Invalid request props";
408
+ code = 422;
409
+ })();
410
+ }
411
+ }
418
412
  return undefined;
419
- }
420
- // eslint-disable-next-line @typescript-eslint/no-deprecated
421
- return presentation_common_1.NodeKey.fromJSON(json);
422
- };
413
+ };
414
+ }
415
+ /* c8 ignore end */
423
416
  //# sourceMappingURL=PresentationRpcImpl.js.map