@itwin/presentation-common 5.0.0-dev.11 → 5.0.0-dev.110

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 (482) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/Ruleset.schema.json +3 -258
  3. package/lib/cjs/package.json +1 -0
  4. package/lib/cjs/presentation-common/AsyncTasks.d.ts +4 -4
  5. package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
  6. package/lib/cjs/presentation-common/AsyncTasks.js +5 -6
  7. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  8. package/lib/cjs/presentation-common/EC.d.ts +37 -81
  9. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  10. package/lib/cjs/presentation-common/EC.js +1 -97
  11. package/lib/cjs/presentation-common/EC.js.map +1 -1
  12. package/lib/cjs/presentation-common/ElementProperties.d.ts +2 -2
  13. package/lib/cjs/presentation-common/ElementProperties.d.ts.map +1 -1
  14. package/lib/cjs/presentation-common/ElementProperties.js +22 -15
  15. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  16. package/lib/cjs/presentation-common/Error.d.ts +2 -0
  17. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  18. package/lib/cjs/presentation-common/Error.js +2 -0
  19. package/lib/cjs/presentation-common/Error.js.map +1 -1
  20. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts +1 -1
  21. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  22. package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
  23. package/lib/cjs/presentation-common/KeySet.d.ts +3 -3
  24. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  25. package/lib/cjs/presentation-common/KeySet.js +20 -22
  26. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  27. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +15 -11
  28. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  29. package/lib/cjs/presentation-common/LabelDefinition.d.ts +2 -50
  30. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  31. package/lib/cjs/presentation-common/LabelDefinition.js +4 -47
  32. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  33. package/lib/cjs/presentation-common/LocalizationHelper.d.ts +10 -10
  34. package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
  35. package/lib/cjs/presentation-common/LocalizationHelper.js +13 -12
  36. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  37. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +12 -7
  38. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  39. package/lib/cjs/presentation-common/PresentationIpcInterface.js +9 -1
  40. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  41. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +40 -25
  42. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  43. package/lib/cjs/presentation-common/PresentationManagerOptions.js +0 -5
  44. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  45. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +22 -29
  46. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  47. package/lib/cjs/presentation-common/PresentationRpcInterface.js +41 -36
  48. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  49. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +6 -5
  50. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  51. package/lib/cjs/presentation-common/RegisteredRuleset.js +9 -1
  52. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  53. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +21 -24
  54. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  55. package/lib/cjs/presentation-common/RpcRequestsHandler.js +42 -35
  56. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  57. package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
  58. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  59. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  60. package/lib/cjs/presentation-common/RulesetsFactory.d.ts +4 -4
  61. package/lib/cjs/presentation-common/RulesetsFactory.d.ts.map +1 -1
  62. package/lib/cjs/presentation-common/RulesetsFactory.js +15 -15
  63. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  64. package/lib/cjs/presentation-common/Update.d.ts +2 -79
  65. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  66. package/lib/cjs/presentation-common/Update.js +1 -104
  67. package/lib/cjs/presentation-common/Update.js.map +1 -1
  68. package/lib/cjs/presentation-common/Utils.d.ts +22 -1
  69. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  70. package/lib/cjs/presentation-common/Utils.js +59 -3
  71. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  72. package/lib/cjs/presentation-common/content/Category.d.ts +1 -1
  73. package/lib/cjs/presentation-common/content/Category.d.ts.map +1 -1
  74. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  75. package/lib/cjs/presentation-common/content/Content.d.ts +2 -9
  76. package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
  77. package/lib/cjs/presentation-common/content/Content.js +9 -14
  78. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  79. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +9 -9
  80. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  81. package/lib/cjs/presentation-common/content/ContentTraverser.js +138 -50
  82. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  83. package/lib/cjs/presentation-common/content/Descriptor.d.ts +7 -52
  84. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  85. package/lib/cjs/presentation-common/content/Descriptor.js +82 -53
  86. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  87. package/lib/cjs/presentation-common/content/Fields.d.ts +157 -33
  88. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  89. package/lib/cjs/presentation-common/content/Fields.js +275 -151
  90. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  91. package/lib/cjs/presentation-common/content/Item.d.ts +28 -33
  92. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  93. package/lib/cjs/presentation-common/content/Item.js +53 -68
  94. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  95. package/lib/cjs/presentation-common/content/Property.d.ts +2 -14
  96. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  97. package/lib/cjs/presentation-common/content/Property.js +2 -20
  98. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  99. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +6 -6
  100. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
  101. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +12 -9
  102. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  103. package/lib/cjs/presentation-common/content/Value.d.ts +8 -110
  104. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  105. package/lib/cjs/presentation-common/content/Value.js +1 -215
  106. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  107. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  108. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  109. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
  110. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  111. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +1 -84
  112. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  113. package/lib/cjs/presentation-common/hierarchy/Key.js +8 -26
  114. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  115. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -107
  116. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  117. package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
  118. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  119. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  120. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  121. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
  122. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  123. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts +2 -2
  124. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts.map +1 -1
  125. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  126. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts +2 -2
  127. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  128. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  129. package/lib/cjs/presentation-common/rules/Rule.d.ts +6 -20
  130. package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
  131. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  132. package/lib/cjs/presentation-common/rules/Ruleset.d.ts +3 -3
  133. package/lib/cjs/presentation-common/rules/Ruleset.d.ts.map +1 -1
  134. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  135. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +2 -2
  136. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts.map +1 -1
  137. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  138. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +2 -2
  139. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts.map +1 -1
  140. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  141. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts +2 -2
  142. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts.map +1 -1
  143. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  144. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +5 -12
  145. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  146. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  147. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +2 -2
  148. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts.map +1 -1
  149. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  150. package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts +3 -3
  151. package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts.map +1 -1
  152. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  153. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +1 -1
  154. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts.map +1 -1
  155. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  156. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +3 -3
  157. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts.map +1 -1
  158. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  159. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +6 -6
  160. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  161. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  162. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +1 -1
  163. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.map +1 -1
  164. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  165. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +2 -2
  166. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts.map +1 -1
  167. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  168. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +6 -10
  169. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  170. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  171. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts +1 -1
  172. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts.map +1 -1
  173. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  174. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +4 -30
  175. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  176. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
  177. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  178. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts +3 -3
  179. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  180. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  181. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts +2 -2
  182. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  183. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  184. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
  185. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
  186. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  187. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +6 -6
  188. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  189. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  190. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +3 -1
  191. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  192. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  193. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +2 -2
  194. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
  195. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  196. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -11
  197. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  198. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  199. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +6 -6
  200. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
  201. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  202. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +1 -1
  203. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
  204. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  205. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -2
  206. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
  207. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  208. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -1
  209. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
  210. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  211. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -2
  212. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
  213. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  214. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +3 -0
  215. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  216. package/lib/cjs/presentation-common/selection/SelectionScope.js +1 -0
  217. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  218. package/lib/cjs/presentation-common-internal.d.ts +10 -0
  219. package/lib/cjs/presentation-common-internal.d.ts.map +1 -0
  220. package/lib/cjs/presentation-common-internal.js +32 -0
  221. package/lib/cjs/presentation-common-internal.js.map +1 -0
  222. package/lib/cjs/presentation-common.d.ts +68 -77
  223. package/lib/cjs/presentation-common.d.ts.map +1 -1
  224. package/lib/cjs/presentation-common.js +110 -89
  225. package/lib/cjs/presentation-common.js.map +1 -1
  226. package/lib/esm/presentation-common/AsyncTasks.d.ts +4 -4
  227. package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
  228. package/lib/esm/presentation-common/AsyncTasks.js +5 -6
  229. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  230. package/lib/esm/presentation-common/EC.d.ts +37 -81
  231. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  232. package/lib/esm/presentation-common/EC.js +0 -96
  233. package/lib/esm/presentation-common/EC.js.map +1 -1
  234. package/lib/esm/presentation-common/ElementProperties.d.ts +2 -2
  235. package/lib/esm/presentation-common/ElementProperties.d.ts.map +1 -1
  236. package/lib/esm/presentation-common/ElementProperties.js +18 -11
  237. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  238. package/lib/esm/presentation-common/Error.d.ts +2 -0
  239. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  240. package/lib/esm/presentation-common/Error.js +2 -0
  241. package/lib/esm/presentation-common/Error.js.map +1 -1
  242. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts +1 -1
  243. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  244. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  245. package/lib/esm/presentation-common/KeySet.d.ts +3 -3
  246. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  247. package/lib/esm/presentation-common/KeySet.js +10 -12
  248. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  249. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +16 -12
  250. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  251. package/lib/esm/presentation-common/LabelDefinition.d.ts +2 -50
  252. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  253. package/lib/esm/presentation-common/LabelDefinition.js +3 -46
  254. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  255. package/lib/esm/presentation-common/LocalizationHelper.d.ts +10 -10
  256. package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
  257. package/lib/esm/presentation-common/LocalizationHelper.js +6 -5
  258. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  259. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +12 -7
  260. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  261. package/lib/esm/presentation-common/PresentationIpcInterface.js +8 -0
  262. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  263. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +40 -25
  264. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  265. package/lib/esm/presentation-common/PresentationManagerOptions.js +0 -4
  266. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  267. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +22 -29
  268. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  269. package/lib/esm/presentation-common/PresentationRpcInterface.js +42 -36
  270. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  271. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +6 -5
  272. package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  273. package/lib/esm/presentation-common/RegisteredRuleset.js +9 -1
  274. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  275. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +21 -24
  276. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  277. package/lib/esm/presentation-common/RpcRequestsHandler.js +42 -35
  278. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  279. package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
  280. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  281. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  282. package/lib/esm/presentation-common/RulesetsFactory.d.ts +4 -4
  283. package/lib/esm/presentation-common/RulesetsFactory.d.ts.map +1 -1
  284. package/lib/esm/presentation-common/RulesetsFactory.js +6 -6
  285. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  286. package/lib/esm/presentation-common/Update.d.ts +2 -79
  287. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  288. package/lib/esm/presentation-common/Update.js +0 -103
  289. package/lib/esm/presentation-common/Update.js.map +1 -1
  290. package/lib/esm/presentation-common/Utils.d.ts +22 -1
  291. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  292. package/lib/esm/presentation-common/Utils.js +54 -1
  293. package/lib/esm/presentation-common/Utils.js.map +1 -1
  294. package/lib/esm/presentation-common/content/Category.d.ts +1 -1
  295. package/lib/esm/presentation-common/content/Category.d.ts.map +1 -1
  296. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  297. package/lib/esm/presentation-common/content/Content.d.ts +2 -9
  298. package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
  299. package/lib/esm/presentation-common/content/Content.js +7 -12
  300. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  301. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +9 -9
  302. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  303. package/lib/esm/presentation-common/content/ContentTraverser.js +123 -35
  304. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  305. package/lib/esm/presentation-common/content/Descriptor.d.ts +7 -52
  306. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  307. package/lib/esm/presentation-common/content/Descriptor.js +71 -42
  308. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  309. package/lib/esm/presentation-common/content/Fields.d.ts +157 -33
  310. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  311. package/lib/esm/presentation-common/content/Fields.js +268 -144
  312. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  313. package/lib/esm/presentation-common/content/Item.d.ts +28 -33
  314. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  315. package/lib/esm/presentation-common/content/Item.js +53 -68
  316. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  317. package/lib/esm/presentation-common/content/Property.d.ts +2 -14
  318. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  319. package/lib/esm/presentation-common/content/Property.js +1 -19
  320. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  321. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +6 -6
  322. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
  323. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +5 -2
  324. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  325. package/lib/esm/presentation-common/content/Value.d.ts +8 -110
  326. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  327. package/lib/esm/presentation-common/content/Value.js +0 -214
  328. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  329. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  330. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  331. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
  332. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  333. package/lib/esm/presentation-common/hierarchy/Key.d.ts +1 -84
  334. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  335. package/lib/esm/presentation-common/hierarchy/Key.js +7 -25
  336. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  337. package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -107
  338. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  339. package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
  340. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  341. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  342. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  343. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
  344. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  345. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts +2 -2
  346. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts.map +1 -1
  347. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  348. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts +2 -2
  349. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  350. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  351. package/lib/esm/presentation-common/rules/Rule.d.ts +6 -20
  352. package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
  353. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  354. package/lib/esm/presentation-common/rules/Ruleset.d.ts +3 -3
  355. package/lib/esm/presentation-common/rules/Ruleset.d.ts.map +1 -1
  356. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  357. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +2 -2
  358. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts.map +1 -1
  359. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  360. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +2 -2
  361. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts.map +1 -1
  362. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  363. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts +2 -2
  364. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts.map +1 -1
  365. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  366. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +5 -12
  367. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  368. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  369. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +2 -2
  370. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts.map +1 -1
  371. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  372. package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts +3 -3
  373. package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts.map +1 -1
  374. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  375. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +1 -1
  376. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts.map +1 -1
  377. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  378. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +3 -3
  379. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts.map +1 -1
  380. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  381. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +6 -6
  382. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  383. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  384. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +1 -1
  385. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.map +1 -1
  386. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  387. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +2 -2
  388. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts.map +1 -1
  389. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  390. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +6 -10
  391. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  392. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  393. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts +1 -1
  394. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts.map +1 -1
  395. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  396. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +4 -30
  397. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  398. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
  399. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  400. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts +3 -3
  401. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  402. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  403. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts +2 -2
  404. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  405. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  406. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
  407. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
  408. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  409. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +6 -6
  410. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  411. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  412. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +3 -1
  413. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  414. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  415. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +2 -2
  416. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
  417. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  418. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -11
  419. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  420. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  421. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +6 -6
  422. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
  423. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  424. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +1 -1
  425. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
  426. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  427. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -2
  428. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
  429. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  430. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -1
  431. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
  432. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  433. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -2
  434. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
  435. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  436. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +3 -0
  437. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  438. package/lib/esm/presentation-common/selection/SelectionScope.js +1 -0
  439. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  440. package/lib/esm/presentation-common-internal.d.ts +10 -0
  441. package/lib/esm/presentation-common-internal.d.ts.map +1 -0
  442. package/lib/esm/presentation-common-internal.js +16 -0
  443. package/lib/esm/presentation-common-internal.js.map +1 -0
  444. package/lib/esm/presentation-common.d.ts +68 -77
  445. package/lib/esm/presentation-common.d.ts.map +1 -1
  446. package/lib/esm/presentation-common.js +60 -89
  447. package/lib/esm/presentation-common.js.map +1 -1
  448. package/package.json +47 -36
  449. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  450. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  451. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
  452. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  453. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  454. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  455. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
  456. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  457. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  458. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  459. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
  460. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  461. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  462. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  463. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
  464. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
  465. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  466. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  467. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
  468. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  469. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  470. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  471. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
  472. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  473. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  474. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  475. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
  476. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  477. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  478. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  479. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
  480. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
  481. /package/lib/{cjs/assets → assets}/locales/en/Presentation.json +0 -0
  482. /package/lib/{cjs/assets → assets}/locales/en-PSEUDO/Presentation.json +0 -0
@@ -2,21 +2,21 @@
2
2
  * @module RPC
3
3
  */
4
4
  import { IModelRpcProps } from "@itwin/core-common";
5
- import { DescriptorJSON, DescriptorOverrides } from "./content/Descriptor";
6
- import { ItemJSON } from "./content/Item";
7
- import { DisplayValueGroupJSON } from "./content/Value";
8
- import { ClientDiagnosticsAttribute } from "./Diagnostics";
9
- import { InstanceKey } from "./EC";
10
- import { NodeKey } from "./hierarchy/Key";
11
- import { NodeJSON } from "./hierarchy/Node";
12
- import { NodePathElementJSON } from "./hierarchy/NodePathElement";
13
- import { KeySetJSON } from "./KeySet";
14
- import { LabelDefinition } from "./LabelDefinition";
15
- import { ComputeSelectionRequestOptions, ContentDescriptorRequestOptions, ContentInstanceKeysRequestOptions, ContentRequestOptions, ContentSourcesRequestOptions, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DistinctValuesRequestOptions, FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions, Paged, RequestOptions, SelectionScopeRequestOptions } from "./PresentationManagerOptions";
16
- import { ContentSourcesRpcResult, PresentationRpcRequestOptions, PresentationRpcResponse } from "./PresentationRpcInterface";
17
- import { RulesetVariableJSON } from "./RulesetVariables";
18
- import { SelectionScope } from "./selection/SelectionScope";
19
- import { PagedResponse } from "./Utils";
5
+ import { DescriptorJSON, DescriptorOverrides } from "./content/Descriptor.js";
6
+ import { ItemJSON } from "./content/Item.js";
7
+ import { ClientDiagnosticsAttribute } from "./Diagnostics.js";
8
+ import { InstanceKey } from "./EC.js";
9
+ import { NodeKey } from "./hierarchy/Key.js";
10
+ import { Node } from "./hierarchy/Node.js";
11
+ import { KeySetJSON } from "./KeySet.js";
12
+ import { LabelDefinition } from "./LabelDefinition.js";
13
+ import { ComputeSelectionRequestOptions, ContentDescriptorRequestOptions, ContentInstanceKeysRequestOptions, ContentRequestOptions, ContentSourcesRequestOptions, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DistinctValuesRequestOptions, FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions, Paged, RequestOptions, SelectionScopeRequestOptions } from "./PresentationManagerOptions.js";
14
+ import { ContentSourcesRpcResult, PresentationRpcRequestOptions, PresentationRpcResponse } from "./PresentationRpcInterface.js";
15
+ import { RulesetVariableJSON } from "./RulesetVariables.js";
16
+ import { SelectionScope } from "./selection/SelectionScope.js";
17
+ import { PagedResponse } from "./Utils.js";
18
+ import { NodePathElement } from "./hierarchy/NodePathElement.js";
19
+ import { DisplayValueGroup } from "./content/Value.js";
20
20
  /**
21
21
  * Configuration parameters for [[RpcRequestsHandler]].
22
22
  *
@@ -48,18 +48,15 @@ export declare class RpcRequestsHandler {
48
48
  private get rpcClient();
49
49
  private requestWithTimeout;
50
50
  /**
51
- * Send the request to backend.
52
- *
53
- * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get
54
- * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]
55
- * is thrown with the details from the response.
51
+ * Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by
52
+ * then, we'll throw an error.
56
53
  */
57
54
  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
55
  getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number>;
59
- getPagedNodes(options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute): Promise<PagedResponse<NodeJSON>>;
56
+ getPagedNodes(options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute): Promise<PagedResponse<Node>>;
60
57
  getNodesDescriptor(options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<DescriptorJSON | undefined>;
61
- getNodePaths(options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<NodePathElementJSON[]>;
62
- getFilteredNodePaths(options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<NodePathElementJSON[]>;
58
+ getNodePaths(options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<NodePathElement[]>;
59
+ getFilteredNodePaths(options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<NodePathElement[]>;
63
60
  getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult>;
64
61
  getContentDescriptor(options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<DescriptorJSON | undefined>;
65
62
  getContentSetSize(options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number>;
@@ -68,7 +65,7 @@ export declare class RpcRequestsHandler {
68
65
  contentSet: PagedResponse<ItemJSON>;
69
66
  } | undefined>;
70
67
  getPagedContentSet(options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>): Promise<PagedResponse<ItemJSON>>;
71
- getPagedDistinctValues(options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<PagedResponse<DisplayValueGroupJSON>>;
68
+ getPagedDistinctValues(options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<PagedResponse<DisplayValueGroup>>;
72
69
  getContentInstanceKeys(options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<{
73
70
  total: number;
74
71
  items: KeySetJSON;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcRequestsHandler.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAc,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OA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,0BAA0B,GACvI,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAK/B,sBAAsB,CACjC,OAAO,EAAE,iCAAiC,CAAC,cAAc,EAAE,UAAU,EAAE,mBAAmB,CAAC,GAAG,0BAA0B,GACvH,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,CAAC;IAKnC,yBAAyB,CACpC,OAAO,EAAE,0BAA0B,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG,0BAA0B,GAC5F,OAAO,CAAC,eAAe,CAAC;IAId,+BAA+B,CAC1C,OAAO,EAAE,2BAA2B,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG,0BAA0B,GAC7F,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAM7B,kBAAkB,CAAC,OAAO,EAAE,4BAA4B,CAAC,cAAc,CAAC,GAAG,0BAA0B,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAGjI,gBAAgB,CAAC,OAAO,EAAE,8BAA8B,CAAC,cAAc,CAAC,GAAG,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAC;CAIzI"}
@@ -10,9 +10,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.RpcRequestsHandler = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_common_1 = require("@itwin/core-common");
13
- const CommonLoggerCategory_1 = require("./CommonLoggerCategory");
14
- const Error_1 = require("./Error");
15
- const PresentationRpcInterface_1 = require("./PresentationRpcInterface");
13
+ const CommonLoggerCategory_js_1 = require("./CommonLoggerCategory.js");
14
+ const Error_js_1 = require("./Error.js");
15
+ const PresentationRpcInterface_js_1 = require("./PresentationRpcInterface.js");
16
+ const Utils_js_1 = require("./Utils.js");
16
17
  /**
17
18
  * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing
18
19
  * a timeout error.
@@ -26,43 +27,50 @@ const DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes
26
27
  * @internal
27
28
  */
28
29
  class RpcRequestsHandler {
30
+ /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */
31
+ timeout;
32
+ /** ID that identifies this handler as a client */
33
+ clientId;
29
34
  constructor(props) {
30
35
  this.clientId = props?.clientId ?? core_bentley_1.Guid.createValue();
31
36
  this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;
32
37
  }
33
38
  // eslint-disable-next-line @typescript-eslint/naming-convention
34
39
  get rpcClient() {
35
- return core_common_1.RpcManager.getClientForInterface(PresentationRpcInterface_1.PresentationRpcInterface);
40
+ return core_common_1.RpcManager.getClientForInterface(PresentationRpcInterface_js_1.PresentationRpcInterface);
36
41
  }
37
42
  async requestWithTimeout(func, diagnosticsHandler) {
38
- const start = core_bentley_1.BeTimePoint.now();
39
- const timeout = core_bentley_1.BeDuration.fromMilliseconds(this.timeout);
40
- let diagnostics;
41
- while (start.plus(timeout).isInFuture) {
42
- try {
43
- const response = await func();
44
- diagnostics = response.diagnostics;
45
- switch (response.statusCode) {
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);
43
+ const rpcResponsePromise = func();
44
+ const rpcRequest = core_common_1.RpcRequest.current(this.rpcClient);
45
+ const timeout = (0, Utils_js_1.createCancellableTimeoutPromise)(this.timeout);
46
+ return Promise.race([
47
+ (async () => {
48
+ let diagnostics;
49
+ try {
50
+ const response = await rpcResponsePromise;
51
+ diagnostics = response.diagnostics;
52
+ switch (response.statusCode) {
53
+ case Error_js_1.PresentationStatus.Success:
54
+ return response.result;
55
+ default:
56
+ throw new Error_js_1.PresentationError(response.statusCode, response.errorMessage);
57
+ }
52
58
  }
53
- }
54
- finally {
55
- diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
56
- }
57
- }
58
- throw new Error_1.PresentationError(Error_1.PresentationStatus.BackendTimeout);
59
+ finally {
60
+ diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
61
+ }
62
+ })(),
63
+ timeout.promise.then(() => {
64
+ throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);
65
+ }),
66
+ ]).finally(() => {
67
+ rpcRequest?.cancel();
68
+ timeout.cancel();
69
+ });
59
70
  }
60
71
  /**
61
- * Send the request to backend.
62
- *
63
- * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get
64
- * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]
65
- * is thrown with the details from the response.
72
+ * Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by
73
+ * then, we'll throw an error.
66
74
  */
67
75
  async request(func, options, ...additionalOptions) {
68
76
  const { imodel, diagnostics, ...optionsNoIModel } = options;
@@ -78,7 +86,8 @@ class RpcRequestsHandler {
78
86
  rpcOptions.diagnostics = diagnosticsOptions;
79
87
  }
80
88
  const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);
81
- return this.requestWithTimeout(doRequest, diagnosticsHandler);
89
+ const result = await this.requestWithTimeout(doRequest, diagnosticsHandler);
90
+ return result;
82
91
  }
83
92
  async getNodesCount(options) {
84
93
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -141,14 +150,12 @@ class RpcRequestsHandler {
141
150
  // eslint-disable-next-line @typescript-eslint/no-deprecated
142
151
  return this.request(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);
143
152
  }
153
+ /* eslint-disable @typescript-eslint/no-deprecated */
144
154
  async getSelectionScopes(options) {
145
- // eslint-disable-next-line @typescript-eslint/no-deprecated
146
155
  return this.request(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);
147
156
  }
148
157
  async computeSelection(options) {
149
- return this.request(
150
- // eslint-disable-next-line @typescript-eslint/no-deprecated
151
- this.rpcClient.computeSelection.bind(this.rpcClient), options);
158
+ return this.request(this.rpcClient.computeSelection.bind(this.rpcClient), options);
152
159
  }
153
160
  }
154
161
  exports.RpcRequestsHandler = RpcRequestsHandler;
@@ -171,7 +178,7 @@ function cleanupRuleset(ruleset) {
171
178
  delete cleanedUpRuleset[propertyKey];
172
179
  }
173
180
  else {
174
- 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.`);
181
+ core_bentley_1.Logger.logWarning(CommonLoggerCategory_js_1.PresentationCommonLoggerCategory.Package, `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`);
175
182
  }
176
183
  }
177
184
  }
@@ -1 +1 @@
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;AAM1E,mCAAgE;AAwBhE,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,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F;AAnLD,gDAmLC;AAED,SAAS,oBAAoB,CAAC,OAAe;IAC3C,OAAO,OAAQ,OAA+C,CAAC,WAAW,KAAK,QAAQ,CAAC;AAC1F,CAAC;AAMD,MAAM,gCAAgC,GAAkC;IACtE,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,eAAe,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,CAAC;QACxD,IAAI,CAAC,gCAAgC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAQ,gBAAwB,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,qBAAM,CAAC,UAAU,CACf,uDAAgC,CAAC,OAAO,EACxC,qDAAqD,WAAW,2DAA2D,CAC5H,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RPC\r\n */\r\n\r\nimport { BeDuration, BeTimePoint, Guid, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps, RpcManager } from \"@itwin/core-common\";\r\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory\";\r\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor\";\r\nimport { ItemJSON } from \"./content/Item\";\r\nimport { DisplayValueGroupJSON } from \"./content/Value\";\r\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics\";\r\nimport { InstanceKey } from \"./EC\";\r\nimport { PresentationError, PresentationStatus } from \"./Error\";\r\nimport { NodeKey } from \"./hierarchy/Key\";\r\nimport { NodeJSON } from \"./hierarchy/Node\";\r\nimport { NodePathElementJSON } from \"./hierarchy/NodePathElement\";\r\nimport { KeySetJSON } from \"./KeySet\";\r\nimport { LabelDefinition } from \"./LabelDefinition\";\r\nimport {\r\n ComputeSelectionRequestOptions,\r\n ContentDescriptorRequestOptions,\r\n ContentInstanceKeysRequestOptions,\r\n ContentRequestOptions,\r\n ContentSourcesRequestOptions,\r\n DisplayLabelRequestOptions,\r\n DisplayLabelsRequestOptions,\r\n DistinctValuesRequestOptions,\r\n FilterByInstancePathsHierarchyRequestOptions,\r\n FilterByTextHierarchyRequestOptions,\r\n HierarchyLevelDescriptorRequestOptions,\r\n HierarchyRequestOptions,\r\n Paged,\r\n RequestOptions,\r\n RequestOptionsWithRuleset,\r\n SelectionScopeRequestOptions,\r\n} from \"./PresentationManagerOptions\";\r\nimport { ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse } from \"./PresentationRpcInterface\";\r\nimport { Ruleset } from \"./rules/Ruleset\";\r\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\r\nimport { SelectionScope } from \"./selection/SelectionScope\";\r\nimport { PagedResponse } from \"./Utils\";\r\n\r\n/**\r\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\r\n * a timeout error.\r\n */\r\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\r\n\r\n/**\r\n * Configuration parameters for [[RpcRequestsHandler]].\r\n *\r\n * @internal\r\n */\r\nexport interface RpcRequestsHandlerProps {\r\n /**\r\n * Optional ID used to identify client that requests data. If not specified,\r\n * the handler creates a unique GUID as a client id.\r\n * @internal\r\n */\r\n clientId?: string;\r\n\r\n /** @internal */\r\n timeout?: number;\r\n}\r\n\r\n/**\r\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\r\n * adds handling for cases when backend needs to be synced with client\r\n * state.\r\n *\r\n * @internal\r\n */\r\nexport class RpcRequestsHandler {\r\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\r\n public readonly timeout: number;\r\n\r\n /** ID that identifies this handler as a client */\r\n public readonly clientId: string;\r\n\r\n public constructor(props?: RpcRequestsHandlerProps) {\r\n this.clientId = props?.clientId ?? Guid.createValue();\r\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private get rpcClient(): PresentationRpcInterface {\r\n return RpcManager.getClientForInterface(PresentationRpcInterface);\r\n }\r\n\r\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\r\n const start = BeTimePoint.now();\r\n const timeout = BeDuration.fromMilliseconds(this.timeout);\r\n let diagnostics: ClientDiagnostics | undefined;\r\n while (start.plus(timeout).isInFuture) {\r\n try {\r\n const response = await func();\r\n diagnostics = response.diagnostics;\r\n switch (response.statusCode) {\r\n case PresentationStatus.Success:\r\n return response.result!;\r\n case PresentationStatus.BackendTimeout:\r\n break;\r\n default:\r\n throw new PresentationError(response.statusCode, response.errorMessage);\r\n }\r\n } finally {\r\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\r\n }\r\n }\r\n throw new PresentationError(PresentationStatus.BackendTimeout);\r\n }\r\n\r\n /**\r\n * Send the request to backend.\r\n *\r\n * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get\r\n * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]\r\n * is thrown with the details from the response.\r\n */\r\n public async request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(\r\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\r\n options: TOptions,\r\n ...additionalOptions: TArg[]\r\n ): Promise<TResult> {\r\n const { imodel, diagnostics, ...optionsNoIModel } = options;\r\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\r\n if (isOptionsWithRuleset(optionsNoIModel)) {\r\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\r\n }\r\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\r\n ...optionsNoIModel,\r\n clientId: this.clientId,\r\n };\r\n if (diagnostics) {\r\n rpcOptions.diagnostics = diagnosticsOptions;\r\n }\r\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\r\n return this.requestWithTimeout(doRequest, diagnosticsHandler);\r\n }\r\n\r\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<number, typeof options>(this.rpcClient.getNodesCount.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getPagedNodes(\r\n options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ): Promise<PagedResponse<NodeJSON>> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<NodeJSON>, typeof options>(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getNodesDescriptor(\r\n options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<DescriptorJSON | undefined> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\r\n if (typeof response === \"string\") {\r\n return JSON.parse(response);\r\n }\r\n return response;\r\n }\r\n\r\n public async getNodePaths(\r\n options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ): Promise<NodePathElementJSON[]> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<NodePathElementJSON[], typeof options>(this.rpcClient.getNodePaths.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getFilteredNodePaths(\r\n options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ): Promise<NodePathElementJSON[]> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<NodePathElementJSON[], typeof options>(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<ContentSourcesRpcResult, typeof options>(this.rpcClient.getContentSources.bind(this.rpcClient), options);\r\n }\r\n public async getContentDescriptor(\r\n options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<DescriptorJSON | undefined> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<DescriptorJSON | undefined, typeof options>(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\r\n }\r\n public async getContentSetSize(\r\n options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<number> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<number, typeof options>(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\r\n }\r\n public async getPagedContent(\r\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\r\n ) {\r\n return this.request<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.rpcClient.getPagedContent.bind(this.rpcClient),\r\n options,\r\n );\r\n }\r\n public async getPagedContentSet(\r\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<ItemJSON>, typeof options>(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getPagedDistinctValues(\r\n options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ): Promise<PagedResponse<DisplayValueGroupJSON>> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<DisplayValueGroupJSON>, typeof options>(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getContentInstanceKeys(\r\n options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<{ total: number; items: KeySetJSON }> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<{ total: number; items: KeySetJSON }, typeof options>(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getDisplayLabelDefinition(\r\n options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<LabelDefinition> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<LabelDefinition, typeof options>(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\r\n }\r\n public async getPagedDisplayLabelDefinitions(\r\n options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<PagedResponse<LabelDefinition>> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<LabelDefinition>, typeof options>(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<SelectionScope[], typeof options>(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\r\n }\r\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\r\n return this.request<KeySetJSON, typeof options>(\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.rpcClient.computeSelection.bind(this.rpcClient),\r\n options,\r\n );\r\n }\r\n}\r\n\r\nfunction isOptionsWithRuleset(options: object): options is { rulesetOrId: Ruleset } {\r\n return typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\";\r\n}\r\n\r\ntype RulesetWithRequiredProperties = {\r\n [key in keyof Ruleset]-?: true;\r\n};\r\n\r\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\r\n id: true,\r\n rules: true,\r\n version: true,\r\n requiredSchemas: true,\r\n supplementationInfo: true,\r\n vars: true,\r\n};\r\n\r\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\r\n const cleanedUpRuleset: Ruleset = { ...ruleset };\r\n\r\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\r\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\r\n if (propertyKey === \"$schema\") {\r\n delete (cleanedUpRuleset as any)[propertyKey];\r\n } else {\r\n Logger.logWarning(\r\n PresentationCommonLoggerCategory.Package,\r\n `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`,\r\n );\r\n }\r\n }\r\n }\r\n\r\n return cleanedUpRuleset;\r\n}\r\n"]}
1
+ {"version":3,"file":"RpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAmD;AACnD,oDAA4E;AAC5E,uEAA6E;AAK7E,yCAAmE;AAuBnE,+EAA0J;AAI1J,yCAA4E;AAI5E;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAmB7D;;;;;;GAMG;AACH,MAAa,kBAAkB;IAC7B,sHAAsH;IACtG,OAAO,CAAS;IAEhC,kDAAkD;IAClC,QAAQ,CAAS;IAEjC,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,sDAAwB,CAAC,CAAC;IACpE,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAU,IAA4C,EAAE,kBAA6C;QACnI,MAAM,kBAAkB,GAAG,IAAI,EAAE,CAAC;QAClC,MAAM,UAAU,GAA2B,wBAAU,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9E,MAAM,OAAO,GAAG,IAAA,0CAA+B,EAAC,IAAI,CAAC,OAAO,CA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oF;QAChH,OAAO,IAAI,CAAC,OAAO,CAA6B,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IACjH,CAAC;CAEF;AAhLD,gDAgLC;AAED,SAAS,oBAAoB,CAAC,OAAe;IAC3C,OAAO,OAAQ,OAA+C,CAAC,WAAW,KAAK,QAAQ,CAAC;AAC1F,CAAC;AAMD,MAAM,gCAAgC,GAAkC;IACtE,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,eAAe,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,CAAC;QACxD,IAAI,CAAC,gCAAgC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAQ,gBAAwB,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,qBAAM,CAAC,UAAU,CACf,0DAAgC,CAAC,OAAO,EACxC,qDAAqD,WAAW,2DAA2D,CAC5H,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RPC\r\n */\r\n\r\nimport { Guid, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps, RpcManager, RpcRequest } from \"@itwin/core-common\";\r\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory.js\";\r\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor.js\";\r\nimport { ItemJSON } from \"./content/Item.js\";\r\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics.js\";\r\nimport { InstanceKey } from \"./EC.js\";\r\nimport { PresentationError, PresentationStatus } from \"./Error.js\";\r\nimport { NodeKey } from \"./hierarchy/Key.js\";\r\nimport { Node } from \"./hierarchy/Node.js\";\r\nimport { KeySetJSON } from \"./KeySet.js\";\r\nimport { LabelDefinition } from \"./LabelDefinition.js\";\r\nimport {\r\n ComputeSelectionRequestOptions,\r\n ContentDescriptorRequestOptions,\r\n ContentInstanceKeysRequestOptions,\r\n ContentRequestOptions,\r\n ContentSourcesRequestOptions,\r\n DisplayLabelRequestOptions,\r\n DisplayLabelsRequestOptions,\r\n DistinctValuesRequestOptions,\r\n FilterByInstancePathsHierarchyRequestOptions,\r\n FilterByTextHierarchyRequestOptions,\r\n HierarchyLevelDescriptorRequestOptions,\r\n HierarchyRequestOptions,\r\n Paged,\r\n RequestOptions,\r\n RequestOptionsWithRuleset,\r\n SelectionScopeRequestOptions,\r\n} from \"./PresentationManagerOptions.js\";\r\nimport { ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse } from \"./PresentationRpcInterface.js\";\r\nimport { Ruleset } from \"./rules/Ruleset.js\";\r\nimport { RulesetVariableJSON } from \"./RulesetVariables.js\";\r\nimport { SelectionScope } from \"./selection/SelectionScope.js\";\r\nimport { createCancellableTimeoutPromise, PagedResponse } from \"./Utils.js\";\r\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\r\nimport { DisplayValueGroup } from \"./content/Value.js\";\r\n\r\n/**\r\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\r\n * a timeout error.\r\n */\r\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\r\n\r\n/**\r\n * Configuration parameters for [[RpcRequestsHandler]].\r\n *\r\n * @internal\r\n */\r\nexport interface RpcRequestsHandlerProps {\r\n /**\r\n * Optional ID used to identify client that requests data. If not specified,\r\n * the handler creates a unique GUID as a client id.\r\n * @internal\r\n */\r\n clientId?: string;\r\n\r\n /** @internal */\r\n timeout?: number;\r\n}\r\n\r\n/**\r\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\r\n * adds handling for cases when backend needs to be synced with client\r\n * state.\r\n *\r\n * @internal\r\n */\r\nexport class RpcRequestsHandler {\r\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\r\n public readonly timeout: number;\r\n\r\n /** ID that identifies this handler as a client */\r\n public readonly clientId: string;\r\n\r\n public constructor(props?: RpcRequestsHandlerProps) {\r\n this.clientId = props?.clientId ?? Guid.createValue();\r\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private get rpcClient(): PresentationRpcInterface {\r\n return RpcManager.getClientForInterface(PresentationRpcInterface);\r\n }\r\n\r\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\r\n const rpcResponsePromise = func();\r\n const rpcRequest: RpcRequest | undefined = RpcRequest.current(this.rpcClient);\r\n const timeout = createCancellableTimeoutPromise(this.timeout);\r\n return Promise.race([\r\n (async () => {\r\n let diagnostics: ClientDiagnostics | undefined;\r\n try {\r\n const response = await rpcResponsePromise;\r\n diagnostics = response.diagnostics;\r\n switch (response.statusCode) {\r\n case PresentationStatus.Success:\r\n return response.result!;\r\n default:\r\n throw new PresentationError(response.statusCode, response.errorMessage);\r\n }\r\n } finally {\r\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\r\n }\r\n })(),\r\n timeout.promise.then(() => {\r\n throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);\r\n }),\r\n ]).finally(() => {\r\n rpcRequest?.cancel();\r\n timeout.cancel();\r\n });\r\n }\r\n\r\n /**\r\n * Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by\r\n * then, we'll throw an error.\r\n */\r\n public async request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(\r\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\r\n options: TOptions,\r\n ...additionalOptions: TArg[]\r\n ): Promise<TResult> {\r\n const { imodel, diagnostics, ...optionsNoIModel } = options;\r\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\r\n if (isOptionsWithRuleset(optionsNoIModel)) {\r\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\r\n }\r\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\r\n ...optionsNoIModel,\r\n clientId: this.clientId,\r\n };\r\n if (diagnostics) {\r\n rpcOptions.diagnostics = diagnosticsOptions;\r\n }\r\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\r\n const result = await this.requestWithTimeout(doRequest, diagnosticsHandler);\r\n return result;\r\n }\r\n\r\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<number, typeof options>(this.rpcClient.getNodesCount.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getPagedNodes(\r\n options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute,\r\n ): Promise<PagedResponse<Node>> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<Node>, typeof options>(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getNodesDescriptor(\r\n options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<DescriptorJSON | undefined> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\r\n if (typeof response === \"string\") {\r\n return JSON.parse(response);\r\n }\r\n return response;\r\n }\r\n\r\n public async getNodePaths(\r\n options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<NodePathElement[]> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getNodePaths.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getFilteredNodePaths(\r\n options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<NodePathElement[]> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<ContentSourcesRpcResult, typeof options>(this.rpcClient.getContentSources.bind(this.rpcClient), options);\r\n }\r\n public async getContentDescriptor(\r\n options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<DescriptorJSON | undefined> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<DescriptorJSON | undefined, typeof options>(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\r\n }\r\n public async getContentSetSize(\r\n options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<number> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<number, typeof options>(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\r\n }\r\n public async getPagedContent(\r\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\r\n ) {\r\n return this.request<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.rpcClient.getPagedContent.bind(this.rpcClient),\r\n options,\r\n );\r\n }\r\n public async getPagedContentSet(\r\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<ItemJSON>, typeof options>(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getPagedDistinctValues(\r\n options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<PagedResponse<DisplayValueGroup>> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<DisplayValueGroup>, typeof options>(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getContentInstanceKeys(\r\n options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\r\n ): Promise<{ total: number; items: KeySetJSON }> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<{ total: number; items: KeySetJSON }, typeof options>(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\r\n }\r\n\r\n public async getDisplayLabelDefinition(\r\n options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<LabelDefinition> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<LabelDefinition, typeof options>(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\r\n }\r\n public async getPagedDisplayLabelDefinitions(\r\n options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\r\n ): Promise<PagedResponse<LabelDefinition>> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return this.request<PagedResponse<LabelDefinition>, typeof options>(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\r\n }\r\n\r\n /* eslint-disable @typescript-eslint/no-deprecated */\r\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\r\n return this.request<SelectionScope[], typeof options>(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\r\n }\r\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\r\n return this.request<KeySetJSON, typeof options>(this.rpcClient.computeSelection.bind(this.rpcClient), options);\r\n }\r\n /* eslint-enable @typescript-eslint/no-deprecated */\r\n}\r\n\r\nfunction isOptionsWithRuleset(options: object): options is { rulesetOrId: Ruleset } {\r\n return typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\";\r\n}\r\n\r\ntype RulesetWithRequiredProperties = {\r\n [key in keyof Ruleset]-?: true;\r\n};\r\n\r\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\r\n id: true,\r\n rules: true,\r\n version: true,\r\n requiredSchemas: true,\r\n supplementationInfo: true,\r\n vars: true,\r\n};\r\n\r\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\r\n const cleanedUpRuleset: Ruleset = { ...ruleset };\r\n\r\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\r\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\r\n if (propertyKey === \"$schema\") {\r\n delete (cleanedUpRuleset as any)[propertyKey];\r\n } else {\r\n Logger.logWarning(\r\n PresentationCommonLoggerCategory.Package,\r\n `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`,\r\n );\r\n }\r\n }\r\n }\r\n\r\n return cleanedUpRuleset;\r\n}\r\n"]}
@@ -101,51 +101,6 @@ export interface RulesetVariableBaseJSON {
101
101
  type: VariableValueTypes;
102
102
  value: VariableValueJSON;
103
103
  }
104
- /**
105
- * JSON representation of [[BooleanRulesetVariable]].
106
- * @public
107
- * @deprecated in 3.x. Use [[BooleanRulesetVariable]]
108
- */
109
- export interface BooleanRulesetVariableJSON extends RulesetVariableBaseJSON {
110
- type: VariableValueTypes.Bool;
111
- value: boolean;
112
- }
113
- /**
114
- * JSON representation of [[StringRulesetVariable]].
115
- * @public
116
- * @deprecated in 3.x. Use [[StringRulesetVariable]]
117
- */
118
- export interface StringRulesetVariableJSON extends RulesetVariableBaseJSON {
119
- type: VariableValueTypes.String;
120
- value: string;
121
- }
122
- /**
123
- * JSON representation of [[IntRulesetVariable]].
124
- * @public
125
- * @deprecated in 3.x. Use [[IntRulesetVariable]]
126
- */
127
- export interface IntRulesetVariableJSON extends RulesetVariableBaseJSON {
128
- type: VariableValueTypes.Int;
129
- value: number;
130
- }
131
- /**
132
- * JSON representation of [[IntsRulesetVariable]].
133
- * @public
134
- * @deprecated in 3.x. Use [[IntsRulesetVariable]]
135
- */
136
- export interface IntsRulesetVariableJSON extends RulesetVariableBaseJSON {
137
- type: VariableValueTypes.IntArray;
138
- value: number[];
139
- }
140
- /**
141
- * JSON representation of [[Id64RulesetVariable]].
142
- * @public
143
- * @deprecated in 3.x. Use [[Id64RulesetVariable]]
144
- */
145
- export interface Id64RulesetVariableJSON extends RulesetVariableBaseJSON {
146
- type: VariableValueTypes.Id64;
147
- value: Id64String;
148
- }
149
104
  /**
150
105
  * JSON representation of [[Id64sRulesetVariable]].
151
106
  * @public
@@ -158,7 +113,7 @@ export interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {
158
113
  * JSON representation of [[RulesetVariable]].
159
114
  * @public
160
115
  */
161
- export type RulesetVariableJSON = BooleanRulesetVariableJSON | StringRulesetVariableJSON | IntRulesetVariableJSON | IntsRulesetVariableJSON | Id64RulesetVariableJSON | Id64sRulesetVariableJSON;
116
+ export type RulesetVariableJSON = BooleanRulesetVariable | StringRulesetVariable | IntRulesetVariable | IntsRulesetVariable | Id64RulesetVariable | Id64sRulesetVariableJSON;
162
117
  /** @public */
163
118
  export declare namespace RulesetVariable {
164
119
  /**
@@ -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,IAA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BAAkB,CAAC,IAAI,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;CAChB;AACD;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB;IACrE,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;IACtE,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AACD;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;IACtE,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC;IAC9B,KAAK,EAAE,UAAU,CAAC;CACnB;AACD;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,uBAAuB;IACvE,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC;IACnC,KAAK,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC;CACzC;AACD;;;GAGG;AAEH,MAAM,MAAM,mBAAmB,GAC3B,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,CAAC;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
+ {"version":3,"file":"RulesetVariables.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,i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E,CAAC;CACjB;AACD;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC;IAC9B,KAAK,EAAE,UAAU,CAAC;CACnB;AACD;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AACD;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,oBAAoB,CAAC;AAEzB;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AACD;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,uBAAuB;IACvE,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC;IACnC,KAAK,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC;CACzC;AACD;;;GAGG;AAEH,MAAM,MAAM,mBAAmB,GAC3B,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,CAAC;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 +1 @@
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,kCAAlB,kBAAkB,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,CAAC;YACnD,OAAO,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,gCAAiB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjF,CAAC;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,CAAC;YAC/C,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACnC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,gCAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3E,CAAC;YACD,OAAO,IAAW,CAAC,CAAC,kFAAkF;QACxG,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IARe,wBAAQ,WAQvB,CAAA;AACH,CAAC,EAtBgB,eAAe,+BAAf,eAAe,QAsB/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/**\r\n * Possible variable value types\r\n * @public\r\n */\r\nexport enum VariableValueTypes {\r\n /** Integer value */\r\n Int = \"int\",\r\n\r\n /** Array of integer values */\r\n IntArray = \"int[]\",\r\n\r\n /** Boolean value */\r\n Bool = \"bool\",\r\n\r\n /** String value */\r\n String = \"string\",\r\n\r\n /** Id64String value */\r\n Id64 = \"id64\",\r\n\r\n /** Array of Id64String values */\r\n Id64Array = \"id64[]\",\r\n}\r\n\r\n/**\r\n * Union of all supported variable value types\r\n * @public\r\n */\r\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\r\n\r\n/**\r\n * JSON representation of [[VariableValue]]\r\n * @public\r\n */\r\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\r\n\r\n/**\r\n * Base data structure for representing ruleset variables.\r\n * @public\r\n */\r\nexport interface RulesetVariableBase {\r\n id: string;\r\n type: VariableValueTypes;\r\n value: VariableValue;\r\n}\r\n/**\r\n * Data structure for representing boolean ruleset variables.\r\n * @public\r\n */\r\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Bool;\r\n value: boolean;\r\n}\r\n/**\r\n * Data structure for representing string ruleset variables.\r\n * @public\r\n */\r\nexport interface StringRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.String;\r\n value: string;\r\n}\r\n/**\r\n * Data structure for representing int ruleset variables.\r\n * @public\r\n */\r\nexport interface IntRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Int;\r\n value: number;\r\n}\r\n/**\r\n * Data structure for representing int array ruleset variables.\r\n * @public\r\n */\r\nexport interface IntsRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.IntArray;\r\n value: number[];\r\n}\r\n/**\r\n * Data structure for representing ID ruleset variables.\r\n * @public\r\n */\r\nexport interface Id64RulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Id64;\r\n value: Id64String;\r\n}\r\n/**\r\n * Data structure for representing ID array ruleset variables.\r\n * @public\r\n */\r\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Id64Array;\r\n value: Id64String[];\r\n}\r\n/**\r\n * Data structure for representing ruleset variables.\r\n * @public\r\n */\r\nexport type RulesetVariable =\r\n | BooleanRulesetVariable\r\n | StringRulesetVariable\r\n | IntRulesetVariable\r\n | IntsRulesetVariable\r\n | Id64RulesetVariable\r\n | Id64sRulesetVariable;\r\n\r\n/**\r\n * JSON representation of [[RulesetVariableBase]].\r\n * @public\r\n */\r\nexport interface RulesetVariableBaseJSON {\r\n id: string;\r\n type: VariableValueTypes;\r\n value: VariableValueJSON;\r\n}\r\n/**\r\n * JSON representation of [[BooleanRulesetVariable]].\r\n * @public\r\n * @deprecated in 3.x. Use [[BooleanRulesetVariable]]\r\n */\r\nexport interface BooleanRulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.Bool;\r\n value: boolean;\r\n}\r\n/**\r\n * JSON representation of [[StringRulesetVariable]].\r\n * @public\r\n * @deprecated in 3.x. Use [[StringRulesetVariable]]\r\n */\r\nexport interface StringRulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.String;\r\n value: string;\r\n}\r\n/**\r\n * JSON representation of [[IntRulesetVariable]].\r\n * @public\r\n * @deprecated in 3.x. Use [[IntRulesetVariable]]\r\n */\r\nexport interface IntRulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.Int;\r\n value: number;\r\n}\r\n/**\r\n * JSON representation of [[IntsRulesetVariable]].\r\n * @public\r\n * @deprecated in 3.x. Use [[IntsRulesetVariable]]\r\n */\r\nexport interface IntsRulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.IntArray;\r\n value: number[];\r\n}\r\n/**\r\n * JSON representation of [[Id64RulesetVariable]].\r\n * @public\r\n * @deprecated in 3.x. Use [[Id64RulesetVariable]]\r\n */\r\nexport interface Id64RulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.Id64;\r\n value: Id64String;\r\n}\r\n/**\r\n * JSON representation of [[Id64sRulesetVariable]].\r\n * @public\r\n */\r\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.Id64Array;\r\n value: Id64String[] | CompressedId64Set;\r\n}\r\n/**\r\n * JSON representation of [[RulesetVariable]].\r\n * @public\r\n */\r\n\r\nexport type RulesetVariableJSON =\r\n | BooleanRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\r\n | StringRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\r\n | IntRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\r\n | IntsRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\r\n | Id64RulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\r\n | Id64sRulesetVariableJSON;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace RulesetVariable {\r\n /**\r\n * Serialize given RulesetVariable to JSON.\r\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\r\n */\r\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\r\n if (variable.type === VariableValueTypes.Id64Array) {\r\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\r\n }\r\n return variable;\r\n }\r\n\r\n /** Deserialize [[RulesetVariable]] from JSON. */\r\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\r\n if (json.type === VariableValueTypes.Id64Array) {\r\n if (typeof json.value === \"string\") {\r\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\r\n }\r\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\r\n }\r\n return json;\r\n }\r\n}\r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AAQ,WAQvB,CAAA;AACH,CAAC,EAtBgB,eAAe,+BAAf,eAAe,QAsB/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/**\r\n * Possible variable value types\r\n * @public\r\n */\r\nexport enum VariableValueTypes {\r\n /** Integer value */\r\n Int = \"int\",\r\n\r\n /** Array of integer values */\r\n IntArray = \"int[]\",\r\n\r\n /** Boolean value */\r\n Bool = \"bool\",\r\n\r\n /** String value */\r\n String = \"string\",\r\n\r\n /** Id64String value */\r\n Id64 = \"id64\",\r\n\r\n /** Array of Id64String values */\r\n Id64Array = \"id64[]\",\r\n}\r\n\r\n/**\r\n * Union of all supported variable value types\r\n * @public\r\n */\r\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\r\n\r\n/**\r\n * JSON representation of [[VariableValue]]\r\n * @public\r\n */\r\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\r\n\r\n/**\r\n * Base data structure for representing ruleset variables.\r\n * @public\r\n */\r\nexport interface RulesetVariableBase {\r\n id: string;\r\n type: VariableValueTypes;\r\n value: VariableValue;\r\n}\r\n/**\r\n * Data structure for representing boolean ruleset variables.\r\n * @public\r\n */\r\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Bool;\r\n value: boolean;\r\n}\r\n/**\r\n * Data structure for representing string ruleset variables.\r\n * @public\r\n */\r\nexport interface StringRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.String;\r\n value: string;\r\n}\r\n/**\r\n * Data structure for representing int ruleset variables.\r\n * @public\r\n */\r\nexport interface IntRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Int;\r\n value: number;\r\n}\r\n/**\r\n * Data structure for representing int array ruleset variables.\r\n * @public\r\n */\r\nexport interface IntsRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.IntArray;\r\n value: number[];\r\n}\r\n/**\r\n * Data structure for representing ID ruleset variables.\r\n * @public\r\n */\r\nexport interface Id64RulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Id64;\r\n value: Id64String;\r\n}\r\n/**\r\n * Data structure for representing ID array ruleset variables.\r\n * @public\r\n */\r\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\r\n type: VariableValueTypes.Id64Array;\r\n value: Id64String[];\r\n}\r\n/**\r\n * Data structure for representing ruleset variables.\r\n * @public\r\n */\r\nexport type RulesetVariable =\r\n | BooleanRulesetVariable\r\n | StringRulesetVariable\r\n | IntRulesetVariable\r\n | IntsRulesetVariable\r\n | Id64RulesetVariable\r\n | Id64sRulesetVariable;\r\n\r\n/**\r\n * JSON representation of [[RulesetVariableBase]].\r\n * @public\r\n */\r\nexport interface RulesetVariableBaseJSON {\r\n id: string;\r\n type: VariableValueTypes;\r\n value: VariableValueJSON;\r\n}\r\n/**\r\n * JSON representation of [[Id64sRulesetVariable]].\r\n * @public\r\n */\r\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\r\n type: VariableValueTypes.Id64Array;\r\n value: Id64String[] | CompressedId64Set;\r\n}\r\n/**\r\n * JSON representation of [[RulesetVariable]].\r\n * @public\r\n */\r\n\r\nexport type RulesetVariableJSON =\r\n | BooleanRulesetVariable\r\n | StringRulesetVariable\r\n | IntRulesetVariable\r\n | IntsRulesetVariable\r\n | Id64RulesetVariable\r\n | Id64sRulesetVariableJSON;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace RulesetVariable {\r\n /**\r\n * Serialize given RulesetVariable to JSON.\r\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\r\n */\r\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\r\n if (variable.type === VariableValueTypes.Id64Array) {\r\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\r\n }\r\n return variable;\r\n }\r\n\r\n /** Deserialize [[RulesetVariable]] from JSON. */\r\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\r\n if (json.type === VariableValueTypes.Id64Array) {\r\n if (typeof json.value === \"string\") {\r\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\r\n }\r\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\r\n }\r\n return json;\r\n }\r\n}\r\n"]}
@@ -1,10 +1,10 @@
1
1
  /** @packageDocumentation
2
2
  * @module Core
3
3
  */
4
- import { Field } from "./content/Fields";
5
- import { Item } from "./content/Item";
6
- import { InstanceKey } from "./EC";
7
- import { Ruleset } from "./rules/Ruleset";
4
+ import { Field } from "./content/Fields.js";
5
+ import { Item } from "./content/Item.js";
6
+ import { InstanceKey } from "./EC.js";
7
+ import { Ruleset } from "./rules/Ruleset.js";
8
8
  /**
9
9
  * A factory class that can be used to create presentation rulesets targeted towards
10
10
  * specific use cases.
@@ -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;IAsCzC;;;;;;;OAOG;IACU,6BAA6B,CACxC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,EACZ,mBAAmB,CAAC,EAAE,2BAA2B,GAChD,OAAO,CAAC;QAAE,OAAO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;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"}
@@ -9,12 +9,12 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.RulesetsFactory = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
- const TypeDescription_1 = require("./content/TypeDescription");
13
- const Value_1 = require("./content/Value");
14
- const EC_1 = require("./EC");
15
- const ContentSpecification_1 = require("./rules/content/ContentSpecification");
16
- const RelationshipDirection_1 = require("./rules/RelationshipDirection");
17
- const Rule_1 = require("./rules/Rule");
12
+ const TypeDescription_js_1 = require("./content/TypeDescription.js");
13
+ const Value_js_1 = require("./content/Value.js");
14
+ const EC_js_1 = require("./EC.js");
15
+ const ContentSpecification_js_1 = require("./rules/content/ContentSpecification.js");
16
+ const RelationshipDirection_js_1 = require("./rules/RelationshipDirection.js");
17
+ const Rule_js_1 = require("./rules/Rule.js");
18
18
  /**
19
19
  * A factory class that can be used to create presentation rulesets targeted towards
20
20
  * specific use cases.
@@ -26,7 +26,7 @@ class RulesetsFactory {
26
26
  if (!field.isPropertiesField()) {
27
27
  throw new Error("Can only create 'similar instances' ruleset for properties-based records");
28
28
  }
29
- if (field.type.valueFormat !== TypeDescription_1.PropertyValueFormat.Primitive) {
29
+ if (field.type.valueFormat !== TypeDescription_js_1.PropertyValueFormat.Primitive) {
30
30
  throw new Error("Can only create 'similar instances' ruleset for primitive properties");
31
31
  }
32
32
  if (field.properties.length === 0) {
@@ -47,10 +47,10 @@ class RulesetsFactory {
47
47
  rules: [],
48
48
  };
49
49
  ruleset.rules.push({
50
- ruleType: Rule_1.RuleTypes.Content,
50
+ ruleType: Rule_js_1.RuleTypes.Content,
51
51
  specifications: [
52
52
  {
53
- specType: ContentSpecification_1.ContentSpecificationTypes.ContentInstancesOfSpecificClasses,
53
+ specType: ContentSpecification_js_1.ContentSpecificationTypes.ContentInstancesOfSpecificClasses,
54
54
  classes: createMultiClassSpecification(record.classInfo),
55
55
  relatedInstances: relatedInstanceInfo ? [relatedInstanceInfo.spec] : [],
56
56
  instanceFilter: createInstanceFilter(relatedInstanceInfo?.spec, field.type, propertyName, propertyValue.raw),
@@ -96,10 +96,10 @@ const getPropertyName = (field) => {
96
96
  return name;
97
97
  };
98
98
  const isPrimitivePropertyValue = (value) => {
99
- if (Value_1.Value.isPrimitive(value)) {
99
+ if (Value_js_1.Value.isPrimitive(value)) {
100
100
  return true;
101
101
  }
102
- if (Value_1.Value.isMap(value)) {
102
+ if (Value_js_1.Value.isMap(value)) {
103
103
  if (typeof value.x === "number" && typeof value.y === "number" && (value.z === undefined || typeof value.z === "number")) {
104
104
  return true;
105
105
  }
@@ -121,7 +121,7 @@ const getPropertyValue = (record, field) => {
121
121
  let value = record.values[currFieldName];
122
122
  currFieldName = fieldNamesStack.pop();
123
123
  while (currFieldName) {
124
- if (!Value_1.Value.isNestedContent(value) || value.length === 0) {
124
+ if (!Value_js_1.Value.isNestedContent(value) || value.length === 0) {
125
125
  throw new Error("Invalid record value");
126
126
  }
127
127
  if (value.length > 1) {
@@ -168,7 +168,7 @@ const createComparison = (type, name, operator, value) => {
168
168
  throw new Error("Expecting point values to be supplied as objects");
169
169
  }
170
170
  const dimensionType = {
171
- valueFormat: TypeDescription_1.PropertyValueFormat.Primitive,
171
+ valueFormat: TypeDescription_js_1.PropertyValueFormat.Primitive,
172
172
  typeName: "double",
173
173
  };
174
174
  const pointValue = value;
@@ -199,7 +199,7 @@ const createRelatedInstanceSpec = (pathFromSelectToPropertyClass, index) => ({
199
199
  spec: {
200
200
  relationshipPath: pathFromSelectToPropertyClass.map((step) => ({
201
201
  relationship: createSingleClassSpecification(step.relationshipInfo),
202
- direction: step.isForwardRelationship ? RelationshipDirection_1.RelationshipDirection.Forward : RelationshipDirection_1.RelationshipDirection.Backward,
202
+ direction: step.isForwardRelationship ? RelationshipDirection_js_1.RelationshipDirection.Forward : RelationshipDirection_js_1.RelationshipDirection.Backward,
203
203
  targetClass: createSingleClassSpecification(step.targetClassInfo),
204
204
  })),
205
205
  isRequired: true,
@@ -214,7 +214,7 @@ const createPathFromSelectToPropertyClass = (field) => {
214
214
  pathFromPropertyToSelectClass.push(...currField.parent.pathToPrimaryClass);
215
215
  currField = currField.parent;
216
216
  }
217
- return EC_1.RelationshipPath.reverse(pathFromPropertyToSelectClass);
217
+ return EC_js_1.RelationshipPath.reverse(pathFromPropertyToSelectClass);
218
218
  };
219
219
  const createRelatedInstanceSpecInfo = (field) => {
220
220
  const path = createPathFromSelectToPropertyClass(field);