@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
@@ -27,8 +27,8 @@ import {
27
27
  import type { QueryBuilderState } from './QueryBuilderState.js';
28
28
  import {
29
29
  AbstractPropertyExpression,
30
+ FunctionExpression,
30
31
  type EnumValueInstanceValue,
31
- type FunctionExpression,
32
32
  type GraphFetchTreeInstanceValue,
33
33
  type ValueSpecificationVisitor,
34
34
  type LambdaFunction,
@@ -55,6 +55,8 @@ import {
55
55
  PackageableElementExplicitReference,
56
56
  MILESTONING_STEREOTYPE,
57
57
  type ColSpecInstanceValue,
58
+ type AccessorInstanceValue,
59
+ RelationColumn,
58
60
  } from '@finos/legend-graph';
59
61
  import { processTDSPostFilterExpression } from './fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js';
60
62
  import { processFilterExpression } from './filter/QueryBuilderFilterStateBuilder.js';
@@ -76,6 +78,7 @@ import {
76
78
  processTDSProjectExpression,
77
79
  processTDSProjectionColumnPropertyExpression,
78
80
  processTDSProjectionDerivationExpression,
81
+ processTDSRelationColumn,
79
82
  processTDSSliceExpression,
80
83
  processTDSSortDirectionExpression,
81
84
  processTDSSortExpression,
@@ -87,7 +90,10 @@ import {
87
90
  QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS,
88
91
  } from '../graph/QueryBuilderMetaModelConst.js';
89
92
  import { LambdaParameterState } from './shared/LambdaParameterState.js';
90
- import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js';
93
+ import {
94
+ processTDS_ExtendExpression,
95
+ processTDS_OLAPGroupByExpression,
96
+ } from './fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js';
91
97
  import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
92
98
  import {
93
99
  type QueryBuilderConstantExpressionState,
@@ -117,7 +123,7 @@ const processGetAllExpression = (
117
123
  Class,
118
124
  `Can't process getAll() expression: getAll() return type is missing`,
119
125
  );
120
- queryBuilderState.setClass(_class);
126
+ queryBuilderState.setSourceElement(_class);
121
127
  queryBuilderState.milestoningState.clearMilestoningDates();
122
128
  queryBuilderState.explorerState.refreshTreeData();
123
129
 
@@ -149,7 +155,7 @@ const processGetAllVersionsExpression = (
149
155
  Class,
150
156
  `Can't process getAllVersions() expression: getAllVersions() return type is missing`,
151
157
  );
152
- queryBuilderState.setClass(_class);
158
+ queryBuilderState.setSourceElement(_class);
153
159
  queryBuilderState.milestoningState.clearMilestoningDates();
154
160
  queryBuilderState.explorerState.refreshTreeData();
155
161
 
@@ -183,7 +189,7 @@ const processGetAllVersionsInRangeExpression = (
183
189
  Class,
184
190
  `Can't process getAllVersionsInRange() expression: getAllVersionsInRange() return type is missing`,
185
191
  );
186
- queryBuilderState.setClass(_class);
192
+ queryBuilderState.setSourceElement(_class);
187
193
  queryBuilderState.milestoningState.clearMilestoningDates();
188
194
  queryBuilderState.explorerState.refreshTreeData();
189
195
 
@@ -309,24 +315,34 @@ const processFromFunction = (
309
315
  expression: SimpleFunctionExpression,
310
316
  queryBuilderState: QueryBuilderState,
311
317
  ): void => {
312
- // mapping
313
- const mappingInstanceExpression = guaranteeType(
314
- expression.parametersValues[1],
315
- InstanceValue,
316
- `Can't process from() expression: only support from() with 1st parameter as instance value`,
317
- );
318
- const mapping = guaranteeType(
319
- guaranteeType(
320
- mappingInstanceExpression.values[0],
321
- PackageableElementReference,
322
- `Can't process from() expression: only support from() with 1st parameter as packagableElement value`,
323
- ).value,
324
- Mapping,
325
- `Can't process from() expression: only support from() with 1st parameter as mapping value`,
326
- );
318
+ const mappingParameter =
319
+ expression.parametersValues[2] !== undefined
320
+ ? expression.parametersValues[1]
321
+ : undefined;
322
+ const runtimeParameter = mappingParameter
323
+ ? expression.parametersValues[2]
324
+ : expression.parametersValues[1];
325
+ let mapping: Mapping | undefined;
326
+ if (mappingParameter) {
327
+ // mapping
328
+ const mappingInstanceExpression = guaranteeType(
329
+ mappingParameter,
330
+ InstanceValue,
331
+ `Can't process from() expression: only support from() with 1st parameter as instance value`,
332
+ );
333
+ mapping = guaranteeType(
334
+ guaranteeType(
335
+ mappingInstanceExpression.values[0],
336
+ PackageableElementReference,
337
+ `Can't process from() expression: only support from() with 1st parameter as packagableElement value`,
338
+ ).value,
339
+ Mapping,
340
+ `Can't process from() expression: only support from() with 1st parameter as mapping value`,
341
+ );
342
+ }
327
343
  // runtime
328
344
  const runtimeInstanceExpression = guaranteeType(
329
- expression.parametersValues[2],
345
+ runtimeParameter,
330
346
  InstanceValue,
331
347
  `Can't process from() expression: only support from() with 2nd parameter as instance value`,
332
348
  );
@@ -516,6 +532,16 @@ export class QueryBuilderValueSpecificationProcessor
516
532
  throw new UnsupportedOperationError();
517
533
  }
518
534
 
535
+ visit_AccessorInstanceValue(
536
+ valueAccessorInstanceValue: AccessorInstanceValue,
537
+ ): void {
538
+ const value = guaranteeNonNullable(
539
+ valueAccessorInstanceValue.values[0],
540
+ `Accessor instance value must have a value`,
541
+ );
542
+ this.queryBuilderState.setSourceElement(value);
543
+ }
544
+
519
545
  visit_SimpleFunctionExpression(
520
546
  valueSpecification: SimpleFunctionExpression,
521
547
  ): void {
@@ -832,8 +858,8 @@ export class QueryBuilderValueSpecificationProcessor
832
858
  } else if (matchFunctionName(functionName, [SUPPORTED_FUNCTIONS.FROM])) {
833
859
  const parameters = valueSpecification.parametersValues;
834
860
  assertTrue(
835
- parameters.length === 3,
836
- 'From function expects 2 parameters (mapping and runtime)',
861
+ parameters.length === 3 || parameters.length === 2,
862
+ 'From function expects an optional mapping with required runtime',
837
863
  );
838
864
  processFromFunction(valueSpecification, this.queryBuilderState);
839
865
  QueryBuilderValueSpecificationProcessor.processChild(
@@ -874,6 +900,18 @@ export class QueryBuilderValueSpecificationProcessor
874
900
  this.parentLambda,
875
901
  );
876
902
  return;
903
+ } else if (
904
+ matchFunctionName(
905
+ functionName,
906
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_EXTEND,
907
+ )
908
+ ) {
909
+ processTDS_ExtendExpression(
910
+ valueSpecification,
911
+ this.queryBuilderState,
912
+ this.parentLambda,
913
+ );
914
+ return;
877
915
  }
878
916
  throw new UnsupportedOperationError(
879
917
  `Can't process expression of function ${functionName}()`,
@@ -983,38 +1021,64 @@ export class QueryBuilderValueSpecificationProcessor
983
1021
  `Can't process col spec array instance: value expected to be of size 1`,
984
1022
  );
985
1023
  guaranteeNonNullable(spec[0]).colSpecs.forEach((col) => {
986
- const _function1 = guaranteeType(
987
- col.function1,
988
- LambdaFunctionInstanceValue,
989
- `Can't process col spec: function1 not a lambda function instance value`,
990
- );
991
- assertTrue(_function1.values.length === 1);
992
- const lambdaVal = guaranteeNonNullable(_function1.values[0]);
993
- assertTrue(lambdaVal.expressionSequence.length === 1);
994
- const expression = guaranteeNonNullable(
995
- lambdaVal.expressionSequence[0],
996
- );
997
-
998
- if (expression instanceof AbstractPropertyExpression) {
999
- processTDSProjectionColumnPropertyExpression(
1000
- expression,
1001
- col.name,
1002
- this.queryBuilderState,
1024
+ const _function1 = col.function1;
1025
+ if (_function1 instanceof LambdaFunctionInstanceValue) {
1026
+ assertTrue(_function1.values.length === 1);
1027
+ const lambdaVal = guaranteeNonNullable(_function1.values[0]);
1028
+ assertTrue(lambdaVal.expressionSequence.length === 1);
1029
+ const expression = guaranteeNonNullable(
1030
+ lambdaVal.expressionSequence[0],
1003
1031
  );
1004
- } else if (expression instanceof INTERNAL__UnknownValueSpecification) {
1032
+ if (expression instanceof AbstractPropertyExpression) {
1033
+ processTDSProjectionColumnPropertyExpression(
1034
+ expression,
1035
+ col.name,
1036
+ this.queryBuilderState,
1037
+ );
1038
+ } else if (expression instanceof FunctionExpression) {
1039
+ const func = expression.func;
1040
+ const relationCol = guaranteeType(
1041
+ func,
1042
+ RelationColumn,
1043
+ 'Can`t process col spec: function1 lambda function does not contain a relation column',
1044
+ );
1045
+ processTDSRelationColumn(
1046
+ expression,
1047
+ col.name,
1048
+ relationCol,
1049
+ this.queryBuilderState,
1050
+ );
1051
+ } else if (
1052
+ expression instanceof INTERNAL__UnknownValueSpecification
1053
+ ) {
1054
+ assertNonNullable(
1055
+ this.parentExpression,
1056
+ `Can't process unknown value: parent expression cannot be retrieved`,
1057
+ );
1058
+ processTDSProjectionDerivationExpression(
1059
+ expression,
1060
+ col.name,
1061
+ this.parentExpression,
1062
+ this.queryBuilderState,
1063
+ );
1064
+ }
1065
+ } else if (_function1 instanceof INTERNAL__UnknownValueSpecification) {
1005
1066
  assertNonNullable(
1006
1067
  this.parentExpression,
1007
1068
  `Can't process unknown value: parent expression cannot be retrieved`,
1008
1069
  );
1009
1070
  processTDSProjectionDerivationExpression(
1010
- expression,
1071
+ _function1,
1011
1072
  col.name,
1012
1073
  this.parentExpression,
1013
1074
  this.queryBuilderState,
1014
1075
  );
1076
+ } else {
1077
+ throw new UnsupportedOperationError(
1078
+ `Can't process col spec: only support col spec with function lambda value`,
1079
+ );
1015
1080
  }
1016
1081
  });
1017
-
1018
1082
  return;
1019
1083
  } else if (
1020
1084
  matchFunctionName(this.parentExpression.functionName, [
@@ -36,6 +36,7 @@ export enum QUERY_BUILDER_STATE_HASH_STRUCTURE {
36
36
  AGGREGATE_OPERATOR_PERCENTILE = 'AGGREGATE_OPERATOR_PERCENTILE',
37
37
  AGGREGATION_STATE = 'AGGREGATION_STATE',
38
38
  SIMPLE_PROJECTION_COLUMN_STATE = 'SIMPLE_PROJECTION_COLUMN_STATE',
39
+ RELATION_COLUMN_PROJECTION_COLUMN_STATE = 'RELATION_COLUMN_PROJECTION_COLUMN_STATE',
39
40
  PROPERTY_EXPRESSION_STATE = 'PROPERTY_EXPRESSION_STATE',
40
41
  DERIVATION_PROJECTION_COLUMN_STATE = 'DERIVATION_PROJECTION_COLUMN_STATE',
41
42
  RESULT_SET_MODIFIER_STATE = 'RESULT_SET_MODIFIER_STATE',
@@ -85,6 +86,7 @@ export enum QUERY_BUILDER_STATE_HASH_STRUCTURE {
85
86
  TDS_WINDOW_OPERATOR_MIN = 'TDS_WINDOW_OPERATOR_MIN',
86
87
  TDS_WINDOW_OPERATOR_COUNT = 'TDS_WINDOW_OPERATOR_COUNT',
87
88
  TDS_WINDOW_OPERATOR_AVERAGE = 'TDS_WINDOW_OPERATOR_AVERAGE',
89
+ TDS_WINDOW_OPERATOR_PERCENT_RANK = 'TDS_WINDOW_OPERATOR_PERCENT_RANK',
88
90
 
89
91
  // filter state
90
92
  FILTER_TREE_GROUP_NODE_DATA = 'FILTER_TREE_GROUP_NODE_DATA',
@@ -180,9 +180,9 @@ const buildRawLambda = (
180
180
  );
181
181
 
182
182
  // build getAll function
183
- const _class = guaranteeNonNullable(queryBuilderState.class);
183
+ const _class = guaranteeNonNullable(queryBuilderState.sourceClass);
184
184
  const getAllFn = buildGetAllFunction(
185
- guaranteeNonNullable(queryBuilderState.class),
185
+ guaranteeNonNullable(queryBuilderState.sourceClass),
186
186
  Multiplicity.ONE,
187
187
  );
188
188
  const milestoningStereotype = getMilestoneTemporalStereotype(
@@ -220,7 +220,7 @@ const buildRawLambda = (
220
220
  colAliases.values.push(colAlias);
221
221
  const columnLambda = propertyExpression
222
222
  ? buildGenericLambdaFunctionInstanceValue(
223
- DEFAULT_LAMBDA_VARIABLE_NAME,
223
+ [DEFAULT_LAMBDA_VARIABLE_NAME],
224
224
  [propertyExpression],
225
225
  queryBuilderState.graphManagerState.graph,
226
226
  )
@@ -229,7 +229,7 @@ const buildRawLambda = (
229
229
  extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_AGG),
230
230
  );
231
231
  const aggregateLambda = buildGenericLambdaFunctionInstanceValue(
232
- DEFAULT_LAMBDA_VARIABLE_NAME,
232
+ [DEFAULT_LAMBDA_VARIABLE_NAME],
233
233
  [
234
234
  aggregationOperator.buildAggregateExpression(
235
235
  propertyExpression,
@@ -267,7 +267,7 @@ const buildRawLambda = (
267
267
  colAliases.values.push(colAlias);
268
268
  const columnLambda = propertyExpression
269
269
  ? buildGenericLambdaFunctionInstanceValue(
270
- DEFAULT_LAMBDA_VARIABLE_NAME,
270
+ [DEFAULT_LAMBDA_VARIABLE_NAME],
271
271
  [propertyExpression],
272
272
  queryBuilderState.graphManagerState.graph,
273
273
  )
@@ -322,7 +322,7 @@ const buildRawLambda = (
322
322
  postFilterExpression.parametersValues.push(value);
323
323
  }
324
324
  const filterLambda = buildGenericLambdaFunctionInstanceValue(
325
- DEFAULT_POST_FILTER_LAMBDA_VARIABLE_NAME,
325
+ [DEFAULT_POST_FILTER_LAMBDA_VARIABLE_NAME],
326
326
  [postFilterExpression],
327
327
  queryBuilderState.graphManagerState.graph,
328
328
  );
@@ -20,7 +20,7 @@ import {
20
20
  isNonNullable,
21
21
  } from '@finos/legend-shared';
22
22
  import {
23
- type Class,
23
+ Class,
24
24
  Multiplicity,
25
25
  getMilestoneTemporalStereotype,
26
26
  extractElementNameFromPath,
@@ -34,6 +34,7 @@ import {
34
34
  SimpleFunctionExpression,
35
35
  SUPPORTED_FUNCTIONS,
36
36
  RuntimePointer,
37
+ AccessorInstanceValue,
37
38
  } from '@finos/legend-graph';
38
39
  import type { QueryBuilderState } from './QueryBuilderState.js';
39
40
  import { buildFilterExpression } from './filter/QueryBuilderFilterValueSpecificationBuilder.js';
@@ -154,10 +155,6 @@ export const buildLambdaFunction = (
154
155
  queryBuilderState: QueryBuilderState,
155
156
  options?: LambdaFunctionBuilderOption,
156
157
  ): LambdaFunction => {
157
- const _class = guaranteeNonNullable(
158
- queryBuilderState.class,
159
- 'Class is required to build query',
160
- );
161
158
  const lambdaFunction = new LambdaFunction(
162
159
  new FunctionType(
163
160
  PackageableElementExplicitReference.create(
@@ -167,70 +164,86 @@ export const buildLambdaFunction = (
167
164
  ),
168
165
  );
169
166
 
170
- const milestoningStereotype = getMilestoneTemporalStereotype(
171
- _class,
172
- queryBuilderState.graphManagerState.graph,
167
+ const sourceElement = guaranteeNonNullable(
168
+ queryBuilderState.sourceElement,
169
+ 'Source element of type class or accessor is required to build query',
173
170
  );
171
+ if (sourceElement instanceof Class) {
172
+ const _class = guaranteeNonNullable(
173
+ queryBuilderState.sourceClass,
174
+ 'Class is required to build query',
175
+ );
174
176
 
175
- if (milestoningStereotype && options?.useAllVersionsForMilestoning) {
176
- // build getAllVersions() when we preview data for milestoned classes
177
- // because if we use getAll() we need to pass in data to execute the query
178
- // but we don't give user that option in this flow.
179
- const getAllVersionsFunction = buildGetAllVersionsFunction(
177
+ const milestoningStereotype = getMilestoneTemporalStereotype(
180
178
  _class,
181
- Multiplicity.ONE,
179
+ queryBuilderState.graphManagerState.graph,
182
180
  );
183
- lambdaFunction.expressionSequence[0] = getAllVersionsFunction;
184
- } else {
185
- switch (queryBuilderState.getAllFunction) {
186
- case QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS: {
187
- if (milestoningStereotype) {
188
- const getAllVersionsFunction = buildGetAllVersionsFunction(
189
- _class,
190
- Multiplicity.ONE,
191
- );
192
- lambdaFunction.expressionSequence[0] = getAllVersionsFunction;
193
- } else {
194
- throw new UnsupportedOperationError(
195
- `Unable to build query lamdba: getAllVersions() expects source class to be milestoned`,
196
- );
181
+
182
+ if (milestoningStereotype && options?.useAllVersionsForMilestoning) {
183
+ // build getAllVersions() when we preview data for milestoned classes
184
+ // because if we use getAll() we need to pass in data to execute the query
185
+ // but we don't give user that option in this flow.
186
+ const getAllVersionsFunction = buildGetAllVersionsFunction(
187
+ _class,
188
+ Multiplicity.ONE,
189
+ );
190
+ lambdaFunction.expressionSequence[0] = getAllVersionsFunction;
191
+ } else {
192
+ switch (queryBuilderState.getAllFunction) {
193
+ case QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS: {
194
+ if (milestoningStereotype) {
195
+ const getAllVersionsFunction = buildGetAllVersionsFunction(
196
+ _class,
197
+ Multiplicity.ONE,
198
+ );
199
+ lambdaFunction.expressionSequence[0] = getAllVersionsFunction;
200
+ } else {
201
+ throw new UnsupportedOperationError(
202
+ `Unable to build query lamdba: getAllVersions() expects source class to be milestoned`,
203
+ );
204
+ }
205
+ break;
197
206
  }
198
- break;
199
- }
200
- case QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS_IN_RANGE: {
201
- if (milestoningStereotype) {
202
- const getAllVersionsInRangeFunction =
203
- buildGetAllVersionsInRangeFunction(_class, Multiplicity.ONE);
204
- queryBuilderState.milestoningState
205
- .getMilestoningImplementation(milestoningStereotype)
206
- .buildGetAllVersionsInRangeParameters(
207
- getAllVersionsInRangeFunction,
207
+ case QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS_IN_RANGE: {
208
+ if (milestoningStereotype) {
209
+ const getAllVersionsInRangeFunction =
210
+ buildGetAllVersionsInRangeFunction(_class, Multiplicity.ONE);
211
+ queryBuilderState.milestoningState
212
+ .getMilestoningImplementation(milestoningStereotype)
213
+ .buildGetAllVersionsInRangeParameters(
214
+ getAllVersionsInRangeFunction,
215
+ );
216
+ lambdaFunction.expressionSequence[0] =
217
+ getAllVersionsInRangeFunction;
218
+ } else {
219
+ throw new UnsupportedOperationError(
220
+ `Unable to build query lamdba: getAllVersionsInRange() expects source class to be milestoned`,
208
221
  );
209
- lambdaFunction.expressionSequence[0] = getAllVersionsInRangeFunction;
210
- } else {
211
- throw new UnsupportedOperationError(
212
- `Unable to build query lamdba: getAllVersionsInRange() expects source class to be milestoned`,
213
- );
222
+ }
223
+ break;
214
224
  }
215
- break;
216
- }
217
- case QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL: {
218
- // build getAll()
219
- const getAllFunction = buildGetAllFunction(_class, Multiplicity.ONE);
220
- if (milestoningStereotype) {
221
- // build milestoning parameter(s) for getAll()
222
- queryBuilderState.milestoningState
223
- .getMilestoningImplementation(milestoningStereotype)
224
- .buildGetAllParameters(getAllFunction);
225
+ case QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL: {
226
+ // build getAll()
227
+ const getAllFunction = buildGetAllFunction(_class, Multiplicity.ONE);
228
+ if (milestoningStereotype) {
229
+ // build milestoning parameter(s) for getAll()
230
+ queryBuilderState.milestoningState
231
+ .getMilestoningImplementation(milestoningStereotype)
232
+ .buildGetAllParameters(getAllFunction);
233
+ }
234
+ lambdaFunction.expressionSequence[0] = getAllFunction;
235
+ break;
225
236
  }
226
- lambdaFunction.expressionSequence[0] = getAllFunction;
227
- break;
237
+ default:
238
+ throw new UnsupportedOperationError(
239
+ `Unable to build query lambda: unknown ${queryBuilderState.getAllFunction} function`,
240
+ );
228
241
  }
229
- default:
230
- throw new UnsupportedOperationError(
231
- `Unable to build query lambda: unknown ${queryBuilderState.getAllFunction} function`,
232
- );
233
242
  }
243
+ } else {
244
+ const accessorInstanceValue = new AccessorInstanceValue();
245
+ accessorInstanceValue.values = [sourceElement];
246
+ lambdaFunction.expressionSequence[0] = accessorInstanceValue;
234
247
  }
235
248
 
236
249
  // build watermark
@@ -299,7 +299,7 @@ export const generateDefaultValueForPrimitiveType = (
299
299
  };
300
300
 
301
301
  export const buildGenericLambdaFunctionInstanceValue = (
302
- lambdaParameterName: string,
302
+ lambdaParameterNames: string[],
303
303
  lambdaBodyExpressions: ValueSpecification[],
304
304
  graph: PureModel,
305
305
  ): LambdaFunctionInstanceValue => {
@@ -310,9 +310,11 @@ export const buildGenericLambdaFunctionInstanceValue = (
310
310
  ),
311
311
  Multiplicity.ONE,
312
312
  );
313
- functionType.parameters.push(
314
- new VariableExpression(lambdaParameterName, Multiplicity.ONE),
313
+
314
+ functionType.parameters = lambdaParameterNames.map(
315
+ (parameterName) => new VariableExpression(parameterName, Multiplicity.ONE),
315
316
  );
317
+
316
318
  const lambdaFunction = new LambdaFunction(functionType);
317
319
  lambdaFunction.expressionSequence = lambdaBodyExpressions;
318
320
  functionInstanceValue.values.push(lambdaFunction);
@@ -140,7 +140,7 @@ export const TEST__setUpQueryBuilderState = async (
140
140
  }
141
141
  if (executionContext) {
142
142
  const graph = queryBuilderState.graphManagerState.graph;
143
- queryBuilderState.class = graph.getClass(executionContext._class);
143
+ queryBuilderState.sourceElement = graph.getClass(executionContext._class);
144
144
  queryBuilderState.executionContextState.mapping = graph.getMapping(
145
145
  executionContext.mapping,
146
146
  );