@itwin/presentation-common 5.0.0-dev.7 → 5.0.0-dev.70

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 (369) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/Ruleset.schema.json +3 -258
  3. package/lib/cjs/assets/locales/en/Presentation.json +19 -19
  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/CommonLoggerCategory.js.map +1 -1
  9. package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
  10. package/lib/cjs/presentation-common/EC.d.ts +36 -80
  11. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  12. package/lib/cjs/presentation-common/EC.js +1 -97
  13. package/lib/cjs/presentation-common/EC.js.map +1 -1
  14. package/lib/cjs/presentation-common/ElementProperties.js +16 -9
  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.js.map +1 -1
  21. package/lib/cjs/presentation-common/KeySet.d.ts +2 -2
  22. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  23. package/lib/cjs/presentation-common/KeySet.js +9 -11
  24. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  25. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +4 -1
  26. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  27. package/lib/cjs/presentation-common/LabelDefinition.d.ts +0 -48
  28. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  29. package/lib/cjs/presentation-common/LabelDefinition.js +1 -44
  30. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  31. package/lib/cjs/presentation-common/LocalizationHelper.js +1 -0
  32. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  33. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  34. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +31 -10
  35. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  36. package/lib/cjs/presentation-common/PresentationManagerOptions.js +0 -5
  37. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  38. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +9 -9
  39. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  40. package/lib/cjs/presentation-common/PresentationRpcInterface.js +36 -21
  41. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  42. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +3 -2
  43. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  44. package/lib/cjs/presentation-common/RegisteredRuleset.js +9 -1
  45. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  46. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +9 -12
  47. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  48. package/lib/cjs/presentation-common/RpcRequestsHandler.js +37 -30
  49. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  50. package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
  51. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  52. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  53. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  54. package/lib/cjs/presentation-common/Update.d.ts +2 -79
  55. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  56. package/lib/cjs/presentation-common/Update.js +1 -104
  57. package/lib/cjs/presentation-common/Update.js.map +1 -1
  58. package/lib/cjs/presentation-common/Utils.d.ts +21 -0
  59. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  60. package/lib/cjs/presentation-common/Utils.js +57 -0
  61. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  62. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  63. package/lib/cjs/presentation-common/content/Content.d.ts +0 -7
  64. package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
  65. package/lib/cjs/presentation-common/content/Content.js +5 -10
  66. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  67. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +1 -1
  68. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  69. package/lib/cjs/presentation-common/content/ContentTraverser.js +116 -28
  70. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  71. package/lib/cjs/presentation-common/content/Descriptor.d.ts +2 -31
  72. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  73. package/lib/cjs/presentation-common/content/Descriptor.js +68 -22
  74. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  75. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  76. package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
  77. package/lib/cjs/presentation-common/content/Fields.d.ts +151 -27
  78. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  79. package/lib/cjs/presentation-common/content/Fields.js +264 -140
  80. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  81. package/lib/cjs/presentation-common/content/Item.d.ts +26 -31
  82. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  83. package/lib/cjs/presentation-common/content/Item.js +52 -67
  84. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  85. package/lib/cjs/presentation-common/content/Property.d.ts +2 -12
  86. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  87. package/lib/cjs/presentation-common/content/Property.js +0 -18
  88. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  89. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +3 -0
  90. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  91. package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
  92. package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
  93. package/lib/cjs/presentation-common/content/Value.d.ts +5 -107
  94. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  95. package/lib/cjs/presentation-common/content/Value.js +1 -215
  96. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  97. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  98. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  99. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
  100. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  101. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +0 -83
  102. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  103. package/lib/cjs/presentation-common/hierarchy/Key.js +6 -24
  104. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  105. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -107
  106. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  107. package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
  108. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  109. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  110. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  111. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
  112. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  113. package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
  114. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  115. package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
  116. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  117. package/lib/cjs/presentation-common/rules/Rule.d.ts +0 -14
  118. package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
  119. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  120. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  121. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  122. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  123. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  124. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  125. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  126. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  127. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  128. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  129. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  130. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  131. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  132. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  133. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  134. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  135. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  136. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  137. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  138. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  139. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  140. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  141. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  142. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  143. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  144. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
  145. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  146. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  147. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  148. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  149. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  150. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  151. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  152. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  153. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  154. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  155. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  156. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  157. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  158. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  159. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  160. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  161. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  162. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +3 -0
  163. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  164. package/lib/cjs/presentation-common/selection/SelectionScope.js +1 -0
  165. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  166. package/lib/cjs/presentation-common.d.ts +1 -5
  167. package/lib/cjs/presentation-common.d.ts.map +1 -1
  168. package/lib/cjs/presentation-common.js +6 -5
  169. package/lib/cjs/presentation-common.js.map +1 -1
  170. package/lib/esm/presentation-common/AsyncTasks.d.ts +4 -4
  171. package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
  172. package/lib/esm/presentation-common/AsyncTasks.js +5 -6
  173. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  174. package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
  175. package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
  176. package/lib/esm/presentation-common/EC.d.ts +36 -80
  177. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  178. package/lib/esm/presentation-common/EC.js +0 -96
  179. package/lib/esm/presentation-common/EC.js.map +1 -1
  180. package/lib/esm/presentation-common/ElementProperties.js +16 -9
  181. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  182. package/lib/esm/presentation-common/Error.d.ts +2 -0
  183. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  184. package/lib/esm/presentation-common/Error.js +2 -0
  185. package/lib/esm/presentation-common/Error.js.map +1 -1
  186. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  187. package/lib/esm/presentation-common/KeySet.d.ts +2 -2
  188. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  189. package/lib/esm/presentation-common/KeySet.js +9 -11
  190. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  191. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +5 -2
  192. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  193. package/lib/esm/presentation-common/LabelDefinition.d.ts +0 -48
  194. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  195. package/lib/esm/presentation-common/LabelDefinition.js +0 -43
  196. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  197. package/lib/esm/presentation-common/LocalizationHelper.js +1 -0
  198. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  199. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  200. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +31 -10
  201. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  202. package/lib/esm/presentation-common/PresentationManagerOptions.js +0 -4
  203. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  204. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +9 -9
  205. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  206. package/lib/esm/presentation-common/PresentationRpcInterface.js +38 -22
  207. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  208. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +3 -2
  209. package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  210. package/lib/esm/presentation-common/RegisteredRuleset.js +9 -1
  211. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  212. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +9 -12
  213. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  214. package/lib/esm/presentation-common/RpcRequestsHandler.js +39 -32
  215. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  216. package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
  217. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  218. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  219. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  220. package/lib/esm/presentation-common/Update.d.ts +2 -79
  221. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  222. package/lib/esm/presentation-common/Update.js +0 -103
  223. package/lib/esm/presentation-common/Update.js.map +1 -1
  224. package/lib/esm/presentation-common/Utils.d.ts +21 -0
  225. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  226. package/lib/esm/presentation-common/Utils.js +54 -0
  227. package/lib/esm/presentation-common/Utils.js.map +1 -1
  228. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  229. package/lib/esm/presentation-common/content/Content.d.ts +0 -7
  230. package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
  231. package/lib/esm/presentation-common/content/Content.js +5 -10
  232. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  233. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +1 -1
  234. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  235. package/lib/esm/presentation-common/content/ContentTraverser.js +117 -29
  236. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  237. package/lib/esm/presentation-common/content/Descriptor.d.ts +2 -31
  238. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  239. package/lib/esm/presentation-common/content/Descriptor.js +68 -22
  240. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  241. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  242. package/lib/esm/presentation-common/content/Editor.js.map +1 -1
  243. package/lib/esm/presentation-common/content/Fields.d.ts +151 -27
  244. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  245. package/lib/esm/presentation-common/content/Fields.js +264 -140
  246. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  247. package/lib/esm/presentation-common/content/Item.d.ts +26 -31
  248. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  249. package/lib/esm/presentation-common/content/Item.js +52 -67
  250. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  251. package/lib/esm/presentation-common/content/Property.d.ts +2 -12
  252. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  253. package/lib/esm/presentation-common/content/Property.js +0 -18
  254. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  255. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +3 -0
  256. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  257. package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
  258. package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
  259. package/lib/esm/presentation-common/content/Value.d.ts +5 -107
  260. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  261. package/lib/esm/presentation-common/content/Value.js +0 -214
  262. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  263. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  264. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  265. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
  266. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  267. package/lib/esm/presentation-common/hierarchy/Key.d.ts +0 -83
  268. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  269. package/lib/esm/presentation-common/hierarchy/Key.js +6 -24
  270. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  271. package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -107
  272. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  273. package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
  274. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  275. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  276. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  277. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
  278. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  279. package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
  280. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  281. package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
  282. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  283. package/lib/esm/presentation-common/rules/Rule.d.ts +0 -14
  284. package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
  285. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  286. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  287. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  288. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  289. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  290. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  291. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  292. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  293. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  294. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  295. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  296. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  297. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  298. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  299. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  300. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  301. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  302. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  303. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  304. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  305. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  306. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  307. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  308. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  309. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  310. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
  311. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  312. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  313. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  314. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  315. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  316. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  317. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  318. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  319. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  320. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  321. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  322. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  323. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  324. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  325. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  326. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  327. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  328. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +3 -0
  329. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  330. package/lib/esm/presentation-common/selection/SelectionScope.js +1 -0
  331. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  332. package/lib/esm/presentation-common.d.ts +1 -5
  333. package/lib/esm/presentation-common.d.ts.map +1 -1
  334. package/lib/esm/presentation-common.js +1 -5
  335. package/lib/esm/presentation-common.js.map +1 -1
  336. package/lib/public/locales/en/Presentation.json +19 -19
  337. package/package.json +12 -12
  338. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  339. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  340. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
  341. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  342. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  343. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  344. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
  345. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  346. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  347. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  348. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
  349. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  350. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  351. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  352. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
  353. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
  354. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  355. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  356. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
  357. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  358. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  359. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  360. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
  361. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  362. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  363. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  364. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
  365. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  366. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  367. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  368. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
  369. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationRpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAuK7C;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,YAAY;IAOxD;;;iGAG6F;IAE7F,4HAA4H;IACrH,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAAoC;QACrF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,4HAA4H;IAC5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AC3B,MAAsB,EACtB,QAA6E,EAC7E,IAAmB,EACnB,QAAiB;QAEjB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;;AAzID,2CAA2C;AACpB,sCAAa,GAAG,0BAA0B,CAAC;AAElE,6CAA6C;AAC/B,yCAAgB,GAAG,OAAO,CAAC;AAwI3C,gBAAgB;AAChB,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,yDAAgC,CAAA;AAClC,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC","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 { Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps, RpcInterface } from \"@itwin/core-common\";\r\nimport { DescriptorJSON, DescriptorOverrides, SelectClassInfoJSON } from \"./content/Descriptor\";\r\nimport { ItemJSON } from \"./content/Item\";\r\nimport { DisplayValueGroupJSON } from \"./content/Value\";\r\nimport { ClientDiagnostics, ClientDiagnosticsOptions } from \"./Diagnostics\";\r\nimport { CompressedClassInfoJSON, InstanceKey } from \"./EC\";\r\nimport { ElementProperties } from \"./ElementProperties\";\r\nimport { 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 SelectionScopeRequestOptions,\r\n SingleElementPropertiesRequestOptions,\r\n} from \"./PresentationManagerOptions\";\r\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\r\nimport { SelectionScope } from \"./selection/SelectionScope\";\r\nimport { Omit, PagedResponse } from \"./Utils\";\r\n\r\n/**\r\n * Base options for all presentation RPC requests.\r\n * @public\r\n */\r\nexport type PresentationRpcRequestOptions<TManagerRequestOptions> = Omit<TManagerRequestOptions, \"imodel\" | \"diagnostics\"> & {\r\n /** @internal ID of the client requesting data */\r\n clientId?: string;\r\n /** RPC request diagnostics options. */\r\n diagnostics?: RpcDiagnosticsOptions;\r\n};\r\n\r\n/**\r\n * Data structure for presentation RPC responses\r\n * @public\r\n */\r\nexport interface PresentationRpcResponseData<TResult = undefined> {\r\n /** Response status code */\r\n statusCode: PresentationStatus;\r\n /** In case of an error response, the error message */\r\n errorMessage?: string;\r\n /** In case of a success response, the result */\r\n result?: TResult;\r\n /** Diagnostics response. */\r\n diagnostics?: ClientDiagnostics;\r\n}\r\n\r\n/**\r\n * Data structure for RPC diagnostics options.\r\n * @public\r\n */\r\nexport type RpcDiagnosticsOptions = Omit<ClientDiagnosticsOptions, \"handler\">;\r\n\r\n/**\r\n * A promise of [[PresentationRpcResponseData]].\r\n * @public\r\n */\r\nexport type PresentationRpcResponse<TResult = undefined> = Promise<PresentationRpcResponseData<TResult>>;\r\n\r\n/**\r\n * Data structure for hierarchy request options.\r\n * @public\r\n */\r\nexport type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;\r\n\r\n/**\r\n * Data structure for hierarchy level descriptor RPC request options.\r\n * @public\r\n */\r\nexport type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<\r\n HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>\r\n>;\r\n\r\n/**\r\n * Data structure for filtering hierarchy by ECInstance paths request options.\r\n * @public\r\n */\r\nexport type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<\r\n FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>\r\n>;\r\n\r\n/**\r\n * Data structure for filtering hierarchy by text request options.\r\n * @public\r\n */\r\nexport type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;\r\n\r\n/**\r\n * Data structure for content sources RPC request options.\r\n * @public\r\n */\r\nexport type ContentSourcesRpcRequestOptions = PresentationRpcRequestOptions<ContentSourcesRequestOptions<never>>;\r\n/**\r\n * Data structure for content sources RPC response.\r\n * @public\r\n */\r\nexport interface ContentSourcesRpcResult {\r\n /** A list of objects containing content source information. */\r\n sources: SelectClassInfoJSON<Id64String>[];\r\n /** An `ECClassId` => [[CompressedClassInfoJSON]] map for deserializing [[sources]]. */\r\n classesMap: { [id: string]: CompressedClassInfoJSON };\r\n}\r\n\r\n/**\r\n * Data structure for content descriptor RPC request options.\r\n * @public\r\n */\r\nexport type ContentDescriptorRpcRequestOptions = PresentationRpcRequestOptions<ContentDescriptorRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\r\n\r\n/**\r\n * Data structure for content RPC request options.\r\n * @public\r\n */\r\nexport type ContentRpcRequestOptions = PresentationRpcRequestOptions<ContentRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\r\n\r\n/**\r\n * Data structure for single element properties RPC request options.\r\n * @public\r\n */\r\nexport type SingleElementPropertiesRpcRequestOptions = PresentationRpcRequestOptions<\r\n Omit<SingleElementPropertiesRequestOptions<never, never>, \"contentParser\">\r\n>;\r\n\r\n/**\r\n * Data structure for distinct values' request options.\r\n * @public\r\n */\r\nexport type DistinctValuesRpcRequestOptions = PresentationRpcRequestOptions<\r\n DistinctValuesRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>\r\n>;\r\n\r\n/**\r\n * Data structure for content instance keys' request options.\r\n * @public\r\n */\r\nexport type ContentInstanceKeysRpcRequestOptions = PresentationRpcRequestOptions<ContentInstanceKeysRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\r\n\r\n/**\r\n * Data structure for label request options.\r\n * @public\r\n */\r\nexport type DisplayLabelRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelRequestOptions<never, InstanceKey>>;\r\n\r\n/**\r\n * Data structure for labels request options.\r\n * @public\r\n */\r\nexport type DisplayLabelsRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelsRequestOptions<never, InstanceKey>>;\r\n\r\n/**\r\n * Data structure for selection scope request options.\r\n * @public\r\n */\r\nexport type SelectionScopeRpcRequestOptions = PresentationRpcRequestOptions<SelectionScopeRequestOptions<never>>;\r\n\r\n/**\r\n * Request options data structure for computing selection based on given selection scope and element IDs.\r\n * @public\r\n */\r\nexport type ComputeSelectionRpcRequestOptions = PresentationRpcRequestOptions<ComputeSelectionRequestOptions<never>>;\r\n\r\n/**\r\n * Interface used for communication between Presentation backend and frontend.\r\n * @public\r\n */\r\nexport class PresentationRpcInterface extends RpcInterface {\r\n /** The immutable name of the interface. */\r\n public static readonly interfaceName = \"PresentationRpcInterface\";\r\n\r\n /** The semantic version of the interface. */\r\n public static interfaceVersion = \"4.1.0\";\r\n\r\n /*===========================================================================================\r\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\r\n NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.\r\n ===========================================================================================*/\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getNodesCount(_token: IModelRpcProps, _options: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public async getPagedNodes(_token: IModelRpcProps, _options: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<NodeJSON>> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getNodesDescriptor(\r\n _token: IModelRpcProps,\r\n _options: HierarchyLevelDescriptorRpcRequestOptions,\r\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n // TODO: add paged version of this (#387280)\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public async getNodePaths(_token: IModelRpcProps, _options: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n // TODO: add paged version of this (#387280)\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public async getFilteredNodePaths(_token: IModelRpcProps, _options: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElementJSON[]> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getContentSources(_token: IModelRpcProps, _options: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getContentDescriptor(_token: IModelRpcProps, _options: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined> {\r\n arguments[1] = { ...arguments[1], transport: \"unparsed-json\" };\r\n const response: PresentationRpcResponseData<DescriptorJSON | string | undefined> = await this.forward(arguments);\r\n if (response.statusCode === PresentationStatus.Success && typeof response.result === \"string\") {\r\n response.result = JSON.parse(response.result);\r\n }\r\n return response as PresentationRpcResponseData<DescriptorJSON | undefined>;\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getContentSetSize(_token: IModelRpcProps, _options: ContentRpcRequestOptions): PresentationRpcResponse<number> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getPagedContent(\r\n _token: IModelRpcProps,\r\n _options: Paged<ContentRpcRequestOptions>,\r\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getPagedContentSet(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getElementProperties(\r\n _token: IModelRpcProps,\r\n _options: SingleElementPropertiesRpcRequestOptions,\r\n ): PresentationRpcResponse<ElementProperties | undefined> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getPagedDistinctValues(\r\n _token: IModelRpcProps,\r\n _options: DistinctValuesRpcRequestOptions,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroupJSON>> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getContentInstanceKeys(\r\n _token: IModelRpcProps,\r\n _options: ContentInstanceKeysRpcRequestOptions,\r\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getDisplayLabelDefinition(_token: IModelRpcProps, _options: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getPagedDisplayLabelDefinitions(\r\n _token: IModelRpcProps,\r\n _options: DisplayLabelsRpcRequestOptions,\r\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async getSelectionScopes(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @deprecated in 3.x. Use the override with [[ComputeSelectionRpcRequestOptions]]. */\r\n public async computeSelection(\r\n _token: IModelRpcProps,\r\n _options: SelectionScopeRpcRequestOptions,\r\n _ids: Id64String[],\r\n _scopeId: string,\r\n ): PresentationRpcResponse<KeySetJSON>;\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON>;\r\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\r\n public async computeSelection(\r\n _token: IModelRpcProps,\r\n _options: ComputeSelectionRpcRequestOptions | SelectionScopeRpcRequestOptions,\r\n _ids?: Id64String[],\r\n _scopeId?: string,\r\n ): PresentationRpcResponse<KeySetJSON> {\r\n return this.forward(arguments);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum PresentationIpcEvents {\r\n /**\r\n * ID of an event that's emitted when backend detects changes in presented data.\r\n */\r\n Update = \"presentation.onUpdate\",\r\n}\r\n"]}
1
+ {"version":3,"file":"PresentationRpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;AAGH,OAAO,EAAkB,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAwB7C,OAAO,EAAE,2BAA2B,EAAuB,MAAM,SAAS,CAAC;AAkJ3E;;;GAGG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,YAAY;IACxD,2CAA2C;IACpC,MAAM,CAAU,aAAa,GAAG,0BAA0B,CAAC;IAElE,6CAA6C;IACtC,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAEzC;;;iGAG6F;IAE7F,4HAA4H;IACrH,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAAoC;QACrF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,4HAA4H;IACrH,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAA2C;QAC5F,OAAO,2BAA2B,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,4HAA4H;IACrH,KAAK,CAAC,kBAAkB,CAC7B,MAAsB,EACtB,QAAmD;QAEnD,OAAO,2BAA2B,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,4HAA4H;IAC5H,4CAA4C;IACrC,KAAK,CAAC,YAAY,CAAC,MAAsB,EAAE,QAAyD;QACzG,OAAO,2BAA2B,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS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,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,4HAA4H;IAC5H,4DAA4D;IACrD,KAAK,CAAC,gBAAgB,CAAC,MAAsB,EAAE,QAA2C;QAC/F,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;;AAhIU,wBAAwB;IADpC,YAAY,CAAC,gBAAgB,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;GAC7C,wBAAwB,CAiIpC;;AAED,gBAAgB;AAChB,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,yDAAgC,CAAA;AAClC,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcInterface, RpcOperation } from \"@itwin/core-common\";\nimport { DescriptorJSON, DescriptorOverrides, SelectClassInfoJSON } from \"./content/Descriptor\";\nimport { ItemJSON } from \"./content/Item\";\nimport { ClientDiagnostics, ClientDiagnosticsOptions } from \"./Diagnostics\";\nimport { CompressedClassInfoJSON, InstanceKey } from \"./EC\";\nimport { ElementProperties } from \"./ElementProperties\";\nimport { PresentationStatus } from \"./Error\";\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { Node } from \"./hierarchy/Node\";\nimport { KeySetJSON } from \"./KeySet\";\nimport { LabelDefinition } from \"./LabelDefinition\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions\";\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\nimport { SelectionScope } from \"./selection/SelectionScope\";\nimport { deepReplaceNullsToUndefined, Omit, PagedResponse } from \"./Utils\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement\";\nimport { DisplayValueGroup } from \"./content/Value\";\n\n/**\n * Base options for all presentation RPC requests.\n * @public\n */\nexport type PresentationRpcRequestOptions<TManagerRequestOptions> = Omit<TManagerRequestOptions, \"imodel\" | \"diagnostics\"> & {\n /** @internal ID of the client requesting data */\n clientId?: string;\n /** RPC request diagnostics options. */\n diagnostics?: RpcDiagnosticsOptions;\n};\n\n/**\n * Data structure for presentation RPC responses\n * @public\n */\nexport interface PresentationRpcResponseData<TResult = undefined> {\n /** Response status code */\n statusCode: PresentationStatus;\n /** In case of an error response, the error message */\n errorMessage?: string;\n /** In case of a success response, the result */\n result?: TResult;\n /** Diagnostics response. */\n diagnostics?: ClientDiagnostics;\n}\n\n/**\n * Data structure for RPC diagnostics options.\n * @public\n */\nexport type RpcDiagnosticsOptions = Omit<ClientDiagnosticsOptions, \"handler\">;\n\n/**\n * A promise of [[PresentationRpcResponseData]].\n * @public\n */\nexport type PresentationRpcResponse<TResult = undefined> = Promise<PresentationRpcResponseData<TResult>>;\n\n/**\n * Data structure for hierarchy request options.\n * @public\n */\nexport type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;\n\n/**\n * Data structure for hierarchy level descriptor RPC request options.\n * @public\n */\nexport type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<\n HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by ECInstance paths request options.\n * @public\n */\nexport type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<\n FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by text request options.\n * @public\n */\nexport type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;\n\n/**\n * Data structure for content sources RPC request options.\n * @public\n */\nexport type ContentSourcesRpcRequestOptions = PresentationRpcRequestOptions<ContentSourcesRequestOptions<never>>;\n/**\n * Data structure for content sources RPC response.\n * @public\n */\nexport interface ContentSourcesRpcResult {\n /** A list of objects containing content source information. */\n sources: SelectClassInfoJSON<Id64String>[];\n /** An `ECClassId` => [[CompressedClassInfoJSON]] map for deserializing [[sources]]. */\n classesMap: { [id: string]: CompressedClassInfoJSON };\n}\n\n/**\n * Data structure for content descriptor RPC request options.\n * @public\n */\nexport type ContentDescriptorRpcRequestOptions = PresentationRpcRequestOptions<ContentDescriptorRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for content RPC request options.\n * @public\n */\nexport type ContentRpcRequestOptions = PresentationRpcRequestOptions<ContentRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for single element properties RPC request options.\n * @public\n */\nexport type SingleElementPropertiesRpcRequestOptions = PresentationRpcRequestOptions<\n Omit<SingleElementPropertiesRequestOptions<never, never>, \"contentParser\">\n>;\n\n/**\n * Data structure for distinct values' request options.\n * @public\n */\nexport type DistinctValuesRpcRequestOptions = PresentationRpcRequestOptions<\n DistinctValuesRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for content instance keys' request options.\n * @public\n */\nexport type ContentInstanceKeysRpcRequestOptions = PresentationRpcRequestOptions<ContentInstanceKeysRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for label request options.\n * @public\n */\nexport type DisplayLabelRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for labels request options.\n * @public\n */\nexport type DisplayLabelsRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelsRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for selection scope request options.\n * @public\n * @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type SelectionScopeRpcRequestOptions = PresentationRpcRequestOptions<SelectionScopeRequestOptions<never>>;\n\n/**\n * Request options data structure for computing selection based on given selection scope and element IDs.\n * @public\n * @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type ComputeSelectionRpcRequestOptions = PresentationRpcRequestOptions<ComputeSelectionRequestOptions<never>>;\n\n/**\n * Interface used for communication between Presentation backend and frontend.\n * @public\n */\n@RpcOperation.setDefaultPolicy({ retryInterval: () => 0 })\nexport class PresentationRpcInterface extends RpcInterface {\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"PresentationRpcInterface\";\n\n /** The semantic version of the interface. */\n public static interfaceVersion = \"5.0.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.\n ===========================================================================================*/\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getNodesCount(_token: IModelRpcProps, _options: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedNodes(_token: IModelRpcProps, _options: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<Node>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getNodesDescriptor(\n _token: IModelRpcProps,\n _options: HierarchyLevelDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // TODO: add paged version of this (#387280)\n public async getNodePaths(_token: IModelRpcProps, _options: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // TODO: add paged version of this (#387280)\n public async getFilteredNodePaths(_token: IModelRpcProps, _options: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentSources(_token: IModelRpcProps, _options: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentDescriptor(_token: IModelRpcProps, _options: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined> {\n arguments[1] = { ...arguments[1], transport: \"unparsed-json\" };\n const response: PresentationRpcResponseData<DescriptorJSON | string | undefined> = await this.forward(arguments);\n if (response.statusCode === PresentationStatus.Success && typeof response.result === \"string\") {\n response.result = JSON.parse(response.result);\n }\n return response as PresentationRpcResponseData<DescriptorJSON | undefined>;\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentSetSize(_token: IModelRpcProps, _options: ContentRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedContent(\n _token: IModelRpcProps,\n _options: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\n const rpcResponse = await this.forward(arguments);\n return {\n ...rpcResponse,\n ...(rpcResponse.result\n ? /* istanbul ignore next */ { result: { ...rpcResponse.result, contentSet: deepReplaceNullsToUndefined(rpcResponse.result.contentSet) } }\n : {}),\n };\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedContentSet(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getElementProperties(\n _token: IModelRpcProps,\n _options: SingleElementPropertiesRpcRequestOptions,\n ): PresentationRpcResponse<ElementProperties | undefined> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedDistinctValues(\n _token: IModelRpcProps,\n _options: DistinctValuesRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroup>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentInstanceKeys(\n _token: IModelRpcProps,\n _options: ContentInstanceKeysRpcRequestOptions,\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getDisplayLabelDefinition(_token: IModelRpcProps, _options: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedDisplayLabelDefinitions(\n _token: IModelRpcProps,\n _options: DisplayLabelsRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async getSelectionScopes(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON> {\n return this.forward(arguments);\n }\n}\n\n/** @internal */\nexport enum PresentationIpcEvents {\n /**\n * ID of an event that's emitted when backend detects changes in presented data.\n */\n Update = \"presentation.onUpdate\",\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  /** @packageDocumentation
2
2
  * @module Core
3
3
  */
4
- import { IDisposable } from "@itwin/core-bentley";
5
4
  import { Rule } from "./rules/Rule";
6
5
  import { Ruleset, SupplementationInfo } from "./rules/Ruleset";
7
6
  import { VariablesGroup } from "./rules/Variables";
@@ -9,13 +8,15 @@ import { VariablesGroup } from "./rules/Variables";
9
8
  * A ruleset that is registered in a ruleset manager.
10
9
  * @public
11
10
  */
12
- export declare class RegisteredRuleset implements IDisposable, Ruleset {
11
+ export declare class RegisteredRuleset implements Disposable, Ruleset {
13
12
  private _ruleset;
14
13
  private _uniqueIdentifier;
15
14
  private _disposeFunc;
16
15
  /** Create a registered ruleset */
17
16
  constructor(ruleset: Ruleset, uniqueIdentifier: string, disposeFunc: (ruleset: RegisteredRuleset) => void);
18
17
  /** Dispose registered ruleset. */
18
+ [Symbol.dispose](): void;
19
+ /** @deprecated in 5.0 Use [Symbol.dispose] instead. */
19
20
  dispose(): void;
20
21
  get uniqueIdentifier(): string;
21
22
  get id(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"RegisteredRuleset.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,WAAW,EAAE,OAAO;IAC5D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,YAAY,CAAuC;IAE3D,kCAAkC;gBACf,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI;IAMhH,kCAAkC;IAC3B,OAAO;IAId,IAAW,gBAAgB,WAE1B;IACD,IAAW,EAAE,IAAI,MAAM,CAEtB;IACD,IAAW,mBAAmB,IAAI,mBAAmB,GAAG,SAAS,CAEhE;IACD,IAAW,KAAK,IAAI,IAAI,EAAE,CAEzB;IACD,IAAW,IAAI,IAAI,cAAc,EAAE,GAAG,SAAS,CAE9C;IACM,MAAM,IAAI,OAAO;CAGzB"}
1
+ {"version":3,"file":"RegisteredRuleset.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,UAAU,EAAE,OAAO;IAC3D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,YAAY,CAAuC;IAE3D,kCAAkC;gBACf,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI;IAMhH,kCAAkC;IAC3B,CAAC,MAAM,CAAC,OAAO,CAAC;IAIvB,uDAAuD;IAEhD,OAAO;IAId,IAAW,gBAAgB,WAE1B;IACD,IAAW,EAAE,IAAI,MAAM,CAEtB;IACD,IAAW,mBAAmB,IAAI,mBAAmB,GAAG,SAAS,CAEhE;IACD,IAAW,KAAK,IAAI,IAAI,EAAE,CAEzB;IACD,IAAW,IAAI,IAAI,cAAc,EAAE,GAAG,SAAS,CAE9C;IACM,MAAM,IAAI,OAAO;CAGzB"}
@@ -10,6 +10,9 @@
10
10
  * @public
11
11
  */
12
12
  export class RegisteredRuleset {
13
+ _ruleset;
14
+ _uniqueIdentifier;
15
+ _disposeFunc;
13
16
  /** Create a registered ruleset */
14
17
  constructor(ruleset, uniqueIdentifier, disposeFunc) {
15
18
  this._disposeFunc = disposeFunc;
@@ -17,9 +20,14 @@ export class RegisteredRuleset {
17
20
  this._uniqueIdentifier = uniqueIdentifier;
18
21
  }
19
22
  /** Dispose registered ruleset. */
20
- dispose() {
23
+ [Symbol.dispose]() {
21
24
  this._disposeFunc(this);
22
25
  }
26
+ /** @deprecated in 5.0 Use [Symbol.dispose] instead. */
27
+ // istanbul ignore next
28
+ dispose() {
29
+ this[Symbol.dispose]();
30
+ }
23
31
  get uniqueIdentifier() {
24
32
  return this._uniqueIdentifier;
25
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RegisteredRuleset.js","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAOH;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAK5B,kCAAkC;IAClC,YAAmB,OAAgB,EAAE,gBAAwB,EAAE,WAAiD;QAC9G,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,kCAAkC;IAC3B,OAAO;QACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IACD,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1B,CAAC;IACD,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC3C,CAAC;IACD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IACM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF","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 { IDisposable } from \"@itwin/core-bentley\";\r\nimport { Rule } from \"./rules/Rule\";\r\nimport { Ruleset, SupplementationInfo } from \"./rules/Ruleset\";\r\nimport { VariablesGroup } from \"./rules/Variables\";\r\n\r\n/**\r\n * A ruleset that is registered in a ruleset manager.\r\n * @public\r\n */\r\nexport class RegisteredRuleset implements IDisposable, Ruleset {\r\n private _ruleset: Ruleset;\r\n private _uniqueIdentifier: string;\r\n private _disposeFunc: (ruleset: RegisteredRuleset) => void;\r\n\r\n /** Create a registered ruleset */\r\n public constructor(ruleset: Ruleset, uniqueIdentifier: string, disposeFunc: (ruleset: RegisteredRuleset) => void) {\r\n this._disposeFunc = disposeFunc;\r\n this._ruleset = ruleset;\r\n this._uniqueIdentifier = uniqueIdentifier;\r\n }\r\n\r\n /** Dispose registered ruleset. */\r\n public dispose() {\r\n this._disposeFunc(this);\r\n }\r\n\r\n public get uniqueIdentifier() {\r\n return this._uniqueIdentifier;\r\n }\r\n public get id(): string {\r\n return this._ruleset.id;\r\n }\r\n public get supplementationInfo(): SupplementationInfo | undefined {\r\n return this._ruleset.supplementationInfo;\r\n }\r\n public get rules(): Rule[] {\r\n return this._ruleset.rules;\r\n }\r\n public get vars(): VariablesGroup[] | undefined {\r\n return this._ruleset.vars;\r\n }\r\n public toJSON(): Ruleset {\r\n return this._ruleset;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RegisteredRuleset.js","sourceRoot":"","sources":["../../../src/presentation-common/RegisteredRuleset.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IACpB,QAAQ,CAAU;IAClB,iBAAiB,CAAS;IAC1B,YAAY,CAAuC;IAE3D,kCAAkC;IAClC,YAAmB,OAAgB,EAAE,gBAAwB,EAAE,WAAiD;QAC9G,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,kCAAkC;IAC3B,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,uDAAuD;IACvD,uBAAuB;IAChB,OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,CAAC;IAED,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IACD,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1B,CAAC;IACD,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC3C,CAAC;IACD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IACM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { Rule } from \"./rules/Rule\";\nimport { Ruleset, SupplementationInfo } from \"./rules/Ruleset\";\nimport { VariablesGroup } from \"./rules/Variables\";\n\n/**\n * A ruleset that is registered in a ruleset manager.\n * @public\n */\nexport class RegisteredRuleset implements Disposable, Ruleset {\n private _ruleset: Ruleset;\n private _uniqueIdentifier: string;\n private _disposeFunc: (ruleset: RegisteredRuleset) => void;\n\n /** Create a registered ruleset */\n public constructor(ruleset: Ruleset, uniqueIdentifier: string, disposeFunc: (ruleset: RegisteredRuleset) => void) {\n this._disposeFunc = disposeFunc;\n this._ruleset = ruleset;\n this._uniqueIdentifier = uniqueIdentifier;\n }\n\n /** Dispose registered ruleset. */\n public [Symbol.dispose]() {\n this._disposeFunc(this);\n }\n\n /** @deprecated in 5.0 Use [Symbol.dispose] instead. */\n // istanbul ignore next\n public dispose() {\n this[Symbol.dispose]();\n }\n\n public get uniqueIdentifier() {\n return this._uniqueIdentifier;\n }\n public get id(): string {\n return this._ruleset.id;\n }\n public get supplementationInfo(): SupplementationInfo | undefined {\n return this._ruleset.supplementationInfo;\n }\n public get rules(): Rule[] {\n return this._ruleset.rules;\n }\n public get vars(): VariablesGroup[] | undefined {\n return this._ruleset.vars;\n }\n public toJSON(): Ruleset {\n return this._ruleset;\n }\n}\n"]}
@@ -4,12 +4,10 @@
4
4
  import { IModelRpcProps } from "@itwin/core-common";
5
5
  import { DescriptorJSON, DescriptorOverrides } from "./content/Descriptor";
6
6
  import { ItemJSON } from "./content/Item";
7
- import { DisplayValueGroupJSON } from "./content/Value";
8
7
  import { ClientDiagnosticsAttribute } from "./Diagnostics";
9
8
  import { InstanceKey } from "./EC";
10
9
  import { NodeKey } from "./hierarchy/Key";
11
- import { NodeJSON } from "./hierarchy/Node";
12
- import { NodePathElementJSON } from "./hierarchy/NodePathElement";
10
+ import { Node } from "./hierarchy/Node";
13
11
  import { KeySetJSON } from "./KeySet";
14
12
  import { LabelDefinition } from "./LabelDefinition";
15
13
  import { ComputeSelectionRequestOptions, ContentDescriptorRequestOptions, ContentInstanceKeysRequestOptions, ContentRequestOptions, ContentSourcesRequestOptions, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DistinctValuesRequestOptions, FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions, Paged, RequestOptions, SelectionScopeRequestOptions } from "./PresentationManagerOptions";
@@ -17,6 +15,8 @@ import { ContentSourcesRpcResult, PresentationRpcRequestOptions, PresentationRpc
17
15
  import { RulesetVariableJSON } from "./RulesetVariables";
18
16
  import { SelectionScope } from "./selection/SelectionScope";
19
17
  import { PagedResponse } from "./Utils";
18
+ import { NodePathElement } from "./hierarchy/NodePathElement";
19
+ import { DisplayValueGroup } from "./content/Value";
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,OA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,CAAC;IAM7H,sBAAsB,CACjC,OAAO,EAAE,4BAA4B,CAAC,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,CAAC,GAAG,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"}
@@ -5,11 +5,12 @@
5
5
  /** @packageDocumentation
6
6
  * @module RPC
7
7
  */
8
- import { BeDuration, BeTimePoint, Guid, Logger } from "@itwin/core-bentley";
9
- import { RpcManager } from "@itwin/core-common";
8
+ import { Guid, Logger } from "@itwin/core-bentley";
9
+ import { RpcManager, RpcRequest } from "@itwin/core-common";
10
10
  import { PresentationCommonLoggerCategory } from "./CommonLoggerCategory";
11
11
  import { PresentationError, PresentationStatus } from "./Error";
12
12
  import { PresentationRpcInterface } from "./PresentationRpcInterface";
13
+ import { createCancellableTimeoutPromise } from "./Utils";
13
14
  /**
14
15
  * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing
15
16
  * a timeout error.
@@ -23,6 +24,10 @@ const DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes
23
24
  * @internal
24
25
  */
25
26
  export class RpcRequestsHandler {
27
+ /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */
28
+ timeout;
29
+ /** ID that identifies this handler as a client */
30
+ clientId;
26
31
  constructor(props) {
27
32
  this.clientId = props?.clientId ?? Guid.createValue();
28
33
  this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;
@@ -32,34 +37,37 @@ export class RpcRequestsHandler {
32
37
  return RpcManager.getClientForInterface(PresentationRpcInterface);
33
38
  }
34
39
  async requestWithTimeout(func, diagnosticsHandler) {
35
- const start = BeTimePoint.now();
36
- const timeout = BeDuration.fromMilliseconds(this.timeout);
37
- let diagnostics;
38
- while (start.plus(timeout).isInFuture) {
39
- try {
40
- const response = await func();
41
- diagnostics = response.diagnostics;
42
- switch (response.statusCode) {
43
- case PresentationStatus.Success:
44
- return response.result;
45
- case PresentationStatus.BackendTimeout:
46
- break;
47
- default:
48
- throw new PresentationError(response.statusCode, response.errorMessage);
40
+ const rpcResponsePromise = func();
41
+ const rpcRequest = RpcRequest.current(this.rpcClient);
42
+ const timeout = createCancellableTimeoutPromise(this.timeout);
43
+ return Promise.race([
44
+ (async () => {
45
+ let diagnostics;
46
+ try {
47
+ const response = await rpcResponsePromise;
48
+ diagnostics = response.diagnostics;
49
+ switch (response.statusCode) {
50
+ case PresentationStatus.Success:
51
+ return response.result;
52
+ default:
53
+ throw new PresentationError(response.statusCode, response.errorMessage);
54
+ }
49
55
  }
50
- }
51
- finally {
52
- diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
53
- }
54
- }
55
- throw new PresentationError(PresentationStatus.BackendTimeout);
56
+ finally {
57
+ diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
58
+ }
59
+ })(),
60
+ timeout.promise.then(() => {
61
+ throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);
62
+ }),
63
+ ]).finally(() => {
64
+ rpcRequest?.cancel();
65
+ timeout.cancel();
66
+ });
56
67
  }
57
68
  /**
58
- * Send the request to backend.
59
- *
60
- * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get
61
- * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]
62
- * is thrown with the details from the response.
69
+ * Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by
70
+ * then, we'll throw an error.
63
71
  */
64
72
  async request(func, options, ...additionalOptions) {
65
73
  const { imodel, diagnostics, ...optionsNoIModel } = options;
@@ -75,7 +83,8 @@ export class RpcRequestsHandler {
75
83
  rpcOptions.diagnostics = diagnosticsOptions;
76
84
  }
77
85
  const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);
78
- return this.requestWithTimeout(doRequest, diagnosticsHandler);
86
+ const result = await this.requestWithTimeout(doRequest, diagnosticsHandler);
87
+ return result;
79
88
  }
80
89
  async getNodesCount(options) {
81
90
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -138,14 +147,12 @@ export class RpcRequestsHandler {
138
147
  // eslint-disable-next-line @typescript-eslint/no-deprecated
139
148
  return this.request(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);
140
149
  }
150
+ /* eslint-disable @typescript-eslint/no-deprecated */
141
151
  async getSelectionScopes(options) {
142
- // eslint-disable-next-line @typescript-eslint/no-deprecated
143
152
  return this.request(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);
144
153
  }
145
154
  async computeSelection(options) {
146
- return this.request(
147
- // eslint-disable-next-line @typescript-eslint/no-deprecated
148
- this.rpcClient.computeSelection.bind(this.rpcClient), options);
155
+ return this.request(this.rpcClient.computeSelection.bind(this.rpcClient), options);
149
156
  }
150
157
  }
151
158
  function isOptionsWithRuleset(options) {
@@ -1 +1 @@
1
- {"version":3,"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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,MAAM,CAAC,UAAU,CACf,gCAAgC,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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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;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,MAAM,CAAC,UAAU,CACf,gCAAgC,CAAC,OAAO,EACxC,qDAAqD,WAAW,2DAA2D,CAC5H,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { Guid, Logger } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcManager, RpcRequest } from \"@itwin/core-common\";\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory\";\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor\";\nimport { ItemJSON } from \"./content/Item\";\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics\";\nimport { InstanceKey } from \"./EC\";\nimport { PresentationError, PresentationStatus } from \"./Error\";\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { Node } from \"./hierarchy/Node\";\nimport { KeySetJSON } from \"./KeySet\";\nimport { LabelDefinition } from \"./LabelDefinition\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n RequestOptions,\n RequestOptionsWithRuleset,\n SelectionScopeRequestOptions,\n} from \"./PresentationManagerOptions\";\nimport { ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse } from \"./PresentationRpcInterface\";\nimport { Ruleset } from \"./rules/Ruleset\";\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\nimport { SelectionScope } from \"./selection/SelectionScope\";\nimport { createCancellableTimeoutPromise, PagedResponse } from \"./Utils\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement\";\nimport { DisplayValueGroup } from \"./content/Value\";\n\n/**\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n */\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\n\n/**\n * Configuration parameters for [[RpcRequestsHandler]].\n *\n * @internal\n */\nexport interface RpcRequestsHandlerProps {\n /**\n * Optional ID used to identify client that requests data. If not specified,\n * the handler creates a unique GUID as a client id.\n * @internal\n */\n clientId?: string;\n\n /** @internal */\n timeout?: number;\n}\n\n/**\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\n * adds handling for cases when backend needs to be synced with client\n * state.\n *\n * @internal\n */\nexport class RpcRequestsHandler {\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\n public readonly timeout: number;\n\n /** ID that identifies this handler as a client */\n public readonly clientId: string;\n\n public constructor(props?: RpcRequestsHandlerProps) {\n this.clientId = props?.clientId ?? Guid.createValue();\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get rpcClient(): PresentationRpcInterface {\n return RpcManager.getClientForInterface(PresentationRpcInterface);\n }\n\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\n const rpcResponsePromise = func();\n const rpcRequest: RpcRequest | undefined = RpcRequest.current(this.rpcClient);\n const timeout = createCancellableTimeoutPromise(this.timeout);\n return Promise.race([\n (async () => {\n let diagnostics: ClientDiagnostics | undefined;\n try {\n const response = await rpcResponsePromise;\n diagnostics = response.diagnostics;\n switch (response.statusCode) {\n case PresentationStatus.Success:\n return response.result!;\n default:\n throw new PresentationError(response.statusCode, response.errorMessage);\n }\n } finally {\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\n }\n })(),\n timeout.promise.then(() => {\n throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);\n }),\n ]).finally(() => {\n rpcRequest?.cancel();\n timeout.cancel();\n });\n }\n\n /**\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\n * then, we'll throw an error.\n */\n public async request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\n options: TOptions,\n ...additionalOptions: TArg[]\n ): Promise<TResult> {\n const { imodel, diagnostics, ...optionsNoIModel } = options;\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\n if (isOptionsWithRuleset(optionsNoIModel)) {\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\n }\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\n ...optionsNoIModel,\n clientId: this.clientId,\n };\n if (diagnostics) {\n rpcOptions.diagnostics = diagnosticsOptions;\n }\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\n const result = await this.requestWithTimeout(doRequest, diagnosticsHandler);\n return result;\n }\n\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<number, typeof options>(this.rpcClient.getNodesCount.bind(this.rpcClient), options);\n }\n\n public async getPagedNodes(\n options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<Node>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<Node>, typeof options>(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\n }\n\n public async getNodesDescriptor(\n options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\n if (typeof response === \"string\") {\n return JSON.parse(response);\n }\n return response;\n }\n\n public async getNodePaths(\n options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getNodePaths.bind(this.rpcClient), options);\n }\n\n public async getFilteredNodePaths(\n options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\n }\n\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<ContentSourcesRpcResult, typeof options>(this.rpcClient.getContentSources.bind(this.rpcClient), options);\n }\n public async getContentDescriptor(\n options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<DescriptorJSON | undefined, typeof options>(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\n }\n public async getContentSetSize(\n options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<number> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<number, typeof options>(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\n }\n public async getPagedContent(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n return this.request<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.rpcClient.getPagedContent.bind(this.rpcClient),\n options,\n );\n }\n public async getPagedContentSet(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<ItemJSON>, typeof options>(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\n }\n\n public async getPagedDistinctValues(\n options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<DisplayValueGroup>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<DisplayValueGroup>, typeof options>(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\n }\n\n public async getContentInstanceKeys(\n options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<{ total: number; items: KeySetJSON }> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<{ total: number; items: KeySetJSON }, typeof options>(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\n }\n\n public async getDisplayLabelDefinition(\n options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<LabelDefinition, typeof options>(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\n }\n public async getPagedDisplayLabelDefinitions(\n options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<LabelDefinition>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<LabelDefinition>, typeof options>(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\n return this.request<SelectionScope[], typeof options>(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\n }\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\n return this.request<KeySetJSON, typeof options>(this.rpcClient.computeSelection.bind(this.rpcClient), options);\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n\nfunction isOptionsWithRuleset(options: object): options is { rulesetOrId: Ruleset } {\n return typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\";\n}\n\ntype RulesetWithRequiredProperties = {\n [key in keyof Ruleset]-?: true;\n};\n\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\n id: true,\n rules: true,\n version: true,\n requiredSchemas: true,\n supplementationInfo: true,\n vars: true,\n};\n\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\n const cleanedUpRuleset: Ruleset = { ...ruleset };\n\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\n if (propertyKey === \"$schema\") {\n delete (cleanedUpRuleset as any)[propertyKey];\n } else {\n Logger.logWarning(\n PresentationCommonLoggerCategory.Package,\n `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`,\n );\n }\n }\n }\n\n return cleanedUpRuleset;\n}\n"]}
@@ -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;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AC;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,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,oBAAoB;IACpB,GAAG,QAAQ;IAEX,8BAA8B;IAC9B,QAAQ,UAAU;IAElB,oBAAoB;IACpB,IAAI,SAAS;IAEb,mBAAmB;IACnB,MAAM,WAAW;IAEjB,uBAAuB;IACvB,IAAI,SAAS;IAEb,iCAAiC;IACjC,SAAS,WAAW;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,UAAU,EAAE,CAAC;AAE7F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC;AAErH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,aAAa,CAAC;CACtB;AACD;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,I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AAC,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,iBAAiB,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,KAAf,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\n"]}
1
+ {"version":3,"file":"RulesetVariables.js","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAc,MAAM,qBAAqB,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAN,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,KAAlB,kBAAkB,QAkB7B;AAiHD,cAAc;AACd,2DAA2D;AAC3D,MAAM,KAAW,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,iBAAiB,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,iBAAiB,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,KAAf,eAAe,QAsB/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\n\n/**\n * Possible variable value types\n * @public\n */\nexport enum VariableValueTypes {\n /** Integer value */\n Int = \"int\",\n\n /** Array of integer values */\n IntArray = \"int[]\",\n\n /** Boolean value */\n Bool = \"bool\",\n\n /** String value */\n String = \"string\",\n\n /** Id64String value */\n Id64 = \"id64\",\n\n /** Array of Id64String values */\n Id64Array = \"id64[]\",\n}\n\n/**\n * Union of all supported variable value types\n * @public\n */\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\n\n/**\n * JSON representation of [[VariableValue]]\n * @public\n */\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\n\n/**\n * Base data structure for representing ruleset variables.\n * @public\n */\nexport interface RulesetVariableBase {\n id: string;\n type: VariableValueTypes;\n value: VariableValue;\n}\n/**\n * Data structure for representing boolean ruleset variables.\n * @public\n */\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * Data structure for representing string ruleset variables.\n * @public\n */\nexport interface StringRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * Data structure for representing int ruleset variables.\n * @public\n */\nexport interface IntRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * Data structure for representing int array ruleset variables.\n * @public\n */\nexport interface IntsRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * Data structure for representing ID ruleset variables.\n * @public\n */\nexport interface Id64RulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * Data structure for representing ID array ruleset variables.\n * @public\n */\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64Array;\n value: Id64String[];\n}\n/**\n * Data structure for representing ruleset variables.\n * @public\n */\nexport type RulesetVariable =\n | BooleanRulesetVariable\n | StringRulesetVariable\n | IntRulesetVariable\n | IntsRulesetVariable\n | Id64RulesetVariable\n | Id64sRulesetVariable;\n\n/**\n * JSON representation of [[RulesetVariableBase]].\n * @public\n */\nexport interface RulesetVariableBaseJSON {\n id: string;\n type: VariableValueTypes;\n value: VariableValueJSON;\n}\n/**\n * JSON representation of [[Id64sRulesetVariable]].\n * @public\n */\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64Array;\n value: Id64String[] | CompressedId64Set;\n}\n/**\n * JSON representation of [[RulesetVariable]].\n * @public\n */\n\nexport type RulesetVariableJSON =\n | BooleanRulesetVariable\n | StringRulesetVariable\n | IntRulesetVariable\n | IntsRulesetVariable\n | Id64RulesetVariable\n | Id64sRulesetVariableJSON;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RulesetVariable {\n /**\n * Serialize given RulesetVariable to JSON.\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\n */\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\n if (variable.type === VariableValueTypes.Id64Array) {\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\n }\n return variable;\n }\n\n /** Deserialize [[RulesetVariable]] from JSON. */\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\n if (json.type === VariableValueTypes.Id64Array) {\n if (typeof json.value === \"string\") {\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\n }\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\n }\n return json;\n }\n}\n"]}