@itwin/presentation-common 4.5.0-dev.8 → 4.6.0-dev.0

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 (403) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/LICENSE.md +1 -1
  3. package/README.md +1 -1
  4. package/Ruleset.schema.json +72 -19
  5. package/lib/cjs/assets/locales/en/Presentation.json +1 -1
  6. package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
  7. package/lib/cjs/presentation-common/AsyncTasks.js +6 -4
  8. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  9. package/lib/cjs/presentation-common/CommonLoggerCategory.js +3 -3
  10. package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
  11. package/lib/cjs/presentation-common/Diagnostics.d.ts.map +1 -1
  12. package/lib/cjs/presentation-common/Diagnostics.js +27 -15
  13. package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
  14. package/lib/cjs/presentation-common/EC.d.ts +7 -4
  15. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  16. package/lib/cjs/presentation-common/EC.js +22 -17
  17. package/lib/cjs/presentation-common/EC.js.map +1 -1
  18. package/lib/cjs/presentation-common/ElementProperties.js +3 -3
  19. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  20. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  21. package/lib/cjs/presentation-common/Error.js +5 -4
  22. package/lib/cjs/presentation-common/Error.js.map +1 -1
  23. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  24. package/lib/cjs/presentation-common/InstanceFilterDefinition.js +3 -3
  25. package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
  26. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  27. package/lib/cjs/presentation-common/KeySet.js +80 -46
  28. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  29. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
  30. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  31. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  32. package/lib/cjs/presentation-common/LabelDefinition.js +5 -4
  33. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  34. package/lib/cjs/presentation-common/LocalizationHelper.d.ts +1 -1
  35. package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
  36. package/lib/cjs/presentation-common/LocalizationHelper.js +18 -1
  37. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  38. package/lib/cjs/presentation-common/PresentationIpcInterface.js +3 -3
  39. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  40. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  41. package/lib/cjs/presentation-common/PresentationManagerOptions.js +3 -3
  42. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  43. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  44. package/lib/cjs/presentation-common/PresentationRpcInterface.js +53 -21
  45. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  46. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  47. package/lib/cjs/presentation-common/RegisteredRuleset.js +21 -9
  48. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  49. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +1 -1
  50. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  51. package/lib/cjs/presentation-common/RpcRequestsHandler.js +19 -15
  52. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  53. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  54. package/lib/cjs/presentation-common/RulesetVariables.js +7 -5
  55. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  56. package/lib/cjs/presentation-common/RulesetsFactory.d.ts.map +1 -1
  57. package/lib/cjs/presentation-common/RulesetsFactory.js +42 -26
  58. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  59. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  60. package/lib/cjs/presentation-common/Update.js +4 -3
  61. package/lib/cjs/presentation-common/Update.js.map +1 -1
  62. package/lib/cjs/presentation-common/Utils.js +3 -3
  63. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  64. package/lib/cjs/presentation-common/content/Category.js +3 -3
  65. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  66. package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
  67. package/lib/cjs/presentation-common/content/Content.js +10 -9
  68. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  69. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  70. package/lib/cjs/presentation-common/content/ContentTraverser.js +47 -25
  71. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  72. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  73. package/lib/cjs/presentation-common/content/Descriptor.js +56 -21
  74. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  75. package/lib/cjs/presentation-common/content/DisplayTypes.js +3 -3
  76. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  77. package/lib/cjs/presentation-common/content/Editor.js +3 -3
  78. package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
  79. package/lib/cjs/presentation-common/content/Fields.d.ts +78 -2
  80. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  81. package/lib/cjs/presentation-common/content/Fields.js +201 -45
  82. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  83. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  84. package/lib/cjs/presentation-common/content/Item.js +8 -6
  85. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  86. package/lib/cjs/presentation-common/content/Property.d.ts +1 -1
  87. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  88. package/lib/cjs/presentation-common/content/Property.js +4 -4
  89. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  90. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +6 -1
  91. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
  92. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +39 -11
  93. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  94. package/lib/cjs/presentation-common/content/Renderer.js +3 -3
  95. package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
  96. package/lib/cjs/presentation-common/content/TypeDescription.js +3 -3
  97. package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
  98. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  99. package/lib/cjs/presentation-common/content/Value.js +46 -30
  100. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  101. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +3 -3
  102. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  103. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  104. package/lib/cjs/presentation-common/hierarchy/Key.js +14 -8
  105. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  106. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  107. package/lib/cjs/presentation-common/hierarchy/Node.js +7 -5
  108. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  109. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  110. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +11 -7
  111. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  112. package/lib/cjs/presentation-common/rules/ClassSpecifications.js +3 -3
  113. package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
  114. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts +39 -11
  115. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts.map +1 -1
  116. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js +3 -3
  117. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  118. package/lib/cjs/presentation-common/rules/RelationshipDirection.js +3 -3
  119. package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
  120. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js +3 -3
  121. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  122. package/lib/cjs/presentation-common/rules/Rule.js +3 -3
  123. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  124. package/lib/cjs/presentation-common/rules/Ruleset.js +3 -3
  125. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  126. package/lib/cjs/presentation-common/rules/SchemasSpecification.js +3 -3
  127. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  128. package/lib/cjs/presentation-common/rules/Variables.js +3 -3
  129. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  130. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +3 -3
  131. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  132. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +3 -3
  133. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  134. package/lib/cjs/presentation-common/rules/content/ContentRule.js +3 -3
  135. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  136. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  137. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js +3 -3
  138. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  139. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +3 -3
  140. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  141. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js +3 -3
  142. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  143. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +3 -3
  144. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  145. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +3 -3
  146. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  147. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js +3 -3
  148. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  149. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +3 -3
  150. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  151. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +3 -3
  152. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  153. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts.map +1 -1
  154. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +3 -3
  155. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  156. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +3 -3
  157. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  158. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +3 -3
  159. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  160. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  161. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  162. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +3 -3
  163. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  164. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js +3 -3
  165. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  166. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +3 -3
  167. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  168. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +3 -3
  169. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  170. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  171. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js +3 -3
  172. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  173. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +3 -3
  174. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  175. package/lib/cjs/presentation-common/rules/customization/SortingRule.js +3 -3
  176. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  177. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +3 -3
  178. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  179. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +3 -3
  180. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  181. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  182. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -3
  183. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  184. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +3 -3
  185. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  186. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -3
  187. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  188. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +3 -3
  189. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  190. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +3 -3
  191. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  192. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js +3 -3
  193. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  194. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +3 -3
  195. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  196. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +3 -3
  197. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  198. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +3 -3
  199. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  200. package/lib/cjs/presentation-common/selection/SelectionScope.js +3 -3
  201. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  202. package/lib/cjs/presentation-common.js +3 -3
  203. package/lib/cjs/presentation-common.js.map +1 -1
  204. package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
  205. package/lib/esm/presentation-common/AsyncTasks.js +6 -4
  206. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  207. package/lib/esm/presentation-common/CommonLoggerCategory.js +3 -3
  208. package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
  209. package/lib/esm/presentation-common/Diagnostics.d.ts.map +1 -1
  210. package/lib/esm/presentation-common/Diagnostics.js +27 -15
  211. package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
  212. package/lib/esm/presentation-common/EC.d.ts +7 -4
  213. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  214. package/lib/esm/presentation-common/EC.js +22 -17
  215. package/lib/esm/presentation-common/EC.js.map +1 -1
  216. package/lib/esm/presentation-common/ElementProperties.js +3 -3
  217. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  218. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  219. package/lib/esm/presentation-common/Error.js +5 -4
  220. package/lib/esm/presentation-common/Error.js.map +1 -1
  221. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  222. package/lib/esm/presentation-common/InstanceFilterDefinition.js +3 -3
  223. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  224. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  225. package/lib/esm/presentation-common/KeySet.js +80 -46
  226. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  227. package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
  228. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  229. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  230. package/lib/esm/presentation-common/LabelDefinition.js +5 -4
  231. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  232. package/lib/esm/presentation-common/LocalizationHelper.d.ts +1 -1
  233. package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
  234. package/lib/esm/presentation-common/LocalizationHelper.js +19 -2
  235. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  236. package/lib/esm/presentation-common/PresentationIpcInterface.js +3 -3
  237. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  238. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  239. package/lib/esm/presentation-common/PresentationManagerOptions.js +3 -3
  240. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  241. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  242. package/lib/esm/presentation-common/PresentationRpcInterface.js +53 -21
  243. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  244. package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  245. package/lib/esm/presentation-common/RegisteredRuleset.js +21 -9
  246. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  247. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +1 -1
  248. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  249. package/lib/esm/presentation-common/RpcRequestsHandler.js +20 -16
  250. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  251. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  252. package/lib/esm/presentation-common/RulesetVariables.js +7 -5
  253. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  254. package/lib/esm/presentation-common/RulesetsFactory.d.ts.map +1 -1
  255. package/lib/esm/presentation-common/RulesetsFactory.js +42 -26
  256. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  257. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  258. package/lib/esm/presentation-common/Update.js +4 -3
  259. package/lib/esm/presentation-common/Update.js.map +1 -1
  260. package/lib/esm/presentation-common/Utils.js +3 -3
  261. package/lib/esm/presentation-common/Utils.js.map +1 -1
  262. package/lib/esm/presentation-common/content/Category.js +3 -3
  263. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  264. package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
  265. package/lib/esm/presentation-common/content/Content.js +10 -9
  266. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  267. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  268. package/lib/esm/presentation-common/content/ContentTraverser.js +47 -25
  269. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  270. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  271. package/lib/esm/presentation-common/content/Descriptor.js +56 -21
  272. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  273. package/lib/esm/presentation-common/content/DisplayTypes.js +3 -3
  274. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  275. package/lib/esm/presentation-common/content/Editor.js +3 -3
  276. package/lib/esm/presentation-common/content/Editor.js.map +1 -1
  277. package/lib/esm/presentation-common/content/Fields.d.ts +78 -2
  278. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  279. package/lib/esm/presentation-common/content/Fields.js +198 -44
  280. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  281. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  282. package/lib/esm/presentation-common/content/Item.js +8 -6
  283. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  284. package/lib/esm/presentation-common/content/Property.d.ts +1 -1
  285. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  286. package/lib/esm/presentation-common/content/Property.js +4 -4
  287. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  288. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +6 -1
  289. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
  290. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +39 -11
  291. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  292. package/lib/esm/presentation-common/content/Renderer.js +3 -3
  293. package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
  294. package/lib/esm/presentation-common/content/TypeDescription.js +3 -3
  295. package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
  296. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  297. package/lib/esm/presentation-common/content/Value.js +46 -30
  298. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  299. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +3 -3
  300. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  301. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  302. package/lib/esm/presentation-common/hierarchy/Key.js +14 -8
  303. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  304. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  305. package/lib/esm/presentation-common/hierarchy/Node.js +7 -5
  306. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  307. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  308. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +11 -7
  309. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  310. package/lib/esm/presentation-common/rules/ClassSpecifications.js +3 -3
  311. package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
  312. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts +39 -11
  313. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts.map +1 -1
  314. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js +3 -3
  315. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  316. package/lib/esm/presentation-common/rules/RelationshipDirection.js +3 -3
  317. package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
  318. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js +3 -3
  319. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  320. package/lib/esm/presentation-common/rules/Rule.js +3 -3
  321. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  322. package/lib/esm/presentation-common/rules/Ruleset.js +3 -3
  323. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  324. package/lib/esm/presentation-common/rules/SchemasSpecification.js +3 -3
  325. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  326. package/lib/esm/presentation-common/rules/Variables.js +3 -3
  327. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  328. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +3 -3
  329. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  330. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +3 -3
  331. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  332. package/lib/esm/presentation-common/rules/content/ContentRule.js +3 -3
  333. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  334. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  335. package/lib/esm/presentation-common/rules/content/ContentSpecification.js +3 -3
  336. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  337. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +3 -3
  338. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  339. package/lib/esm/presentation-common/rules/content/PropertySpecification.js +3 -3
  340. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  341. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +3 -3
  342. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  343. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +3 -3
  344. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  345. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js +3 -3
  346. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  347. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +3 -3
  348. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  349. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +3 -3
  350. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  351. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts.map +1 -1
  352. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +3 -3
  353. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  354. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +3 -3
  355. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  356. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +3 -3
  357. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  358. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  359. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  360. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +3 -3
  361. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  362. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js +3 -3
  363. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  364. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +3 -3
  365. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  366. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +3 -3
  367. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  368. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  369. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js +3 -3
  370. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  371. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +3 -3
  372. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  373. package/lib/esm/presentation-common/rules/customization/SortingRule.js +3 -3
  374. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  375. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +3 -3
  376. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  377. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +3 -3
  378. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  379. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  380. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -3
  381. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  382. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +3 -3
  383. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  384. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -3
  385. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  386. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +3 -3
  387. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  388. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +3 -3
  389. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  390. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js +3 -3
  391. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  392. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +3 -3
  393. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  394. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +3 -3
  395. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  396. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +3 -3
  397. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  398. package/lib/esm/presentation-common/selection/SelectionScope.js +3 -3
  399. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  400. package/lib/esm/presentation-common.js +3 -3
  401. package/lib/esm/presentation-common.js.map +1 -1
  402. package/lib/public/locales/en/Presentation.json +1 -1
  403. package/package.json +14 -11
@@ -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 RPC
8
8
  */
@@ -25,15 +25,27 @@ class PresentationRpcInterface extends core_common_1.RpcInterface {
25
25
  NOTE: Any add/remove/change to the methods below requires an update of the interface version.
26
26
  NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.
27
27
  ===========================================================================================*/
28
- async getNodesCount(_token, _options) { return this.forward(arguments); }
29
- async getPagedNodes(_token, _options) { return this.forward(arguments); }
28
+ async getNodesCount(_token, _options) {
29
+ return this.forward(arguments);
30
+ }
31
+ async getPagedNodes(_token, _options) {
32
+ return this.forward(arguments);
33
+ }
30
34
  /** @beta */
31
- async getNodesDescriptor(_token, _options) { return this.forward(arguments); }
35
+ async getNodesDescriptor(_token, _options) {
36
+ return this.forward(arguments);
37
+ }
32
38
  // TODO: add paged version of this (#387280)
33
- async getNodePaths(_token, _options) { return this.forward(arguments); }
39
+ async getNodePaths(_token, _options) {
40
+ return this.forward(arguments);
41
+ }
34
42
  // TODO: add paged version of this (#387280)
35
- async getFilteredNodePaths(_token, _options) { return this.forward(arguments); }
36
- async getContentSources(_token, _options) { return this.forward(arguments); }
43
+ async getFilteredNodePaths(_token, _options) {
44
+ return this.forward(arguments);
45
+ }
46
+ async getContentSources(_token, _options) {
47
+ return this.forward(arguments);
48
+ }
37
49
  async getContentDescriptor(_token, _options) {
38
50
  arguments[1] = { ...arguments[1], transport: "unparsed-json" };
39
51
  const response = await this.forward(arguments);
@@ -42,21 +54,42 @@ class PresentationRpcInterface extends core_common_1.RpcInterface {
42
54
  }
43
55
  return response;
44
56
  }
45
- async getContentSetSize(_token, _options) { return this.forward(arguments); }
46
- async getPagedContent(_token, _options) { return this.forward(arguments); }
47
- async getPagedContentSet(_token, _options) { return this.forward(arguments); }
48
- async getElementProperties(_token, _options) { return this.forward(arguments); }
49
- async getPagedDistinctValues(_token, _options) { return this.forward(arguments); }
50
- async getContentInstanceKeys(_token, _options) { return this.forward(arguments); }
51
- async getDisplayLabelDefinition(_token, _options) { return this.forward(arguments); }
52
- async getPagedDisplayLabelDefinitions(_token, _options) { return this.forward(arguments); }
53
- async getSelectionScopes(_token, _options) { return this.forward(arguments); }
54
- async computeSelection(_token, _options, _ids, _scopeId) { return this.forward(arguments); }
57
+ async getContentSetSize(_token, _options) {
58
+ return this.forward(arguments);
59
+ }
60
+ async getPagedContent(_token, _options) {
61
+ return this.forward(arguments);
62
+ }
63
+ async getPagedContentSet(_token, _options) {
64
+ return this.forward(arguments);
65
+ }
66
+ async getElementProperties(_token, _options) {
67
+ return this.forward(arguments);
68
+ }
69
+ async getPagedDistinctValues(_token, _options) {
70
+ return this.forward(arguments);
71
+ }
72
+ async getContentInstanceKeys(_token, _options) {
73
+ return this.forward(arguments);
74
+ }
75
+ async getDisplayLabelDefinition(_token, _options) {
76
+ return this.forward(arguments);
77
+ }
78
+ async getPagedDisplayLabelDefinitions(_token, _options) {
79
+ return this.forward(arguments);
80
+ }
81
+ async getSelectionScopes(_token, _options) {
82
+ return this.forward(arguments);
83
+ }
84
+ async computeSelection(_token, _options, _ids, _scopeId) {
85
+ return this.forward(arguments);
86
+ }
55
87
  }
88
+ // eslint-disable-line deprecation/deprecation
56
89
  /** The immutable name of the interface. */
57
90
  PresentationRpcInterface.interfaceName = "PresentationRpcInterface"; // eslint-disable-line @typescript-eslint/naming-convention
58
91
  /** The semantic version of the interface. */
59
- PresentationRpcInterface.interfaceVersion = "4.0.0";
92
+ PresentationRpcInterface.interfaceVersion = "4.1.0";
60
93
  __decorate([
61
94
  core_common_1.RpcOperation.setPolicy({ allowResponseCompression: true })
62
95
  // eslint-disable-next-line deprecation/deprecation
@@ -89,7 +122,6 @@ __decorate([
89
122
  ], PresentationRpcInterface.prototype, "getElementProperties", null);
90
123
  __decorate([
91
124
  core_common_1.RpcOperation.setPolicy({ allowResponseCompression: true })
92
- // eslint-disable-next-line deprecation/deprecation
93
125
  ], PresentationRpcInterface.prototype, "getPagedDistinctValues", null);
94
126
  __decorate([
95
127
  core_common_1.RpcOperation.setPolicy({ allowResponseCompression: true })
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationRpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;AAGH,oDAAgF;AAOhF,mCAA6C;AA0J7C;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,0BAAY;IAOxD;;;iGAG6F;IAEtF,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAAoC,IAAqC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAIhJ,AAAN,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAA2C,IAAsD,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAErL,YAAY;IAEC,AAAN,KAAK,CAAC,kBAAkB,CAAC,MAAsB,EAAE,QAAmD,IAAkE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAE9M,4CAA4C;IAG/B,AAAN,KAAK,CAAC,YAAY,CAAC,MAAsB,EAAE,QAAyD,IAAoD,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEhM,4CAA4C;IAG/B,AAAN,KAAK,CAAC,oBAAoB,CAAC,MAAsB,EAAE,QAAgD,IAAoD,OAAO,IAAI,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C,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;iEAC4H;AAG1K;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;oEAQ1D;AAKY;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;+DACkL;AAGhO;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;kEAC6H;AAG3K;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;oEAC8I;AAI5L;IAFZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;IAC3D,mDAAmD;sEACsJ;AAO5L;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;+EACgJ;AAQ9L;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;gEAC0L;AAzE1O,4DAAwB;AA4ErC,gBAAgB;AAChB,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,yDAAgC,CAAA;AAClC,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC","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 RPC\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcInterface, RpcOperation } from \"@itwin/core-common\";\nimport { DescriptorJSON, DescriptorOverrides, SelectClassInfoJSON } from \"./content/Descriptor\";\nimport { ItemJSON } from \"./content/Item\";\nimport { DisplayValueGroupJSON } from \"./content/Value\";\nimport { ClientDiagnostics, ClientDiagnosticsOptions } from \"./Diagnostics\";\nimport { CompressedClassInfoJSON, InstanceKey } from \"./EC\";\nimport { ElementProperties } from \"./ElementProperties\";\nimport { PresentationStatus } from \"./Error\";\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { NodeJSON } from \"./hierarchy/Node\";\nimport { NodePathElementJSON } from \"./hierarchy/NodePathElement\";\nimport { KeySetJSON } from \"./KeySet\";\nimport { LabelDefinition } from \"./LabelDefinition\";\nimport {\n ComputeSelectionRequestOptions, ContentDescriptorRequestOptions, ContentInstanceKeysRequestOptions, ContentRequestOptions,\n ContentSourcesRequestOptions, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions,\n Paged, SelectionScopeRequestOptions, SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions\";\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\nimport { SelectionScope } from \"./selection/SelectionScope\";\nimport { Omit, PagedResponse } from \"./Utils\";\n\n/**\n * Base options for all presentation RPC requests.\n * @public\n */\nexport type PresentationRpcRequestOptions<TManagerRequestOptions> = Omit<TManagerRequestOptions, \"imodel\" | \"diagnostics\"> & {\n /** @internal ID of the client requesting data */\n clientId?: string;\n /**\n * RPC request diagnostics options.\n * @beta\n */\n diagnostics?: RpcDiagnosticsOptions;\n};\n\n/**\n * Data structure for presentation RPC responses\n * @public\n */\nexport interface PresentationRpcResponseData<TResult = undefined> {\n /** Response status code */\n statusCode: PresentationStatus;\n /** In case of an error response, the error message */\n errorMessage?: string;\n /** In case of a success response, the result */\n result?: TResult;\n /**\n * Diagnostics response.\n * @beta\n */\n diagnostics?: ClientDiagnostics;\n}\n\n/**\n * Data structure for RPC diagnostics options.\n * @beta\n */\nexport type RpcDiagnosticsOptions = Omit<ClientDiagnosticsOptions, \"handler\">;\n\n/**\n * A promise of [[PresentationRpcResponseData]].\n * @public\n */\nexport type PresentationRpcResponse<TResult = undefined> = Promise<PresentationRpcResponseData<TResult>>;\n\n/**\n * Data structure for hierarchy request options.\n * @public\n */\nexport type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;\n\n/**\n * Data structure for hierarchy level descriptor RPC request options.\n * @beta\n */\nexport type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>>;\n\n/**\n * Data structure for filtering hierarchy by ECInstance paths request options.\n * @public\n */\nexport type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>>;\n\n/**\n * Data structure for filtering hierarchy by text request options.\n * @public\n */\nexport type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;\n\n/**\n * Data structure for content sources RPC request options.\n * @public\n */\nexport type ContentSourcesRpcRequestOptions = PresentationRpcRequestOptions<ContentSourcesRequestOptions<never>>;\n/**\n * Data structure for content sources RPC response.\n * @public\n */\nexport interface ContentSourcesRpcResult {\n /** A list of objects containing content source information. */\n sources: SelectClassInfoJSON<Id64String>[];\n /** An `ECClassId` => [[CompressedClassInfoJSON]] map for deserializing [[sources]]. */\n classesMap: { [id: string]: CompressedClassInfoJSON };\n}\n\n/**\n * Data structure for content descriptor RPC request options.\n * @public\n */\nexport type ContentDescriptorRpcRequestOptions = PresentationRpcRequestOptions<ContentDescriptorRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for content RPC request options.\n * @public\n */\nexport type ContentRpcRequestOptions = PresentationRpcRequestOptions<ContentRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for single element properties RPC request options.\n * @public\n */\nexport type SingleElementPropertiesRpcRequestOptions = PresentationRpcRequestOptions<SingleElementPropertiesRequestOptions<never>>;\n\n/**\n * Data structure for distinct values' request options.\n * @public\n */\nexport type DistinctValuesRpcRequestOptions = PresentationRpcRequestOptions<DistinctValuesRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for content instance keys' request options.\n * @public\n */\nexport type ContentInstanceKeysRpcRequestOptions = PresentationRpcRequestOptions<ContentInstanceKeysRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for label request options.\n * @public\n */\nexport type DisplayLabelRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for labels request options.\n * @public\n */\nexport type DisplayLabelsRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelsRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for selection scope request options.\n * @public\n */\nexport type SelectionScopeRpcRequestOptions = PresentationRpcRequestOptions<SelectionScopeRequestOptions<never>>;\n\n/**\n * Request options data structure for computing selection based on given selection scope and element IDs.\n * @public\n */\nexport type ComputeSelectionRpcRequestOptions = PresentationRpcRequestOptions<ComputeSelectionRequestOptions<never>>;\n\n/**\n * Interface used for communication between Presentation backend and frontend.\n * @public\n */\nexport class PresentationRpcInterface extends RpcInterface { // eslint-disable-line deprecation/deprecation\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"PresentationRpcInterface\"; // eslint-disable-line @typescript-eslint/naming-convention\n\n /** The semantic version of the interface. */\n public static interfaceVersion = \"4.0.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.\n ===========================================================================================*/\n\n public async getNodesCount(_token: IModelRpcProps, _options: HierarchyRpcRequestOptions): PresentationRpcResponse<number> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getPagedNodes(_token: IModelRpcProps, _options: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<NodeJSON>> { return this.forward(arguments); }\n\n /** @beta */\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getNodesDescriptor(_token: IModelRpcProps, _options: HierarchyLevelDescriptorRpcRequestOptions): PresentationRpcResponse<string | DescriptorJSON | undefined> { return this.forward(arguments); }\n\n // TODO: add paged version of this (#387280)\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getNodePaths(_token: IModelRpcProps, _options: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]> { return this.forward(arguments); }\n\n // TODO: add paged version of this (#387280)\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getFilteredNodePaths(_token: IModelRpcProps, _options: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getContentSources(_token: IModelRpcProps, _options: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getContentDescriptor(_token: IModelRpcProps, _options: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined> {\n arguments[1] = { ...arguments[1], transport: \"unparsed-json\" };\n const response: PresentationRpcResponseData<DescriptorJSON | string | undefined> = await this.forward(arguments);\n if (response.statusCode === PresentationStatus.Success && typeof response.result === \"string\") {\n response.result = JSON.parse(response.result);\n }\n return response as PresentationRpcResponseData<DescriptorJSON | undefined>;\n }\n\n public async getContentSetSize(_token: IModelRpcProps, _options: ContentRpcRequestOptions): PresentationRpcResponse<number> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedContent(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<{ descriptor: DescriptorJSON, contentSet: PagedResponse<ItemJSON> } | undefined> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedContentSet(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getElementProperties(_token: IModelRpcProps, _options: SingleElementPropertiesRpcRequestOptions): PresentationRpcResponse<ElementProperties | undefined> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getPagedDistinctValues(_token: IModelRpcProps, _options: DistinctValuesRpcRequestOptions): PresentationRpcResponse<PagedResponse<DisplayValueGroupJSON>> { return this.forward(arguments); }\n\n public async getContentInstanceKeys(_token: IModelRpcProps, _options: ContentInstanceKeysRpcRequestOptions): PresentationRpcResponse<{ total: number, items: KeySetJSON }> { return this.forward(arguments); }\n\n public async getDisplayLabelDefinition(_token: IModelRpcProps, _options: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition> { return this.forward(arguments); }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedDisplayLabelDefinitions(_token: IModelRpcProps, _options: DisplayLabelsRpcRequestOptions): PresentationRpcResponse<PagedResponse<LabelDefinition>> { return this.forward(arguments); }\n\n public async getSelectionScopes(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> { return this.forward(arguments); }\n\n /** @deprecated in 3.x. Use the override with [[ComputeSelectionRpcRequestOptions]]. */\n public async computeSelection(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions, _ids: Id64String[], _scopeId: string): PresentationRpcResponse<KeySetJSON>;\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON>;\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions | SelectionScopeRpcRequestOptions, _ids?: Id64String[], _scopeId?: string): PresentationRpcResponse<KeySetJSON> { return this.forward(arguments); }\n}\n\n/** @internal */\nexport enum PresentationIpcEvents {\n /**\n * ID of an event that's emitted when backend detects changes in presented data.\n */\n Update = \"presentation.onUpdate\",\n}\n"]}
1
+ {"version":3,"file":"PresentationRpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;AAGH,oDAAgF;AAOhF,mCAA6C;AA2K7C;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,0BAAY;IAQxD;;;iGAG6F;IAEtF,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAAoC;QACrF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAIY,AAAN,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAA2C;QAC5F,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,YAAY;IAEC,AAAN,KAAK,CAAC,kBAAkB,CAC7B,MAAsB,EACtB,QAAmD;QAEnD,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,4CAA4C;IAG/B,AAAN,KAAK,CAAC,YAAY,CAAC,MAAsB,EAAE,QAAyD;QACzG,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,4CAA4C;IAG/B,AAAN,KAAK,CAAC,oBAAoB,CAAC,MAAsB,EAAE,QAAgD;QACxG,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAGY,AAAN,KAAK,CAAC,iBAAiB,CAAC,MAAsB,EAAE,QAAyC;QAC9F,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;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,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;+DAM1D;AAGY;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;kEAG1D;AAGY;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;oEAM1D;AAGY;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;sEAO1D;AAcY;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;+EAM1D;AAeY;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;gEAQ1D;AAtIU,4DAAwB;AAyIrC,gBAAgB;AAChB,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,yDAAgC,CAAA;AAClC,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC","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 RPC\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcInterface, RpcOperation } from \"@itwin/core-common\";\nimport { DescriptorJSON, DescriptorOverrides, SelectClassInfoJSON } from \"./content/Descriptor\";\nimport { ItemJSON } from \"./content/Item\";\nimport { DisplayValueGroupJSON } from \"./content/Value\";\nimport { ClientDiagnostics, ClientDiagnosticsOptions } from \"./Diagnostics\";\nimport { CompressedClassInfoJSON, InstanceKey } from \"./EC\";\nimport { ElementProperties } from \"./ElementProperties\";\nimport { PresentationStatus } from \"./Error\";\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { NodeJSON } from \"./hierarchy/Node\";\nimport { NodePathElementJSON } from \"./hierarchy/NodePathElement\";\nimport { KeySetJSON } from \"./KeySet\";\nimport { LabelDefinition } from \"./LabelDefinition\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions\";\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\nimport { SelectionScope } from \"./selection/SelectionScope\";\nimport { Omit, PagedResponse } from \"./Utils\";\n\n/**\n * Base options for all presentation RPC requests.\n * @public\n */\nexport type PresentationRpcRequestOptions<TManagerRequestOptions> = Omit<TManagerRequestOptions, \"imodel\" | \"diagnostics\"> & {\n /** @internal ID of the client requesting data */\n clientId?: string;\n /**\n * RPC request diagnostics options.\n * @beta\n */\n diagnostics?: RpcDiagnosticsOptions;\n};\n\n/**\n * Data structure for presentation RPC responses\n * @public\n */\nexport interface PresentationRpcResponseData<TResult = undefined> {\n /** Response status code */\n statusCode: PresentationStatus;\n /** In case of an error response, the error message */\n errorMessage?: string;\n /** In case of a success response, the result */\n result?: TResult;\n /**\n * Diagnostics response.\n * @beta\n */\n diagnostics?: ClientDiagnostics;\n}\n\n/**\n * Data structure for RPC diagnostics options.\n * @beta\n */\nexport type RpcDiagnosticsOptions = Omit<ClientDiagnosticsOptions, \"handler\">;\n\n/**\n * A promise of [[PresentationRpcResponseData]].\n * @public\n */\nexport type PresentationRpcResponse<TResult = undefined> = Promise<PresentationRpcResponseData<TResult>>;\n\n/**\n * Data structure for hierarchy request options.\n * @public\n */\nexport type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;\n\n/**\n * Data structure for hierarchy level descriptor RPC request options.\n * @beta\n */\nexport type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<\n HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by ECInstance paths request options.\n * @public\n */\nexport type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<\n FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by text request options.\n * @public\n */\nexport type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;\n\n/**\n * Data structure for content sources RPC request options.\n * @public\n */\nexport type ContentSourcesRpcRequestOptions = PresentationRpcRequestOptions<ContentSourcesRequestOptions<never>>;\n/**\n * Data structure for content sources RPC response.\n * @public\n */\nexport interface ContentSourcesRpcResult {\n /** A list of objects containing content source information. */\n sources: SelectClassInfoJSON<Id64String>[];\n /** An `ECClassId` => [[CompressedClassInfoJSON]] map for deserializing [[sources]]. */\n classesMap: { [id: string]: CompressedClassInfoJSON };\n}\n\n/**\n * Data structure for content descriptor RPC request options.\n * @public\n */\nexport type ContentDescriptorRpcRequestOptions = PresentationRpcRequestOptions<ContentDescriptorRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for content RPC request options.\n * @public\n */\nexport type ContentRpcRequestOptions = PresentationRpcRequestOptions<ContentRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for single element properties RPC request options.\n * @public\n */\nexport type SingleElementPropertiesRpcRequestOptions = PresentationRpcRequestOptions<SingleElementPropertiesRequestOptions<never>>;\n\n/**\n * Data structure for distinct values' request options.\n * @public\n */\nexport type DistinctValuesRpcRequestOptions = PresentationRpcRequestOptions<\n DistinctValuesRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for content instance keys' request options.\n * @public\n */\nexport type ContentInstanceKeysRpcRequestOptions = PresentationRpcRequestOptions<ContentInstanceKeysRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for label request options.\n * @public\n */\nexport type DisplayLabelRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for labels request options.\n * @public\n */\nexport type DisplayLabelsRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelsRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for selection scope request options.\n * @public\n */\nexport type SelectionScopeRpcRequestOptions = PresentationRpcRequestOptions<SelectionScopeRequestOptions<never>>;\n\n/**\n * Request options data structure for computing selection based on given selection scope and element IDs.\n * @public\n */\nexport type ComputeSelectionRpcRequestOptions = PresentationRpcRequestOptions<ComputeSelectionRequestOptions<never>>;\n\n/**\n * Interface used for communication between Presentation backend and frontend.\n * @public\n */\nexport class PresentationRpcInterface extends RpcInterface {\n // eslint-disable-line deprecation/deprecation\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"PresentationRpcInterface\"; // eslint-disable-line @typescript-eslint/naming-convention\n\n /** The semantic version of the interface. */\n public static interfaceVersion = \"4.1.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.\n ===========================================================================================*/\n\n public async getNodesCount(_token: IModelRpcProps, _options: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getPagedNodes(_token: IModelRpcProps, _options: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<NodeJSON>> {\n return this.forward(arguments);\n }\n\n /** @beta */\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getNodesDescriptor(\n _token: IModelRpcProps,\n _options: HierarchyLevelDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\n return this.forward(arguments);\n }\n\n // TODO: add paged version of this (#387280)\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getNodePaths(_token: IModelRpcProps, _options: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]> {\n return this.forward(arguments);\n }\n\n // TODO: add paged version of this (#387280)\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n // eslint-disable-next-line deprecation/deprecation\n public async getFilteredNodePaths(_token: IModelRpcProps, _options: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getContentSources(_token: IModelRpcProps, _options: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getContentDescriptor(_token: IModelRpcProps, _options: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined> {\n arguments[1] = { ...arguments[1], transport: \"unparsed-json\" };\n const response: PresentationRpcResponseData<DescriptorJSON | string | undefined> = await this.forward(arguments);\n if (response.statusCode === PresentationStatus.Success && typeof response.result === \"string\") {\n response.result = JSON.parse(response.result);\n }\n return response as PresentationRpcResponseData<DescriptorJSON | undefined>;\n }\n\n public async getContentSetSize(_token: IModelRpcProps, _options: ContentRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedContent(\n _token: IModelRpcProps,\n _options: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedContentSet(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getElementProperties(\n _token: IModelRpcProps,\n _options: SingleElementPropertiesRpcRequestOptions,\n ): PresentationRpcResponse<ElementProperties | undefined> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedDistinctValues(\n _token: IModelRpcProps,\n _options: DistinctValuesRpcRequestOptions,\n // eslint-disable-next-line deprecation/deprecation\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroupJSON>> {\n return this.forward(arguments);\n }\n\n public async getContentInstanceKeys(\n _token: IModelRpcProps,\n _options: ContentInstanceKeysRpcRequestOptions,\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\n return this.forward(arguments);\n }\n\n public async getDisplayLabelDefinition(_token: IModelRpcProps, _options: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition> {\n return this.forward(arguments);\n }\n\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async getPagedDisplayLabelDefinitions(\n _token: IModelRpcProps,\n _options: DisplayLabelsRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\n return this.forward(arguments);\n }\n\n public async getSelectionScopes(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 3.x. Use the override with [[ComputeSelectionRpcRequestOptions]]. */\n public async computeSelection(\n _token: IModelRpcProps,\n _options: SelectionScopeRpcRequestOptions,\n _ids: Id64String[],\n _scopeId: string,\n ): PresentationRpcResponse<KeySetJSON>;\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON>;\n @RpcOperation.setPolicy({ allowResponseCompression: true })\n public async computeSelection(\n _token: IModelRpcProps,\n _options: ComputeSelectionRpcRequestOptions | SelectionScopeRpcRequestOptions,\n _ids?: Id64String[],\n _scopeId?: string,\n ): PresentationRpcResponse<KeySetJSON> {\n return this.forward(arguments);\n }\n}\n\n/** @internal */\nexport enum PresentationIpcEvents {\n /**\n * ID of an event that's emitted when backend detects changes in presented data.\n */\n Update = \"presentation.onUpdate\",\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RegisteredRuleset.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,WAAW,EAAE,OAAO;IAC5D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,YAAY,CAAuC;IAE3D,kCAAkC;gBACf,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI;IAMhH,kCAAkC;IAC3B,OAAO;IAId,IAAW,gBAAgB,WAAqC;IAChE,IAAW,EAAE,IAAI,MAAM,CAA6B;IACpD,IAAW,mBAAmB,IAAI,mBAAmB,GAAG,SAAS,CAA8C;IAC/G,IAAW,KAAK,IAAI,IAAI,EAAE,CAAgC;IAC1D,IAAW,IAAI,IAAI,cAAc,EAAE,GAAG,SAAS,CAA+B;IACvE,MAAM,IAAI,OAAO;CACzB"}
1
+ {"version":3,"file":"RegisteredRuleset.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,WAAW,EAAE,OAAO;IAC5D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,YAAY,CAAuC;IAE3D,kCAAkC;gBACf,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI;IAMhH,kCAAkC;IAC3B,OAAO;IAId,IAAW,gBAAgB,WAE1B;IACD,IAAW,EAAE,IAAI,MAAM,CAEtB;IACD,IAAW,mBAAmB,IAAI,mBAAmB,GAAG,SAAS,CAEhE;IACD,IAAW,KAAK,IAAI,IAAI,EAAE,CAEzB;IACD,IAAW,IAAI,IAAI,cAAc,EAAE,GAAG,SAAS,CAE9C;IACM,MAAM,IAAI,OAAO;CAGzB"}
@@ -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
  */
@@ -23,12 +23,24 @@ class RegisteredRuleset {
23
23
  dispose() {
24
24
  this._disposeFunc(this);
25
25
  }
26
- get uniqueIdentifier() { return this._uniqueIdentifier; }
27
- get id() { return this._ruleset.id; }
28
- get supplementationInfo() { return this._ruleset.supplementationInfo; }
29
- get rules() { return this._ruleset.rules; }
30
- get vars() { return this._ruleset.vars; }
31
- toJSON() { return this._ruleset; }
26
+ get uniqueIdentifier() {
27
+ return this._uniqueIdentifier;
28
+ }
29
+ get id() {
30
+ return this._ruleset.id;
31
+ }
32
+ get supplementationInfo() {
33
+ return this._ruleset.supplementationInfo;
34
+ }
35
+ get rules() {
36
+ return this._ruleset.rules;
37
+ }
38
+ get vars() {
39
+ return this._ruleset.vars;
40
+ }
41
+ toJSON() {
42
+ return this._ruleset;
43
+ }
32
44
  }
33
45
  exports.RegisteredRuleset = RegisteredRuleset;
34
46
  //# sourceMappingURL=RegisteredRuleset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegisteredRuleset.js","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,MAAa,iBAAiB;IAK5B,kCAAkC;IAClC,YAAmB,OAAgB,EAAE,gBAAwB,EAAE,WAAiD;QAC9G,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,kCAAkC;IAC3B,OAAO;QACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAW,gBAAgB,KAAK,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAChE,IAAW,EAAE,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,IAAW,mBAAmB,KAAsC,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC/G,IAAW,KAAK,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1D,IAAW,IAAI,KAAmC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACvE,MAAM,KAAc,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;CACnD;AAvBD,8CAuBC","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 { IDisposable } from \"@itwin/core-bentley\";\nimport { Rule } from \"./rules/Rule\";\nimport { Ruleset, SupplementationInfo } from \"./rules/Ruleset\";\nimport { VariablesGroup } from \"./rules/Variables\";\n\n/**\n * A ruleset that is registered in a ruleset manager.\n * @public\n */\nexport class RegisteredRuleset implements IDisposable, Ruleset {\n private _ruleset: Ruleset;\n private _uniqueIdentifier: string;\n private _disposeFunc: (ruleset: RegisteredRuleset) => void;\n\n /** Create a registered ruleset */\n public constructor(ruleset: Ruleset, uniqueIdentifier: string, disposeFunc: (ruleset: RegisteredRuleset) => void) {\n this._disposeFunc = disposeFunc;\n this._ruleset = ruleset;\n this._uniqueIdentifier = uniqueIdentifier;\n }\n\n /** Dispose registered ruleset. */\n public dispose() {\n this._disposeFunc(this);\n }\n\n public get uniqueIdentifier() { return this._uniqueIdentifier; }\n public get id(): string { return this._ruleset.id; }\n public get supplementationInfo(): SupplementationInfo | undefined { return this._ruleset.supplementationInfo; }\n public get rules(): Rule[] { return this._ruleset.rules; }\n public get vars(): VariablesGroup[] | undefined { return this._ruleset.vars; }\n public toJSON(): Ruleset { return this._ruleset; }\n}\n"]}
1
+ {"version":3,"file":"RegisteredRuleset.js","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAOH;;;GAGG;AACH,MAAa,iBAAiB;IAK5B,kCAAkC;IAClC,YAAmB,OAAgB,EAAE,gBAAwB,EAAE,WAAiD;QAC9G,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,kCAAkC;IAC3B,OAAO;QACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IACD,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1B,CAAC;IACD,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC3C,CAAC;IACD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IACM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAnCD,8CAmCC","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 { IDisposable } from \"@itwin/core-bentley\";\nimport { Rule } from \"./rules/Rule\";\nimport { Ruleset, SupplementationInfo } from \"./rules/Ruleset\";\nimport { VariablesGroup } from \"./rules/Variables\";\n\n/**\n * A ruleset that is registered in a ruleset manager.\n * @public\n */\nexport class RegisteredRuleset implements IDisposable, Ruleset {\n private _ruleset: Ruleset;\n private _uniqueIdentifier: string;\n private _disposeFunc: (ruleset: RegisteredRuleset) => void;\n\n /** Create a registered ruleset */\n public constructor(ruleset: Ruleset, uniqueIdentifier: string, disposeFunc: (ruleset: RegisteredRuleset) => void) {\n this._disposeFunc = disposeFunc;\n this._ruleset = ruleset;\n this._uniqueIdentifier = uniqueIdentifier;\n }\n\n /** Dispose registered ruleset. */\n public dispose() {\n this._disposeFunc(this);\n }\n\n public get uniqueIdentifier() {\n return this._uniqueIdentifier;\n }\n public get id(): string {\n return this._ruleset.id;\n }\n public get supplementationInfo(): SupplementationInfo | undefined {\n return this._ruleset.supplementationInfo;\n }\n public get rules(): Rule[] {\n return this._ruleset.rules;\n }\n public get vars(): VariablesGroup[] | undefined {\n return this._ruleset.vars;\n }\n public toJSON(): Ruleset {\n return this._ruleset;\n }\n}\n"]}
@@ -55,7 +55,7 @@ export declare class RpcRequestsHandler {
55
55
  * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]
56
56
  * is thrown with the details from the response.
57
57
  */
58
- request<TResult, TOptions extends (RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute), TArg = any>(func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>, options: TOptions, ...additionalOptions: TArg[]): Promise<TResult>;
58
+ request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>, options: TOptions, ...additionalOptions: TArg[]): Promise<TResult>;
59
59
  getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number>;
60
60
  getPagedNodes(options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute): Promise<PagedResponse<NodeJSON>>;
61
61
  getNodesDescriptor(options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<DescriptorJSON | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcRequestsHandler.d.ts","sour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,CAAC,GAAG,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAC;CAOzI"}
@@ -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 RPC
8
8
  */
@@ -31,7 +31,9 @@ class RpcRequestsHandler {
31
31
  this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;
32
32
  }
33
33
  // eslint-disable-next-line @typescript-eslint/naming-convention
34
- get rpcClient() { return core_common_1.RpcManager.getClientForInterface(PresentationRpcInterface_1.PresentationRpcInterface); }
34
+ get rpcClient() {
35
+ return core_common_1.RpcManager.getClientForInterface(PresentationRpcInterface_1.PresentationRpcInterface);
36
+ }
35
37
  async requestWithTimeout(func, diagnosticsHandler) {
36
38
  const start = core_bentley_1.BeTimePoint.now();
37
39
  const timeout = core_bentley_1.BeDuration.fromMilliseconds(this.timeout);
@@ -41,9 +43,12 @@ class RpcRequestsHandler {
41
43
  const response = await func();
42
44
  diagnostics = response.diagnostics;
43
45
  switch (response.statusCode) {
44
- case Error_1.PresentationStatus.Success: return response.result;
45
- case Error_1.PresentationStatus.BackendTimeout: break;
46
- default: throw new Error_1.PresentationError(response.statusCode, response.errorMessage);
46
+ case Error_1.PresentationStatus.Success:
47
+ return response.result;
48
+ case Error_1.PresentationStatus.BackendTimeout:
49
+ break;
50
+ default:
51
+ throw new Error_1.PresentationError(response.statusCode, response.errorMessage);
47
52
  }
48
53
  }
49
54
  finally {
@@ -78,23 +83,21 @@ class RpcRequestsHandler {
78
83
  async getNodesCount(options) {
79
84
  return this.request(this.rpcClient.getNodesCount.bind(this.rpcClient), options);
80
85
  }
81
- // eslint-disable-next-line deprecation/deprecation
82
86
  async getPagedNodes(options) {
83
87
  // eslint-disable-next-line deprecation/deprecation
84
88
  return this.request(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);
85
89
  }
86
90
  async getNodesDescriptor(options) {
87
91
  const response = await this.request(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);
88
- if (typeof response === "string")
92
+ if (typeof response === "string") {
89
93
  return JSON.parse(response);
94
+ }
90
95
  return response;
91
96
  }
92
- // eslint-disable-next-line deprecation/deprecation
93
97
  async getNodePaths(options) {
94
98
  // eslint-disable-next-line deprecation/deprecation
95
99
  return this.request(this.rpcClient.getNodePaths.bind(this.rpcClient), options);
96
100
  }
97
- // eslint-disable-next-line deprecation/deprecation
98
101
  async getFilteredNodePaths(options) {
99
102
  // eslint-disable-next-line deprecation/deprecation
100
103
  return this.request(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);
@@ -114,7 +117,6 @@ class RpcRequestsHandler {
114
117
  async getPagedContentSet(options) {
115
118
  return this.request(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);
116
119
  }
117
- // eslint-disable-next-line deprecation/deprecation
118
120
  async getPagedDistinctValues(options) {
119
121
  // eslint-disable-next-line deprecation/deprecation
120
122
  return this.request(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);
@@ -142,7 +144,7 @@ class RpcRequestsHandler {
142
144
  }
143
145
  exports.RpcRequestsHandler = RpcRequestsHandler;
144
146
  function isOptionsWithRuleset(options) {
145
- return (typeof options.rulesetOrId === "object");
147
+ return typeof options.rulesetOrId === "object";
146
148
  }
147
149
  const RULESET_SUPPORTED_PROPERTIES_OBJ = {
148
150
  id: true,
@@ -156,10 +158,12 @@ function cleanupRuleset(ruleset) {
156
158
  const cleanedUpRuleset = { ...ruleset };
157
159
  for (const propertyKey of Object.keys(cleanedUpRuleset)) {
158
160
  if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {
159
- if (propertyKey === "$schema")
161
+ if (propertyKey === "$schema") {
160
162
  delete cleanedUpRuleset[propertyKey];
161
- else
163
+ }
164
+ else {
162
165
  core_bentley_1.Logger.logWarning(CommonLoggerCategory_1.PresentationCommonLoggerCategory.Package, `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`);
166
+ }
163
167
  }
164
168
  }
165
169
  return cleanedUpRuleset;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4E;AAC5E,oDAAgE;AAChE,iEAA0E;AAO1E,mCAAgE;AAYhE,yEAEoC;AAMpC;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAmB7D;;;;;;GAMG;AACH,MAAa,kBAAkB;IAO7B,YAAmB,KAA+B;QAChD,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,QAAQ,IAAI,mBAAI,CAAC,WAAW,EAAE,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,uBAAuB,CAAC;IAC3D,CAAC;IAED,gEAAgE;IAChE,IAAY,SAAS,KAA+B,OAAO,wBAAU,CAAC,qBAAqB,CAAC,mDAAwB,CAAC,CAAC,CAAC,CAAC;IAEhH,KAAK,CAAC,kBAAkB,CAAU,IAA4C,EAAE,kBAA6C;QACnI,MAAM,KAAK,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,yBAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,WAA0C,CAAC;QAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE;YACrC,IAAI;gBACF,MAAM,QAAQ,GAAG,MAAM,IAA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e,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,SAAS,cAAc,CAAC,OAAgB;IACtC,MAAM,gBAAgB,GAAY,EAAE,GAAG,OAAO,EAAE,CAAC;IAEjD,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;QACvD,IAAI,CAAC,gCAAgC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YACjE,IAAI,WAAW,KAAK,SAAS;gBAC3B,OAAQ,gBAAwB,CAAC,WAAW,CAAC,CAAC;;gBAE9C,qBAAM,CAAC,UAAU,CAAC,uDAAgC,CAAC,OAAO,EAAE,qDAAqD,WAAW,2DAA2D,CAAC,CAAC;SAC5L;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,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 RPC\n */\n\nimport { BeDuration, BeTimePoint, Guid, Logger } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcManager } from \"@itwin/core-common\";\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory\";\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor\";\nimport { ItemJSON } from \"./content/Item\";\nimport { DisplayValueGroupJSON } from \"./content/Value\";\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics\";\nimport { InstanceKey } from \"./EC\";\nimport { ElementProperties } from \"./ElementProperties\";\nimport { PresentationError, PresentationStatus } from \"./Error\";\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { NodeJSON } from \"./hierarchy/Node\";\nimport { NodePathElementJSON } from \"./hierarchy/NodePathElement\";\nimport { KeySetJSON } from \"./KeySet\";\nimport { LabelDefinition } from \"./LabelDefinition\";\nimport {\n ComputeSelectionRequestOptions, ContentDescriptorRequestOptions, ContentInstanceKeysRequestOptions, ContentRequestOptions,\n ContentSourcesRequestOptions, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions,\n Paged, RequestOptions, RequestOptionsWithRuleset, SelectionScopeRequestOptions, SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions\";\nimport {\n ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse,\n} from \"./PresentationRpcInterface\";\nimport { Ruleset } from \"./rules/Ruleset\";\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\nimport { SelectionScope } from \"./selection/SelectionScope\";\nimport { PagedResponse } from \"./Utils\";\n\n/**\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n */\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\n\n/**\n * Configuration parameters for [[RpcRequestsHandler]].\n *\n * @internal\n */\nexport interface RpcRequestsHandlerProps {\n /**\n * Optional ID used to identify client that requests data. If not specified,\n * the handler creates a unique GUID as a client id.\n * @internal\n */\n clientId?: string;\n\n /** @internal */\n timeout?: number;\n}\n\n/**\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\n * adds handling for cases when backend needs to be synced with client\n * state.\n *\n * @internal\n */\nexport class RpcRequestsHandler {\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\n public readonly timeout: number;\n\n /** ID that identifies this handler as a client */\n public readonly clientId: string;\n\n public constructor(props?: RpcRequestsHandlerProps) {\n this.clientId = props?.clientId ?? Guid.createValue();\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get rpcClient(): PresentationRpcInterface { return RpcManager.getClientForInterface(PresentationRpcInterface); }\n\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\n const start = BeTimePoint.now();\n const timeout = BeDuration.fromMilliseconds(this.timeout);\n let diagnostics: ClientDiagnostics | undefined;\n while (start.plus(timeout).isInFuture) {\n try {\n const response = await func();\n diagnostics = response.diagnostics;\n switch (response.statusCode) {\n case PresentationStatus.Success: return response.result!;\n case PresentationStatus.BackendTimeout: break;\n default: throw new PresentationError(response.statusCode, response.errorMessage);\n }\n } finally {\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\n }\n }\n throw new PresentationError(PresentationStatus.BackendTimeout);\n }\n\n /**\n * Send the request to backend.\n *\n * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get\n * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]\n * is thrown with the details from the response.\n */\n public async request<TResult, TOptions extends (RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute), TArg = any>(\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\n options: TOptions,\n ...additionalOptions: TArg[]\n ): Promise<TResult> {\n const { imodel, diagnostics, ...optionsNoIModel } = options;\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\n if (isOptionsWithRuleset(optionsNoIModel)) {\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\n }\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\n ...optionsNoIModel,\n clientId: this.clientId,\n };\n if (diagnostics) {\n rpcOptions.diagnostics = diagnosticsOptions;\n }\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\n return this.requestWithTimeout(doRequest, diagnosticsHandler);\n }\n\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\n return this.request<number, typeof options>(\n this.rpcClient.getNodesCount.bind(this.rpcClient), options);\n }\n // eslint-disable-next-line deprecation/deprecation\n public async getPagedNodes(options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute): Promise<PagedResponse<NodeJSON>> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<PagedResponse<NodeJSON>, typeof options>(\n this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\n }\n\n public async getNodesDescriptor(options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<DescriptorJSON | undefined> {\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(\n this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\n if (typeof response === \"string\")\n return JSON.parse(response);\n return response;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n public async getNodePaths(options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<NodePathElementJSON[]> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<NodePathElementJSON[], typeof options>(\n this.rpcClient.getNodePaths.bind(this.rpcClient), options);\n }\n // eslint-disable-next-line deprecation/deprecation\n public async getFilteredNodePaths(options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<NodePathElementJSON[]> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<NodePathElementJSON[], typeof options>(\n this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\n }\n\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\n return this.request<ContentSourcesRpcResult, typeof options>(\n this.rpcClient.getContentSources.bind(this.rpcClient), options);\n }\n public async getContentDescriptor(options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<DescriptorJSON | undefined> {\n return this.request<DescriptorJSON | undefined, typeof options>(\n this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\n }\n public async getContentSetSize(options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\n return this.request<number, typeof options>(\n this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\n }\n public async getPagedContent(options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>) {\n return this.request<{ descriptor: DescriptorJSON, contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\n this.rpcClient.getPagedContent.bind(this.rpcClient), options);\n }\n public async getPagedContentSet(options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>) {\n return this.request<PagedResponse<ItemJSON>, typeof options>(\n this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n public async getPagedDistinctValues(options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<PagedResponse<DisplayValueGroupJSON>> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<PagedResponse<DisplayValueGroupJSON>, typeof options>(\n this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\n }\n\n public async getElementProperties(options: SingleElementPropertiesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ElementProperties | undefined> {\n return this.request<ElementProperties | undefined, typeof options>(\n this.rpcClient.getElementProperties.bind(this.rpcClient), options);\n }\n\n public async getContentInstanceKeys(options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<{ total: number, items: KeySetJSON }> {\n return this.request<{ total: number, items: KeySetJSON }, typeof options>(\n this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\n }\n\n public async getDisplayLabelDefinition(options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute): Promise<LabelDefinition> {\n return this.request<LabelDefinition, typeof options>(\n this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\n }\n public async getPagedDisplayLabelDefinitions(options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute): Promise<PagedResponse<LabelDefinition>> {\n return this.request<PagedResponse<LabelDefinition>, typeof options>(\n this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\n }\n\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\n return this.request<SelectionScope[], typeof options>(\n this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\n }\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\n return this.request<KeySetJSON, typeof options>(\n // eslint-disable-next-line deprecation/deprecation\n this.rpcClient.computeSelection.bind(this.rpcClient), options);\n }\n}\n\nfunction isOptionsWithRuleset(options: Object): options is { rulesetOrId: Ruleset } {\n return (typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\");\n}\n\ntype RulesetWithRequiredProperties = {\n [key in keyof Ruleset]-?: true;\n};\n\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\n id: true,\n rules: true,\n version: true,\n requiredSchemas: true,\n supplementationInfo: true,\n vars: true,\n};\n\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\n const cleanedUpRuleset: Ruleset = { ...ruleset };\n\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\n if (propertyKey === \"$schema\")\n delete (cleanedUpRuleset as any)[propertyKey];\n else\n Logger.logWarning(PresentationCommonLoggerCategory.Package, `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`);\n }\n }\n\n return cleanedUpRuleset;\n}\n"]}
1
+ {"version":3,"file":"RpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA4E;AAC5E,oDAAgE;AAChE,iEAA0E;AAO1E,mCAAgE;AAyBhE,yEAAuJ;AAMvJ;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAmB7D;;;;;;GAMG;AACH,MAAa,kBAAkB;IAO7B,YAAmB,KAA+B;QAChD,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,QAAQ,IAAI,mBAAI,CAAC,WAAW,EAAE,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,uBAAuB,CAAC;IAC3D,CAAC;IAED,gEAAgE;IAChE,IAAY,SAAS;QACnB,OAAO,wBAAU,CAAC,qBAAqB,CAAC,mDAAwB,CAAC,CAAC;IACpE,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAU,IAA4C,EAAE,kBAA6C;QACnI,MAAM,KAAK,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,yBAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,WAA0C,CAAC;QAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE;YACrC,IAAI;gBACF,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC;gBAC9B,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;gBACnC,QAAQ,QAAQ,CAAC,UAAU,EAAE;oBAC3B,KAA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CAAC;IAEjD,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;QACvD,IAAI,CAAC,gCAAgC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YACjE,IAAI,WAAW,KAAK,SAAS,EAAE;gBAC7B,OAAQ,gBAAwB,CAAC,WAAW,CAAC,CAAC;aAC/C;iBAAM;gBACL,qBAAM,CAAC,UAAU,CACf,uDAAgC,CAAC,OAAO,EACxC,qDAAqD,WAAW,2DAA2D,CAC5H,CAAC;aACH;SACF;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,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 RPC\n */\n\nimport { BeDuration, BeTimePoint, Guid, Logger } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcManager } from \"@itwin/core-common\";\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory\";\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor\";\nimport { ItemJSON } from \"./content/Item\";\nimport { DisplayValueGroupJSON } from \"./content/Value\";\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics\";\nimport { InstanceKey } from \"./EC\";\nimport { ElementProperties } from \"./ElementProperties\";\nimport { PresentationError, PresentationStatus } from \"./Error\";\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { NodeJSON } from \"./hierarchy/Node\";\nimport { NodePathElementJSON } from \"./hierarchy/NodePathElement\";\nimport { KeySetJSON } from \"./KeySet\";\nimport { LabelDefinition } from \"./LabelDefinition\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n RequestOptions,\n RequestOptionsWithRuleset,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions\";\nimport { ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse } from \"./PresentationRpcInterface\";\nimport { Ruleset } from \"./rules/Ruleset\";\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\nimport { SelectionScope } from \"./selection/SelectionScope\";\nimport { PagedResponse } from \"./Utils\";\n\n/**\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n */\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\n\n/**\n * Configuration parameters for [[RpcRequestsHandler]].\n *\n * @internal\n */\nexport interface RpcRequestsHandlerProps {\n /**\n * Optional ID used to identify client that requests data. If not specified,\n * the handler creates a unique GUID as a client id.\n * @internal\n */\n clientId?: string;\n\n /** @internal */\n timeout?: number;\n}\n\n/**\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\n * adds handling for cases when backend needs to be synced with client\n * state.\n *\n * @internal\n */\nexport class RpcRequestsHandler {\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\n public readonly timeout: number;\n\n /** ID that identifies this handler as a client */\n public readonly clientId: string;\n\n public constructor(props?: RpcRequestsHandlerProps) {\n this.clientId = props?.clientId ?? Guid.createValue();\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get rpcClient(): PresentationRpcInterface {\n return RpcManager.getClientForInterface(PresentationRpcInterface);\n }\n\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\n const start = BeTimePoint.now();\n const timeout = BeDuration.fromMilliseconds(this.timeout);\n let diagnostics: ClientDiagnostics | undefined;\n while (start.plus(timeout).isInFuture) {\n try {\n const response = await func();\n diagnostics = response.diagnostics;\n switch (response.statusCode) {\n case PresentationStatus.Success:\n return response.result!;\n case PresentationStatus.BackendTimeout:\n break;\n default:\n throw new PresentationError(response.statusCode, response.errorMessage);\n }\n } finally {\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\n }\n }\n throw new PresentationError(PresentationStatus.BackendTimeout);\n }\n\n /**\n * Send the request to backend.\n *\n * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get\n * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]\n * is thrown with the details from the response.\n */\n public async request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\n options: TOptions,\n ...additionalOptions: TArg[]\n ): Promise<TResult> {\n const { imodel, diagnostics, ...optionsNoIModel } = options;\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\n if (isOptionsWithRuleset(optionsNoIModel)) {\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\n }\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\n ...optionsNoIModel,\n clientId: this.clientId,\n };\n if (diagnostics) {\n rpcOptions.diagnostics = diagnosticsOptions;\n }\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\n return this.requestWithTimeout(doRequest, diagnosticsHandler);\n }\n\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\n return this.request<number, typeof options>(this.rpcClient.getNodesCount.bind(this.rpcClient), options);\n }\n\n public async getPagedNodes(\n options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute,\n // eslint-disable-next-line deprecation/deprecation\n ): Promise<PagedResponse<NodeJSON>> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<PagedResponse<NodeJSON>, typeof options>(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\n }\n\n public async getNodesDescriptor(\n options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\n if (typeof response === \"string\") {\n return JSON.parse(response);\n }\n return response;\n }\n\n public async getNodePaths(\n options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n // eslint-disable-next-line deprecation/deprecation\n ): Promise<NodePathElementJSON[]> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<NodePathElementJSON[], typeof options>(this.rpcClient.getNodePaths.bind(this.rpcClient), options);\n }\n\n public async getFilteredNodePaths(\n options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n // eslint-disable-next-line deprecation/deprecation\n ): Promise<NodePathElementJSON[]> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<NodePathElementJSON[], typeof options>(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\n }\n\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\n return this.request<ContentSourcesRpcResult, typeof options>(this.rpcClient.getContentSources.bind(this.rpcClient), options);\n }\n public async getContentDescriptor(\n options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n return this.request<DescriptorJSON | undefined, typeof options>(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\n }\n public async getContentSetSize(\n options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<number> {\n return this.request<number, typeof options>(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\n }\n public async getPagedContent(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n return this.request<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\n this.rpcClient.getPagedContent.bind(this.rpcClient),\n options,\n );\n }\n public async getPagedContentSet(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n return this.request<PagedResponse<ItemJSON>, typeof options>(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\n }\n\n public async getPagedDistinctValues(\n options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n // eslint-disable-next-line deprecation/deprecation\n ): Promise<PagedResponse<DisplayValueGroupJSON>> {\n // eslint-disable-next-line deprecation/deprecation\n return this.request<PagedResponse<DisplayValueGroupJSON>, typeof options>(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\n }\n\n public async getElementProperties(\n options: SingleElementPropertiesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute,\n ): Promise<ElementProperties | undefined> {\n return this.request<ElementProperties | undefined, typeof options>(this.rpcClient.getElementProperties.bind(this.rpcClient), options);\n }\n\n public async getContentInstanceKeys(\n options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<{ total: number; items: KeySetJSON }> {\n return this.request<{ total: number; items: KeySetJSON }, typeof options>(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\n }\n\n public async getDisplayLabelDefinition(\n options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n return this.request<LabelDefinition, typeof options>(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\n }\n public async getPagedDisplayLabelDefinitions(\n options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<LabelDefinition>> {\n return this.request<PagedResponse<LabelDefinition>, typeof options>(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\n }\n\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\n return this.request<SelectionScope[], typeof options>(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\n }\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\n return this.request<KeySetJSON, typeof options>(\n // eslint-disable-next-line deprecation/deprecation\n this.rpcClient.computeSelection.bind(this.rpcClient),\n options,\n );\n }\n}\n\nfunction isOptionsWithRuleset(options: Object): options is { rulesetOrId: Ruleset } {\n return typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\";\n}\n\ntype RulesetWithRequiredProperties = {\n [key in keyof Ruleset]-?: true;\n};\n\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\n id: true,\n rules: true,\n version: true,\n requiredSchemas: true,\n supplementationInfo: true,\n vars: true,\n};\n\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\n const cleanedUpRuleset: Ruleset = { ...ruleset };\n\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\n if (propertyKey === \"$schema\") {\n delete (cleanedUpRuleset as any)[propertyKey];\n } else {\n Logger.logWarning(\n PresentationCommonLoggerCategory.Package,\n `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`,\n );\n }\n }\n }\n\n return cleanedUpRuleset;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetVariables.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,oBAAoB;IACpB,GAAG,QAAQ;IAEX,8BAA8B;IAC9B,QAAQ,UAAU;IAElB,oBAAoB;IACpB,IAAI,SAAS;IAEb,mBAAmB;IACnB,MAAM,WAAW;IAEjB,uBAAuB;IACvB,IAAI,SAAS;IAEb,iCAAiC;IACjC,SAAS,WAAW;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,UAAU,EAAE,CAAC;AAE7F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC;AAErH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,aAAa,CAAC;CACtB;AACD;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;CAChB;AACD;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;IAChC,KAAK,E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AAE7B,cAAc;AAEd,yBAAiB,eAAe,CAAC;IAC/B;;;OAGG;IACH,SAAgB,MAAM,CAAC,QAAQ,EAAE,eAAe,GAAG,mBAAmB,CAKrE;IAED,iDAAiD;IACjD,SAAgB,QAAQ,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CAQnE;CACF"}
@@ -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
  */
@@ -37,16 +37,18 @@ var RulesetVariable;
37
37
  * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].
38
38
  */
39
39
  function toJSON(variable) {
40
- if (variable.type === VariableValueTypes.Id64Array)
40
+ if (variable.type === VariableValueTypes.Id64Array) {
41
41
  return { ...variable, value: core_bentley_1.CompressedId64Set.compressArray(variable.value) };
42
+ }
42
43
  return variable;
43
44
  }
44
45
  RulesetVariable.toJSON = toJSON;
45
46
  /** Deserialize [[RulesetVariable]] from JSON. */
46
47
  function fromJSON(json) {
47
48
  if (json.type === VariableValueTypes.Id64Array) {
48
- if (typeof json.value === "string")
49
+ if (typeof json.value === "string") {
49
50
  return { ...json, value: core_bentley_1.CompressedId64Set.decompressArray(json.value) };
51
+ }
50
52
  return json; // for some reason TS doesn't understand that `json.value` is always an array here
51
53
  }
52
54
  return json;
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetVariables.js","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AAEpE;;;GAGG;AACH,IAAY,kBAkBX;AAlBD,WAAY,kBAAkB;IAC5B,oBAAoB;IACpB,iCAAW,CAAA;IAEX,8BAA8B;IAC9B,wCAAkB,CAAA;IAElB,oBAAoB;IACpB,mCAAa,CAAA;IAEb,mBAAmB;IACnB,uCAAiB,CAAA;IAEjB,uBAAuB;IACvB,mCAAa,CAAA;IAEb,iCAAiC;IACjC,0CAAoB,CAAA;AACtB,CAAC,EAlBW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAkB7B;AAkJD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,eAAe,CAoB/B;AApBD,WAAiB,eAAe;IAC9B;;;OAGG;IACH,SAAgB,MAAM,CAAC,QAAyB;QAC9C,IAAI,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS;YAChD,OAAO,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,gCAAiB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAJe,sBAAM,SAIrB,CAAA;IAED,iDAAiD;IACjD,SAAgB,QAAQ,CAAC,IAAyB;QAChD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE;YAC9C,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;gBAChC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,gCAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3E,OAAO,IAAW,CAAC,CAAC,kFAAkF;SACvG;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAPe,wBAAQ,WAOvB,CAAA;AACH,CAAC,EApBgB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAoB/B","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 { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\n\n/**\n * Possible variable value types\n * @public\n */\nexport enum VariableValueTypes {\n /** Integer value */\n Int = \"int\",\n\n /** Array of integer values */\n IntArray = \"int[]\",\n\n /** Boolean value */\n Bool = \"bool\",\n\n /** String value */\n String = \"string\",\n\n /** Id64String value */\n Id64 = \"id64\",\n\n /** Array of Id64String values */\n Id64Array = \"id64[]\",\n}\n\n/**\n * Union of all supported variable value types\n * @public\n */\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\n\n/**\n * JSON representation of [[VariableValue]]\n * @public\n */\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\n\n/**\n * Base data structure for representing ruleset variables.\n * @public\n */\nexport interface RulesetVariableBase {\n id: string;\n type: VariableValueTypes;\n value: VariableValue;\n}\n/**\n * Data structure for representing boolean ruleset variables.\n * @public\n */\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * Data structure for representing string ruleset variables.\n * @public\n */\nexport interface StringRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * Data structure for representing int ruleset variables.\n * @public\n */\nexport interface IntRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * Data structure for representing int array ruleset variables.\n * @public\n */\nexport interface IntsRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * Data structure for representing ID ruleset variables.\n * @public\n */\nexport interface Id64RulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * Data structure for representing ID array ruleset variables.\n * @public\n */\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64Array;\n value: Id64String[];\n}\n/**\n * Data structure for representing ruleset variables.\n * @public\n */\nexport type RulesetVariable = BooleanRulesetVariable | StringRulesetVariable | IntRulesetVariable | IntsRulesetVariable | Id64RulesetVariable | Id64sRulesetVariable;\n\n/**\n * JSON representation of [[RulesetVariableBase]].\n * @public\n */\nexport interface RulesetVariableBaseJSON {\n id: string;\n type: VariableValueTypes;\n value: VariableValueJSON;\n}\n/**\n * JSON representation of [[BooleanRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[BooleanRulesetVariable]]\n */\nexport interface BooleanRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * JSON representation of [[StringRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[StringRulesetVariable]]\n */\nexport interface StringRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * JSON representation of [[IntRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[IntRulesetVariable]]\n */\nexport interface IntRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * JSON representation of [[IntsRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[IntsRulesetVariable]]\n */\nexport interface IntsRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * JSON representation of [[Id64RulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[Id64RulesetVariable]]\n */\nexport interface Id64RulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * JSON representation of [[Id64sRulesetVariable]].\n * @public\n */\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64Array;\n value: Id64String[] | CompressedId64Set;\n}\n/**\n * JSON representation of [[RulesetVariable]].\n * @public\n */\n// eslint-disable-next-line deprecation/deprecation\nexport type RulesetVariableJSON = BooleanRulesetVariableJSON | StringRulesetVariableJSON | IntRulesetVariableJSON | IntsRulesetVariableJSON | Id64RulesetVariableJSON | Id64sRulesetVariableJSON;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RulesetVariable {\n /**\n * Serialize given RulesetVariable to JSON.\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\n */\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\n if (variable.type === VariableValueTypes.Id64Array)\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\n return variable;\n }\n\n /** Deserialize [[RulesetVariable]] from JSON. */\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\n if (json.type === VariableValueTypes.Id64Array) {\n if (typeof json.value === \"string\")\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\n }\n return json;\n }\n}\n"]}
1
+ {"version":3,"file":"RulesetVariables.js","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAoE;AAEpE;;;GAGG;AACH,IAAY,kBAkBX;AAlBD,WAAY,kBAAkB;IAC5B,oBAAoB;IACpB,iCAAW,CAAA;IAEX,8BAA8B;IAC9B,wCAAkB,CAAA;IAElB,oBAAoB;IACpB,mCAAa,CAAA;IAEb,mBAAmB;IACnB,uCAAiB,CAAA;IAEjB,uBAAuB;IACvB,mCAAa,CAAA;IAEb,iCAAiC;IACjC,0CAAoB,CAAA;AACtB,CAAC,EAlBW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAkB7B;AA8JD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,eAAe,CAsB/B;AAtBD,WAAiB,eAAe;IAC9B;;;OAGG;IACH,SAAgB,MAAM,CAAC,QAAyB;QAC9C,IAAI,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE;YAClD,OAAO,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,gCAAiB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;SAChF;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IALe,sBAAM,SAKrB,CAAA;IAED,iDAAiD;IACjD,SAAgB,QAAQ,CAAC,IAAyB;QAChD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE;YAC9C,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;gBAClC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,gCAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;aAC1E;YACD,OAAO,IAAW,CAAC,CAAC,kFAAkF;SACvG;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IARe,wBAAQ,WAQvB,CAAA;AACH,CAAC,EAtBgB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAsB/B","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 { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\n\n/**\n * Possible variable value types\n * @public\n */\nexport enum VariableValueTypes {\n /** Integer value */\n Int = \"int\",\n\n /** Array of integer values */\n IntArray = \"int[]\",\n\n /** Boolean value */\n Bool = \"bool\",\n\n /** String value */\n String = \"string\",\n\n /** Id64String value */\n Id64 = \"id64\",\n\n /** Array of Id64String values */\n Id64Array = \"id64[]\",\n}\n\n/**\n * Union of all supported variable value types\n * @public\n */\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\n\n/**\n * JSON representation of [[VariableValue]]\n * @public\n */\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\n\n/**\n * Base data structure for representing ruleset variables.\n * @public\n */\nexport interface RulesetVariableBase {\n id: string;\n type: VariableValueTypes;\n value: VariableValue;\n}\n/**\n * Data structure for representing boolean ruleset variables.\n * @public\n */\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * Data structure for representing string ruleset variables.\n * @public\n */\nexport interface StringRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * Data structure for representing int ruleset variables.\n * @public\n */\nexport interface IntRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * Data structure for representing int array ruleset variables.\n * @public\n */\nexport interface IntsRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * Data structure for representing ID ruleset variables.\n * @public\n */\nexport interface Id64RulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * Data structure for representing ID array ruleset variables.\n * @public\n */\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64Array;\n value: Id64String[];\n}\n/**\n * Data structure for representing ruleset variables.\n * @public\n */\nexport type RulesetVariable =\n | BooleanRulesetVariable\n | StringRulesetVariable\n | IntRulesetVariable\n | IntsRulesetVariable\n | Id64RulesetVariable\n | Id64sRulesetVariable;\n\n/**\n * JSON representation of [[RulesetVariableBase]].\n * @public\n */\nexport interface RulesetVariableBaseJSON {\n id: string;\n type: VariableValueTypes;\n value: VariableValueJSON;\n}\n/**\n * JSON representation of [[BooleanRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[BooleanRulesetVariable]]\n */\nexport interface BooleanRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * JSON representation of [[StringRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[StringRulesetVariable]]\n */\nexport interface StringRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * JSON representation of [[IntRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[IntRulesetVariable]]\n */\nexport interface IntRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * JSON representation of [[IntsRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[IntsRulesetVariable]]\n */\nexport interface IntsRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * JSON representation of [[Id64RulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[Id64RulesetVariable]]\n */\nexport interface Id64RulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * JSON representation of [[Id64sRulesetVariable]].\n * @public\n */\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64Array;\n value: Id64String[] | CompressedId64Set;\n}\n/**\n * JSON representation of [[RulesetVariable]].\n * @public\n */\n\nexport type RulesetVariableJSON =\n | BooleanRulesetVariableJSON // eslint-disable-line deprecation/deprecation\n | StringRulesetVariableJSON // eslint-disable-line deprecation/deprecation\n | IntRulesetVariableJSON // eslint-disable-line deprecation/deprecation\n | IntsRulesetVariableJSON // eslint-disable-line deprecation/deprecation\n | Id64RulesetVariableJSON // eslint-disable-line deprecation/deprecation\n | Id64sRulesetVariableJSON;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RulesetVariable {\n /**\n * Serialize given RulesetVariable to JSON.\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\n */\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\n if (variable.type === VariableValueTypes.Id64Array) {\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\n }\n return variable;\n }\n\n /** Deserialize [[RulesetVariable]] from JSON. */\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\n if (json.type === VariableValueTypes.Id64Array) {\n if (typeof json.value === \"string\") {\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\n }\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\n }\n return json;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetsFactory.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RulesetsFactory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,KAAK,EAAmB,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAa,WAAW,EAAoB,MAAM,MAAM,CAAC;AAMhE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,iCAAiC;IA+BzC;;;;;;;OAOG;IACU,6BAA6B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAK9K;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAOjI;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;AAGjG,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"RulesetsFactory.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RulesetsFactory.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