@finos/legend-query-builder 4.17.99 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +2 -1
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderSideBar.js +9 -8
  6. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  7. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  8. package/lib/components/explorer/QueryBuilderExplorerPanel.js +48 -5
  9. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  10. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.d.ts +24 -0
  11. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.d.ts.map +1 -0
  12. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.js +202 -0
  13. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.js.map +1 -0
  14. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  15. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  16. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +3 -3
  17. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  18. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  19. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +25 -6
  20. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  21. package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
  22. package/lib/components/result/QueryBuilderResultPanel.js +1 -1
  23. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
  24. package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.d.ts +42 -0
  25. package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.d.ts.map +1 -0
  26. package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.js +212 -0
  27. package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.js.map +1 -0
  28. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.d.ts +66 -0
  29. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.d.ts.map +1 -0
  30. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.js +265 -0
  31. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.js.map +1 -0
  32. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.d.ts +28 -0
  33. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.d.ts.map +1 -0
  34. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.js +148 -0
  35. package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.js.map +1 -0
  36. package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.d.ts +19 -0
  37. package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.d.ts.map +1 -0
  38. package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.js +196 -0
  39. package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.js.map +1 -0
  40. package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts +5 -0
  41. package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -1
  42. package/lib/components/result/tds/QueryBuilderTDSGridResult.js +64 -87
  43. package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -1
  44. package/lib/components/result/tds/QueryBuilderTDSGridShared.d.ts +26 -0
  45. package/lib/components/result/tds/QueryBuilderTDSGridShared.d.ts.map +1 -0
  46. package/lib/components/result/tds/QueryBuilderTDSGridShared.js +51 -0
  47. package/lib/components/result/tds/QueryBuilderTDSGridShared.js.map +1 -0
  48. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts +5 -0
  49. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts.map +1 -1
  50. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +169 -60
  51. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -1
  52. package/lib/components/workflows/AccessorQueryBuilder.d.ts +18 -0
  53. package/lib/components/workflows/AccessorQueryBuilder.d.ts.map +1 -0
  54. package/lib/components/workflows/AccessorQueryBuilder.js +87 -0
  55. package/lib/components/workflows/AccessorQueryBuilder.js.map +1 -0
  56. package/lib/components/workflows/ClassQueryBuilder.js +5 -5
  57. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  58. package/lib/data-access-overview.css +1 -1
  59. package/lib/graph/QueryBuilderMetaModelConst.d.ts +4 -0
  60. package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
  61. package/lib/graph/QueryBuilderMetaModelConst.js +4 -0
  62. package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
  63. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  64. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +7 -1
  65. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  66. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +2 -0
  67. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  68. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +93 -3
  69. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  70. package/lib/index.css +2 -2
  71. package/lib/index.css.map +1 -1
  72. package/lib/index.d.ts +2 -0
  73. package/lib/index.d.ts.map +1 -1
  74. package/lib/index.js +2 -0
  75. package/lib/index.js.map +1 -1
  76. package/lib/package.json +1 -1
  77. package/lib/stores/QueryBuilderConfig.d.ts +3 -0
  78. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  79. package/lib/stores/QueryBuilderConfig.js +3 -0
  80. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  81. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  82. package/lib/stores/QueryBuilderResultState.js +13 -3
  83. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  84. package/lib/stores/QueryBuilderState.d.ts +14 -4
  85. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  86. package/lib/stores/QueryBuilderState.js +41 -13
  87. package/lib/stores/QueryBuilderState.js.map +1 -1
  88. package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -1
  89. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  90. package/lib/stores/QueryBuilderStateBuilder.js +51 -20
  91. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  92. package/lib/stores/QueryBuilderStateHashUtils.d.ts +1 -0
  93. package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
  94. package/lib/stores/QueryBuilderStateHashUtils.js +1 -0
  95. package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
  96. package/lib/stores/QueryBuilderTypeaheadHelper.js +2 -2
  97. package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
  98. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +1 -1
  99. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  100. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +54 -45
  101. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  102. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +1 -1
  103. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
  104. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +12 -2
  105. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  106. package/lib/stores/explorer/QueryBuilderExplorerState.js +12 -2
  107. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  108. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -2
  109. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  110. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  111. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -2
  112. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  113. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -3
  114. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  115. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +1 -1
  116. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  117. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts +2 -0
  118. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts.map +1 -1
  119. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js +19 -0
  120. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js.map +1 -1
  121. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +7 -4
  122. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  123. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +59 -12
  124. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  125. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +16 -3
  126. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  127. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +102 -24
  128. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  129. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +2 -1
  130. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  131. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +16 -1
  132. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  133. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +3 -3
  134. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  135. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.d.ts.map +1 -1
  136. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.js +11 -2
  137. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.js.map +1 -1
  138. package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.d.ts.map +1 -1
  139. package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js +16 -12
  140. package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js.map +1 -1
  141. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +4 -3
  142. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -1
  143. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js +19 -9
  144. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -1
  145. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts +1 -0
  146. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts.map +1 -1
  147. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js +57 -5
  148. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js.map +1 -1
  149. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts +4 -3
  150. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts.map +1 -1
  151. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js +85 -6
  152. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -1
  153. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts +1 -0
  154. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts.map +1 -1
  155. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js.map +1 -1
  156. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts +1 -0
  157. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts.map +1 -1
  158. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js +3 -0
  159. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js.map +1 -1
  160. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts +1 -0
  161. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts.map +1 -1
  162. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js +3 -0
  163. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js.map +1 -1
  164. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts +1 -0
  165. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts.map +1 -1
  166. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js +3 -0
  167. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js.map +1 -1
  168. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts +1 -0
  169. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts.map +1 -1
  170. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js +3 -0
  171. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js.map +1 -1
  172. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts +1 -0
  173. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts.map +1 -1
  174. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js +3 -0
  175. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js.map +1 -1
  176. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts +1 -0
  177. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts.map +1 -1
  178. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js +4 -0
  179. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js.map +1 -1
  180. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts +1 -0
  181. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts.map +1 -1
  182. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js +3 -0
  183. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js.map +1 -1
  184. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts +1 -0
  185. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts.map +1 -1
  186. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js +3 -0
  187. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js.map +1 -1
  188. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts +1 -0
  189. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts.map +1 -1
  190. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js +3 -0
  191. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js.map +1 -1
  192. package/lib/stores/milestoning/QueryBuilderMilestoningState.js +4 -4
  193. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
  194. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -2
  195. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  196. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -2
  197. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  198. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.d.ts +18 -0
  199. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.d.ts.map +1 -0
  200. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.js +32 -0
  201. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.js.map +1 -0
  202. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts +57 -0
  203. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts.map +1 -0
  204. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js +125 -0
  205. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js.map +1 -0
  206. package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js +4 -4
  207. package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js.map +1 -1
  208. package/package.json +7 -7
  209. package/src/components/QueryBuilder.tsx +2 -1
  210. package/src/components/QueryBuilderSideBar.tsx +12 -8
  211. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +77 -14
  212. package/src/components/explorer/QueryBuilderRelationExplorerPanel.tsx +536 -0
  213. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +1 -0
  214. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +3 -3
  215. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +62 -4
  216. package/src/components/result/QueryBuilderResultPanel.tsx +6 -2
  217. package/src/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.ts +254 -0
  218. package/src/components/result/tds/QueryBuilderTDSCellSelectionStats.ts +397 -0
  219. package/src/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.tsx +439 -0
  220. package/src/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.ts +270 -0
  221. package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +107 -112
  222. package/src/components/result/tds/QueryBuilderTDSGridShared.ts +76 -0
  223. package/src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx +272 -99
  224. package/src/components/workflows/AccessorQueryBuilder.tsx +211 -0
  225. package/src/components/workflows/ClassQueryBuilder.tsx +5 -5
  226. package/src/graph/QueryBuilderMetaModelConst.ts +5 -0
  227. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +28 -0
  228. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +223 -4
  229. package/src/index.ts +2 -0
  230. package/src/stores/QueryBuilderConfig.ts +3 -0
  231. package/src/stores/QueryBuilderResultState.ts +22 -9
  232. package/src/stores/QueryBuilderState.ts +47 -12
  233. package/src/stores/QueryBuilderStateBuilder.ts +107 -43
  234. package/src/stores/QueryBuilderStateHashUtils.ts +1 -0
  235. package/src/stores/QueryBuilderTypeaheadHelper.ts +2 -2
  236. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +72 -59
  237. package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +1 -1
  238. package/src/stores/explorer/QueryBuilderExplorerState.ts +26 -2
  239. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +1 -2
  240. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +4 -3
  241. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +1 -1
  242. package/src/stores/fetch-structure/tds/QueryBuilderTDSHelper.ts +42 -0
  243. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +135 -19
  244. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +197 -38
  245. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +30 -0
  246. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +3 -3
  247. package/src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.ts +21 -0
  248. package/src/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.ts +25 -16
  249. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowState.ts +23 -9
  250. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.ts +146 -4
  251. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.ts +145 -10
  252. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.ts +2 -0
  253. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.ts +4 -0
  254. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.ts +4 -0
  255. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.ts +4 -0
  256. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.ts +4 -0
  257. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.ts +4 -0
  258. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.ts +5 -0
  259. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.ts +4 -0
  260. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.ts +4 -0
  261. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.ts +4 -0
  262. package/src/stores/milestoning/QueryBuilderMilestoningState.ts +4 -4
  263. package/src/stores/workflows/MappingQueryBuilderState.ts +2 -2
  264. package/src/stores/workflows/ServiceQueryBuilderState.ts +2 -2
  265. package/src/stores/workflows/accessor/AccessorQueryBuilderHelper.ts +51 -0
  266. package/src/stores/workflows/accessor/AccessorQueryBuilderState.ts +195 -0
  267. package/src/stores/workflows/dataProduct/DataProductQueryBuilderState.ts +4 -4
  268. package/tsconfig.json +9 -0
@@ -64,9 +64,9 @@ const ClassQueryBuilderSetupPanelContent = observer(
64
64
 
65
65
  // mapping
66
66
  const mappingOptions = (
67
- queryBuilderState.class
67
+ queryBuilderState.sourceClass
68
68
  ? getClassCompatibleMappings(
69
- queryBuilderState.class,
69
+ queryBuilderState.sourceClass,
70
70
  queryBuilderState.graphManagerState.usableMappings,
71
71
  )
72
72
  : []
@@ -79,7 +79,7 @@ const ClassQueryBuilderSetupPanelContent = observer(
79
79
  : null;
80
80
  const changeMapping = (val: PackageableElementOption<Mapping>): void => {
81
81
  if (
82
- !queryBuilderState.class ||
82
+ !queryBuilderState.sourceElement ||
83
83
  val.value === queryBuilderState.executionContextState.mapping
84
84
  ) {
85
85
  return;
@@ -152,7 +152,7 @@ const ClassQueryBuilderSetupPanelContent = observer(
152
152
  : 'No compatible mapping found for class'
153
153
  }
154
154
  noMatchMessage="No compatible mapping found for specified class"
155
- disabled={!queryBuilderState.class}
155
+ disabled={!queryBuilderState.sourceElement}
156
156
  options={mappingOptions}
157
157
  onChange={changeMapping}
158
158
  value={selectedMappingOption}
@@ -182,7 +182,7 @@ const ClassQueryBuilderSetupPanelContent = observer(
182
182
  placeholder="Choose a runtime..."
183
183
  noMatchMessage="No compatible runtime found for specified mapping"
184
184
  disabled={
185
- !queryBuilderState.class ||
185
+ !queryBuilderState.sourceElement ||
186
186
  !queryBuilderState.executionContextState.mapping
187
187
  }
188
188
  options={runtimeOptions}
@@ -127,6 +127,11 @@ export enum QUERY_BUILDER_SUPPORTED_FUNCTIONS {
127
127
  RELATION_SORT = 'meta::pure::functions::relation::sort',
128
128
  RELATION_SLICE = 'meta::pure::functions::relation::slice',
129
129
  RELATION_GROUP_BY = 'meta::pure::functions::relation::groupBy',
130
+ RELATION_EXTEND = 'meta::pure::functions::relation::extend',
131
+ RELATION_OVER = 'meta::pure::functions::relation::over',
132
+ RELATION_RANK = 'meta::pure::functions::relation::rank',
133
+ RELATION_DENSE_RANK = 'meta::pure::functions::relation::denseRank',
134
+
130
135
  // filter
131
136
  CONTAINS = 'meta::pure::functions::string::contains',
132
137
  ENDS_WITH = 'meta::pure::functions::string::endsWith',
@@ -26,6 +26,8 @@ import {
26
26
  V1_buildSubTypePropertyExpressionTypeInference,
27
27
  V1_buildWatermarkFunctionExpression,
28
28
  V1_buildGroupByFunctionExpression,
29
+ V1_buildOverFunctionExpression,
30
+ V1_buildExtendFunctionExpression,
29
31
  } from './v1/V1_QueryValueSpecificationBuilderHelper.js';
30
32
  import {
31
33
  type V1_GraphBuilderContext,
@@ -237,6 +239,32 @@ export class QueryBuilder_PureProtocolProcessorPlugin extends PureProtocolProces
237
239
  new GenericType(PrimitiveType.DATE),
238
240
  );
239
241
  return expression;
242
+ } else if (
243
+ matchFunctionName(
244
+ functionName,
245
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_EXTEND,
246
+ )
247
+ ) {
248
+ return V1_buildExtendFunctionExpression(
249
+ functionName,
250
+ parameters,
251
+ openVariables,
252
+ compileContext,
253
+ processingContext,
254
+ );
255
+ } else if (
256
+ matchFunctionName(
257
+ functionName,
258
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_OVER,
259
+ )
260
+ ) {
261
+ return V1_buildOverFunctionExpression(
262
+ functionName,
263
+ parameters,
264
+ openVariables,
265
+ compileContext,
266
+ processingContext,
267
+ );
240
268
  } else if (
241
269
  matchFunctionName(
242
270
  functionName,
@@ -697,10 +697,6 @@ const V1_buildTypedProjectFunctionExpression = (
697
697
  GenericTypeExplicitReference.create(new GenericType(returnType)),
698
698
  ),
699
699
  );
700
- } else {
701
- throw new UnsupportedOperationError(
702
- 'Unable to get return type for current lambda',
703
- );
704
700
  }
705
701
  return pColSpec;
706
702
  });
@@ -1219,6 +1215,7 @@ export const V1_buildTypedGroupByFunctionExpression = (
1219
1215
  .map((colSpec) => [colSpec.function1, colSpec.function2])
1220
1216
  .flat()
1221
1217
  .filter(isNonNullable)
1218
+ .filter(filterByType(V1_Lambda))
1222
1219
  .map((value) => value.parameters)
1223
1220
  .flat();
1224
1221
  topLevelLambdaParameters.forEach((variable) => {
@@ -1576,3 +1573,225 @@ export const V1_buildSubTypePropertyExpressionTypeInference = (
1576
1573
  inferredVariable.parametersValues.filter(
1577
1574
  (param) => param instanceof InstanceValue,
1578
1575
  )[0]?.genericType?.value.rawType;
1576
+
1577
+ export const V1_buildOverFunctionExpression = (
1578
+ functionName: string,
1579
+ parameters: V1_ValueSpecification[],
1580
+ openVariables: string[],
1581
+ compileContext: V1_GraphBuilderContext,
1582
+ processingContext: V1_ProcessingContext,
1583
+ ): SimpleFunctionExpression => {
1584
+ assertTrue(
1585
+ parameters.length >= 1 && parameters.length <= 2,
1586
+ `Can't build over() expression: over() expects 1-2 arguments, got ${parameters.length}`,
1587
+ );
1588
+ //TODO: handle over() when first param is a ColSpec, and when only given SortInfo
1589
+ const windowColumns = parameters[0];
1590
+ assertType(
1591
+ windowColumns,
1592
+ V1_ClassInstance,
1593
+ `Can't build over() expression with ColSpecArray: expects argument #1 to be a ClassInstance`,
1594
+ );
1595
+ const specArray = guaranteeType(
1596
+ windowColumns.value,
1597
+ V1_ColSpecArray,
1598
+ `Can't build over() expression with ColSpecArray: expects ClassInstance to hold ColSpecArray`,
1599
+ );
1600
+
1601
+ const windowColSpecArrayInst = new ColSpecArrayInstance(Multiplicity.ONE);
1602
+ const windowColSpecArray = new ColSpecArray();
1603
+ windowColSpecArrayInst.values = [windowColSpecArray];
1604
+
1605
+ windowColSpecArray.colSpecs = specArray.colSpecs.map((colSpec) => {
1606
+ const windowColSpec = new ColSpec();
1607
+ windowColSpec.name = colSpec.name;
1608
+ windowColSpec.type = colSpec.type;
1609
+ return windowColSpec;
1610
+ });
1611
+
1612
+ const processedParams: ValueSpecification[] = [windowColSpecArrayInst];
1613
+
1614
+ if (parameters[1]) {
1615
+ const sortBy = parameters[1].accept_ValueSpecificationVisitor(
1616
+ new V1_ValueSpecificationBuilder(
1617
+ compileContext,
1618
+ processingContext,
1619
+ openVariables,
1620
+ ),
1621
+ );
1622
+ processedParams.push(sortBy);
1623
+ }
1624
+
1625
+ return V1_buildBaseSimpleFunctionExpression(
1626
+ processedParams,
1627
+ functionName,
1628
+ compileContext,
1629
+ );
1630
+ };
1631
+
1632
+ export const V1_buildExtendFunctionExpression = (
1633
+ functionName: string,
1634
+ parameters: V1_ValueSpecification[],
1635
+ openVariables: string[],
1636
+ compileContext: V1_GraphBuilderContext,
1637
+ processingContext: V1_ProcessingContext,
1638
+ ): SimpleFunctionExpression => {
1639
+ if (parameters.length === 3) {
1640
+ const precedingExpression = guaranteeNonNullable(
1641
+ parameters[0],
1642
+ `Can't build relation extend() expression: preceding expression is missing`,
1643
+ ).accept_ValueSpecificationVisitor(
1644
+ new V1_ValueSpecificationBuilder(
1645
+ compileContext,
1646
+ processingContext,
1647
+ openVariables,
1648
+ ),
1649
+ );
1650
+ assertNonNullable(
1651
+ precedingExpression.genericType,
1652
+ `Can't build relation extend() expression: preceding expression return type is missing`,
1653
+ );
1654
+
1655
+ const overExpression = guaranteeNonNullable(
1656
+ parameters[1],
1657
+ `Can't build relation extend() expression: over() expression is missing`,
1658
+ ).accept_ValueSpecificationVisitor(
1659
+ new V1_ValueSpecificationBuilder(
1660
+ compileContext,
1661
+ processingContext,
1662
+ openVariables,
1663
+ ),
1664
+ );
1665
+
1666
+ const windowOperator = guaranteeNonNullable(
1667
+ parameters[2],
1668
+ `Can't build relation extend() expression: window operator is missing`,
1669
+ );
1670
+ assertType(
1671
+ windowOperator,
1672
+ V1_ClassInstance,
1673
+ `Can't build relation extend() expression: extend() expects argument #3 to be a ClassInstance`,
1674
+ );
1675
+
1676
+ //TODO: handle extend() where the third parameter is a ColSpec
1677
+ const operatorExpression = windowOperator.value as V1_ColSpecArray;
1678
+
1679
+ const topLevelLambdaParameters: V1_Variable[] = operatorExpression.colSpecs
1680
+ .flatMap((colSpec) => [colSpec.function1, colSpec.function2])
1681
+ .filter(isNonNullable)
1682
+ .flatMap((value) => (value as V1_Lambda).parameters);
1683
+ topLevelLambdaParameters.forEach((variable) => {
1684
+ if (!variable.genericType) {
1685
+ const variableExpression = new VariableExpression(
1686
+ variable.name,
1687
+ precedingExpression.multiplicity,
1688
+ );
1689
+ variableExpression.genericType = precedingExpression.genericType;
1690
+ processingContext.addInferredVariables(
1691
+ variable.name,
1692
+ variableExpression,
1693
+ );
1694
+ }
1695
+ });
1696
+
1697
+ const builtOperatorExpressions = new ColSpecArrayInstance(Multiplicity.ONE);
1698
+ const builtOperatorColSpecArray = new ColSpecArray();
1699
+ builtOperatorExpressions.values = [builtOperatorColSpecArray];
1700
+
1701
+ const precedingRelationType =
1702
+ precedingExpression.genericType.value.typeArguments?.[0]?.value.rawType;
1703
+ const relationType = new RelationType(RelationType.ID);
1704
+
1705
+ if (precedingRelationType instanceof RelationType) {
1706
+ precedingRelationType.columns.forEach((col) => {
1707
+ relationType.columns.push(col);
1708
+ });
1709
+ }
1710
+
1711
+ builtOperatorColSpecArray.colSpecs = operatorExpression.colSpecs.map(
1712
+ (colSpec) => {
1713
+ const builtColSpec = new ColSpec();
1714
+ builtColSpec.name = colSpec.name;
1715
+ if (colSpec.function1) {
1716
+ const function1 = guaranteeType(
1717
+ colSpec.function1,
1718
+ V1_Lambda,
1719
+ `Can't build relation extend() col spec expression: expects function1 to be a lambda`,
1720
+ );
1721
+
1722
+ const function1Lambda = guaranteeType(
1723
+ function1.accept_ValueSpecificationVisitor(
1724
+ new V1_ValueSpecificationBuilder(
1725
+ compileContext,
1726
+ processingContext,
1727
+ openVariables,
1728
+ ),
1729
+ ),
1730
+ LambdaFunctionInstanceValue,
1731
+ `Can't build relation extend() col spec expression: expected function1 to be a lambda`,
1732
+ );
1733
+ builtColSpec.function1 = function1Lambda;
1734
+ }
1735
+
1736
+ if (colSpec.function2) {
1737
+ const function2 = guaranteeType(
1738
+ colSpec.function2,
1739
+ V1_Lambda,
1740
+ `Can't build relation extend() col spec expression: expects function2 to be a lambda`,
1741
+ );
1742
+ const function2Lambda = guaranteeType(
1743
+ function2.accept_ValueSpecificationVisitor(
1744
+ new V1_ValueSpecificationBuilder(
1745
+ compileContext,
1746
+ processingContext,
1747
+ openVariables,
1748
+ ),
1749
+ ),
1750
+ LambdaFunctionInstanceValue,
1751
+ `Can't build relation extend() col spec expression: expected aggregation function to be a lambda`,
1752
+ );
1753
+ builtColSpec.function2 = function2Lambda;
1754
+ }
1755
+
1756
+ let returnType: Type | undefined;
1757
+ if (builtColSpec.function2) {
1758
+ returnType = getValueSpecificationReturnType(builtColSpec.function2);
1759
+ } else if (builtColSpec.function1) {
1760
+ returnType = getValueSpecificationReturnType(builtColSpec.function1);
1761
+ }
1762
+
1763
+ if (returnType) {
1764
+ relationType.columns.push(
1765
+ new RelationColumn(
1766
+ colSpec.name,
1767
+ GenericTypeExplicitReference.create(new GenericType(returnType)),
1768
+ ),
1769
+ );
1770
+ }
1771
+
1772
+ return builtColSpec;
1773
+ },
1774
+ );
1775
+
1776
+ //build extend()
1777
+ const expression = V1_buildBaseSimpleFunctionExpression(
1778
+ [precedingExpression, overExpression, builtOperatorExpressions],
1779
+ functionName,
1780
+ compileContext,
1781
+ );
1782
+
1783
+ const relationGenericType = new GenericType(Relation.INSTANCE);
1784
+ const relationTypeGenericType = new GenericType(relationType);
1785
+ relationGenericType.typeArguments = [
1786
+ GenericTypeExplicitReference.create(relationTypeGenericType),
1787
+ ];
1788
+ expression.genericType =
1789
+ GenericTypeExplicitReference.create(relationGenericType);
1790
+
1791
+ return expression;
1792
+ } else {
1793
+ throw new UnsupportedOperationError(
1794
+ `Can't build relation extend() expression: extend() on non window functions is not yet supported`,
1795
+ );
1796
+ }
1797
+ };
package/src/index.ts CHANGED
@@ -70,6 +70,8 @@ export {
70
70
  ModelAccessPointDataProductExecutionState,
71
71
  } from './stores/workflows/dataProduct/DataProductQueryBuilderState.js';
72
72
  export { DataProductQueryBuilderSetupFormContent } from './components/workflows/DataProductQueryBuilder.js';
73
+ export { AccessorQueryBuilderState } from './stores/workflows/accessor/AccessorQueryBuilderState.js';
74
+ export { getCompatibleRuntimesFromAccessorOwner } from './stores/workflows/accessor/AccessorQueryBuilderHelper.js';
73
75
  export { MappingQueryBuilderState } from './stores/workflows/MappingQueryBuilderState.js';
74
76
  export {
75
77
  type ServiceExecutionContext,
@@ -24,6 +24,9 @@ export const DEFAULT_LAMBDA_VARIABLE_NAME = 'x';
24
24
  export const DEFAULT_VARIABLE_NAME = 'var';
25
25
  export const DEFAULT_CONSTANT_VARIABLE_NAME = 'c_var';
26
26
  export const DEFAULT_POST_FILTER_LAMBDA_VARIABLE_NAME = 'row';
27
+ export const DEFAULT_WINDOW_FUNCTION_PARTITION_VAR_NAME = 'p';
28
+ export const DEFAULT_WINDOW_FUNCTION_WINDOW_VAR_NAME = 'w';
29
+ export const DEFAULT_WINDOW_FUNCTION_ROW_VAR_NAME = 'r';
27
30
 
28
31
  export const QUERY_BUILDER_PROPERTY_SEARCH_MAX_DEPTH = 10;
29
32
  export const QUERY_BUILDER_PROPERTY_SEARCH_MAX_NODES = 10000;
@@ -224,7 +224,16 @@ export class QueryBuilderResultState {
224
224
  }
225
225
 
226
226
  addSelectedCell(val: TDSResultCellData): void {
227
- this.selectedCells.push(val);
227
+ // Deduplicate by coordinates — Ctrl+clicking an already-selected cell
228
+ // must not inflate the count or corrupt statistics.
229
+ const alreadyPresent = this.selectedCells.some(
230
+ (c) =>
231
+ c.coordinates.rowIndex === val.coordinates.rowIndex &&
232
+ c.coordinates.colIndex === val.coordinates.colIndex,
233
+ );
234
+ if (!alreadyPresent) {
235
+ this.selectedCells.push(val);
236
+ }
228
237
  }
229
238
 
230
239
  setSelectedCells(val: TDSResultCellData[]): void {
@@ -473,10 +482,12 @@ export class QueryBuilderResultState {
473
482
  try {
474
483
  this.setIsRunningQuery(true);
475
484
  const currentHashCode = this.queryBuilderState.hashCode;
476
- guaranteeNonNullable(
477
- this.queryBuilderState.executionContextState.mapping,
478
- 'Mapping is required to execute query',
479
- );
485
+ if (this.queryBuilderState.requiresMappingForExecution) {
486
+ guaranteeNonNullable(
487
+ this.queryBuilderState.executionContextState.mapping,
488
+ 'Mapping is required to execute query',
489
+ );
490
+ }
480
491
  guaranteeNonNullable(
481
492
  this.queryBuilderState.executionContextState.runtimeValue,
482
493
  `Runtime is required to execute query`,
@@ -581,10 +592,12 @@ export class QueryBuilderResultState {
581
592
  *generatePlan(debug: boolean): GeneratorFn<void> {
582
593
  try {
583
594
  this.isGeneratingPlan = true;
584
- guaranteeNonNullable(
585
- this.queryBuilderState.executionContextState.mapping,
586
- 'Mapping is required to execute query',
587
- );
595
+ if (this.queryBuilderState.requiresMappingForExecution) {
596
+ guaranteeNonNullable(
597
+ this.queryBuilderState.executionContextState.mapping,
598
+ 'Mapping is required to execute query',
599
+ );
600
+ }
588
601
  guaranteeNonNullable(
589
602
  this.queryBuilderState.executionContextState.runtimeValue,
590
603
  `Runtime is required to execute query`,
@@ -55,10 +55,12 @@ import {
55
55
  type PackageableElement,
56
56
  type ValueSpecification,
57
57
  type Type,
58
+ type RelationType,
58
59
  type QueryGridConfig,
59
60
  type QueryExecutionContext,
60
61
  type FunctionAnalysisInfo,
61
62
  type GraphData,
63
+ Accessor,
62
64
  GRAPH_MANAGER_EVENT,
63
65
  CompilationError,
64
66
  extractSourceInformationCoordinates,
@@ -226,7 +228,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
226
228
 
227
229
  lambdaWriteMode = QUERY_BUILDER_LAMBDA_WRITER_MODE.STANDARD;
228
230
 
229
- class?: Class | undefined;
231
+ sourceElement?: Class | Accessor | undefined;
230
232
  getAllFunction: QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS =
231
233
  QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL;
232
234
  executionContextState: QueryBuilderExecutionContextState;
@@ -270,7 +272,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
270
272
  changeDetectionState: observable,
271
273
  changeHistoryState: observable,
272
274
  executionContextState: observable,
273
- class: observable,
275
+ sourceElement: observable,
274
276
  queryChatState: observable,
275
277
  isQueryChatOpened: observable,
276
278
  isLocalModeEnabled: observable,
@@ -280,9 +282,13 @@ export abstract class QueryBuilderState implements CommandRegistrar {
280
282
  INTERNAL__enableInitializingDefaultSimpleExpressionValue: observable,
281
283
 
282
284
  sideBarClassName: computed,
285
+ sourceClass: computed,
286
+ sourceAccessor: computed,
287
+ sourceRelationType: computed,
283
288
  isQuerySupported: computed,
284
289
  allValidationIssues: computed,
285
290
  canBuildQuery: computed,
291
+ useRelation: computed,
286
292
 
287
293
  setShowFunctionsExplorerPanel: action,
288
294
  setShowParametersPanel: action,
@@ -291,7 +297,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
291
297
  setDataCubeViewerState: action,
292
298
  openDataCubeEngine: action,
293
299
  setIsCheckingEntitlments: action,
294
- setClass: action,
300
+ setSourceElement: action,
295
301
  setIsQueryChatOpened: action,
296
302
  setIsLocalModeEnabled: action,
297
303
  setGetAllFunction: action,
@@ -301,7 +307,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
301
307
 
302
308
  resetQueryResult: action,
303
309
  resetQueryContent: action,
304
- changeClass: action,
310
+ changeSourceElement: action,
305
311
  changeMapping: action,
306
312
  changeRuntime: action,
307
313
  setExecutionContextState: action,
@@ -358,6 +364,10 @@ export abstract class QueryBuilderState implements CommandRegistrar {
358
364
  return new QueryBuilderExternalExecutionContextState(this);
359
365
  }
360
366
 
367
+ get useRelation(): boolean {
368
+ return this.sourceElement instanceof Accessor || this.isFetchStructureTyped;
369
+ }
370
+
361
371
  get isMappingReadOnly(): boolean {
362
372
  return false;
363
373
  }
@@ -415,6 +425,10 @@ export abstract class QueryBuilderState implements CommandRegistrar {
415
425
  return this.isFetchStructureTyped;
416
426
  }
417
427
 
428
+ get requiresMappingForExecution(): boolean {
429
+ return true;
430
+ }
431
+
418
432
  setLambdaWriteMode(val: QUERY_BUILDER_LAMBDA_WRITER_MODE): void {
419
433
  this.lambdaWriteMode = val;
420
434
  }
@@ -463,7 +477,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
463
477
  */
464
478
  getStateInfo(): QueryableClassMappingRuntimeInfo | undefined {
465
479
  if (this.sourceInfo) {
466
- const classPath = this.class?.path;
480
+ const classPath = this.sourceClass?.path;
467
481
  const mappingPath = this.executionContextState.mapping?.path;
468
482
  const runtimePath =
469
483
  this.executionContextState.runtimeValue instanceof RuntimePointer
@@ -528,8 +542,29 @@ export abstract class QueryBuilderState implements CommandRegistrar {
528
542
  this.isCalendarEnabled = val;
529
543
  }
530
544
 
531
- setClass(val: Class | undefined): void {
532
- this.class = val;
545
+ /**
546
+ * Convenience getter that returns the class only when the source
547
+ * type is a Class (not a RelationType). Use this in code paths
548
+ * that are Class-specific (milestoning, explorer tree, graph-fetch, etc.).
549
+ */
550
+ get sourceClass(): Class | undefined {
551
+ return this.sourceElement instanceof Accessor
552
+ ? undefined
553
+ : this.sourceElement;
554
+ }
555
+
556
+ get sourceAccessor(): Accessor | undefined {
557
+ return this.sourceElement instanceof Accessor
558
+ ? this.sourceElement
559
+ : undefined;
560
+ }
561
+
562
+ get sourceRelationType(): RelationType | undefined {
563
+ return this.sourceAccessor?.relationType;
564
+ }
565
+
566
+ setSourceElement(val: Class | Accessor | undefined): void {
567
+ this.sourceElement = val;
533
568
  }
534
569
 
535
570
  setExecutionContextState(val: QueryBuilderExecutionContextState): void {
@@ -651,13 +686,13 @@ export abstract class QueryBuilderState implements CommandRegistrar {
651
686
  }
652
687
  }
653
688
 
654
- changeClass(val: Class): void {
689
+ changeSourceElement(val: Class | Accessor): void {
655
690
  this.resetQueryResult();
656
691
  this.resetQueryContent();
657
692
  this.setGetAllFunction(QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL);
658
- this.setClass(val);
693
+ this.setSourceElement(val);
659
694
  this.explorerState.refreshTreeData();
660
- this.fetchStructureState.implementation.onClassChange(val);
695
+ this.fetchStructureState.implementation.onClassChange();
661
696
  this.milestoningState.updateMilestoningConfiguration();
662
697
  this.changeHistoryState.cacheNewQuery(this.buildQuery());
663
698
  }
@@ -878,7 +913,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
878
913
  this.resetQueryContent();
879
914
  this.unsupportedQueryState.setLambdaError(error);
880
915
  this.unsupportedQueryState.setRawLambda(query);
881
- this.setClass(undefined);
916
+ this.setSourceElement(undefined);
882
917
  const parameters = buildLambdaVariableExpressions(
883
918
  query,
884
919
  this.graphManagerState,
@@ -1019,7 +1054,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
1019
1054
  this.workflowState,
1020
1055
  undefined,
1021
1056
  );
1022
- basicState.class = this.class;
1057
+ basicState.sourceElement = this.sourceElement;
1023
1058
  basicState.executionContextState.mapping =
1024
1059
  this.executionContextState.mapping;
1025
1060
  basicState.executionContextState.runtimeValue =