@finos/legend-application-query 5.2.4 → 5.2.7

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 (231) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +22 -11
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderResultPanel.js +14 -9
  6. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  7. package/lib/components/QueryBuilderSetupPanel.js +1 -1
  8. package/lib/components/QueryBuilderSetupPanel.js.map +1 -1
  9. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts +2 -0
  10. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  11. package/lib/components/explorer/QueryBuilderExplorerPanel.js +21 -5
  12. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  13. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +2 -2
  14. package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
  15. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  16. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +22 -105
  17. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
  18. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -2
  19. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  20. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +8 -10
  21. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  22. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  23. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +23 -17
  24. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  25. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts +2 -2
  26. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts.map +1 -1
  27. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js +15 -12
  28. package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +2 -2
  30. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  31. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +23 -28
  32. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  33. package/lib/components/filter/QueryBuilderFilterPanel.js +7 -7
  34. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  35. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -1
  36. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +1 -1
  37. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
  38. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  39. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +5 -3
  40. package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/package.json +13 -13
  44. package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
  45. package/lib/stores/QueryBuilderPreviewDataHelper.js +17 -14
  46. package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
  47. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  48. package/lib/stores/QueryBuilderPropertyEditorState.js +34 -24
  49. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  50. package/lib/stores/QueryBuilderState.d.ts +1 -2
  51. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  52. package/lib/stores/QueryBuilderState.js +17 -26
  53. package/lib/stores/QueryBuilderState.js.map +1 -1
  54. package/lib/stores/QueryBuilderStateBuilder.d.ts +124 -0
  55. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -0
  56. package/lib/stores/QueryBuilderStateBuilder.js +310 -0
  57. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -0
  58. package/lib/stores/{QueryBuilderTestUtils.d.ts → QueryBuilderStateTestUtils.d.ts} +2 -2
  59. package/lib/stores/QueryBuilderStateTestUtils.d.ts.map +1 -0
  60. package/lib/stores/{QueryBuilderTestUtils.js → QueryBuilderStateTestUtils.js} +2 -2
  61. package/lib/stores/QueryBuilderStateTestUtils.js.map +1 -0
  62. package/lib/stores/QueryBuilderTypeaheadHelper.d.ts.map +1 -1
  63. package/lib/stores/QueryBuilderTypeaheadHelper.js +14 -12
  64. package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
  65. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +3 -11
  66. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  67. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +10 -319
  68. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  69. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +27 -0
  70. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -0
  71. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +153 -0
  72. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -0
  73. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +37 -1
  74. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  75. package/lib/stores/QueryBuilderValueSpecificationHelper.js +79 -2
  76. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  77. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +14 -9
  78. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  79. package/lib/stores/explorer/QueryBuilderExplorerState.js +62 -19
  80. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  81. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts +1 -1
  82. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts.map +1 -1
  83. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js +3 -1
  84. package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js.map +1 -1
  85. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +17 -0
  86. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  87. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +10 -0
  88. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  89. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts +3 -20
  90. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
  91. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +31 -73
  92. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
  93. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +17 -4
  94. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  95. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +110 -21
  96. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  97. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +20 -0
  98. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -0
  99. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +62 -0
  100. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -0
  101. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts +2 -1
  102. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts.map +1 -1
  103. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +4 -4
  104. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
  105. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts +9 -2
  106. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts.map +1 -1
  107. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js +28 -5
  108. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js.map +1 -1
  109. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js +2 -2
  110. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  111. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts +11 -2
  112. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts.map +1 -1
  113. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js +106 -5
  114. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js.map +1 -1
  115. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts +25 -0
  116. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -0
  117. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js +186 -0
  118. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js.map +1 -0
  119. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts +9 -4
  120. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  121. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js +129 -13
  122. package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  123. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts +20 -0
  124. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -0
  125. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js +96 -0
  126. package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -0
  127. package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js +1 -1
  128. package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js.map +1 -1
  129. package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.d.ts → QueryBuilderPostFilterStateBuilder.d.ts} +4 -3
  130. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -0
  131. package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.js → QueryBuilderPostFilterStateBuilder.js} +30 -21
  132. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -0
  133. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.d.ts.map +1 -1
  134. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js +1 -4
  135. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js.map +1 -1
  136. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +1 -1
  137. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  138. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +1 -1
  139. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  140. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +1 -1
  141. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  142. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +1 -1
  143. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  144. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +1 -1
  145. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js.map +1 -1
  146. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js +1 -1
  147. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
  148. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +1 -1
  149. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js.map +1 -1
  150. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +1 -1
  151. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  152. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +1 -1
  153. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js.map +1 -1
  154. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +1 -1
  155. package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  156. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts +19 -0
  157. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -0
  158. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +74 -0
  159. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -0
  160. package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.d.ts → QueryBuilderFilterValueSpecificationBuilder.d.ts} +1 -1
  161. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -0
  162. package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.js → QueryBuilderFilterValueSpecificationBuilder.js} +1 -1
  163. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -0
  164. package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.d.ts.map +1 -1
  165. package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js +5 -5
  166. package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js.map +1 -1
  167. package/package.json +20 -20
  168. package/src/components/QueryBuilder.tsx +47 -28
  169. package/src/components/QueryBuilderResultPanel.tsx +21 -14
  170. package/src/components/QueryBuilderSetupPanel.tsx +1 -1
  171. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +50 -10
  172. package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +2 -2
  173. package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +41 -175
  174. package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +9 -12
  175. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +62 -28
  176. package/src/components/fetch-structure/QueryBuilderProjectionPanel.tsx +74 -48
  177. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +33 -41
  178. package/src/components/filter/QueryBuilderFilterPanel.tsx +7 -7
  179. package/src/components/shared/QueryBuilderPanelIssueCountBadge.tsx +3 -1
  180. package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +5 -8
  181. package/src/stores/QueryBuilderPreviewDataHelper.ts +27 -18
  182. package/src/stores/QueryBuilderPropertyEditorState.ts +40 -31
  183. package/src/stores/QueryBuilderState.ts +26 -32
  184. package/src/stores/QueryBuilderStateBuilder.ts +584 -0
  185. package/src/stores/{QueryBuilderTestUtils.ts → QueryBuilderStateTestUtils.ts} +1 -1
  186. package/src/stores/QueryBuilderTypeaheadHelper.ts +23 -16
  187. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +24 -584
  188. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +248 -0
  189. package/src/stores/QueryBuilderValueSpecificationHelper.ts +114 -0
  190. package/src/stores/explorer/QueryBuilderExplorerState.ts +93 -32
  191. package/src/stores/explorer/QueryBuilderPropertySearchPanelState.ts +3 -1
  192. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +33 -2
  193. package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +53 -118
  194. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +166 -26
  195. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +131 -0
  196. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +7 -6
  197. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.ts +68 -4
  198. package/src/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.ts +2 -2
  199. package/src/stores/fetch-structure/projection/QueryBuilderProjectionState.ts +182 -3
  200. package/src/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.ts +426 -0
  201. package/src/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +266 -21
  202. package/src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.ts +228 -0
  203. package/src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.ts +1 -1
  204. package/src/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.ts → QueryBuilderPostFilterStateBuilder.ts} +68 -48
  205. package/src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts +1 -11
  206. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +1 -1
  207. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +1 -1
  208. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +1 -1
  209. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +1 -1
  210. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +1 -1
  211. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +1 -1
  212. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +1 -1
  213. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +1 -1
  214. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +1 -1
  215. package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +1 -1
  216. package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +155 -0
  217. package/src/stores/filter/{QueryBuilderValueSpecificationBuilder.ts → QueryBuilderFilterValueSpecificationBuilder.ts} +0 -0
  218. package/src/stores/filter/operators/QueryBuilderFilterOperatorHelper.ts +5 -5
  219. package/tsconfig.json +10 -5
  220. package/tsconfig.package.json +1 -1
  221. package/lib/stores/QueryBuilderTestUtils.d.ts.map +0 -1
  222. package/lib/stores/QueryBuilderTestUtils.js.map +0 -1
  223. package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts +0 -56
  224. package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts.map +0 -1
  225. package/lib/stores/QueryBuilderValueSpecificationProcessor.js +0 -548
  226. package/lib/stores/QueryBuilderValueSpecificationProcessor.js.map +0 -1
  227. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.d.ts.map +0 -1
  228. package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.js.map +0 -1
  229. package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.d.ts.map +0 -1
  230. package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.js.map +0 -1
  231. package/src/stores/QueryBuilderValueSpecificationProcessor.ts +0 -1254
@@ -25,12 +25,15 @@ import {
25
25
  TYPICAL_MULTIPLICITY_TYPE,
26
26
  type ValueSpecification,
27
27
  type LambdaFunction,
28
+ RootGraphFetchTreeInstanceValue,
28
29
  } from '@finos/legend-graph';
29
- import { guaranteeType } from '@finos/legend-shared';
30
+ import { guaranteeNonNullable, guaranteeType } from '@finos/legend-shared';
30
31
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../QueryBuilder_Const.js';
31
32
  import type { QueryBuilderState } from '../../QueryBuilderState.js';
33
+ import type { QueryBuilderGraphFetchTreeState } from './QueryBuilderGraphFetchTreeState.js';
34
+ import { isGraphFetchTreeDataEmpty } from './QueryBuilderGraphFetchTreeUtil.js';
32
35
 
33
- export const appendTakeLimit = (
36
+ const appendTakeLimit = (
34
37
  queryBuilderState: QueryBuilderState,
35
38
  lambda: LambdaFunction,
36
39
  previewLimit?: number | undefined,
@@ -67,8 +70,8 @@ export const appendTakeLimit = (
67
70
  multiplicityOne,
68
71
  );
69
72
 
70
- // NOTE: `take()` does not work on `graphFetch()` or `serialize()` so we will put it
71
- // right next to `all()`
73
+ // NOTE: `take()` does not work on `graphFetch()` or `serialize()` so we need to
74
+ // put it next to `all()`
72
75
  const serializeFunction = func;
73
76
  const graphFetchFunc = guaranteeType(
74
77
  serializeFunction.parametersValues[0],
@@ -88,3 +91,64 @@ export const appendTakeLimit = (
88
91
  }
89
92
  return lambda;
90
93
  };
94
+
95
+ export const appendGraphFetch = (
96
+ graphFetchTreeState: QueryBuilderGraphFetchTreeState,
97
+ lambdaFunction: LambdaFunction,
98
+ options?: {
99
+ /**
100
+ * Set queryBuilderState to `true` when we construct query for execution within the app.
101
+ * queryBuilderState will make the lambda function building process overrides several query values, such as the row limit.
102
+ */
103
+ isBuildingExecutionQuery?: boolean | undefined;
104
+ keepSourceInformation?: boolean | undefined;
105
+ },
106
+ ): void => {
107
+ const queryBuilderState = graphFetchTreeState.queryBuilderState;
108
+ const precedingExpression = guaranteeNonNullable(
109
+ lambdaFunction.expressionSequence[0],
110
+ `Can't build graph-fetch tree expression: preceding expression is not defined`,
111
+ );
112
+ const multiplicityOne =
113
+ queryBuilderState.graphManagerState.graph.getTypicalMultiplicity(
114
+ TYPICAL_MULTIPLICITY_TYPE.ONE,
115
+ );
116
+
117
+ // build graph-fetch tree
118
+ if (
119
+ graphFetchTreeState.treeData &&
120
+ !isGraphFetchTreeDataEmpty(graphFetchTreeState.treeData)
121
+ ) {
122
+ const graphFetchInstance = new RootGraphFetchTreeInstanceValue(
123
+ multiplicityOne,
124
+ );
125
+ graphFetchInstance.values = [graphFetchTreeState.treeData.tree];
126
+ const serializeFunction = new SimpleFunctionExpression(
127
+ extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.SERIALIZE),
128
+ multiplicityOne,
129
+ );
130
+ const graphFetchFunc = new SimpleFunctionExpression(
131
+ graphFetchTreeState.isChecked
132
+ ? extractElementNameFromPath(
133
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
134
+ )
135
+ : extractElementNameFromPath(
136
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
137
+ ),
138
+ multiplicityOne,
139
+ );
140
+
141
+ graphFetchFunc.parametersValues = [precedingExpression, graphFetchInstance];
142
+ serializeFunction.parametersValues = [graphFetchFunc, graphFetchInstance];
143
+ lambdaFunction.expressionSequence[0] = serializeFunction;
144
+ }
145
+
146
+ // build result set modifier: i.e. preview limit
147
+ if (options?.isBuildingExecutionQuery) {
148
+ appendTakeLimit(
149
+ queryBuilderState,
150
+ lambdaFunction,
151
+ queryBuilderState.resultState.previewLimit,
152
+ );
153
+ }
154
+ };
@@ -131,8 +131,8 @@ export class QueryBuilderSimpleProjectionColumnState extends QueryBuilderProject
131
131
  .nonNullableTreeData,
132
132
  node,
133
133
  this.projectionState.queryBuilderState.graphManagerState.graph,
134
- this.projectionState.queryBuilderState.explorerState
135
- .propertySearchPanelState.allMappedPropertyNodes,
134
+ this.projectionState.queryBuilderState.explorerState.propertySearchState
135
+ .allMappedPropertyNodes,
136
136
  ),
137
137
  );
138
138
  this.columnName = getPropertyChainName(
@@ -42,14 +42,25 @@ import {
42
42
  LAMBDA_PIPE,
43
43
  RawLambda,
44
44
  isStubbed_RawLambda,
45
+ Class,
46
+ type LambdaFunction,
47
+ type ValueSpecification,
48
+ AbstractPropertyExpression,
49
+ matchFunctionName,
50
+ SimpleFunctionExpression,
51
+ getAllSuperclasses,
45
52
  } from '@finos/legend-graph';
46
53
  import {
47
54
  DEFAULT_LAMBDA_VARIABLE_NAME,
48
55
  QUERY_BUILDER_SOURCE_ID_LABEL,
56
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS,
49
57
  } from '../../../QueryBuilder_Const.js';
50
58
  import { QueryBuilderAggregationState } from './aggregation/QueryBuilderAggregationState.js';
51
59
  import { buildGenericLambdaFunctionInstanceValue } from '../../QueryBuilderValueSpecificationHelper.js';
52
- import { QueryBuilderFetchStructureImplementationState } from '../QueryBuilderFetchStructureImplementationState.js';
60
+ import {
61
+ FETCH_STRUCTURE_IMPLEMENTATION,
62
+ QueryBuilderFetchStructureImplementationState,
63
+ } from '../QueryBuilderFetchStructureImplementationState.js';
53
64
  import { QueryResultSetModifierState } from './QueryResultSetModifierState.js';
54
65
  import { QueryBuilderPostFilterState } from './post-filter/QueryBuilderPostFilterState.js';
55
66
  import type { QueryBuilderPostFilterOperator } from './post-filter/QueryBuilderPostFilterOperator.js';
@@ -58,10 +69,22 @@ import type { QueryBuilderAggregateOperator } from './aggregation/QueryBuilderAg
58
69
  import { getQueryBuilderCoreAggregrationOperators } from './aggregation/QueryBuilderAggregateOperatorLoader.js';
59
70
  import {
60
71
  QueryBuilderDerivationProjectionColumnState,
72
+ QueryBuilderSimpleProjectionColumnState,
61
73
  type QueryBuilderProjectionColumnState,
62
- type QueryBuilderSimpleProjectionColumnState,
63
74
  } from './QueryBuilderProjectionColumnState.js';
64
75
  import type { QueryBuilderFetchStructureState } from '../QueryBuilderFetchStructureState.js';
76
+ import {
77
+ buildPropertyExpressionFromExplorerTreeNodeData,
78
+ generateExplorerTreePropertyNodeID,
79
+ generateExplorerTreeSubtypeNodeID,
80
+ type QueryBuilderExplorerTreePropertyNodeData,
81
+ } from '../../explorer/QueryBuilderExplorerState.js';
82
+ import {
83
+ ActionAlertActionType,
84
+ ActionAlertType,
85
+ } from '@finos/legend-application';
86
+ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecificationBuilderHelper.js';
87
+ import { appendProjection } from './QueryBuilderProjectionValueSpecificationBuilder.js';
65
88
 
66
89
  export class QueryBuilderProjectionState extends QueryBuilderFetchStructureImplementationState {
67
90
  columns: QueryBuilderProjectionColumnState[] = [];
@@ -91,7 +114,6 @@ export class QueryBuilderProjectionState extends QueryBuilderFetchStructureImple
91
114
  showPostFilterPanel: observable,
92
115
  derivations: computed,
93
116
  hasParserError: computed,
94
- validationIssues: computed,
95
117
  addColumn: action,
96
118
  moveColumn: action,
97
119
  replaceColumn: action,
@@ -110,6 +132,10 @@ export class QueryBuilderProjectionState extends QueryBuilderFetchStructureImple
110
132
  );
111
133
  }
112
134
 
135
+ get type(): string {
136
+ return FETCH_STRUCTURE_IMPLEMENTATION.PROJECTION;
137
+ }
138
+
113
139
  get derivations(): QueryBuilderDerivationProjectionColumnState[] {
114
140
  return this.columns.filter(
115
141
  filterByType(QueryBuilderDerivationProjectionColumnState),
@@ -122,6 +148,80 @@ export class QueryBuilderProjectionState extends QueryBuilderFetchStructureImple
122
148
  );
123
149
  }
124
150
 
151
+ get usedExplorerTreePropertyNodeIDs(): string[] {
152
+ let nodeIDs: string[] = [];
153
+ this.columns.forEach((column) => {
154
+ if (column instanceof QueryBuilderSimpleProjectionColumnState) {
155
+ let chunks: (string | Class)[] = [];
156
+ let currentExpression: ValueSpecification =
157
+ column.propertyExpressionState.propertyExpression;
158
+ while (currentExpression instanceof AbstractPropertyExpression) {
159
+ chunks.push(currentExpression.func.name);
160
+ currentExpression = guaranteeNonNullable(
161
+ currentExpression.parametersValues[0],
162
+ );
163
+ while (currentExpression instanceof SimpleFunctionExpression) {
164
+ if (
165
+ matchFunctionName(
166
+ currentExpression.functionName,
167
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.SUBTYPE,
168
+ ) &&
169
+ currentExpression.parametersValues.length >= 1 &&
170
+ currentExpression.parametersValues[1]?.genericType?.value
171
+ .rawType instanceof Class
172
+ ) {
173
+ // flatten subtype casting chain: stop pushing more classes
174
+ if (!(chunks[chunks.length - 1] instanceof Class)) {
175
+ chunks.push(
176
+ currentExpression.parametersValues[1]?.genericType?.value
177
+ .rawType,
178
+ );
179
+ }
180
+ currentExpression = guaranteeNonNullable(
181
+ currentExpression.parametersValues[0],
182
+ );
183
+ } else {
184
+ // unknown property expression
185
+ return;
186
+ }
187
+ }
188
+ }
189
+ chunks = chunks.reverse();
190
+ const chunkIDs: string[] = [];
191
+ const ids: string[] = [];
192
+
193
+ for (let i = 0; i < chunks.length; i++) {
194
+ const currentChunk = guaranteeNonNullable(chunks[i]);
195
+ const previousID = i > 0 ? guaranteeNonNullable(chunkIDs[i - 1]) : '';
196
+ if (currentChunk instanceof Class) {
197
+ getAllSuperclasses(currentChunk)
198
+ .concat(currentChunk)
199
+ .forEach((_class) =>
200
+ ids.push(
201
+ generateExplorerTreeSubtypeNodeID(previousID, _class.path),
202
+ ),
203
+ );
204
+ chunkIDs.push(
205
+ generateExplorerTreeSubtypeNodeID(previousID, currentChunk.path),
206
+ );
207
+ } else {
208
+ const id = generateExplorerTreePropertyNodeID(
209
+ previousID,
210
+ currentChunk,
211
+ );
212
+ chunkIDs.push(id);
213
+ ids.push(id);
214
+ }
215
+ }
216
+
217
+ nodeIDs = nodeIDs.concat(ids);
218
+ }
219
+ });
220
+
221
+ // deduplicate
222
+ return Array.from(new Set(nodeIDs).values());
223
+ }
224
+
125
225
  get validationIssues(): string[] | undefined {
126
226
  const hasDuplicatedProjectionColumns = this.columns.some(
127
227
  (column) =>
@@ -138,6 +238,17 @@ export class QueryBuilderProjectionState extends QueryBuilderFetchStructureImple
138
238
  return undefined;
139
239
  }
140
240
 
241
+ onClassChange(_class: Class | undefined): void {
242
+ return;
243
+ }
244
+
245
+ appendFetchStructure(
246
+ lambdaFunction: LambdaFunction,
247
+ options?: LambdaFunctionBuilderOption,
248
+ ): void {
249
+ appendProjection(this, lambdaFunction, options);
250
+ }
251
+
141
252
  setShowPostFilterPanel(val: boolean): void {
142
253
  this.showPostFilterPanel = val;
143
254
  }
@@ -387,4 +498,72 @@ export class QueryBuilderProjectionState extends QueryBuilderFetchStructureImple
387
498
  ),
388
499
  );
389
500
  }
501
+
502
+ fetchProperty(node: QueryBuilderExplorerTreePropertyNodeData): void {
503
+ this.addColumn(
504
+ new QueryBuilderSimpleProjectionColumnState(
505
+ this,
506
+ buildPropertyExpressionFromExplorerTreeNodeData(
507
+ this.queryBuilderState.explorerState.nonNullableTreeData,
508
+ node,
509
+ this.queryBuilderState.graphManagerState.graph,
510
+ this.queryBuilderState.explorerState.propertySearchState
511
+ .allMappedPropertyNodes,
512
+ ),
513
+ this.queryBuilderState.explorerState.humanizePropertyName,
514
+ ),
515
+ );
516
+ }
517
+
518
+ fetchProperties(nodes: QueryBuilderExplorerTreePropertyNodeData[]): void {
519
+ nodes.forEach((nodeToAdd) => {
520
+ this.addColumn(
521
+ new QueryBuilderSimpleProjectionColumnState(
522
+ this,
523
+ buildPropertyExpressionFromExplorerTreeNodeData(
524
+ this.queryBuilderState.explorerState.nonNullableTreeData,
525
+ nodeToAdd,
526
+ this.queryBuilderState.graphManagerState.graph,
527
+ this.queryBuilderState.explorerState.propertySearchState
528
+ .allMappedPropertyNodes,
529
+ ),
530
+ this.queryBuilderState.explorerState.humanizePropertyName,
531
+ ),
532
+ );
533
+ });
534
+ }
535
+
536
+ checkBeforeChangingImplementation(onChange: () => void): void {
537
+ if (
538
+ this.columns.length > 0
539
+ // NOTE: here we could potentially check for the presence of post-filter as well
540
+ // but we make the assumption that if there is no projection column, there should
541
+ // not be any post-filter at all
542
+ ) {
543
+ this.queryBuilderState.applicationStore.setActionAlertInfo({
544
+ message:
545
+ this.showPostFilterPanel && this.postFilterState.nodes.size > 0
546
+ ? 'With graph-fetch mode, post filter is not supported. Current projection columns and post filters will be lost when switching to the graph-fetch mode. Do you still want to proceed?'
547
+ : 'Current projection columns will be lost when switching to the graph-fetch mode. Do you still want to proceed?',
548
+ type: ActionAlertType.CAUTION,
549
+ actions: [
550
+ {
551
+ label: 'Proceed',
552
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
553
+ handler:
554
+ this.queryBuilderState.applicationStore.guardUnhandledError(
555
+ async () => onChange(),
556
+ ),
557
+ },
558
+ {
559
+ label: 'Cancel',
560
+ type: ActionAlertActionType.PROCEED,
561
+ default: true,
562
+ },
563
+ ],
564
+ });
565
+ } else {
566
+ onChange();
567
+ }
568
+ }
390
569
  }