@finos/legend-query-builder 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. package/lib/components/QueryBuilder.d.ts +1 -0
  2. package/lib/components/QueryBuilder.d.ts.map +1 -1
  3. package/lib/components/QueryBuilder.js +11 -2
  4. package/lib/components/QueryBuilder.js.map +1 -1
  5. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +23 -0
  6. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -0
  7. package/lib/components/QueryBuilderConstantExpressionPanel.js +104 -0
  8. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -0
  9. package/lib/components/QueryBuilderDiffPanel.d.ts +1 -0
  10. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  11. package/lib/components/QueryBuilderDiffPanel.js +1 -2
  12. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  13. package/lib/components/QueryBuilderParametersPanel.d.ts +1 -9
  14. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderParametersPanel.js +8 -26
  16. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +1 -0
  18. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderPropertyExpressionEditor.js +60 -12
  20. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  21. package/lib/components/QueryBuilderResultPanel.d.ts +1 -0
  22. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderSideBar.d.ts +3 -1
  24. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderSideBar.js +6 -14
  26. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  27. package/lib/components/QueryBuilderTextEditor.d.ts +1 -0
  28. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +1 -0
  30. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  31. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +1 -0
  32. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  33. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +1 -0
  34. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  35. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +12 -18
  36. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  37. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +1 -0
  38. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  39. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +1 -0
  40. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  41. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -0
  42. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.d.ts → QueryBuilderOLAPGroupByPanel.d.ts} +3 -2
  44. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +1 -0
  45. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.js → QueryBuilderOLAPGroupByPanel.js} +2 -2
  46. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +1 -0
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +1 -0
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +9 -11
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +1 -0
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +1 -1
  54. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +1 -0
  56. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +1 -0
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -4
  60. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  61. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +1 -0
  62. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.js +8 -9
  64. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  65. package/lib/components/shared/BasicValueSpecificationEditor.d.ts +12 -1
  66. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  67. package/lib/components/shared/BasicValueSpecificationEditor.js +11 -7
  68. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  69. package/lib/components/shared/LambdaEditor.d.ts +1 -0
  70. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaEditor.js +1 -15
  72. package/lib/components/shared/LambdaEditor.js.map +1 -1
  73. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
  74. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  75. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +36 -0
  76. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
  77. package/lib/components/shared/QueryBuilderVariableSelector.js +50 -0
  78. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
  79. package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
  80. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  81. package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
  82. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  83. package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
  84. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  85. package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
  86. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  87. package/lib/index.css +2 -2
  88. package/lib/index.css.map +1 -1
  89. package/lib/package.json +6 -6
  90. package/lib/stores/QueryBuilderConfig.d.ts +1 -0
  91. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  92. package/lib/stores/QueryBuilderConfig.js +1 -0
  93. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  94. package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
  95. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
  96. package/lib/stores/QueryBuilderConstantsState.js +116 -0
  97. package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
  98. package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
  99. package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
  100. package/lib/stores/QueryBuilderParametersState.js +0 -1
  101. package/lib/stores/QueryBuilderParametersState.js.map +1 -1
  102. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
  103. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  104. package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
  105. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  106. package/lib/stores/QueryBuilderState.d.ts +9 -3
  107. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  108. package/lib/stores/QueryBuilderState.js +19 -4
  109. package/lib/stores/QueryBuilderState.js.map +1 -1
  110. package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
  111. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  112. package/lib/stores/QueryBuilderStateBuilder.js +50 -42
  113. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  114. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  115. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
  116. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  117. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  118. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
  119. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  120. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  121. package/lib/stores/QueryBuilderValueSpecificationHelper.js +4 -20
  122. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  123. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
  124. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  125. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
  126. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  127. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -1
  128. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +2 -2
  130. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  131. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
  132. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  133. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
  134. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  135. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
  136. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
  137. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
  138. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
  139. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
  140. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
  141. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
  142. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
  143. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
  144. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
  145. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
  151. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
  152. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  153. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
  154. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  155. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
  156. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  157. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
  158. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  159. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
  160. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  161. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
  162. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  163. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
  164. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
  165. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
  166. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
  167. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
  168. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
  169. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
  170. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
  171. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
  172. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
  173. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
  174. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
  175. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
  176. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
  177. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
  178. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
  179. package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +6 -2
  180. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
  181. package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +20 -20
  182. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
  183. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
  184. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
  185. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
  186. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
  187. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  188. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  189. package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
  190. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  191. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
  192. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
  193. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
  194. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
  195. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
  196. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
  197. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
  198. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
  199. package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
  200. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  201. package/package.json +13 -13
  202. package/src/components/QueryBuilder.tsx +38 -0
  203. package/src/components/QueryBuilderConstantExpressionPanel.tsx +284 -0
  204. package/src/components/QueryBuilderDiffPanel.tsx +0 -2
  205. package/src/components/QueryBuilderParametersPanel.tsx +22 -103
  206. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
  207. package/src/components/QueryBuilderSideBar.tsx +5 -22
  208. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
  209. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
  210. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
  211. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
  212. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
  213. package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
  214. package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
  215. package/src/components/shared/LambdaEditor.tsx +0 -15
  216. package/src/components/shared/QueryBuilderVariableSelector.tsx +186 -0
  217. package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
  218. package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
  219. package/src/stores/QueryBuilderConfig.ts +1 -0
  220. package/src/stores/QueryBuilderConstantsState.ts +173 -0
  221. package/src/stores/QueryBuilderParametersState.ts +0 -6
  222. package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
  223. package/src/stores/QueryBuilderState.ts +25 -4
  224. package/src/stores/QueryBuilderStateBuilder.ts +111 -52
  225. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
  226. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
  227. package/src/stores/QueryBuilderValueSpecificationHelper.ts +10 -29
  228. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
  229. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +2 -2
  230. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
  231. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
  232. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
  233. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
  234. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
  235. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
  236. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
  237. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
  238. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
  239. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
  240. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
  241. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
  242. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
  243. package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +55 -39
  244. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
  245. package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
  246. package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
  247. package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
  248. package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
  249. package/tsconfig.json +14 -6
  250. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
  251. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
  252. package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
  253. package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
  254. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
  255. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
  256. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
  257. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
  258. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
  259. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
  260. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
  261. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ type LambdaFunction,
18
19
  GraphFetchTreeInstanceValue,
19
20
  matchFunctionName,
20
21
  RootGraphFetchTree,
@@ -31,6 +32,7 @@ import { buildGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
31
32
  export const processGraphFetchExpression = (
32
33
  expression: SimpleFunctionExpression,
33
34
  queryBuilderState: QueryBuilderState,
35
+ parentLambda: LambdaFunction,
34
36
  ): void => {
35
37
  const functionName = expression.functionName;
36
38
 
@@ -55,6 +57,7 @@ export const processGraphFetchExpression = (
55
57
  );
56
58
  QueryBuilderValueSpecificationProcessor.process(
57
59
  precedingExpression,
60
+ parentLambda,
58
61
  queryBuilderState,
59
62
  );
60
63
 
@@ -77,6 +80,7 @@ export const processGraphFetchExpression = (
77
80
  export const processGraphFetchSerializeExpression = (
78
81
  expression: SimpleFunctionExpression,
79
82
  queryBuilderState: QueryBuilderState,
83
+ parentLambda: LambdaFunction,
80
84
  ): void => {
81
85
  // update fetch-structure
82
86
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -104,6 +108,7 @@ export const processGraphFetchSerializeExpression = (
104
108
  );
105
109
  QueryBuilderValueSpecificationProcessor.process(
106
110
  precedingExpression,
111
+ parentLambda,
107
112
  queryBuilderState,
108
113
  );
109
114
 
@@ -91,9 +91,9 @@ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecifi
91
91
  import { appendProjection } from './projection/QueryBuilderProjectionValueSpecificationBuilder.js';
92
92
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graphManager/QueryBuilderSupportedFunctions.js';
93
93
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../graphManager/QueryBuilderHashUtils.js';
94
- import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState_.js';
94
+ import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState.js';
95
95
  import type { QueryBuilderTDS_OLAPOperator } from './olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js';
96
- import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js';
96
+ import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js';
97
97
  import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
98
98
 
99
99
  export class QueryBuilderTDSState
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ type LambdaFunction,
18
19
  CollectionInstanceValue,
19
20
  LambdaFunctionInstanceValue,
20
21
  matchFunctionName,
@@ -41,6 +42,7 @@ export const processTDSAggregateExpression = (
41
42
  expression: SimpleFunctionExpression,
42
43
  parentExpression: SimpleFunctionExpression | undefined,
43
44
  queryBuilderState: QueryBuilderState,
45
+ parentLambda: LambdaFunction,
44
46
  ): void => {
45
47
  // check parent expression
46
48
  assertTrue(
@@ -65,6 +67,7 @@ export const processTDSAggregateExpression = (
65
67
  // TODO?: do we want to do more validation here for the shape of the column lambda?
66
68
  guaranteeNonNullable(expression.parametersValues[0]),
67
69
  expression,
70
+ parentLambda,
68
71
  queryBuilderState,
69
72
  );
70
73
 
@@ -137,6 +140,7 @@ export const processTDSAggregateExpression = (
137
140
  export const processTDSGroupByExpression = (
138
141
  expression: SimpleFunctionExpression,
139
142
  queryBuilderState: QueryBuilderState,
143
+ parentLambda: LambdaFunction,
140
144
  ): void => {
141
145
  // update fetch-structureTABULAR_DATA_STRUCTURE
142
146
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -164,6 +168,7 @@ export const processTDSGroupByExpression = (
164
168
  );
165
169
  QueryBuilderValueSpecificationProcessor.process(
166
170
  precedingExpression,
171
+ parentLambda,
167
172
  queryBuilderState,
168
173
  );
169
174
 
@@ -178,6 +183,7 @@ export const processTDSGroupByExpression = (
178
183
  QueryBuilderValueSpecificationProcessor.processChild(
179
184
  value,
180
185
  expression,
186
+ parentLambda,
181
187
  queryBuilderState,
182
188
  ),
183
189
  );
@@ -193,6 +199,7 @@ export const processTDSGroupByExpression = (
193
199
  QueryBuilderValueSpecificationProcessor.processChild(
194
200
  value,
195
201
  expression,
202
+ parentLambda,
196
203
  queryBuilderState,
197
204
  ),
198
205
  );
@@ -44,11 +44,12 @@ import {
44
44
  QueryBuilderOLAPGroupByColumnState,
45
45
  QueryBuilderTDS_OLAPAggreationOperatorState,
46
46
  QueryBuilderTDS_OLAPRankOperatorState,
47
- } from './QueryBuilderOLAPGroupByState_.js';
47
+ } from './QueryBuilderOLAPGroupByState.js';
48
48
 
49
49
  export const processTDS_OLAPGroupByExpression = (
50
50
  expression: SimpleFunctionExpression,
51
51
  queryBuilderState: QueryBuilderState,
52
+ parentLambda: LambdaFunction,
52
53
  ): void => {
53
54
  // check parameters
54
55
  const parametersLength = expression.parametersValues.length;
@@ -90,6 +91,7 @@ export const processTDS_OLAPGroupByExpression = (
90
91
  );
91
92
  QueryBuilderValueSpecificationProcessor.process(
92
93
  precedingExpression,
94
+ parentLambda,
93
95
  queryBuilderState,
94
96
  );
95
97
 
@@ -34,7 +34,7 @@ import {
34
34
  type QueryBuilderOLAPGroupByColumnState,
35
35
  type QueryBuilderOLAPGroupByState,
36
36
  QueryBuilderTDS_OLAPAggreationOperatorState,
37
- } from './QueryBuilderOLAPGroupByState_.js';
37
+ } from './QueryBuilderOLAPGroupByState.js';
38
38
 
39
39
  const appendOLAPGroupByColumnState = (
40
40
  olapGroupByColumnState: QueryBuilderOLAPGroupByColumnState,
@@ -17,7 +17,7 @@
17
17
  import { Multiplicity } from '@finos/legend-graph';
18
18
  import { UnsupportedOperationError } from '@finos/legend-shared';
19
19
  import { QueryBuilderAggregateColumnState } from '../../aggregation/QueryBuilderAggregationState.js';
20
- import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState_.js';
20
+ import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState.js';
21
21
  import { QueryBuilderSimpleProjectionColumnState } from '../../projection/QueryBuilderProjectionColumnState.js';
22
22
  import type { QueryBuilderTDSColumnState } from '../../QueryBuilderTDSColumnState.js';
23
23
 
@@ -17,6 +17,7 @@
17
17
  import {
18
18
  type INTERNAL__UnknownValueSpecification,
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  AbstractPropertyExpression,
21
22
  CollectionInstanceValue,
22
23
  DerivedProperty,
@@ -59,6 +60,7 @@ import {
59
60
  export const processTDSProjectExpression = (
60
61
  expression: SimpleFunctionExpression,
61
62
  queryBuilderState: QueryBuilderState,
63
+ parentLambda: LambdaFunction,
62
64
  ): void => {
63
65
  // update fetch-structure
64
66
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -87,6 +89,7 @@ export const processTDSProjectExpression = (
87
89
  );
88
90
  QueryBuilderValueSpecificationProcessor.process(
89
91
  precedingExpression,
92
+ parentLambda,
90
93
  queryBuilderState,
91
94
  );
92
95
 
@@ -101,6 +104,7 @@ export const processTDSProjectExpression = (
101
104
  QueryBuilderValueSpecificationProcessor.processChild(
102
105
  value,
103
106
  expression,
107
+ parentLambda,
104
108
  queryBuilderState,
105
109
  ),
106
110
  );
@@ -236,6 +240,7 @@ export const processTDSProjectionDerivationExpression = (
236
240
  export const processTDSTakeExpression = (
237
241
  expression: SimpleFunctionExpression,
238
242
  queryBuilderState: QueryBuilderState,
243
+ parentLambda: LambdaFunction,
239
244
  ): void => {
240
245
  // check parameters
241
246
  assertTrue(
@@ -263,6 +268,7 @@ export const processTDSTakeExpression = (
263
268
  );
264
269
  QueryBuilderValueSpecificationProcessor.process(
265
270
  precedingExpression,
271
+ parentLambda,
266
272
  queryBuilderState,
267
273
  );
268
274
 
@@ -283,6 +289,7 @@ export const processTDSTakeExpression = (
283
289
  export const processTDSDistinctExpression = (
284
290
  expression: SimpleFunctionExpression,
285
291
  queryBuilderState: QueryBuilderState,
292
+ parentLambda: LambdaFunction,
286
293
  ): void => {
287
294
  // check parameters
288
295
  assertTrue(
@@ -309,6 +316,7 @@ export const processTDSDistinctExpression = (
309
316
  );
310
317
  QueryBuilderValueSpecificationProcessor.process(
311
318
  precedingExpression,
319
+ parentLambda,
312
320
  queryBuilderState,
313
321
  );
314
322
 
@@ -326,6 +334,7 @@ export const processTDSDistinctExpression = (
326
334
  export const processTDSSortExpression = (
327
335
  expression: SimpleFunctionExpression,
328
336
  queryBuilderState: QueryBuilderState,
337
+ parentLambda: LambdaFunction,
329
338
  ): void => {
330
339
  // check parameters
331
340
  assertTrue(
@@ -353,6 +362,7 @@ export const processTDSSortExpression = (
353
362
  );
354
363
  QueryBuilderValueSpecificationProcessor.process(
355
364
  precedingExpression,
365
+ parentLambda,
356
366
  queryBuilderState,
357
367
  );
358
368
 
@@ -367,6 +377,7 @@ export const processTDSSortExpression = (
367
377
  QueryBuilderValueSpecificationProcessor.processChild(
368
378
  value,
369
379
  expression,
380
+ parentLambda,
370
381
  queryBuilderState,
371
382
  ),
372
383
  );
@@ -47,7 +47,7 @@ import {
47
47
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graphManager/QueryBuilderSupportedFunctions.js';
48
48
  import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
49
49
  import { buildPropertyExpressionChain } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
50
- import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js';
50
+ import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js';
51
51
  import { appendPostFilter } from '../post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js';
52
52
 
53
53
  const buildSortExpression = (
@@ -17,6 +17,7 @@
17
17
  import { isNonNullable, guaranteeNonNullable } from '@finos/legend-shared';
18
18
  import {
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  extractElementNameFromPath,
21
22
  SimpleFunctionExpression,
22
23
  } from '@finos/legend-graph';
@@ -80,22 +81,25 @@ const buildFilterConditionExpression = (
80
81
 
81
82
  export const buildFilterExpression = (
82
83
  filterState: QueryBuilderFilterState,
83
- getAllFunc: SimpleFunctionExpression,
84
- ): SimpleFunctionExpression | undefined => {
84
+ lambdaFunction: LambdaFunction,
85
+ ): void => {
85
86
  const filterConditionExpressions = filterState.rootIds
86
87
  .map((e) => guaranteeNonNullable(filterState.nodes.get(e)))
87
88
  .map((e) => buildFilterConditionExpression(filterState, e))
88
89
  .filter(isNonNullable);
89
90
 
90
91
  if (!filterConditionExpressions.length) {
91
- return undefined;
92
+ return;
92
93
  }
93
94
  // main filter expression
94
95
  const filterExpression = new SimpleFunctionExpression(
95
96
  extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.FILTER),
96
97
  );
98
+ const currentExpression = guaranteeNonNullable(
99
+ lambdaFunction.expressionSequence[0],
100
+ );
97
101
  // param [0]
98
- filterExpression.parametersValues.push(getAllFunc);
102
+ filterExpression.parametersValues.push(currentExpression);
99
103
  // param [1]
100
104
  filterExpression.parametersValues.push(
101
105
  buildGenericLambdaFunctionInstanceValue(
@@ -104,5 +108,6 @@ export const buildFilterExpression = (
104
108
  filterState.queryBuilderState.graphManagerState.graph,
105
109
  ),
106
110
  );
107
- return filterExpression;
111
+ // reprocess filter as main expression
112
+ lambdaFunction.expressionSequence[0] = filterExpression;
108
113
  };
@@ -0,0 +1,165 @@
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 ValueSpecification,
19
+ PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
20
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
21
+ type SimpleFunctionExpression,
22
+ AbstractPropertyExpression,
23
+ MILESTONING_STEREOTYPE,
24
+ INTERNAL__PropagatedValue,
25
+ } from '@finos/legend-graph';
26
+ import {
27
+ assertTrue,
28
+ guaranteeNonNullable,
29
+ guaranteeType,
30
+ } from '@finos/legend-shared';
31
+ import { getParameterValue } from '../../components/QueryBuilderSideBar.js';
32
+ import type { QueryBuilderDerivedPropertyExpressionState } from '../QueryBuilderPropertyEditorState.js';
33
+ import { QueryBuilderMilestoningImplementation } from './QueryBuilderMilestoningImplementation.js';
34
+
35
+ export class QueryBuilderBitemporalMilestoningImplementation extends QueryBuilderMilestoningImplementation {
36
+ getMilestoningDate(index?: number): ValueSpecification | undefined {
37
+ if (index === 0) {
38
+ return this.milestoningState.processingDate;
39
+ } else {
40
+ return this.milestoningState.businessDate;
41
+ }
42
+ }
43
+
44
+ getMilestoningToolTipText(): string {
45
+ return `Processing Date: ${getParameterValue(
46
+ this.getMilestoningDate(0),
47
+ )}, Business Date: ${getParameterValue(this.getMilestoningDate(1))}`;
48
+ }
49
+
50
+ initializeMilestoningParameters(force?: boolean): void {
51
+ if (!this.milestoningState.processingDate || force) {
52
+ this.milestoningState.setProcessingDate(
53
+ this.milestoningState.buildMilestoningParameter(
54
+ PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
55
+ ),
56
+ );
57
+ }
58
+ if (!this.milestoningState.businessDate || force) {
59
+ this.milestoningState.setBusinessDate(
60
+ this.milestoningState.buildMilestoningParameter(
61
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
62
+ ),
63
+ );
64
+ }
65
+ }
66
+
67
+ processGetAllParamaters(parameterValues: ValueSpecification[]): void {
68
+ assertTrue(
69
+ parameterValues.length === 3,
70
+ `Can't process getAll() expression: when used with a bitemporal milestoned class getAll() expects two parameters`,
71
+ );
72
+ this.milestoningState.setProcessingDate(parameterValues[1]);
73
+ this.milestoningState.setBusinessDate(parameterValues[2]);
74
+ }
75
+
76
+ buildGetAllParameters(getAllFunction: SimpleFunctionExpression): void {
77
+ getAllFunction.parametersValues.push(
78
+ guaranteeNonNullable(
79
+ this.getMilestoningDate(0),
80
+ `Milestoning class should have a parameter of type 'Date'`,
81
+ ),
82
+ );
83
+ getAllFunction.parametersValues.push(
84
+ guaranteeNonNullable(
85
+ this.getMilestoningDate(1),
86
+ `Milestoning class should have a parameter of type 'Date'`,
87
+ ),
88
+ );
89
+ }
90
+
91
+ generateMilestoningDate(
92
+ isDatePropagationSupported: boolean,
93
+ hasDefaultMilestoningDate: boolean,
94
+ prevPropertyExpression: AbstractPropertyExpression | undefined,
95
+ temporalSource: MILESTONING_STEREOTYPE | undefined,
96
+ idx?: number,
97
+ derivedPropertyExpressionState?: QueryBuilderDerivedPropertyExpressionState,
98
+ ): ValueSpecification {
99
+ this.initializeMilestoningParameters();
100
+ if (idx === 0) {
101
+ if (
102
+ temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
103
+ derivedPropertyExpressionState?.parameterValues.length === 1
104
+ ) {
105
+ return new INTERNAL__PropagatedValue(() =>
106
+ guaranteeNonNullable(
107
+ guaranteeType(prevPropertyExpression, AbstractPropertyExpression)
108
+ .parametersValues[1],
109
+ ),
110
+ );
111
+ }
112
+ let parameter;
113
+ if (
114
+ isDatePropagationSupported &&
115
+ prevPropertyExpression &&
116
+ !hasDefaultMilestoningDate
117
+ ) {
118
+ parameter = new INTERNAL__PropagatedValue(() =>
119
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[1]),
120
+ );
121
+ } else {
122
+ parameter = new INTERNAL__PropagatedValue(() =>
123
+ guaranteeNonNullable(this.getMilestoningDate(idx)),
124
+ );
125
+ parameter.isPropagatedValue = hasDefaultMilestoningDate
126
+ ? false
127
+ : isDatePropagationSupported;
128
+ }
129
+ return parameter;
130
+ } else {
131
+ if (
132
+ temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL &&
133
+ derivedPropertyExpressionState?.parameterValues.length === 1
134
+ ) {
135
+ return new INTERNAL__PropagatedValue(() =>
136
+ guaranteeNonNullable(
137
+ guaranteeType(
138
+ derivedPropertyExpressionState.propertyExpression
139
+ .parametersValues[0],
140
+ AbstractPropertyExpression,
141
+ ).parametersValues[1],
142
+ ),
143
+ );
144
+ }
145
+ let parameter;
146
+ if (
147
+ isDatePropagationSupported &&
148
+ prevPropertyExpression &&
149
+ !hasDefaultMilestoningDate
150
+ ) {
151
+ parameter = new INTERNAL__PropagatedValue(() =>
152
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[2]),
153
+ );
154
+ } else {
155
+ parameter = new INTERNAL__PropagatedValue(() =>
156
+ guaranteeNonNullable(this.getMilestoningDate(idx)),
157
+ );
158
+ parameter.isPropagatedValue = hasDefaultMilestoningDate
159
+ ? false
160
+ : isDatePropagationSupported;
161
+ }
162
+ return parameter;
163
+ }
164
+ }
165
+ }
@@ -0,0 +1,96 @@
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 ValueSpecification,
19
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
20
+ type SimpleFunctionExpression,
21
+ type AbstractPropertyExpression,
22
+ MILESTONING_STEREOTYPE,
23
+ INTERNAL__PropagatedValue,
24
+ } from '@finos/legend-graph';
25
+ import { assertTrue, guaranteeNonNullable } from '@finos/legend-shared';
26
+ import { getParameterValue } from '../../components/QueryBuilderSideBar.js';
27
+ import { QueryBuilderMilestoningImplementation } from './QueryBuilderMilestoningImplementation.js';
28
+
29
+ export class QueryBuilderBusinessTemporalMilestoningImplementation extends QueryBuilderMilestoningImplementation {
30
+ getMilestoningDate(): ValueSpecification | undefined {
31
+ return this.milestoningState.businessDate;
32
+ }
33
+
34
+ getMilestoningToolTipText(): string {
35
+ return `Business Date: ${getParameterValue(this.getMilestoningDate())}`;
36
+ }
37
+
38
+ initializeMilestoningParameters(force?: boolean): void {
39
+ if (!this.milestoningState.businessDate || force) {
40
+ this.milestoningState.setBusinessDate(
41
+ this.milestoningState.buildMilestoningParameter(
42
+ BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
43
+ ),
44
+ );
45
+ }
46
+ }
47
+
48
+ processGetAllParamaters(parameterValues: ValueSpecification[]): void {
49
+ assertTrue(
50
+ parameterValues.length === 2,
51
+ `Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
52
+ );
53
+ this.milestoningState.setBusinessDate(parameterValues[1]);
54
+ }
55
+
56
+ buildGetAllParameters(getAllFunction: SimpleFunctionExpression): void {
57
+ getAllFunction.parametersValues.push(
58
+ guaranteeNonNullable(
59
+ this.getMilestoningDate(),
60
+ `Milestoning class should have a parameter of type 'Date'`,
61
+ ),
62
+ );
63
+ }
64
+
65
+ generateMilestoningDate(
66
+ isDatePropagationSupported: boolean,
67
+ hasDefaultMilestoningDate: boolean,
68
+ prevPropertyExpression: AbstractPropertyExpression | undefined,
69
+ temporalSource: MILESTONING_STEREOTYPE | undefined,
70
+ ): ValueSpecification {
71
+ this.initializeMilestoningParameters();
72
+ if (
73
+ isDatePropagationSupported &&
74
+ prevPropertyExpression &&
75
+ !hasDefaultMilestoningDate
76
+ ) {
77
+ if (temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL) {
78
+ return new INTERNAL__PropagatedValue(() =>
79
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[1]),
80
+ );
81
+ } else {
82
+ return new INTERNAL__PropagatedValue(() =>
83
+ guaranteeNonNullable(prevPropertyExpression.parametersValues[2]),
84
+ );
85
+ }
86
+ } else {
87
+ const milestoningDate = new INTERNAL__PropagatedValue(() =>
88
+ guaranteeNonNullable(this.getMilestoningDate()),
89
+ );
90
+ milestoningDate.isPropagatedValue = hasDefaultMilestoningDate
91
+ ? false
92
+ : isDatePropagationSupported;
93
+ return milestoningDate;
94
+ }
95
+ }
96
+ }