@finos/legend-query-builder 4.17.100 → 4.18.1

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 (278) hide show
  1. package/lib/__test__.d.ts +1 -0
  2. package/lib/__test__.d.ts.map +1 -1
  3. package/lib/__test__.js +1 -0
  4. package/lib/__test__.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +2 -1
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderSideBar.js +9 -8
  10. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  11. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts +5 -0
  12. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  13. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +28 -2
  14. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  15. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  16. package/lib/components/explorer/QueryBuilderExplorerPanel.js +48 -5
  17. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  18. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.d.ts +24 -0
  19. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.d.ts.map +1 -0
  20. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.js +202 -0
  21. package/lib/components/explorer/QueryBuilderRelationExplorerPanel.js.map +1 -0
  22. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  23. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  24. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +3 -3
  25. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  26. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  27. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +25 -6
  28. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  30. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +8 -2
  31. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  32. package/lib/components/workflows/AccessorQueryBuilder.d.ts +18 -0
  33. package/lib/components/workflows/AccessorQueryBuilder.d.ts.map +1 -0
  34. package/lib/components/workflows/AccessorQueryBuilder.js +87 -0
  35. package/lib/components/workflows/AccessorQueryBuilder.js.map +1 -0
  36. package/lib/components/workflows/ClassQueryBuilder.js +5 -5
  37. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  38. package/lib/components/workflows/DataProductQueryBuilder.d.ts.map +1 -1
  39. package/lib/components/workflows/DataProductQueryBuilder.js +13 -12
  40. package/lib/components/workflows/DataProductQueryBuilder.js.map +1 -1
  41. package/lib/data-access-overview.css +1 -1
  42. package/lib/graph/QueryBuilderMetaModelConst.d.ts +6 -0
  43. package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
  44. package/lib/graph/QueryBuilderMetaModelConst.js +6 -0
  45. package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
  46. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  47. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +7 -1
  48. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  49. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +2 -0
  50. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  51. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +93 -3
  52. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  53. package/lib/index.css +2 -2
  54. package/lib/index.css.map +1 -1
  55. package/lib/index.d.ts +3 -1
  56. package/lib/index.d.ts.map +1 -1
  57. package/lib/index.js +3 -1
  58. package/lib/index.js.map +1 -1
  59. package/lib/package.json +1 -1
  60. package/lib/stores/QueryBuilderConfig.d.ts +3 -0
  61. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  62. package/lib/stores/QueryBuilderConfig.js +3 -0
  63. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  64. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  65. package/lib/stores/QueryBuilderResultState.js +6 -2
  66. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  67. package/lib/stores/QueryBuilderState.d.ts +14 -4
  68. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  69. package/lib/stores/QueryBuilderState.js +41 -13
  70. package/lib/stores/QueryBuilderState.js.map +1 -1
  71. package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -1
  72. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  73. package/lib/stores/QueryBuilderStateBuilder.js +51 -20
  74. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  75. package/lib/stores/QueryBuilderStateHashUtils.d.ts +2 -0
  76. package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
  77. package/lib/stores/QueryBuilderStateHashUtils.js +2 -0
  78. package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
  79. package/lib/stores/QueryBuilderTypeaheadHelper.js +6 -6
  80. package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
  81. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +1 -1
  82. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  83. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +54 -45
  84. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  85. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +1 -1
  86. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  87. package/lib/stores/QueryBuilderValueSpecificationHelper.js +2 -2
  88. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  89. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +1 -1
  90. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
  91. package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.d.ts +374 -0
  92. package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.d.ts.map +1 -0
  93. package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.js +625 -0
  94. package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.js.map +1 -0
  95. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +12 -2
  96. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  97. package/lib/stores/explorer/QueryBuilderExplorerState.js +12 -2
  98. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  99. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -2
  100. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  101. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  102. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -2
  103. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  104. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -3
  105. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  106. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +1 -1
  107. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  108. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts +2 -0
  109. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts.map +1 -1
  110. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js +19 -0
  111. package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js.map +1 -1
  112. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +7 -4
  113. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  114. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +61 -13
  115. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  116. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderRelationAggregationValueSpecBuilder.js +2 -2
  117. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderRelationAggregationValueSpecBuilder.js.map +1 -1
  118. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js +1 -1
  119. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js.map +1 -1
  120. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +16 -3
  121. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  122. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +102 -24
  123. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  124. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +2 -1
  125. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  126. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +16 -1
  127. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  128. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +11 -9
  130. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  131. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.d.ts.map +1 -1
  132. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.js +12 -3
  133. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.js.map +1 -1
  134. package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.d.ts.map +1 -1
  135. package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js +16 -12
  136. package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js.map +1 -1
  137. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.d.ts.map +1 -1
  138. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js +2 -0
  139. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js.map +1 -1
  140. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +4 -3
  141. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -1
  142. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js +19 -9
  143. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -1
  144. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts +1 -0
  145. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts.map +1 -1
  146. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js +83 -5
  147. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js.map +1 -1
  148. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts +4 -3
  149. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts.map +1 -1
  150. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js +130 -9
  151. package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -1
  152. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts +2 -1
  153. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts.map +1 -1
  154. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js.map +1 -1
  155. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts +1 -0
  156. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts.map +1 -1
  157. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js +3 -0
  158. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js.map +1 -1
  159. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts +1 -0
  160. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts.map +1 -1
  161. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js +3 -0
  162. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js.map +1 -1
  163. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts +1 -0
  164. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts.map +1 -1
  165. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js +3 -0
  166. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js.map +1 -1
  167. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts +1 -0
  168. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts.map +1 -1
  169. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js +3 -0
  170. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js.map +1 -1
  171. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_PercentRank.d.ts +25 -0
  172. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_PercentRank.d.ts.map +1 -0
  173. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_PercentRank.js +54 -0
  174. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_PercentRank.js.map +1 -0
  175. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts +1 -0
  176. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts.map +1 -1
  177. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js +3 -0
  178. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js.map +1 -1
  179. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts +1 -0
  180. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts.map +1 -1
  181. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js +4 -0
  182. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js.map +1 -1
  183. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts +1 -0
  184. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts.map +1 -1
  185. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js +3 -0
  186. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js.map +1 -1
  187. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts +1 -0
  188. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts.map +1 -1
  189. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js +3 -0
  190. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js.map +1 -1
  191. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts +1 -0
  192. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts.map +1 -1
  193. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js +3 -0
  194. package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js.map +1 -1
  195. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +3 -3
  196. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  197. package/lib/stores/milestoning/QueryBuilderMilestoningState.js +4 -4
  198. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
  199. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -2
  200. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  201. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -2
  202. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  203. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.d.ts +18 -0
  204. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.d.ts.map +1 -0
  205. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.js +32 -0
  206. package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.js.map +1 -0
  207. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts +58 -0
  208. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts.map +1 -0
  209. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js +129 -0
  210. package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js.map +1 -0
  211. package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.d.ts +31 -6
  212. package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.d.ts.map +1 -1
  213. package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js +164 -17
  214. package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js.map +1 -1
  215. package/package.json +7 -7
  216. package/src/__test__.ts +1 -0
  217. package/src/components/QueryBuilder.tsx +2 -1
  218. package/src/components/QueryBuilderSideBar.tsx +12 -8
  219. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +73 -1
  220. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +77 -14
  221. package/src/components/explorer/QueryBuilderRelationExplorerPanel.tsx +536 -0
  222. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +1 -0
  223. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +3 -3
  224. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +62 -4
  225. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +10 -4
  226. package/src/components/workflows/AccessorQueryBuilder.tsx +211 -0
  227. package/src/components/workflows/ClassQueryBuilder.tsx +5 -5
  228. package/src/components/workflows/DataProductQueryBuilder.tsx +40 -62
  229. package/src/graph/QueryBuilderMetaModelConst.ts +7 -0
  230. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +28 -0
  231. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +223 -4
  232. package/src/index.ts +5 -0
  233. package/src/stores/QueryBuilderConfig.ts +3 -0
  234. package/src/stores/QueryBuilderResultState.ts +12 -8
  235. package/src/stores/QueryBuilderState.ts +47 -12
  236. package/src/stores/QueryBuilderStateBuilder.ts +107 -43
  237. package/src/stores/QueryBuilderStateHashUtils.ts +2 -0
  238. package/src/stores/QueryBuilderTypeaheadHelper.ts +6 -6
  239. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +72 -59
  240. package/src/stores/QueryBuilderValueSpecificationHelper.ts +5 -3
  241. package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +1 -1
  242. package/src/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.ts +630 -0
  243. package/src/stores/explorer/QueryBuilderExplorerState.ts +26 -2
  244. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +1 -2
  245. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +4 -3
  246. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +1 -1
  247. package/src/stores/fetch-structure/tds/QueryBuilderTDSHelper.ts +42 -0
  248. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +137 -20
  249. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderRelationAggregationValueSpecBuilder.ts +2 -2
  250. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts +1 -1
  251. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +197 -38
  252. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +30 -0
  253. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +11 -9
  254. package/src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.ts +22 -1
  255. package/src/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.ts +25 -16
  256. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.ts +2 -0
  257. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowState.ts +23 -9
  258. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.ts +206 -4
  259. package/src/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.ts +250 -12
  260. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.ts +3 -1
  261. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.ts +4 -0
  262. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.ts +4 -0
  263. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.ts +4 -0
  264. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.ts +4 -0
  265. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_PercentRank.ts +57 -0
  266. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.ts +4 -0
  267. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.ts +5 -0
  268. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.ts +4 -0
  269. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.ts +4 -0
  270. package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.ts +4 -0
  271. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +3 -3
  272. package/src/stores/milestoning/QueryBuilderMilestoningState.ts +4 -4
  273. package/src/stores/workflows/MappingQueryBuilderState.ts +2 -2
  274. package/src/stores/workflows/ServiceQueryBuilderState.ts +2 -2
  275. package/src/stores/workflows/accessor/AccessorQueryBuilderHelper.ts +51 -0
  276. package/src/stores/workflows/accessor/AccessorQueryBuilderState.ts +200 -0
  277. package/src/stores/workflows/dataProduct/DataProductQueryBuilderState.ts +277 -26
  278. package/tsconfig.json +6 -0
@@ -22,19 +22,38 @@ import {
22
22
  GenericTypeExplicitReference,
23
23
  PrimitiveInstanceValue,
24
24
  SimpleFunctionExpression,
25
+ FunctionExpression,
25
26
  VariableExpression,
26
27
  Multiplicity,
27
28
  PrimitiveType,
29
+ ColSpec,
30
+ ColSpecArray,
31
+ ColSpecArrayInstance,
32
+ ColSpecInstanceValue,
33
+ RelationColumn,
28
34
  } from '@finos/legend-graph';
29
- import { guaranteeNonNullable } from '@finos/legend-shared';
35
+ import {
36
+ guaranteeNonNullable,
37
+ UnsupportedOperationError,
38
+ } from '@finos/legend-shared';
30
39
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graph/QueryBuilderMetaModelConst.js';
31
40
  import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
32
- import { getFunctionNameFromTDSSortColumn } from '../QueryBuilderTDSHelper.js';
41
+ import {
42
+ getFunctionNameFromTDSSortColumn,
43
+ getFunctionNameFromRelationSortColumn,
44
+ } from '../QueryBuilderTDSHelper.js';
33
45
  import {
34
46
  type QueryBuilderWindowColumnState,
35
47
  type QueryBuilderWindowState,
36
48
  QueryBuilderTDS_WindowAggreationOperatorState,
49
+ QueryBuilderTDS_WindowRankOperatorState,
37
50
  } from './QueryBuilderWindowState.js';
51
+ import { DEFAULT_LAMBDA_VARIABLE_NAME } from '@finos/legend-data-cube';
52
+ import {
53
+ DEFAULT_WINDOW_FUNCTION_PARTITION_VAR_NAME,
54
+ DEFAULT_WINDOW_FUNCTION_ROW_VAR_NAME,
55
+ DEFAULT_WINDOW_FUNCTION_WINDOW_VAR_NAME,
56
+ } from '../../../QueryBuilderConfig.js';
38
57
 
39
58
  const appendOLAPGroupByColumnState = (
40
59
  olapGroupByColumnState: QueryBuilderWindowColumnState,
@@ -78,16 +97,20 @@ const appendOLAPGroupByColumnState = (
78
97
 
79
98
  // create olap operation expression
80
99
  const operationState = olapGroupByColumnState.operatorState;
81
- const olapFunc = extractElementNameFromPath(operationState.operator.pureFunc);
100
+ const lambdaParameterName =
101
+ operationState.lambdaParameterNames[0] ?? DEFAULT_LAMBDA_VARIABLE_NAME;
102
+ const olapFunc = extractElementNameFromPath(
103
+ guaranteeNonNullable(
104
+ operationState.operator.pureFunc,
105
+ `Operator '${operationState.operator.getLabel()}' does not have a compatible OLAP function`,
106
+ ),
107
+ );
82
108
  const olapFuncExpression = new SimpleFunctionExpression(olapFunc);
83
109
  olapFuncExpression.parametersValues = [
84
- new VariableExpression(
85
- operationState.lambdaParameterName,
86
- Multiplicity.ONE,
87
- ),
110
+ new VariableExpression(lambdaParameterName, Multiplicity.ONE),
88
111
  ];
89
112
  const olapLambdaFuncInstance = buildGenericLambdaFunctionInstanceValue(
90
- operationState.lambdaParameterName,
113
+ [lambdaParameterName],
91
114
  [olapFuncExpression],
92
115
  graph,
93
116
  );
@@ -132,12 +155,227 @@ const appendOLAPGroupByColumnState = (
132
155
  return lambda;
133
156
  };
134
157
 
135
- export const appendOLAPGroupByState = (
136
- olapGroupByState: QueryBuilderWindowState,
158
+ export const appendOverExpression = (
159
+ extendColumnState: QueryBuilderWindowColumnState,
160
+ ): SimpleFunctionExpression => {
161
+ const overExpression = new SimpleFunctionExpression(
162
+ extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_OVER),
163
+ );
164
+
165
+ //TODO: handle over() where the first parameter is a ColSpec
166
+ const colSpecArrayInstance = new ColSpecArrayInstance(
167
+ Multiplicity.ONE,
168
+ undefined,
169
+ );
170
+ const colSpecArray = new ColSpecArray();
171
+ colSpecArrayInstance.values = [colSpecArray];
172
+
173
+ extendColumnState.windowColumns.forEach((column) => {
174
+ const colSpec = new ColSpec();
175
+ colSpec.name = column.columnName;
176
+ colSpecArray.colSpecs.push(colSpec);
177
+ });
178
+ overExpression.parametersValues.push(colSpecArrayInstance);
179
+
180
+ if (extendColumnState.sortByState) {
181
+ const sortByState = extendColumnState.sortByState;
182
+ const sortByFunction = new SimpleFunctionExpression(
183
+ getFunctionNameFromRelationSortColumn(sortByState.sortType),
184
+ );
185
+ const sortColSpec = new ColSpecInstanceValue(Multiplicity.ONE, undefined);
186
+ const sortCol = new ColSpec();
187
+ sortCol.name = sortByState.columnState.columnName;
188
+ sortColSpec.values = [sortCol];
189
+ sortByFunction.parametersValues[0] = sortColSpec;
190
+
191
+ const sortByCollection = new CollectionInstanceValue(Multiplicity.ONE);
192
+ sortByCollection.values = [sortByFunction];
193
+
194
+ overExpression.parametersValues.push(sortByCollection);
195
+ }
196
+
197
+ return overExpression;
198
+ };
199
+
200
+ const appendExtendColumnState = (
201
+ extendColumnState: QueryBuilderWindowColumnState,
137
202
  lambda: LambdaFunction,
138
203
  ): LambdaFunction => {
139
- olapGroupByState.windowColumns.forEach((c) =>
140
- appendOLAPGroupByColumnState(c, lambda),
204
+ const graph =
205
+ extendColumnState.windowState.tdsState.queryBuilderState.graphManagerState
206
+ .graph;
207
+
208
+ const overExpression = appendOverExpression(extendColumnState);
209
+
210
+ const operatorColSpecArrayInst = new ColSpecArrayInstance(
211
+ Multiplicity.ONE,
212
+ undefined,
141
213
  );
214
+ const operatorColSpecArray = new ColSpecArray();
215
+ operatorColSpecArrayInst.values = [operatorColSpecArray];
216
+
217
+ const operatorColSpec = new ColSpec();
218
+ operatorColSpec.name = extendColumnState.columnName;
219
+
220
+ const operatorState = extendColumnState.operatorState;
221
+ if (operatorState.lambdaParameterNames.length === 1) {
222
+ //this was previously nontyped, so need to add window function parameters
223
+ operatorState.setLambdaParameterNames([
224
+ DEFAULT_WINDOW_FUNCTION_PARTITION_VAR_NAME,
225
+ DEFAULT_WINDOW_FUNCTION_WINDOW_VAR_NAME,
226
+ DEFAULT_WINDOW_FUNCTION_ROW_VAR_NAME,
227
+ ]);
228
+ }
229
+
230
+ if (
231
+ operatorState instanceof QueryBuilderTDS_WindowAggreationOperatorState &&
232
+ operatorState.operator.relationFunc
233
+ ) {
234
+ const operatorFunc = extractElementNameFromPath(
235
+ operatorState.operator.relationFunc,
236
+ );
237
+
238
+ //parameters
239
+ const [
240
+ partitionParam = DEFAULT_WINDOW_FUNCTION_PARTITION_VAR_NAME,
241
+ windowParam = DEFAULT_WINDOW_FUNCTION_WINDOW_VAR_NAME,
242
+ rowParam = DEFAULT_WINDOW_FUNCTION_ROW_VAR_NAME,
243
+ aggParam = DEFAULT_LAMBDA_VARIABLE_NAME,
244
+ ] = operatorState.lambdaParameterNames;
245
+
246
+ // Build function1: the map lambda {p, w, r|$r.SOURCE_COL}
247
+ const columnAccessExpression = new FunctionExpression(
248
+ operatorState.columnState.columnName,
249
+ );
250
+ columnAccessExpression.func = new RelationColumn(
251
+ operatorState.columnState.columnName,
252
+ GenericTypeExplicitReference.create(
253
+ new GenericType(PrimitiveType.STRING),
254
+ ),
255
+ );
256
+ columnAccessExpression.parametersValues = [
257
+ new VariableExpression(rowParam, Multiplicity.ONE),
258
+ ];
259
+
260
+ const mapLambda = buildGenericLambdaFunctionInstanceValue(
261
+ [partitionParam, windowParam, rowParam],
262
+ [columnAccessExpression],
263
+ graph,
264
+ );
265
+
266
+ operatorColSpec.function1 = mapLambda;
267
+
268
+ // Build function2: the reduce lambda x|$x->operatorFunc()
269
+ const operatorFuncExpression = new SimpleFunctionExpression(operatorFunc);
270
+ operatorFuncExpression.parametersValues = [
271
+ new VariableExpression(aggParam, Multiplicity.ONE),
272
+ ];
273
+
274
+ //build col spec
275
+ const function2 = buildGenericLambdaFunctionInstanceValue(
276
+ [aggParam],
277
+ [operatorFuncExpression],
278
+ graph,
279
+ );
280
+
281
+ operatorColSpec.function2 = function2;
282
+
283
+ operatorColSpecArray.colSpecs.push(operatorColSpec);
284
+
285
+ const extendExpression = new SimpleFunctionExpression(
286
+ extractElementNameFromPath(
287
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_EXTEND,
288
+ ),
289
+ );
290
+ const currentExpression = guaranteeNonNullable(
291
+ lambda.expressionSequence[0],
292
+ );
293
+ extendExpression.parametersValues = [
294
+ currentExpression,
295
+ overExpression,
296
+ operatorColSpecArrayInst,
297
+ ];
298
+ lambda.expressionSequence[0] = extendExpression;
299
+ return lambda;
300
+ } else if (
301
+ operatorState instanceof QueryBuilderTDS_WindowRankOperatorState &&
302
+ operatorState.operator.relationFunc
303
+ ) {
304
+ const operatorFunc = extractElementNameFromPath(
305
+ operatorState.operator.relationFunc,
306
+ );
307
+ const operatorFuncExpression = new SimpleFunctionExpression(operatorFunc);
308
+ const [
309
+ partitionParam = DEFAULT_WINDOW_FUNCTION_PARTITION_VAR_NAME,
310
+ windowParam = DEFAULT_WINDOW_FUNCTION_WINDOW_VAR_NAME,
311
+ rowParam = DEFAULT_WINDOW_FUNCTION_ROW_VAR_NAME,
312
+ ] = operatorState.lambdaParameterNames;
313
+
314
+ if (
315
+ operatorFunc ===
316
+ extractElementNameFromPath(
317
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_ROW_NUMBER,
318
+ )
319
+ ) {
320
+ operatorFuncExpression.parametersValues = [
321
+ new VariableExpression(partitionParam, Multiplicity.ONE),
322
+ new VariableExpression(rowParam, Multiplicity.ONE),
323
+ ];
324
+ } else {
325
+ operatorFuncExpression.parametersValues = [
326
+ new VariableExpression(partitionParam, Multiplicity.ONE),
327
+ new VariableExpression(windowParam, Multiplicity.ONE),
328
+ new VariableExpression(rowParam, Multiplicity.ONE),
329
+ ];
330
+ }
331
+
332
+ const rankLambda = buildGenericLambdaFunctionInstanceValue(
333
+ [partitionParam, windowParam, rowParam],
334
+ [operatorFuncExpression],
335
+ graph,
336
+ );
337
+
338
+ operatorColSpec.function1 = rankLambda;
339
+ operatorColSpecArray.colSpecs.push(operatorColSpec);
340
+
341
+ const extendExpression = new SimpleFunctionExpression(
342
+ extractElementNameFromPath(
343
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_EXTEND,
344
+ ),
345
+ );
346
+
347
+ const currentExpression = guaranteeNonNullable(
348
+ lambda.expressionSequence[0],
349
+ );
350
+ extendExpression.parametersValues = [
351
+ currentExpression,
352
+ overExpression,
353
+ operatorColSpecArrayInst,
354
+ ];
355
+
356
+ lambda.expressionSequence[0] = extendExpression;
357
+ return lambda;
358
+ } else {
359
+ throw new UnsupportedOperationError(
360
+ `Unsupported window function. Function must be supported for typed TDS and be an aggregation or rank function.`,
361
+ );
362
+ }
363
+ };
364
+
365
+ export const appendWindowFunctionState = (
366
+ olapGroupByState: QueryBuilderWindowState,
367
+ lambda: LambdaFunction,
368
+ ): LambdaFunction => {
369
+ const typedTds =
370
+ olapGroupByState.tdsState.queryBuilderState.isFetchStructureTyped;
371
+ if (typedTds) {
372
+ olapGroupByState.windowColumns.forEach((c) =>
373
+ appendExtendColumnState(c, lambda),
374
+ );
375
+ } else {
376
+ olapGroupByState.windowColumns.forEach((c) =>
377
+ appendOLAPGroupByColumnState(c, lambda),
378
+ );
379
+ }
142
380
  return lambda;
143
381
  };
@@ -25,7 +25,9 @@ export abstract class QueryBuilderTDS_WindowOperator implements Hashable {
25
25
 
26
26
  abstract get hashCode(): string;
27
27
 
28
- abstract get pureFunc(): string;
28
+ abstract get pureFunc(): string | undefined;
29
+
30
+ abstract get relationFunc(): string | undefined;
29
31
 
30
32
  abstract isCompatibleWithType(type: Type | undefined): boolean;
31
33
 
@@ -32,6 +32,10 @@ export class QueryBuilderTDS_WindowOperator_Average extends QueryBuilderTDS_Wind
32
32
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.AVERAGE;
33
33
  }
34
34
 
35
+ get relationFunc(): string | undefined {
36
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.AVERAGE;
37
+ }
38
+
35
39
  get hashCode(): string {
36
40
  return hashArray([
37
41
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_AVERAGE,
@@ -32,6 +32,10 @@ export class QueryBuilderTDS_WindowOperator_Count extends QueryBuilderTDS_Window
32
32
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.COUNT;
33
33
  }
34
34
 
35
+ get relationFunc(): string | undefined {
36
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.COUNT;
37
+ }
38
+
35
39
  get hashCode(): string {
36
40
  return hashArray([
37
41
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_COUNT,
@@ -32,6 +32,10 @@ export class QueryBuilderTDS_WindowOperator_Max extends QueryBuilderTDS_WindowOp
32
32
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.MAX;
33
33
  }
34
34
 
35
+ get relationFunc(): string | undefined {
36
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.MAX;
37
+ }
38
+
35
39
  get hashCode(): string {
36
40
  return hashArray([
37
41
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_MAX,
@@ -32,6 +32,10 @@ export class QueryBuilderTDS_WindowOperator_Min extends QueryBuilderTDS_WindowOp
32
32
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.MIN;
33
33
  }
34
34
 
35
+ get relationFunc(): string | undefined {
36
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.MIN;
37
+ }
38
+
35
39
  get hashCode(): string {
36
40
  return hashArray([
37
41
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_MIN,
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { PRIMITIVE_TYPE, type Type } from '@finos/legend-graph';
18
+ import { QueryBuilderTDS_WindowOperator } from './QueryBuilderTDS_WindowOperator.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
21
+ import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
22
+
23
+ export class QueryBuilderTDS_WindowRankOperator_PercentRank extends QueryBuilderTDS_WindowOperator {
24
+ override getLabel(): string {
25
+ return 'percent rank';
26
+ }
27
+ override get pureFunc(): string | undefined {
28
+ // percentRank() is only supported for typed TDS
29
+ return undefined;
30
+ }
31
+ override get relationFunc(): string | undefined {
32
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_PERCENT_RANK;
33
+ }
34
+ override get hashCode(): string {
35
+ return hashArray([
36
+ QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_PERCENT_RANK,
37
+ ]);
38
+ }
39
+ override isCompatibleWithType(type: Type | undefined): boolean {
40
+ if (type) {
41
+ return (
42
+ [
43
+ PRIMITIVE_TYPE.STRING,
44
+ PRIMITIVE_TYPE.BOOLEAN,
45
+ PRIMITIVE_TYPE.NUMBER,
46
+ PRIMITIVE_TYPE.INTEGER,
47
+ PRIMITIVE_TYPE.DECIMAL,
48
+ PRIMITIVE_TYPE.FLOAT,
49
+ PRIMITIVE_TYPE.DATE,
50
+ PRIMITIVE_TYPE.STRICTDATE,
51
+ PRIMITIVE_TYPE.DATETIME,
52
+ ] as string[]
53
+ ).includes(type.path);
54
+ }
55
+ return true;
56
+ }
57
+ }
@@ -32,6 +32,10 @@ export class QueryBuilderTDS_WindowOperator_Sum extends QueryBuilderTDS_WindowOp
32
32
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.SUM;
33
33
  }
34
34
 
35
+ get relationFunc(): string | undefined {
36
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.SUM;
37
+ }
38
+
35
39
  get hashCode(): string {
36
40
  return hashArray([
37
41
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_SUM,
@@ -29,6 +29,11 @@ export class QueryBuilderTDS_WindowRankOperator_AverageRank extends QueryBuilder
29
29
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.OLAP_AVERAGE_RANK;
30
30
  }
31
31
 
32
+ get relationFunc(): string | undefined {
33
+ //averageRank not supported for typed TDS
34
+ return undefined;
35
+ }
36
+
32
37
  get hashCode(): string {
33
38
  return hashArray([
34
39
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_DENSE_RANK,
@@ -29,6 +29,10 @@ export class QueryBuilderTDS_WindowRankOperator_DenseRank extends QueryBuilderTD
29
29
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.OLAP_DENSE_RANK;
30
30
  }
31
31
 
32
+ get relationFunc(): string | undefined {
33
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_DENSE_RANK;
34
+ }
35
+
32
36
  get hashCode(): string {
33
37
  return hashArray([
34
38
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_DENSE_RANK,
@@ -29,6 +29,10 @@ export class QueryBuilderTDS_WindowRankOperator_Rank extends QueryBuilderTDS_Win
29
29
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.OLAP_RANK;
30
30
  }
31
31
 
32
+ get relationFunc(): string | undefined {
33
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_RANK;
34
+ }
35
+
32
36
  get hashCode(): string {
33
37
  return hashArray([
34
38
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_RANK,
@@ -29,6 +29,10 @@ export class QueryBuilderTDS_WindowRankOperator_RowNumber extends QueryBuilderTD
29
29
  return QUERY_BUILDER_SUPPORTED_FUNCTIONS.OLAP_ROW_NUMBER;
30
30
  }
31
31
 
32
+ get relationFunc(): string | undefined {
33
+ return QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_ROW_NUMBER;
34
+ }
35
+
32
36
  get hashCode(): string {
33
37
  return hashArray([
34
38
  QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_OPERATOR_ROW_NUMBER,
@@ -156,7 +156,7 @@ export const buildFilterConditionExpression = (
156
156
  } else if (clauses.length === 1) {
157
157
  const lambdaFunctionInstanceValue =
158
158
  buildGenericLambdaFunctionInstanceValue(
159
- node.lambdaParameterName ?? DEFAULT_LAMBDA_VARIABLE_NAME,
159
+ [node.lambdaParameterName ?? DEFAULT_LAMBDA_VARIABLE_NAME],
160
160
  clauses,
161
161
  filterState.queryBuilderState.graphManagerState.graph,
162
162
  );
@@ -175,7 +175,7 @@ export const buildFilterConditionExpression = (
175
175
  );
176
176
  simp.parametersValues = parametersValues;
177
177
  const lambdaFunctionInstanceValue = buildGenericLambdaFunctionInstanceValue(
178
- node.lambdaParameterName ?? DEFAULT_LAMBDA_VARIABLE_NAME,
178
+ [node.lambdaParameterName ?? DEFAULT_LAMBDA_VARIABLE_NAME],
179
179
  [simp],
180
180
  filterState.queryBuilderState.graphManagerState.graph,
181
181
  );
@@ -209,7 +209,7 @@ export const buildFilterExpression = (
209
209
  // param [1]
210
210
  filterExpression.parametersValues.push(
211
211
  buildGenericLambdaFunctionInstanceValue(
212
- filterState.lambdaParameterName,
212
+ [filterState.lambdaParameterName],
213
213
  filterConditionExpressions,
214
214
  filterState.queryBuilderState.graphManagerState.graph,
215
215
  ),
@@ -163,7 +163,7 @@ export class QueryBuilderMilestoningState implements Hashable {
163
163
  } else if (node instanceof QueryBuilderFilterTreeExistsNodeData) {
164
164
  if (
165
165
  node.propertyExpressionState.derivedPropertyExpressionStates[0] &&
166
- this.queryBuilderState.class?._generatedMilestonedProperties.includes(
166
+ this.queryBuilderState.sourceClass?._generatedMilestonedProperties.includes(
167
167
  node.propertyExpressionState.derivedPropertyExpressionStates[0]
168
168
  .derivedProperty,
169
169
  )
@@ -192,7 +192,7 @@ export class QueryBuilderMilestoningState implements Hashable {
192
192
  }
193
193
 
194
194
  get isCurrentClassMilestoned(): boolean {
195
- const currentclass = this.queryBuilderState.class;
195
+ const currentclass = this.queryBuilderState.sourceClass;
196
196
  if (currentclass !== undefined) {
197
197
  const stereotype = getMilestoneTemporalStereotype(
198
198
  currentclass,
@@ -204,7 +204,7 @@ export class QueryBuilderMilestoningState implements Hashable {
204
204
  }
205
205
 
206
206
  get isCurrentClassSupportsVersionsInRange(): boolean {
207
- const currentclass = this.queryBuilderState.class;
207
+ const currentclass = this.queryBuilderState.sourceClass;
208
208
  if (currentclass !== undefined) {
209
209
  const stereotype = getMilestoneTemporalStereotype(
210
210
  currentclass,
@@ -412,7 +412,7 @@ export class QueryBuilderMilestoningState implements Hashable {
412
412
  }
413
413
 
414
414
  updateMilestoningConfiguration(): void {
415
- const currentclass = this.queryBuilderState.class;
415
+ const currentclass = this.queryBuilderState.sourceClass;
416
416
  if (currentclass !== undefined) {
417
417
  const stereotype = getMilestoneTemporalStereotype(
418
418
  currentclass,
@@ -92,10 +92,10 @@ export class MappingQueryBuilderState extends QueryBuilderState {
92
92
  );
93
93
  // if there is no chosen class or the chosen one is not compatible
94
94
  // with the mapping then pick a compatible class if possible
95
- if (!this.class || !compatibleClasses.includes(this.class)) {
95
+ if (!this.sourceClass || !compatibleClasses.includes(this.sourceClass)) {
96
96
  const possibleNewClass = compatibleClasses[0];
97
97
  if (possibleNewClass) {
98
- this.changeClass(possibleNewClass);
98
+ this.changeSourceElement(possibleNewClass);
99
99
  }
100
100
  }
101
101
  }
@@ -169,10 +169,10 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
169
169
  );
170
170
  // if there is no chosen class or the chosen one is not compatible
171
171
  // with the mapping then pick a compatible class if possible
172
- if (!this.class || !compatibleClasses.includes(this.class)) {
172
+ if (!this.sourceClass || !compatibleClasses.includes(this.sourceClass)) {
173
173
  const possibleNewClass = compatibleClasses[0];
174
174
  if (possibleNewClass) {
175
- this.changeClass(possibleNewClass);
175
+ this.changeSourceElement(possibleNewClass);
176
176
  }
177
177
  }
178
178
  }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ type AccessorOwner,
19
+ type GraphManagerState,
20
+ type PackageableRuntime,
21
+ IngestDefinition,
22
+ Database,
23
+ DataProduct,
24
+ EngineRuntime,
25
+ LakehouseRuntime,
26
+ } from '@finos/legend-graph';
27
+ import { UnsupportedOperationError } from '@finos/legend-shared';
28
+
29
+ export const getCompatibleRuntimesFromAccessorOwner = (
30
+ accessorOwner: AccessorOwner,
31
+ graphManagerState: GraphManagerState,
32
+ ): PackageableRuntime[] => {
33
+ if (accessorOwner instanceof DataProduct) {
34
+ throw new UnsupportedOperationError(
35
+ `DataProduct is not supported as an accessor owner`,
36
+ );
37
+ }
38
+ if (accessorOwner instanceof IngestDefinition) {
39
+ return graphManagerState.usableRuntimes.filter(
40
+ (runtime) => runtime.runtimeValue instanceof LakehouseRuntime,
41
+ );
42
+ } else if (accessorOwner instanceof Database) {
43
+ return graphManagerState.usableRuntimes.filter(
44
+ (runtime) =>
45
+ runtime.runtimeValue instanceof EngineRuntime &&
46
+ !(runtime.runtimeValue instanceof LakehouseRuntime) &&
47
+ runtime.runtimeValue.mappings.length === 0,
48
+ );
49
+ }
50
+ return [];
51
+ };