@itwin/presentation-hierarchies 2.0.0-alpha.16 → 2.0.0-alpha.18

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 (421) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/README.md +4 -6
  3. package/lib/hierarchies/HierarchyErrors.d.ts.map +1 -0
  4. package/lib/hierarchies/HierarchyErrors.js.map +1 -0
  5. package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
  6. package/lib/{esm/hierarchies → hierarchies}/HierarchyMerge.js +1 -1
  7. package/lib/hierarchies/HierarchyMerge.js.map +1 -0
  8. package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
  9. package/lib/hierarchies/HierarchyNode.js.map +1 -0
  10. package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
  11. package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
  12. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +4 -4
  13. package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
  14. package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +8 -8
  15. package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
  16. package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
  17. package/lib/hierarchies/HierarchyProvider.js.map +1 -0
  18. package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
  19. package/lib/hierarchies/HierarchySearch.js.map +1 -0
  20. package/lib/hierarchies/Logging.d.ts.map +1 -0
  21. package/lib/hierarchies/Logging.js.map +1 -0
  22. package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
  23. package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
  24. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +3 -3
  25. package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
  26. package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
  27. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +2 -2
  28. package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
  29. package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
  30. package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.d.ts +2 -4
  31. package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
  32. package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyProvider.js +15 -12
  33. package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
  34. package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
  35. package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
  36. package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +10 -6
  37. package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
  38. package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +80 -43
  39. package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
  40. package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +4 -4
  41. package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
  42. package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +1 -1
  43. package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
  44. package/lib/{cjs/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.d.ts +2 -2
  45. package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
  46. package/lib/{esm/hierarchies → hierarchies}/imodel/SearchHierarchyDefinition.js +3 -4
  47. package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
  48. package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +1 -1
  49. package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
  50. package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +2 -5
  51. package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
  52. package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
  53. package/lib/hierarchies/imodel/Utils.js.map +1 -0
  54. package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
  55. package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
  56. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.d.ts +2 -2
  57. package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
  58. package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
  59. package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
  60. package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
  61. package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
  62. package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
  63. package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
  64. package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
  65. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.d.ts +3 -3
  66. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
  67. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +9 -10
  68. package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
  69. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
  70. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +4 -6
  71. package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
  72. package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
  73. package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
  74. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
  75. package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
  76. package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +4 -4
  77. package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
  78. package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +38 -30
  79. package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
  80. package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
  81. package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
  82. package/lib/hierarchies/internal/Common.d.ts.map +1 -0
  83. package/lib/hierarchies/internal/Common.js.map +1 -0
  84. package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
  85. package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
  86. package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
  87. package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
  88. package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
  89. package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
  90. package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
  91. package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
  92. package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
  93. package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
  94. package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
  95. package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
  96. package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
  97. package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
  98. package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
  99. package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
  100. package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
  101. package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
  102. package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
  103. package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
  104. package/lib/presentation-hierarchies.d.ts.map +1 -0
  105. package/lib/{cjs/presentation-hierarchies.js.map → presentation-hierarchies.js.map} +1 -1
  106. package/package.json +19 -21
  107. package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
  108. package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
  109. package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
  110. package/lib/cjs/hierarchies/HierarchyMerge.d.ts.map +0 -1
  111. package/lib/cjs/hierarchies/HierarchyMerge.js +0 -43
  112. package/lib/cjs/hierarchies/HierarchyMerge.js.map +0 -1
  113. package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
  114. package/lib/cjs/hierarchies/HierarchyNode.js +0 -82
  115. package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
  116. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
  117. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -52
  118. package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
  119. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -162
  120. package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
  121. package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
  122. package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
  123. package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
  124. package/lib/cjs/hierarchies/HierarchyProvider.js +0 -64
  125. package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
  126. package/lib/cjs/hierarchies/HierarchySearch.d.ts.map +0 -1
  127. package/lib/cjs/hierarchies/HierarchySearch.js +0 -468
  128. package/lib/cjs/hierarchies/HierarchySearch.js.map +0 -1
  129. package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
  130. package/lib/cjs/hierarchies/Logging.js +0 -27
  131. package/lib/cjs/hierarchies/Logging.js.map +0 -1
  132. package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
  133. package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -81
  134. package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
  135. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -144
  136. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
  137. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
  138. package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
  139. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
  140. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
  141. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
  142. package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
  143. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
  144. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -657
  145. package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
  146. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  147. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -126
  148. package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
  149. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -231
  150. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
  151. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -629
  152. package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
  153. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
  154. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
  155. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -94
  156. package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
  157. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
  158. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js +0 -268
  159. package/lib/cjs/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
  160. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -35
  161. package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
  162. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -51
  163. package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
  164. package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
  165. package/lib/cjs/hierarchies/imodel/Utils.js +0 -73
  166. package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
  167. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
  168. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -40
  169. package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
  170. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +0 -26
  171. package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
  172. package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -176
  173. package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
  174. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
  175. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -75
  176. package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
  177. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
  178. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -84
  179. package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
  180. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
  181. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
  182. package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
  183. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  184. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -113
  185. package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
  186. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
  187. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -54
  188. package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
  189. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
  190. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -49
  191. package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
  192. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
  193. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -52
  194. package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
  195. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  196. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -310
  197. package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
  198. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
  199. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -31
  200. package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
  201. package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
  202. package/lib/cjs/hierarchies/internal/Common.js +0 -91
  203. package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
  204. package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
  205. package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
  206. package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
  207. package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
  208. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +0 -12
  209. package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
  210. package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -111
  211. package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
  212. package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
  213. package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
  214. package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
  215. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
  216. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -28
  217. package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
  218. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
  219. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -54
  220. package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
  221. package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
  222. package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
  223. package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
  224. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
  225. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
  226. package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
  227. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
  228. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
  229. package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
  230. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
  231. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
  232. package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
  233. package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
  234. package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
  235. package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
  236. package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
  237. package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
  238. package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
  239. package/lib/cjs/package.json +0 -1
  240. package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
  241. package/lib/cjs/presentation-hierarchies.js +0 -40
  242. package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
  243. package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
  244. package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
  245. package/lib/esm/hierarchies/HierarchyMerge.d.ts +0 -19
  246. package/lib/esm/hierarchies/HierarchyMerge.d.ts.map +0 -1
  247. package/lib/esm/hierarchies/HierarchyMerge.js.map +0 -1
  248. package/lib/esm/hierarchies/HierarchyNode.d.ts +0 -149
  249. package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
  250. package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
  251. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -31
  252. package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
  253. package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
  254. package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
  255. package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
  256. package/lib/esm/hierarchies/HierarchyProvider.d.ts +0 -134
  257. package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
  258. package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
  259. package/lib/esm/hierarchies/HierarchySearch.d.ts +0 -297
  260. package/lib/esm/hierarchies/HierarchySearch.d.ts.map +0 -1
  261. package/lib/esm/hierarchies/HierarchySearch.js.map +0 -1
  262. package/lib/esm/hierarchies/Logging.d.ts +0 -13
  263. package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
  264. package/lib/esm/hierarchies/Logging.js.map +0 -1
  265. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
  266. package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
  267. package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
  268. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
  269. package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
  270. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
  271. package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
  272. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -138
  273. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
  274. package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
  275. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
  276. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
  277. package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
  278. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
  279. package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
  280. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
  281. package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
  282. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts +0 -35
  283. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +0 -1
  284. package/lib/esm/hierarchies/imodel/SearchHierarchyDefinition.js.map +0 -1
  285. package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
  286. package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
  287. package/lib/esm/hierarchies/imodel/Utils.d.ts +0 -5
  288. package/lib/esm/hierarchies/imodel/Utils.d.ts.map +0 -1
  289. package/lib/esm/hierarchies/imodel/Utils.js.map +0 -1
  290. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +0 -11
  291. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
  292. package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
  293. package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
  294. package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
  295. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
  296. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
  297. package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
  298. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
  299. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
  300. package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
  301. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
  302. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
  303. package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
  304. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
  305. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
  306. package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
  307. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
  308. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
  309. package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
  310. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
  311. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
  312. package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
  313. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
  314. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
  315. package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
  316. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
  317. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
  318. package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
  319. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
  320. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
  321. package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
  322. package/lib/esm/hierarchies/internal/Common.d.ts +0 -61
  323. package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
  324. package/lib/esm/hierarchies/internal/Common.js.map +0 -1
  325. package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
  326. package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
  327. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
  328. package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
  329. package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -108
  330. package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
  331. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts +0 -12
  332. package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
  333. package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
  334. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -75
  335. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
  336. package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
  337. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
  338. package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
  339. package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
  340. package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -7
  341. package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
  342. package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
  343. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
  344. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
  345. package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
  346. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
  347. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
  348. package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
  349. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
  350. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
  351. package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
  352. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
  353. package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
  354. package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
  355. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts +0 -4
  356. package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
  357. package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
  358. package/lib/esm/presentation-hierarchies.d.ts +0 -24
  359. package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
  360. package/lib/esm/presentation-hierarchies.js.map +0 -1
  361. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
  362. /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
  363. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyMerge.d.ts +0 -0
  364. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNode.d.ts +0 -0
  365. /package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +0 -0
  366. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +0 -0
  367. /package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +0 -0
  368. /package/lib/{cjs/hierarchies → hierarchies}/HierarchyProvider.d.ts +0 -0
  369. /package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.js +0 -0
  370. /package/lib/{cjs/hierarchies → hierarchies}/HierarchySearch.d.ts +0 -0
  371. /package/lib/{esm/hierarchies → hierarchies}/HierarchySearch.js +0 -0
  372. /package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +0 -0
  373. /package/lib/{esm/hierarchies → hierarchies}/Logging.js +0 -0
  374. /package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +0 -0
  375. /package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +0 -0
  376. /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
  377. /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
  378. /package/lib/{cjs/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +0 -0
  379. /package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +0 -0
  380. /package/lib/{cjs/hierarchies → hierarchies}/imodel/Utils.d.ts +0 -0
  381. /package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +0 -0
  382. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +0 -0
  383. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +0 -0
  384. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +0 -0
  385. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +0 -0
  386. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +0 -0
  387. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +0 -0
  388. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +0 -0
  389. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +0 -0
  390. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
  391. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.d.ts +0 -0
  392. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +0 -0
  393. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +0 -0
  394. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.d.ts +0 -0
  395. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +0 -0
  396. /package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +0 -0
  397. /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +0 -0
  398. /package/lib/{cjs/hierarchies → hierarchies}/internal/Common.d.ts +0 -0
  399. /package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +0 -0
  400. /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
  401. /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
  402. /package/lib/{cjs/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +0 -0
  403. /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
  404. /package/lib/{cjs/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +0 -0
  405. /package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +0 -0
  406. /package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +0 -0
  407. /package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +0 -0
  408. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +0 -0
  409. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
  410. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +0 -0
  411. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
  412. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +0 -0
  413. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
  414. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +0 -0
  415. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
  416. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +0 -0
  417. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
  418. /package/lib/{cjs/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +0 -0
  419. /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
  420. /package/lib/{cjs/presentation-hierarchies.d.ts → presentation-hierarchies.d.ts} +0 -0
  421. /package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +0 -0
@@ -1,629 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.NodeSelectClauseColumnNames = void 0;
8
- exports.createNodesQueryClauseFactory = createNodesQueryClauseFactory;
9
- const core_bentley_1 = require("@itwin/core-bentley");
10
- const core_common_1 = require("@itwin/core-common");
11
- const presentation_shared_1 = require("@itwin/presentation-shared");
12
- /**
13
- * Column names of the SELECT clause created by `NodeSelectClauseFactory`. Order of the names matches the order of columns
14
- * created by the factory.
15
- *
16
- * @public
17
- */
18
- var NodeSelectClauseColumnNames;
19
- (function (NodeSelectClauseColumnNames) {
20
- /** Full class name of the instance the node represents. Type: `string` in format `{schema name}:{class name}`. */
21
- NodeSelectClauseColumnNames["FullClassName"] = "FullClassName";
22
- /** ECInstance ID of the instance the node represents. Type: `Id64String`. */
23
- NodeSelectClauseColumnNames["ECInstanceId"] = "ECInstanceId";
24
- /** Display label. Type: `string`. */
25
- NodeSelectClauseColumnNames["DisplayLabel"] = "DisplayLabel";
26
- /**
27
- * A flag indicating if the node has children. Type: `boolean`. Values:
28
- * - `false` - node never has children.
29
- * - `true` - node always has children.
30
- * - NULL - unknown, needs to be determined by requesting children for the node.
31
- */
32
- NodeSelectClauseColumnNames["HasChildren"] = "HasChildren";
33
- /** A flag indicating that a node should be hidden if it has no children. Type: `boolean`. */
34
- NodeSelectClauseColumnNames["HideIfNoChildren"] = "HideIfNoChildren";
35
- /** A flag indicating that a node should be hidden and its children should be displayed instead. Type: `boolean`. */
36
- NodeSelectClauseColumnNames["HideNodeInHierarchy"] = "HideNodeInHierarchy";
37
- /** A serialized JSON object for providing grouping information. */
38
- NodeSelectClauseColumnNames["Grouping"] = "Grouping";
39
- /** A serialized JSON object for associating a node with additional data. */
40
- NodeSelectClauseColumnNames["ExtendedData"] = "ExtendedData";
41
- /** A flag indicating the node should be auto-expanded when it's loaded. */
42
- NodeSelectClauseColumnNames["AutoExpand"] = "AutoExpand";
43
- /** A flag indicating the node supports child hierarchy level filtering. */
44
- NodeSelectClauseColumnNames["SupportsFiltering"] = "SupportsFiltering";
45
- })(NodeSelectClauseColumnNames || (exports.NodeSelectClauseColumnNames = NodeSelectClauseColumnNames = {}));
46
- /**
47
- * Creates an instance of `NodeSelectQueryFactory`.
48
- */
49
- function createNodesQueryClauseFactory(props) {
50
- return new NodeSelectQueryFactory(props);
51
- }
52
- /** A factory for creating a nodes' select ECSQL query. */
53
- class NodeSelectQueryFactory {
54
- _imodelAccess;
55
- _instanceLabelSelectClauseFactory;
56
- constructor(props) {
57
- this._imodelAccess = props.imodelAccess;
58
- this._instanceLabelSelectClauseFactory = props.instanceLabelSelectClauseFactory;
59
- }
60
- /** Create a SELECT clause in a format understood by results reader of the library. */
61
- async createSelectClause(props) {
62
- // note: the columns order must match the order in `NodeSelectClauseColumnNames`
63
- return `
64
- ec_ClassName(${props.ecClassId.selector}) AS ${NodeSelectClauseColumnNames.FullClassName},
65
- ${props.ecInstanceId.selector} AS ${NodeSelectClauseColumnNames.ECInstanceId},
66
- ${createECSqlValueSelector(typeof props.nodeLabel === "object" && "of" in props.nodeLabel
67
- ? { selector: await this._instanceLabelSelectClauseFactory.createSelectClause(props.nodeLabel.of) }
68
- : props.nodeLabel)} AS ${NodeSelectClauseColumnNames.DisplayLabel},
69
- CAST(${createECSqlValueSelector(props.hasChildren)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.HasChildren},
70
- CAST(${createECSqlValueSelector(props.hideIfNoChildren)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.HideIfNoChildren},
71
- CAST(${createECSqlValueSelector(props.hideNodeInHierarchy)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.HideNodeInHierarchy},
72
- ${props.grouping ? await createGroupingSelector(props.grouping, this._imodelAccess, this._instanceLabelSelectClauseFactory) : "CAST(NULL AS TEXT)"} AS ${NodeSelectClauseColumnNames.Grouping},
73
- ${props.extendedData
74
- ? `json_object(${Object.entries(props.extendedData)
75
- .map(([key, value]) => `'${key}', ${createECSqlValueSelector(value)}`)
76
- .join(", ")})`
77
- : "CAST(NULL AS TEXT)"} AS ${NodeSelectClauseColumnNames.ExtendedData},
78
- CAST(${createECSqlValueSelector(props.autoExpand)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.AutoExpand},
79
- CAST(${createECSqlValueSelector(props.supportsFiltering)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.SupportsFiltering}
80
- `;
81
- }
82
- /**
83
- * Creates the necessary ECSQL snippets to create an instance filter described by the `filter` argument.
84
- * - `from` is set to either the `contentClass.fullName` or one of `filter.propertyClassNames`, depending on which is more specific.
85
- * - `joins` is set to a number of `JOIN` clauses required to join all relationships described by `filter.relatedInstances`.
86
- * - `where` is set to a `WHERE` clause (without the `WHERE` keyword) that filters instances by classes on
87
- * `filter.filterClassNames` and by properties as described by `filter.rules`.
88
- *
89
- * Special cases:
90
- * - If `filter` is `undefined`, `joins` and `where` are set to empty strings and `from` is set to `contentClass.fullName`.
91
- * - If the provided content class doesn't intersect with the property class in provided filter OR referenced schema items (classes/properties)
92
- * don't exist in the iModel, a special result is returned to make sure the resulting query is valid and doesn't return anything.
93
- */
94
- async createFilterClauses(props) {
95
- const { contentClass, filter } = props;
96
- const { from, joins, where } = filter
97
- ? await createInstanceFilterClauses({ imodelAccess: this._imodelAccess, contentClass, filter })
98
- : { from: contentClass.fullName, joins: [], where: [] };
99
- const fromClass = await (0, presentation_shared_1.getClass)(this._imodelAccess, (0, presentation_shared_1.normalizeFullClassName)(from));
100
- const hiddenClasses = await getHiddenClassesTree(fromClass);
101
- const hiddenClassesWhereClause = createWhereClauseForHiddenClasses(hiddenClasses, contentClass.alias);
102
- hiddenClassesWhereClause.hideClause && where.push(hiddenClassesWhereClause.hideClause);
103
- (0, core_bentley_1.assert)(!hiddenClassesWhereClause.showClause, "`showClause` is expected to always be empty here");
104
- return { from, joins: joins.join("\n"), where: where.join(" AND ") };
105
- }
106
- }
107
- /**
108
- * Creates the necessary ECSQL snippets to create an instance filter described by the `filter` argument.
109
- * - `from` is set to either the `contentClass.fullName` or one of `filter.propertyClassNames`, depending on which is more specific.
110
- * - `joins` is set to a number of `JOIN` clauses required to join all relationships described by `filter.relatedInstances`.
111
- * - `where` is set to a `WHERE` clause (without the `WHERE` keyword) that filters instances by classes on
112
- * `filter.filterClassNames` and by properties as described by `filter.rules`.
113
- *
114
- * Special cases:
115
- * - If `filter` is `undefined`, `joins` and `where` are set to empty strings and `from` is set to `contentClass.fullName`.
116
- * - If the provided content class doesn't intersect with the property class in provided filter, a special result
117
- * is returned to make sure the resulting query is valid and doesn't return anything.
118
- */
119
- async function createInstanceFilterClauses(props) {
120
- const { imodelAccess, contentClass, filter } = props;
121
- // In some cases the given filter means we want the query to return nothing - e.g. when filtering by classes that don't intersect
122
- // with the given content class. Return a special result that makes sure the resulting query is valid, but returns no rows.
123
- const DISABLE_QUERY = { from: contentClass.fullName, joins: [], where: ["FALSE"] };
124
- const from = await specializeContentClass({
125
- classHierarchyInspector: {
126
- async classDerivesFrom(derivedClassName, baseClassName) {
127
- try {
128
- return await imodelAccess.classDerivesFrom(derivedClassName, baseClassName);
129
- }
130
- catch (e) {
131
- /* v8 ignore else -- @preserve */
132
- if (isSchemaOrClassNotFoundError(e)) {
133
- // either derived or base class doesn't exist in this iModel
134
- return false;
135
- }
136
- /* v8 ignore next -- @preserve */
137
- throw e;
138
- }
139
- },
140
- },
141
- contentClassName: contentClass.fullName,
142
- filterClassNames: filter.propertyClassNames.map(presentation_shared_1.normalizeFullClassName),
143
- });
144
- if (!from) {
145
- // filter class doesn't intersect with content class
146
- return DISABLE_QUERY;
147
- }
148
- let filteredClassNamesInThisIModel;
149
- if (filter.filteredClassNames && filter.filteredClassNames.length > 0) {
150
- filteredClassNamesInThisIModel = (await Promise.all(filter.filteredClassNames
151
- .map(presentation_shared_1.normalizeFullClassName)
152
- .map(async (fullClassName) => ({
153
- fullClassName,
154
- filteredClass: await tryGetClass(imodelAccess, fullClassName),
155
- }))))
156
- .filter(({ filteredClass }) => !!filteredClass)
157
- .map(({ fullClassName }) => fullClassName);
158
- if (filteredClassNamesInThisIModel.length === 0) {
159
- // we had filter classes, but none of them exist in this iModel
160
- return DISABLE_QUERY;
161
- }
162
- }
163
- let joins;
164
- try {
165
- joins = await Promise.all(filter.relatedInstances.map(async (rel, i) => {
166
- const res = await presentation_shared_1.ECSql.createRelationshipPathJoinClause({
167
- schemaProvider: imodelAccess,
168
- path: assignRelationshipPathAliases(rel.path, i, contentClass.alias, rel.alias),
169
- });
170
- (0, core_bentley_1.assert)(!res.bindings, "Expecting no bindings as the relationship path has no instance filter.");
171
- return res.joins;
172
- }));
173
- }
174
- catch (e) {
175
- /* v8 ignore else -- @preserve */
176
- if (isSchemaOrClassNotFoundError(e)) {
177
- // at least one related instance spec uses a class that doesn't exist in this iModel
178
- return DISABLE_QUERY;
179
- }
180
- /* v8 ignore next -- @preserve */
181
- throw e;
182
- }
183
- const classAliasMap = new Map([[contentClass.alias, from]]);
184
- filter.relatedInstances.forEach(({ path, alias }) => path.length > 0 && classAliasMap.set(alias, (0, presentation_shared_1.normalizeFullClassName)(path[path.length - 1].targetClassName)));
185
- let propertiesFilter;
186
- try {
187
- propertiesFilter = await createWhereClause(contentClass.alias, async (alias) => {
188
- const aliasClassName = classAliasMap.get(alias);
189
- return aliasClassName ? (0, presentation_shared_1.getClass)(imodelAccess, aliasClassName) : undefined;
190
- }, filter.rules);
191
- }
192
- catch (e) {
193
- // note: don't need to worry about schemas & classes here, because that's taken care of above, when
194
- // validating property class names & related instance defs
195
- /* v8 ignore else -- @preserve */
196
- if (isPropertyNotFoundError(e)) {
197
- // filter uses a property that doesn't exist in this iModel
198
- return DISABLE_QUERY;
199
- }
200
- /* v8 ignore next -- @preserve */
201
- throw e;
202
- }
203
- const where = new Array();
204
- if (filteredClassNamesInThisIModel) {
205
- where.push(`${presentation_shared_1.ECSql.createRawPropertyValueSelector(contentClass.alias, "ECClassId")} IS (
206
- ${filteredClassNamesInThisIModel
207
- .map(presentation_shared_1.parseFullClassName)
208
- .map(({ schemaName, className }) => `[${schemaName}].[${className}]`)
209
- .join(", ")}
210
- )`);
211
- }
212
- if (propertiesFilter) {
213
- where.push(propertiesFilter);
214
- }
215
- return { from, joins, where };
216
- }
217
- function createECSqlValueSelector(input) {
218
- if (input === undefined) {
219
- return "NULL";
220
- }
221
- if (isSelector(input)) {
222
- return input.selector;
223
- }
224
- return presentation_shared_1.ECSql.createRawPrimitiveValueSelector(input);
225
- }
226
- function isSelector(x) {
227
- return !!x.selector;
228
- }
229
- async function createGroupingSelector(grouping, imodelAccess, instanceLabelSelectClauseFactory) {
230
- const groupingSelectors = new Array();
231
- grouping.byLabel &&
232
- groupingSelectors.push({
233
- key: "byLabel",
234
- selector: typeof grouping.byLabel === "boolean" || isSelector(grouping.byLabel)
235
- ? createECSqlValueSelector(grouping.byLabel)
236
- : serializeJsonObject(createLabelGroupingBaseParamsSelectors(grouping.byLabel)),
237
- });
238
- grouping.byClass &&
239
- groupingSelectors.push({
240
- key: "byClass",
241
- selector: typeof grouping.byClass === "boolean" || isSelector(grouping.byClass)
242
- ? createECSqlValueSelector(grouping.byClass)
243
- : serializeJsonObject(createBaseGroupingParamSelectors(grouping.byClass)),
244
- });
245
- grouping.byBaseClasses &&
246
- groupingSelectors.push({
247
- key: "byBaseClasses",
248
- selector: serializeJsonObject([
249
- {
250
- key: "fullClassNames",
251
- selector: `json_array(${grouping.byBaseClasses.fullClassNames.map((className) => createECSqlValueSelector(className)).join(", ")})`,
252
- },
253
- ...createBaseGroupingParamSelectors(grouping.byBaseClasses),
254
- ]),
255
- });
256
- // TODO: MISSING_COVERAGE
257
- /* v8 ignore else -- @preserve */
258
- if (grouping.byProperties) {
259
- const propertyClass = await (0, presentation_shared_1.getClass)(imodelAccess, grouping.byProperties.propertiesClassName);
260
- groupingSelectors.push({
261
- key: "byProperties",
262
- selector: serializeJsonObject([
263
- {
264
- key: "propertiesClassName",
265
- selector: `${createECSqlValueSelector(grouping.byProperties.propertiesClassName)}`,
266
- },
267
- {
268
- key: "propertyGroups",
269
- selector: `json_array(${(await Promise.all(grouping.byProperties.propertyGroups.map(async (propertyGroup) => serializeJsonObject(await createPropertyGroupSelectors(propertyGroup, propertyClass, instanceLabelSelectClauseFactory))))).join(", ")})`,
270
- },
271
- ...(grouping.byProperties.createGroupForOutOfRangeValues !== undefined
272
- ? [
273
- {
274
- key: "createGroupForOutOfRangeValues",
275
- selector: `CAST(${createECSqlValueSelector(grouping.byProperties.createGroupForOutOfRangeValues)} AS BOOLEAN)`,
276
- },
277
- ]
278
- : []),
279
- ...(grouping.byProperties.createGroupForUnspecifiedValues !== undefined
280
- ? [
281
- {
282
- key: "createGroupForUnspecifiedValues",
283
- selector: `CAST(${createECSqlValueSelector(grouping.byProperties.createGroupForUnspecifiedValues)} AS BOOLEAN)`,
284
- },
285
- ]
286
- : []),
287
- ...createBaseGroupingParamSelectors(grouping.byProperties),
288
- ]),
289
- });
290
- }
291
- return serializeJsonObject(groupingSelectors);
292
- }
293
- function createLabelGroupingBaseParamsSelectors(byLabel) {
294
- const selectors = new Array();
295
- if (byLabel.action !== undefined) {
296
- selectors.push({ key: "action", selector: `${createECSqlValueSelector(byLabel.action)}` });
297
- }
298
- if (byLabel.groupId !== undefined) {
299
- selectors.push({ key: "groupId", selector: createECSqlValueSelector(byLabel.groupId) });
300
- }
301
- if (byLabel.action !== "merge") {
302
- selectors.push(...createBaseGroupingParamSelectors(byLabel));
303
- }
304
- return selectors;
305
- }
306
- async function createPropertyGroupSelectors(propertyGroup, propertyClass, instanceLabelSelectClauseFactory) {
307
- const selectors = new Array();
308
- selectors.push({ key: "propertyName", selector: `${createECSqlValueSelector(propertyGroup.propertyName)}` });
309
- const property = await propertyClass.getProperty(propertyGroup.propertyName);
310
- if (!property) {
311
- throw new Error(`Property "${propertyGroup.propertyName}" not found in ECClass "${propertyClass.fullName}".`);
312
- }
313
- if (property.isNavigation()) {
314
- const relationshipClass = await property.relationshipClass;
315
- const abstractConstraint = property.direction === "Forward"
316
- ? await relationshipClass.target.abstractConstraint
317
- : await relationshipClass.source.abstractConstraint;
318
- // TODO: MISSING_COVERAGE
319
- /* v8 ignore else -- @preserve */
320
- if (!abstractConstraint) {
321
- throw new Error(`Could not determine class name for navigation property with direction "${property.direction}".`);
322
- }
323
- const fullName = abstractConstraint.fullName;
324
- const targetAlias = "target";
325
- selectors.push({
326
- key: "propertyValue",
327
- selector: `(
328
- SELECT ${await instanceLabelSelectClauseFactory.createSelectClause({ className: fullName, classAlias: targetAlias })}
329
- FROM ${fullName} AS ${targetAlias}
330
- WHERE [${targetAlias}].[ECInstanceId] = [${propertyGroup.propertyClassAlias}].[${propertyGroup.propertyName}].[Id]
331
- )`,
332
- });
333
- }
334
- else {
335
- selectors.push({
336
- key: "propertyValue",
337
- selector: `[${propertyGroup.propertyClassAlias}].[${propertyGroup.propertyName}]`,
338
- });
339
- }
340
- if (propertyGroup.ranges) {
341
- selectors.push(createRangeParamSelectors(propertyGroup.ranges));
342
- }
343
- return selectors;
344
- }
345
- function createRangeParamSelectors(ranges) {
346
- return {
347
- key: "ranges",
348
- selector: `json_array(${ranges
349
- .map((range) => serializeJsonObject([
350
- { key: "fromValue", selector: createECSqlValueSelector(range.fromValue) },
351
- { key: "toValue", selector: createECSqlValueSelector(range.toValue) },
352
- ...(range.rangeLabel
353
- ? [{ key: "rangeLabel", selector: `${createECSqlValueSelector(range.rangeLabel)}` }]
354
- : []),
355
- ]))
356
- .join(", ")})`,
357
- };
358
- }
359
- function createBaseGroupingParamSelectors(params) {
360
- const selectors = new Array();
361
- if (params.hideIfNoSiblings !== undefined) {
362
- selectors.push({ key: "hideIfNoSiblings", selector: createECSqlValueSelector(params.hideIfNoSiblings) });
363
- }
364
- if (params.hideIfOneGroupedNode !== undefined) {
365
- selectors.push({ key: "hideIfOneGroupedNode", selector: createECSqlValueSelector(params.hideIfOneGroupedNode) });
366
- }
367
- if (params.autoExpand !== undefined) {
368
- selectors.push({ key: "autoExpand", selector: createECSqlValueSelector(params.autoExpand) });
369
- }
370
- return selectors;
371
- }
372
- function serializeJsonObject(selectors) {
373
- return `json_object(${selectors.map(({ key, selector }) => `'${key}', ${selector}`).join(", ")})`;
374
- }
375
- async function createWhereClause(contentClassAlias, classLoader, rule) {
376
- if (core_common_1.GenericInstanceFilter.isFilterRuleGroup(rule)) {
377
- const clause = (await Promise.all(rule.rules.map(async (r) => createWhereClause(contentClassAlias, classLoader, r))))
378
- .filter((c) => !!c)
379
- .join(` ${getECSqlLogicalOperator(rule.operator)} `);
380
- return clause ? (rule.operator === "or" ? `(${clause})` : clause) : undefined;
381
- }
382
- const sourceAlias = rule.sourceAlias ? rule.sourceAlias : contentClassAlias;
383
- const propertyClass = await classLoader(sourceAlias);
384
- if (!propertyClass) {
385
- throw new Error(`Class with alias "${sourceAlias}" not found.`);
386
- }
387
- const property = await propertyClass.getProperty(rule.propertyName);
388
- if (!property) {
389
- throw new Error(`Property "${rule.propertyName}" not found in ECClass "${propertyClass.fullName}".`);
390
- }
391
- const propertyValueSelector = presentation_shared_1.ECSql.createRawPropertyValueSelector(sourceAlias, property.name);
392
- if (isUnaryRuleOperator(rule.operator)) {
393
- switch (rule.operator) {
394
- case "is-true":
395
- return propertyValueSelector;
396
- case "is-false":
397
- return `NOT ${propertyValueSelector}`;
398
- case "is-null":
399
- return `${propertyValueSelector} IS NULL`;
400
- case "is-not-null":
401
- return `${propertyValueSelector} IS NOT NULL`;
402
- }
403
- }
404
- const ecsqlOperator = getECSqlComparisonOperator(rule.operator);
405
- if (rule.value === undefined) {
406
- throw new Error(`Rule "${rule.propertyName}" ${ecsqlOperator} is missing value.`);
407
- }
408
- const value = rule.value.rawValue;
409
- if (rule.operator === "like" && typeof value === "string") {
410
- const escapedValue = value.replace(/[%_\\]/g, "\\$&");
411
- return `${propertyValueSelector} ${ecsqlOperator} '%${escapedValue}%' ESCAPE '\\'`;
412
- }
413
- if (property.isNavigation()) {
414
- (0, core_bentley_1.assert)(core_common_1.GenericInstanceFilterRuleValue.isInstanceKey(value));
415
- return `${propertyValueSelector}.[Id] ${ecsqlOperator} ${presentation_shared_1.ECSql.createRawPrimitiveValueSelector(value.id)}`;
416
- }
417
- if (property.isEnumeration()) {
418
- (0, core_bentley_1.assert)(!core_common_1.GenericInstanceFilterRuleValue.isInstanceKey(value));
419
- return `${propertyValueSelector} ${ecsqlOperator} ${presentation_shared_1.ECSql.createRawPrimitiveValueSelector(value)}`;
420
- }
421
- if (property.isPrimitive()) {
422
- (0, core_bentley_1.assert)(!core_common_1.GenericInstanceFilterRuleValue.isInstanceKey(value));
423
- switch (property.primitiveType) {
424
- case "Point2d": {
425
- (0, core_bentley_1.assert)(rule.operator === "is-equal" || rule.operator === "is-not-equal");
426
- (0, core_bentley_1.assert)(presentation_shared_1.PrimitiveValue.isPoint2d(value));
427
- const condition = `
428
- ${createFloatingPointEqualityClause(`${propertyValueSelector}.[x]`, "is-equal", value.x)}
429
- AND ${createFloatingPointEqualityClause(`${propertyValueSelector}.[y]`, "is-equal", value.y)}
430
- `;
431
- return rule.operator === "is-equal" ? condition : `NOT (${condition})`;
432
- }
433
- case "Point3d": {
434
- (0, core_bentley_1.assert)(rule.operator === "is-equal" || rule.operator === "is-not-equal");
435
- (0, core_bentley_1.assert)(presentation_shared_1.PrimitiveValue.isPoint3d(value));
436
- const condition = `
437
- ${createFloatingPointEqualityClause(`${propertyValueSelector}.[x]`, "is-equal", value.x)}
438
- AND ${createFloatingPointEqualityClause(`${propertyValueSelector}.[y]`, "is-equal", value.y)}
439
- AND ${createFloatingPointEqualityClause(`${propertyValueSelector}.[z]`, "is-equal", value.z)}
440
- `;
441
- return rule.operator === "is-equal" ? condition : `NOT (${condition})`;
442
- }
443
- case "Double": {
444
- (0, core_bentley_1.assert)(typeof value === "number");
445
- if (rule.operator === "is-equal" || rule.operator === "is-not-equal") {
446
- return `${createFloatingPointEqualityClause(propertyValueSelector, rule.operator, value)}`;
447
- }
448
- return `${propertyValueSelector} ${ecsqlOperator} ${presentation_shared_1.ECSql.createRawPrimitiveValueSelector(value)}`;
449
- }
450
- default: {
451
- return `${propertyValueSelector} ${ecsqlOperator} ${presentation_shared_1.ECSql.createRawPrimitiveValueSelector(value)}`;
452
- }
453
- }
454
- }
455
- throw new Error("Struct and array properties are not supported for filtering");
456
- }
457
- function createFloatingPointEqualityClause(valueSelector, operator, value) {
458
- const [from, to] = getFloatingPointValueRange(value);
459
- return `${valueSelector} ${operator === "is-not-equal" ? "NOT " : ""} BETWEEN ${from} AND ${to}`;
460
- }
461
- function getFloatingPointValueRange(value) {
462
- return [value - Number.EPSILON, value + Number.EPSILON];
463
- }
464
- function getECSqlLogicalOperator(op) {
465
- switch (op) {
466
- case "and":
467
- return "AND";
468
- case "or":
469
- return "OR";
470
- }
471
- }
472
- function isUnaryRuleOperator(op) {
473
- return op === "is-true" || op === "is-false" || op === "is-null" || op === "is-not-null";
474
- }
475
- function getECSqlComparisonOperator(op) {
476
- switch (op) {
477
- case "is-equal":
478
- return `=`;
479
- case "is-not-equal":
480
- return `<>`;
481
- case "greater":
482
- return `>`;
483
- case "greater-or-equal":
484
- return `>=`;
485
- case "less":
486
- return `<`;
487
- case "less-or-equal":
488
- return `<=`;
489
- case "like":
490
- return `LIKE`;
491
- }
492
- }
493
- function assignRelationshipPathAliases(path, pathIndex, sourceAlias, targetAlias) {
494
- function createAlias(fullClassName, index) {
495
- return `rel_${pathIndex}_${fullClassName.replaceAll(/[\.:]/g, "_")}_${index}`;
496
- }
497
- const result = [];
498
- path.forEach((step, i) => {
499
- const sourceClassName = (0, presentation_shared_1.normalizeFullClassName)(step.sourceClassName);
500
- const targetClassName = (0, presentation_shared_1.normalizeFullClassName)(step.targetClassName);
501
- const relationshipName = (0, presentation_shared_1.normalizeFullClassName)(step.relationshipClassName);
502
- result.push({
503
- targetClassName,
504
- relationshipName,
505
- sourceClassName,
506
- relationshipReverse: !step.isForwardRelationship,
507
- sourceAlias: i === 0 ? sourceAlias : result[i - 1].targetAlias,
508
- relationshipAlias: createAlias(relationshipName, i),
509
- targetAlias: i === path.length - 1 ? targetAlias : createAlias(targetClassName, i),
510
- joinType: "inner",
511
- });
512
- });
513
- return result;
514
- }
515
- async function specializeContentClass(props) {
516
- const filterClass = await getSpecializedPropertyClass(props.classHierarchyInspector, props.filterClassNames);
517
- if (!filterClass) {
518
- return props.contentClassName;
519
- }
520
- if (await props.classHierarchyInspector.classDerivesFrom(filterClass, props.contentClassName)) {
521
- return filterClass;
522
- }
523
- if (await props.classHierarchyInspector.classDerivesFrom(props.contentClassName, filterClass)) {
524
- return props.contentClassName;
525
- }
526
- return undefined;
527
- }
528
- async function getSpecializedPropertyClass(classHierarchyInspector, classes) {
529
- if (classes.length === 0) {
530
- return undefined;
531
- }
532
- const [currClassName, ...restClasses] = classes;
533
- let resolvedClassName = currClassName;
534
- for (const propClassName of restClasses) {
535
- if (await classHierarchyInspector.classDerivesFrom(propClassName, resolvedClassName)) {
536
- resolvedClassName = propClassName;
537
- }
538
- }
539
- return resolvedClassName;
540
- }
541
- async function getHiddenClassesTree(selectClass, selectClassAttribute = "show") {
542
- const derivedClasses = await getDirectDerivedClasses(selectClass);
543
- const derivedClassSchemas = derivedClasses.reduce((acc, ecClass) => {
544
- /* v8 ignore else -- @preserve */
545
- if (!acc.set.has(ecClass.schema.name)) {
546
- acc.schemas.push(ecClass.schema);
547
- acc.set.add(ecClass.schema.name);
548
- }
549
- return acc;
550
- }, { set: new Set(), schemas: new Array() }).schemas;
551
- const hiddenSchemas = new Map();
552
- await Promise.all(derivedClassSchemas.map(async (ecSchema) => {
553
- hiddenSchemas.set(ecSchema.name, await getHiddenSchemaAttribute(ecSchema));
554
- }));
555
- const tree = (await Promise.all(derivedClasses.map(async (ecClass) => {
556
- const hiddenClassAttr = await getHiddenClassAttribute(ecClass);
557
- const attr = hiddenClassAttr ?? hiddenSchemas.get(ecClass.schema.name);
558
- if (!attr || attr === selectClassAttribute) {
559
- return getHiddenClassesTree(ecClass, selectClassAttribute);
560
- }
561
- return [{ fullName: ecClass.fullName, state: attr, children: await getHiddenClassesTree(ecClass, attr) }];
562
- }))).flat();
563
- return tree;
564
- }
565
- async function getDirectDerivedClasses(ecClass) {
566
- const allDerived = await ecClass.getDerivedClasses();
567
- return (await Promise.all(allDerived.map(async (c) => ({ derived: c, base: await c.baseClass }))))
568
- .filter(({ base }) => base && (0, presentation_shared_1.compareFullClassNames)(base.fullName, ecClass.fullName) === 0)
569
- .map(({ derived }) => derived);
570
- }
571
- async function getHiddenClassAttribute(ecClass) {
572
- const customAttributes = await ecClass.getCustomAttributes();
573
- const hiddenClassAttribute = customAttributes.get("CoreCustomAttributes.HiddenClass");
574
- return hiddenClassAttribute ? (hiddenClassAttribute.Show ? "show" : "hide") : undefined;
575
- }
576
- async function getHiddenSchemaAttribute(ecSchema) {
577
- const customAttributes = await ecSchema.getCustomAttributes();
578
- const hiddenSchemaAttribute = customAttributes.get("CoreCustomAttributes.HiddenSchema");
579
- return hiddenSchemaAttribute ? (hiddenSchemaAttribute.ShowClasses ? "show" : "hide") : undefined;
580
- }
581
- function createWhereClauseForHiddenClasses(hiddenClasses, selectAlias) {
582
- const res = {};
583
- const show = hiddenClasses.filter(({ state }) => state === "show");
584
- if (show.length > 0) {
585
- let showClause = `[${selectAlias}].[ECClassId] IS (${show
586
- .map(({ fullName }) => (0, presentation_shared_1.parseFullClassName)(fullName))
587
- .map(({ schemaName, className }) => `[${schemaName}].[${className}]`)
588
- .join(", ")})`;
589
- const childClauses = createWhereClauseForHiddenClasses(show.flatMap(({ children }) => children), selectAlias);
590
- if (childClauses.hideClause) {
591
- showClause = `(${showClause} AND ${childClauses.hideClause})`;
592
- }
593
- res.showClause = showClause;
594
- }
595
- const hide = hiddenClasses.filter(({ state }) => state === "hide");
596
- if (hide.length > 0) {
597
- let hideClause = `[${selectAlias}].[ECClassId] IS NOT (${hide
598
- .map(({ fullName }) => (0, presentation_shared_1.parseFullClassName)(fullName))
599
- .map(({ schemaName, className }) => `[${schemaName}].[${className}]`)
600
- .join(", ")})`;
601
- const childClauses = createWhereClauseForHiddenClasses(hide.flatMap(({ children }) => children), selectAlias);
602
- if (childClauses.showClause) {
603
- hideClause = `(${hideClause} OR ${childClauses.showClause})`;
604
- }
605
- res.hideClause = hideClause;
606
- }
607
- return res;
608
- }
609
- async function tryGetClass(schemaProvider, fullClassName) {
610
- try {
611
- return await (0, presentation_shared_1.getClass)(schemaProvider, fullClassName);
612
- }
613
- catch (e) {
614
- /* v8 ignore else -- @preserve */
615
- if (isSchemaOrClassNotFoundError(e)) {
616
- return undefined;
617
- }
618
- /* v8 ignore next -- @preserve */
619
- throw e;
620
- }
621
- }
622
- function isSchemaOrClassNotFoundError(e) {
623
- return (e instanceof Error &&
624
- (!!e.message.match(/^Schema "[\w\d_]+" not found/) || !!e.message.match(/^Class "[\w\d_\.:]+" not found/)));
625
- }
626
- function isPropertyNotFoundError(e) {
627
- return e instanceof Error && !!e.message.match(/^Property "[\w\d]+" not found in ECClass/);
628
- }
629
- //# sourceMappingURL=NodeSelectQueryFactory.js.map