@finos/legend-query-builder 3.0.8 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +20 -20
  2. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderTelemetryHelper.js +40 -40
  4. package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +51 -4
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryLoader.d.ts +30 -0
  9. package/lib/components/QueryLoader.d.ts.map +1 -0
  10. package/lib/components/QueryLoader.js +160 -0
  11. package/lib/components/QueryLoader.js.map +1 -0
  12. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +18 -0
  13. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  14. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +152 -15
  15. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  16. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -1
  17. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +2 -1
  18. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
  19. package/lib/graph/QueryBuilderMetaModelConst.d.ts +33 -0
  20. package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
  21. package/lib/graph/QueryBuilderMetaModelConst.js +34 -0
  22. package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
  23. package/lib/graph-manager/QueryBuilderConst.d.ts +20 -0
  24. package/lib/graph-manager/QueryBuilderConst.d.ts.map +1 -0
  25. package/lib/graph-manager/QueryBuilderConst.js +21 -0
  26. package/lib/graph-manager/QueryBuilderConst.js.map +1 -0
  27. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  28. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +3 -2
  29. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +27 -14
  32. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  33. package/lib/index.css +2 -2
  34. package/lib/index.css.map +1 -1
  35. package/lib/index.d.ts +3 -0
  36. package/lib/index.d.ts.map +1 -1
  37. package/lib/index.js +3 -0
  38. package/lib/index.js.map +1 -1
  39. package/lib/package.json +1 -1
  40. package/lib/stores/QueryBuilderState.d.ts +2 -0
  41. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  42. package/lib/stores/QueryBuilderState.js +7 -0
  43. package/lib/stores/QueryBuilderState.js.map +1 -1
  44. package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
  45. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  46. package/lib/stores/QueryBuilderStateBuilder.js +11 -2
  47. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  48. package/lib/stores/QueryBuilderStateHashUtils.d.ts +32 -1
  49. package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
  50. package/lib/stores/QueryBuilderStateHashUtils.js +32 -0
  51. package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
  52. package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
  53. package/lib/stores/QueryBuilderTextEditorState.js +12 -6
  54. package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
  55. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +30 -0
  56. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -0
  57. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.js +17 -0
  58. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.js.map +1 -0
  59. package/lib/stores/QueryLoaderState.d.ts +67 -0
  60. package/lib/stores/QueryLoaderState.d.ts.map +1 -0
  61. package/lib/stores/QueryLoaderState.js +205 -0
  62. package/lib/stores/QueryLoaderState.js.map +1 -0
  63. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +1 -1
  64. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  65. package/lib/stores/explorer/QueryBuilderExplorerState.js +2 -2
  66. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  67. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
  68. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +1 -0
  69. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
  70. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
  71. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  72. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +14 -4
  73. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  74. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts +38 -0
  75. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts.map +1 -0
  76. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js +54 -0
  77. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js.map +1 -0
  78. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.d.ts +18 -0
  79. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.d.ts.map +1 -0
  80. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.js +80 -0
  81. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.js.map +1 -0
  82. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts +8 -1
  83. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts.map +1 -1
  84. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js +24 -1
  85. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js.map +1 -1
  86. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  87. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +23 -0
  88. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  89. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts +22 -0
  90. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts.map +1 -0
  91. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js +61 -0
  92. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js.map +1 -0
  93. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts +28 -0
  94. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts.map +1 -0
  95. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js +55 -0
  96. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js.map +1 -0
  97. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts +28 -0
  98. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts.map +1 -0
  99. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js +55 -0
  100. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js.map +1 -0
  101. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts +28 -0
  102. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts.map +1 -0
  103. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js +55 -0
  104. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js.map +1 -0
  105. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts +28 -0
  106. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts.map +1 -0
  107. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js +55 -0
  108. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js.map +1 -0
  109. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts +28 -0
  110. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts.map +1 -0
  111. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js +55 -0
  112. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js.map +1 -0
  113. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts +28 -0
  114. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts.map +1 -0
  115. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js +55 -0
  116. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js.map +1 -0
  117. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts +28 -0
  118. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts.map +1 -0
  119. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js +55 -0
  120. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js.map +1 -0
  121. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts +28 -0
  122. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts.map +1 -0
  123. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js +55 -0
  124. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js.map +1 -0
  125. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts +28 -0
  126. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts.map +1 -0
  127. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js +55 -0
  128. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js.map +1 -0
  129. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts +28 -0
  130. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts.map +1 -0
  131. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js +55 -0
  132. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js.map +1 -0
  133. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts +28 -0
  134. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts.map +1 -0
  135. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js +55 -0
  136. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js.map +1 -0
  137. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts +28 -0
  138. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts.map +1 -0
  139. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js +55 -0
  140. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js.map +1 -0
  141. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts +28 -0
  142. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts.map +1 -0
  143. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js +55 -0
  144. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js.map +1 -0
  145. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts +28 -0
  146. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts.map +1 -0
  147. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js +55 -0
  148. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js.map +1 -0
  149. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts +28 -0
  150. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts.map +1 -0
  151. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js +55 -0
  152. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js.map +1 -0
  153. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts +28 -0
  154. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts.map +1 -0
  155. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js +55 -0
  156. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js.map +1 -0
  157. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts +28 -0
  158. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts.map +1 -0
  159. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js +55 -0
  160. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js.map +1 -0
  161. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts +28 -0
  162. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts.map +1 -0
  163. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js +55 -0
  164. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js.map +1 -0
  165. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts +28 -0
  166. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts.map +1 -0
  167. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js +55 -0
  168. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js.map +1 -0
  169. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts +28 -0
  170. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts.map +1 -0
  171. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js +55 -0
  172. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js.map +1 -0
  173. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts +28 -0
  174. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts.map +1 -0
  175. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js +55 -0
  176. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js.map +1 -0
  177. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts +28 -0
  178. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts.map +1 -0
  179. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js +55 -0
  180. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js.map +1 -0
  181. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts +28 -0
  182. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts.map +1 -0
  183. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js +55 -0
  184. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js.map +1 -0
  185. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts +28 -0
  186. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts.map +1 -0
  187. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js +55 -0
  188. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js.map +1 -0
  189. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts +28 -0
  190. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts.map +1 -0
  191. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js +55 -0
  192. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js.map +1 -0
  193. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts +28 -0
  194. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts.map +1 -0
  195. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js +55 -0
  196. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js.map +1 -0
  197. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts +28 -0
  198. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts.map +1 -0
  199. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js +55 -0
  200. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js.map +1 -0
  201. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts +28 -0
  202. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts.map +1 -0
  203. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js +55 -0
  204. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js.map +1 -0
  205. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts +28 -0
  206. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts.map +1 -0
  207. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js +55 -0
  208. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js.map +1 -0
  209. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts +28 -0
  210. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts.map +1 -0
  211. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js +55 -0
  212. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js.map +1 -0
  213. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts +28 -0
  214. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts.map +1 -0
  215. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js +55 -0
  216. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js.map +1 -0
  217. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  218. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +9 -1
  219. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  220. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  221. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  222. package/lib/stores/shared/ValueSpecificationEditorHelper.js +7 -1
  223. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  224. package/package.json +8 -8
  225. package/src/__lib__/QueryBuilderTelemetryHelper.ts +40 -59
  226. package/src/components/QueryBuilder.tsx +79 -0
  227. package/src/components/QueryLoader.tsx +501 -0
  228. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +456 -92
  229. package/src/components/shared/QueryBuilderPanelIssueCountBadge.tsx +2 -1
  230. package/src/graph/QueryBuilderMetaModelConst.ts +34 -0
  231. package/src/graph-manager/QueryBuilderConst.ts +20 -0
  232. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +10 -1
  233. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +73 -28
  234. package/src/index.ts +3 -0
  235. package/src/stores/QueryBuilderState.ts +8 -0
  236. package/src/stores/QueryBuilderStateBuilder.ts +33 -2
  237. package/src/stores/QueryBuilderStateHashUtils.ts +33 -0
  238. package/src/stores/QueryBuilderTextEditorState.ts +21 -14
  239. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +36 -0
  240. package/src/stores/QueryLoaderState.ts +298 -0
  241. package/src/stores/explorer/QueryBuilderExplorerState.ts +2 -1
  242. package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +1 -0
  243. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +22 -3
  244. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.ts +98 -0
  245. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.ts +83 -0
  246. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.ts +31 -0
  247. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +41 -0
  248. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.ts +175 -0
  249. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.ts +98 -0
  250. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.ts +98 -0
  251. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.ts +98 -0
  252. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.ts +99 -0
  253. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.ts +98 -0
  254. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.ts +98 -0
  255. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.ts +98 -0
  256. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.ts +98 -0
  257. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.ts +98 -0
  258. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.ts +98 -0
  259. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.ts +98 -0
  260. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.ts +98 -0
  261. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.ts +98 -0
  262. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.ts +98 -0
  263. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.ts +98 -0
  264. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.ts +98 -0
  265. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.ts +98 -0
  266. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.ts +98 -0
  267. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.ts +98 -0
  268. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.ts +98 -0
  269. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.ts +98 -0
  270. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.ts +98 -0
  271. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.ts +98 -0
  272. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.ts +98 -0
  273. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.ts +98 -0
  274. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.ts +98 -0
  275. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.ts +98 -0
  276. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.ts +98 -0
  277. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.ts +98 -0
  278. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.ts +98 -0
  279. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.ts +98 -0
  280. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +18 -1
  281. package/src/stores/shared/ValueSpecificationEditorHelper.ts +39 -2
  282. package/tsconfig.json +38 -0
@@ -0,0 +1,298 @@
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
+ DEFAULT_TYPEAHEAD_SEARCH_MINIMUM_SEARCH_LENGTH,
19
+ type GenericLegendApplicationStore,
20
+ } from '@finos/legend-application';
21
+ import {
22
+ type LightQuery,
23
+ QuerySearchSpecification,
24
+ type QueryInfo,
25
+ type BasicGraphManagerState,
26
+ type Query,
27
+ } from '@finos/legend-graph';
28
+ import {
29
+ ActionState,
30
+ type GeneratorFn,
31
+ assertErrorThrown,
32
+ guaranteeNonNullable,
33
+ } from '@finos/legend-shared';
34
+ import { makeObservable, observable, action, flow } from 'mobx';
35
+ import type { QueryBuilderState } from './QueryBuilderState.js';
36
+ import type {
37
+ LoadQueryFilterOption,
38
+ QueryBuilder_LegendApplicationPlugin_Extension,
39
+ } from './QueryBuilder_LegendApplicationPlugin_Extension.js';
40
+
41
+ export const QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT = 20;
42
+
43
+ export class QueryLoaderState {
44
+ readonly applicationStore: GenericLegendApplicationStore;
45
+ readonly graphManagerState: BasicGraphManagerState;
46
+
47
+ readonly searchQueriesState = ActionState.create();
48
+ readonly renameQueryState = ActionState.create();
49
+ readonly deleteQueryState = ActionState.create();
50
+ readonly previewQueryState = ActionState.create();
51
+
52
+ readonly decorateSearchSpecification?:
53
+ | ((val: QuerySearchSpecification) => QuerySearchSpecification)
54
+ | undefined;
55
+
56
+ readonly loadQuery: (query: LightQuery) => void;
57
+ readonly fetchDefaultQueries?: (() => Promise<LightQuery[]>) | undefined;
58
+ readonly generateDefaultQueriesSummaryText?:
59
+ | ((queries: LightQuery[]) => string)
60
+ | undefined;
61
+
62
+ readonly isReadOnly?: boolean | undefined;
63
+ readonly onQueryRenamed?: ((query: LightQuery) => void) | undefined;
64
+ readonly onQueryDeleted?: ((query: LightQuery) => void) | undefined;
65
+
66
+ queryBuilderState?: QueryBuilderState | undefined;
67
+
68
+ searchText = '';
69
+ showCurrentUserQueriesOnly = false; // TODO: if we start having more native filters, we should make them part of `extraFilters`
70
+ extraFilters = new Map<string, boolean>();
71
+ extraFilterOptions: LoadQueryFilterOption[] = [];
72
+ queries: LightQuery[] = [];
73
+
74
+ isQueryLoaderDialogOpen = false;
75
+ showingDefaultQueries = true;
76
+ showPreviewViewer = false;
77
+ queryPreviewContent?: QueryInfo;
78
+
79
+ constructor(
80
+ applicationStore: GenericLegendApplicationStore,
81
+ graphManagerState: BasicGraphManagerState,
82
+ options: {
83
+ decorateSearchSpecification?:
84
+ | ((val: QuerySearchSpecification) => QuerySearchSpecification)
85
+ | undefined;
86
+
87
+ loadQuery: (query: LightQuery) => void;
88
+ fetchDefaultQueries?: (() => Promise<LightQuery[]>) | undefined;
89
+ generateDefaultQueriesSummaryText?:
90
+ | ((queries: LightQuery[]) => string)
91
+ | undefined;
92
+
93
+ isReadOnly?: boolean | undefined;
94
+ onQueryRenamed?: ((query: LightQuery) => void) | undefined;
95
+ onQueryDeleted?: ((query: LightQuery) => void) | undefined;
96
+ },
97
+ ) {
98
+ makeObservable(this, {
99
+ isQueryLoaderDialogOpen: observable,
100
+ queryPreviewContent: observable,
101
+ showingDefaultQueries: observable,
102
+ queries: observable,
103
+ showCurrentUserQueriesOnly: observable,
104
+ showPreviewViewer: observable,
105
+ searchText: observable,
106
+ setSearchText: action,
107
+ setQueryLoaderDialogOpen: action,
108
+ setQueries: action,
109
+ setShowCurrentUserQueriesOnly: action,
110
+ setShowPreviewViewer: action,
111
+ searchQueries: flow,
112
+ getPreviewQueryContent: flow,
113
+ deleteQuery: flow,
114
+ renameQuery: flow,
115
+ initialize: flow,
116
+ });
117
+
118
+ this.applicationStore = applicationStore;
119
+ this.graphManagerState = graphManagerState;
120
+
121
+ this.loadQuery = options.loadQuery;
122
+ this.fetchDefaultQueries = options.fetchDefaultQueries;
123
+ this.generateDefaultQueriesSummaryText =
124
+ options.generateDefaultQueriesSummaryText;
125
+ this.decorateSearchSpecification = options.decorateSearchSpecification;
126
+ this.isReadOnly = options.isReadOnly;
127
+ this.onQueryRenamed = options.onQueryRenamed;
128
+ this.onQueryDeleted = options.onQueryDeleted;
129
+ }
130
+
131
+ setSearchText(val: string): void {
132
+ this.searchText = val;
133
+ }
134
+
135
+ setQueryLoaderDialogOpen(val: boolean): void {
136
+ this.isQueryLoaderDialogOpen = val;
137
+ }
138
+
139
+ setQueries(val: LightQuery[]): void {
140
+ this.queries = val;
141
+ }
142
+
143
+ setShowPreviewViewer(val: boolean): void {
144
+ this.showPreviewViewer = val;
145
+ }
146
+
147
+ setShowCurrentUserQueriesOnly(val: boolean): void {
148
+ this.showCurrentUserQueriesOnly = val;
149
+ }
150
+
151
+ reset(): void {
152
+ this.setShowCurrentUserQueriesOnly(false);
153
+ }
154
+
155
+ *initialize(queryBuilderState: QueryBuilderState): GeneratorFn<void> {
156
+ this.queryBuilderState = queryBuilderState;
157
+ this.extraFilterOptions = this.applicationStore.pluginManager
158
+ .getApplicationPlugins()
159
+ .flatMap(
160
+ (plugin) =>
161
+ (
162
+ plugin as QueryBuilder_LegendApplicationPlugin_Extension
163
+ ).getExtraLoadQueryFilterOptions?.() ?? [],
164
+ );
165
+ const extraFilters = this.extraFilterOptions.map((filterOption) =>
166
+ filterOption.label(guaranteeNonNullable(this.queryBuilderState)),
167
+ );
168
+ extraFilters.forEach(
169
+ (filter) => filter && this.extraFilters.set(filter, false),
170
+ );
171
+ }
172
+
173
+ *searchQueries(searchText: string): GeneratorFn<void> {
174
+ if (
175
+ searchText.length < DEFAULT_TYPEAHEAD_SEARCH_MINIMUM_SEARCH_LENGTH &&
176
+ !this.showCurrentUserQueriesOnly &&
177
+ Array.from(this.extraFilters.values()).every((value) => value === false)
178
+ ) {
179
+ // if no search text is specified, use fetch the default queries
180
+ if (!searchText) {
181
+ this.showingDefaultQueries = true;
182
+ this.searchQueriesState.inProgress();
183
+ this.queries = [];
184
+ try {
185
+ if (!this.fetchDefaultQueries) {
186
+ return;
187
+ }
188
+ this.queries = (yield this.fetchDefaultQueries()) as LightQuery[];
189
+ this.searchQueriesState.pass();
190
+ } catch (error) {
191
+ this.searchQueriesState.fail();
192
+ assertErrorThrown(error);
193
+ this.applicationStore.notificationService.notifyError(error);
194
+ }
195
+ }
196
+
197
+ // skip otherwise
198
+ return;
199
+ }
200
+
201
+ // search using the search term
202
+ this.showingDefaultQueries = false;
203
+ this.searchQueriesState.inProgress();
204
+ try {
205
+ let searchSpecification = new QuerySearchSpecification();
206
+ searchSpecification.searchTerm = searchText;
207
+ searchSpecification.limit = QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT + 1;
208
+ searchSpecification.showCurrentUserQueriesOnly =
209
+ this.showCurrentUserQueriesOnly;
210
+ if (this.queryBuilderState) {
211
+ Array.from(this.extraFilters.entries()).forEach(([key, value]) => {
212
+ if (value) {
213
+ const filterOption = this.extraFilterOptions.find(
214
+ (option) =>
215
+ option.label(guaranteeNonNullable(this.queryBuilderState)) ===
216
+ key,
217
+ );
218
+ if (filterOption) {
219
+ searchSpecification = filterOption.filterFunction(
220
+ searchSpecification,
221
+ guaranteeNonNullable(this.queryBuilderState),
222
+ );
223
+ }
224
+ }
225
+ });
226
+ }
227
+ searchSpecification =
228
+ this.decorateSearchSpecification?.(searchSpecification) ??
229
+ searchSpecification;
230
+ this.queries = (yield this.graphManagerState.graphManager.searchQueries(
231
+ searchSpecification,
232
+ )) as LightQuery[];
233
+ this.searchQueriesState.pass();
234
+ } catch (error) {
235
+ assertErrorThrown(error);
236
+ this.applicationStore.notificationService.notifyError(error);
237
+ this.searchQueriesState.fail();
238
+ }
239
+ }
240
+
241
+ *renameQuery(queryId: string, name: string): GeneratorFn<void> {
242
+ this.renameQueryState.inProgress();
243
+ try {
244
+ const query = (yield this.graphManagerState.graphManager.renameQuery(
245
+ queryId,
246
+ name,
247
+ )) as Query;
248
+ this.onQueryRenamed?.(query);
249
+ this.applicationStore.notificationService.notify(
250
+ 'Renamed query successfully',
251
+ );
252
+ this.renameQueryState.pass();
253
+ this.searchQueries(this.searchText); // trigger a search to refresh the query list
254
+ } catch (error) {
255
+ assertErrorThrown(error);
256
+ this.applicationStore.notificationService.notifyError(error);
257
+ this.renameQueryState.fail();
258
+ }
259
+ }
260
+
261
+ *deleteQuery(queryId: string): GeneratorFn<void> {
262
+ this.deleteQueryState.inProgress();
263
+ try {
264
+ const query = (yield this.graphManagerState.graphManager.deleteQuery(
265
+ queryId,
266
+ )) as Query;
267
+ this.onQueryDeleted?.(query);
268
+ this.applicationStore.notificationService.notify(
269
+ 'Deleted query successfully',
270
+ );
271
+ this.deleteQueryState.pass();
272
+ this.searchQueries(this.searchText); // trigger a search to refresh the query list
273
+ } catch (error) {
274
+ assertErrorThrown(error);
275
+ this.applicationStore.notificationService.notifyError(error);
276
+ this.deleteQueryState.fail();
277
+ }
278
+ }
279
+
280
+ *getPreviewQueryContent(queryId: string): GeneratorFn<void> {
281
+ this.previewQueryState.inProgress();
282
+ try {
283
+ const queryInfo = (yield this.graphManagerState.graphManager.getQueryInfo(
284
+ queryId,
285
+ )) as QueryInfo;
286
+ this.queryPreviewContent = queryInfo;
287
+ this.queryPreviewContent.content =
288
+ (yield this.graphManagerState.graphManager.prettyLambdaContent(
289
+ queryInfo.content,
290
+ )) as string;
291
+ this.previewQueryState.pass();
292
+ } catch (error) {
293
+ assertErrorThrown(error);
294
+ this.applicationStore.notificationService.notifyError(error);
295
+ this.previewQueryState.fail();
296
+ }
297
+ }
298
+ }
@@ -193,12 +193,13 @@ export class QueryBuilderExplorerTreeSubTypeNodeData extends QueryBuilderExplore
193
193
  export const buildPropertyExpressionFromExplorerTreeNodeData = (
194
194
  node: QueryBuilderExplorerTreePropertyNodeData,
195
195
  explorerState: QueryBuilderExplorerState,
196
+ lambdaParameterName?: string,
196
197
  ): AbstractPropertyExpression => {
197
198
  const treeData = explorerState.nonNullableTreeData;
198
199
  const propertySearchIndexedTreeNodes =
199
200
  explorerState.propertySearchState.indexedExplorerTreeNodes;
200
201
  const projectionColumnLambdaVariable = new VariableExpression(
201
- DEFAULT_LAMBDA_VARIABLE_NAME,
202
+ lambdaParameterName ?? DEFAULT_LAMBDA_VARIABLE_NAME,
202
203
  Multiplicity.ONE,
203
204
  );
204
205
  const propertyExpression = new AbstractPropertyExpression('');
@@ -62,6 +62,7 @@ export class QueryBuilderFetchStructureState {
62
62
  break;
63
63
  }
64
64
  case FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH: {
65
+ this.queryBuilderState.setIsCalendarEnabled(false);
65
66
  this.implementation = new QueryBuilderGraphFetchTreeState(
66
67
  this.queryBuilderState,
67
68
  this,
@@ -101,6 +101,8 @@ import { getQueryBuilderCoreWindowOperators } from './window/QueryBuilderWindowG
101
101
  import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
102
102
  import { QUERY_BUILDER_SETTING_KEY } from '../../../__lib__/QueryBuilderSetting.js';
103
103
  import type { ExportDataInfo } from '../../QueryBuilderResultState.js';
104
+ import type { QueryBuilderAggregateCalendarFunction } from './aggregation/QueryBuilderAggregateCalendarFunction.js';
105
+ import { getQueryBuilderCoreAggregrationCalendarFunctions } from './aggregation/QueryBuilderAggregateCalendarFunctionLoader.js';
104
106
 
105
107
  // TODO: should we support raw once externalize() is supported on TDS ?
106
108
  export enum TDS_EXECUTION_SERIALIZATION_FORMAT {
@@ -124,6 +126,8 @@ export class QueryBuilderTDSState
124
126
  getQueryBuilderCorePostFilterOperators();
125
127
  aggregationOperators: QueryBuilderAggregateOperator[] =
126
128
  getQueryBuilderCoreAggregrationOperators();
129
+ aggregationCalendarFunctions: QueryBuilderAggregateCalendarFunction[] =
130
+ getQueryBuilderCoreAggregrationCalendarFunctions();
127
131
  windowFuncOperators: QueryBuilderTDS_WindowOperator[] =
128
132
  getQueryBuilderCoreWindowOperators();
129
133
 
@@ -158,6 +162,7 @@ export class QueryBuilderTDSState
158
162
  this.aggregationState = new QueryBuilderAggregationState(
159
163
  this,
160
164
  this.aggregationOperators,
165
+ this.aggregationCalendarFunctions,
161
166
  );
162
167
  this.windowState = new QueryBuilderWindowState(
163
168
  this,
@@ -268,19 +273,33 @@ export class QueryBuilderTDSState
268
273
  }
269
274
 
270
275
  get fetchStructureValidationIssues(): string[] {
276
+ const validationIssues: string[] = [];
277
+ const hasInValidCalendarAggregateColumns =
278
+ this.aggregationState.columns.some(
279
+ (column) =>
280
+ column.calendarFunction &&
281
+ column.calendarFunction.dateColumn === undefined,
282
+ );
283
+ if (hasInValidCalendarAggregateColumns) {
284
+ validationIssues.push(
285
+ 'Query has calendar function with no date column specified',
286
+ );
287
+ }
271
288
  const hasDuplicatedProjectionColumns = this.projectionColumns.some(
272
289
  (column) =>
273
290
  this.projectionColumns.filter((c) => c.columnName === column.columnName)
274
291
  .length > 1,
275
292
  );
276
293
  if (hasDuplicatedProjectionColumns) {
277
- return ['Query has duplicated projection columns'];
294
+ validationIssues.push('Query has duplicated projection columns');
295
+ return validationIssues;
278
296
  }
279
297
  const hasNoProjectionColumns = this.projectionColumns.length === 0;
280
298
  if (hasNoProjectionColumns) {
281
- return ['Query has no projection columns'];
299
+ validationIssues.push('Query has no projection columns');
300
+ return validationIssues;
282
301
  }
283
- return [];
302
+ return validationIssues;
284
303
  }
285
304
 
286
305
  get allValidationIssues(): string[] {
@@ -0,0 +1,98 @@
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 { type Hashable, guaranteeType } from '@finos/legend-shared';
18
+ import type {
19
+ AbstractPropertyExpression,
20
+ PrimitiveInstanceValue,
21
+ SimpleFunctionExpression,
22
+ ValueSpecification,
23
+ } from '@finos/legend-graph';
24
+ import {
25
+ type QueryBuilderProjectionColumnState,
26
+ QueryBuilderSimpleProjectionColumnState,
27
+ } from '../projection/QueryBuilderProjectionColumnState.js';
28
+ import type { QueryBuilderAggregateColumnState } from './QueryBuilderAggregationState.js';
29
+ import { computed, makeObservable, observable, action } from 'mobx';
30
+ import type { QUERY_BUILDER_CALENDAR_TYPE } from '../../../../graph-manager/QueryBuilderConst.js';
31
+ import { DEFAULT_LAMBDA_VARIABLE_NAME } from '../../../QueryBuilderConfig.js';
32
+
33
+ export abstract class QueryBuilderAggregateCalendarFunction
34
+ implements Hashable
35
+ {
36
+ dateColumn?: AbstractPropertyExpression | undefined;
37
+ calendarType!: QUERY_BUILDER_CALENDAR_TYPE;
38
+ endDate!: PrimitiveInstanceValue;
39
+ lambdaParameterName: string = DEFAULT_LAMBDA_VARIABLE_NAME;
40
+
41
+ constructor() {
42
+ makeObservable(this, {
43
+ dateColumn: observable,
44
+ lambdaParameterName: observable,
45
+ calendarType: observable,
46
+ endDate: observable,
47
+ setDateColumn: action,
48
+ setCalendarType: action,
49
+ setLambdaParameterName: action,
50
+ setEndDate: action,
51
+ hashCode: computed,
52
+ });
53
+ }
54
+
55
+ abstract getLabel(): string;
56
+
57
+ abstract isCompatibleWithColumn(
58
+ projectionColumnState: QueryBuilderProjectionColumnState,
59
+ ): boolean;
60
+
61
+ abstract buildCalendarFunctionExpression(
62
+ propertyExpression: AbstractPropertyExpression,
63
+ ): ValueSpecification;
64
+
65
+ buildCalendarFunctionExpressionFromState(
66
+ aggregateColumnState: QueryBuilderAggregateColumnState,
67
+ ): ValueSpecification {
68
+ return this.buildCalendarFunctionExpression(
69
+ guaranteeType(
70
+ aggregateColumnState.projectionColumnState,
71
+ QueryBuilderSimpleProjectionColumnState,
72
+ ).propertyExpressionState.propertyExpression,
73
+ );
74
+ }
75
+
76
+ abstract updateAggregateColumnState(
77
+ expression: SimpleFunctionExpression,
78
+ aggregationColumnState: QueryBuilderAggregateColumnState,
79
+ ): void;
80
+
81
+ setDateColumn(val: AbstractPropertyExpression): void {
82
+ this.dateColumn = val;
83
+ }
84
+
85
+ setLambdaParameterName(val: string): void {
86
+ this.lambdaParameterName = val;
87
+ }
88
+
89
+ setCalendarType(val: QUERY_BUILDER_CALENDAR_TYPE): void {
90
+ this.calendarType = val;
91
+ }
92
+
93
+ setEndDate(val: PrimitiveInstanceValue): void {
94
+ this.endDate = val;
95
+ }
96
+
97
+ abstract get hashCode(): string;
98
+ }
@@ -0,0 +1,83 @@
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 { QueryBuilderAggregateCalendarFunction_Ytd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js';
18
+ import { QueryBuilderAggregateCalendarFunction_Annualized } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js';
19
+ import type { QueryBuilderAggregateCalendarFunction } from './QueryBuilderAggregateCalendarFunction.js';
20
+ import { QueryBuilderAggregateCalendarFunction_Cme } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js';
21
+ import { QueryBuilderAggregateCalendarFunction_Cw } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js';
22
+ import { QueryBuilderAggregateCalendarFunction_Cw_Fm } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js';
23
+ import { QueryBuilderAggregateCalendarFunction_Cy_Minus2 } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js';
24
+ import { QueryBuilderAggregateCalendarFunction_Cy_Minus3 } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js';
25
+ import { QueryBuilderAggregateCalendarFunction_Mtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js';
26
+ import { QueryBuilderAggregateCalendarFunction_P12Wa } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js';
27
+ import { QueryBuilderAggregateCalendarFunction_P12Wtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js';
28
+ import { QueryBuilderAggregateCalendarFunction_P4Wa } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js';
29
+ import { QueryBuilderAggregateCalendarFunction_P4Wtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js';
30
+ import { QueryBuilderAggregateCalendarFunction_P52Wa } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js';
31
+ import { QueryBuilderAggregateCalendarFunction_P52Wtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js';
32
+ import { QueryBuilderAggregateCalendarFunction_Pma } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js';
33
+ import { QueryBuilderAggregateCalendarFunction_Pmtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js';
34
+ import { QueryBuilderAggregateCalendarFunction_Pqtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js';
35
+ import { QueryBuilderAggregateCalendarFunction_PriorDay } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js';
36
+ import { QueryBuilderAggregateCalendarFunction_PriorYear } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js';
37
+ import { QueryBuilderAggregateCalendarFunction_Pw } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js';
38
+ import { QueryBuilderAggregateCalendarFunction_Pw_Fm } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js';
39
+ import { QueryBuilderAggregateCalendarFunction_Pwa } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js';
40
+ import { QueryBuilderAggregateCalendarFunction_Pwtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js';
41
+ import { QueryBuilderAggregateCalendarFunction_Pymtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js';
42
+ import { QueryBuilderAggregateCalendarFunction_Pyqtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js';
43
+ import { QueryBuilderAggregateCalendarFunction_Pytd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js';
44
+ import { QueryBuilderAggregateCalendarFunction_Pywa } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js';
45
+ import { QueryBuilderAggregateCalendarFunction_Pywtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js';
46
+ import { QueryBuilderAggregateCalendarFunction_Qtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js';
47
+ import { QueryBuilderAggregateCalendarFunction_ReportEndDay } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js';
48
+ import { QueryBuilderAggregateCalendarFunction_Wtd } from './calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js';
49
+
50
+ export const getQueryBuilderCoreAggregrationCalendarFunctions =
51
+ (): QueryBuilderAggregateCalendarFunction[] => [
52
+ new QueryBuilderAggregateCalendarFunction_Annualized(),
53
+ new QueryBuilderAggregateCalendarFunction_Ytd(),
54
+ new QueryBuilderAggregateCalendarFunction_Cme(),
55
+ new QueryBuilderAggregateCalendarFunction_Cw(),
56
+ new QueryBuilderAggregateCalendarFunction_Cw_Fm(),
57
+ new QueryBuilderAggregateCalendarFunction_Cy_Minus2(),
58
+ new QueryBuilderAggregateCalendarFunction_Cy_Minus3(),
59
+ new QueryBuilderAggregateCalendarFunction_Mtd(),
60
+ new QueryBuilderAggregateCalendarFunction_P12Wa(),
61
+ new QueryBuilderAggregateCalendarFunction_P12Wtd(),
62
+ new QueryBuilderAggregateCalendarFunction_P4Wa(),
63
+ new QueryBuilderAggregateCalendarFunction_P4Wtd(),
64
+ new QueryBuilderAggregateCalendarFunction_P52Wa(),
65
+ new QueryBuilderAggregateCalendarFunction_P52Wtd(),
66
+ new QueryBuilderAggregateCalendarFunction_Pma(),
67
+ new QueryBuilderAggregateCalendarFunction_Pmtd(),
68
+ new QueryBuilderAggregateCalendarFunction_Pqtd(),
69
+ new QueryBuilderAggregateCalendarFunction_PriorDay(),
70
+ new QueryBuilderAggregateCalendarFunction_PriorYear(),
71
+ new QueryBuilderAggregateCalendarFunction_Pw(),
72
+ new QueryBuilderAggregateCalendarFunction_Pw_Fm(),
73
+ new QueryBuilderAggregateCalendarFunction_Pwa(),
74
+ new QueryBuilderAggregateCalendarFunction_Pwtd(),
75
+ new QueryBuilderAggregateCalendarFunction_Pymtd(),
76
+ new QueryBuilderAggregateCalendarFunction_Pyqtd(),
77
+ new QueryBuilderAggregateCalendarFunction_Pytd(),
78
+ new QueryBuilderAggregateCalendarFunction_Pywa(),
79
+ new QueryBuilderAggregateCalendarFunction_Pywtd(),
80
+ new QueryBuilderAggregateCalendarFunction_Qtd(),
81
+ new QueryBuilderAggregateCalendarFunction_ReportEndDay(),
82
+ new QueryBuilderAggregateCalendarFunction_Wtd(),
83
+ ];
@@ -28,6 +28,7 @@ import type { QueryBuilderAggregateOperator } from './QueryBuilderAggregateOpera
28
28
  import type { QueryBuilderProjectionColumnState } from '../projection/QueryBuilderProjectionColumnState.js';
29
29
  import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../QueryBuilderStateHashUtils.js';
30
30
  import { QueryBuilderTDSColumnState } from '../QueryBuilderTDSColumnState.js';
31
+ import type { QueryBuilderAggregateCalendarFunction } from './QueryBuilderAggregateCalendarFunction.js';
31
32
 
32
33
  export class QueryBuilderAggregateColumnState
33
34
  extends QueryBuilderTDSColumnState
@@ -37,6 +38,8 @@ export class QueryBuilderAggregateColumnState
37
38
  projectionColumnState: QueryBuilderProjectionColumnState;
38
39
  lambdaParameterName: string = DEFAULT_LAMBDA_VARIABLE_NAME;
39
40
  operator: QueryBuilderAggregateOperator;
41
+ calendarFunction?: QueryBuilderAggregateCalendarFunction | undefined;
42
+ hideCalendarColumnState = true;
40
43
 
41
44
  constructor(
42
45
  aggregationState: QueryBuilderAggregationState,
@@ -47,10 +50,14 @@ export class QueryBuilderAggregateColumnState
47
50
  makeObservable(this, {
48
51
  projectionColumnState: observable,
49
52
  lambdaParameterName: observable,
53
+ calendarFunction: observable,
54
+ hideCalendarColumnState: observable,
50
55
  operator: observable,
56
+ setHideCalendarColumnState: action,
51
57
  setColumnState: action,
52
58
  setLambdaParameterName: action,
53
59
  setOperator: action,
60
+ setCalendarFunction: action,
54
61
  hashCode: computed,
55
62
  });
56
63
 
@@ -58,6 +65,7 @@ export class QueryBuilderAggregateColumnState
58
65
  this.projectionColumnState = projectionColumnState;
59
66
  this.operator = operator;
60
67
  }
68
+
61
69
  setColumnState(val: QueryBuilderProjectionColumnState): void {
62
70
  this.projectionColumnState = val;
63
71
  }
@@ -66,6 +74,16 @@ export class QueryBuilderAggregateColumnState
66
74
  this.lambdaParameterName = val;
67
75
  }
68
76
 
77
+ setHideCalendarColumnState(val: boolean): void {
78
+ this.hideCalendarColumnState = val;
79
+ }
80
+
81
+ setCalendarFunction(
82
+ val: QueryBuilderAggregateCalendarFunction | undefined,
83
+ ): void {
84
+ this.calendarFunction = val;
85
+ }
86
+
69
87
  setOperator(val: QueryBuilderAggregateOperator): void {
70
88
  this.operator = val;
71
89
  }
@@ -78,6 +96,7 @@ export class QueryBuilderAggregateColumnState
78
96
  return hashArray([
79
97
  QUERY_BUILDER_STATE_HASH_STRUCTURE.AGGREGATE_COLUMN_STATE,
80
98
  this.operator,
99
+ this.calendarFunction ?? '',
81
100
  ]);
82
101
  }
83
102
 
@@ -89,22 +108,26 @@ export class QueryBuilderAggregateColumnState
89
108
  export class QueryBuilderAggregationState implements Hashable {
90
109
  readonly tdsState: QueryBuilderTDSState;
91
110
  readonly operators: QueryBuilderAggregateOperator[] = [];
111
+ readonly calendarFunctions: QueryBuilderAggregateCalendarFunction[];
92
112
  columns: QueryBuilderAggregateColumnState[] = [];
93
113
 
94
114
  constructor(
95
115
  tdsState: QueryBuilderTDSState,
96
116
  operators: QueryBuilderAggregateOperator[],
117
+ calendarFunctions: QueryBuilderAggregateCalendarFunction[],
97
118
  ) {
98
119
  makeObservable(this, {
99
120
  columns: observable,
100
121
  removeColumn: action,
101
122
  addColumn: action,
102
123
  changeColumnAggregateOperator: action,
124
+ disableCalendar: action,
103
125
  hashCode: computed,
104
126
  });
105
127
 
106
128
  this.tdsState = tdsState;
107
129
  this.operators = operators;
130
+ this.calendarFunctions = calendarFunctions;
108
131
  }
109
132
 
110
133
  removeColumn(val: QueryBuilderAggregateColumnState): void {
@@ -163,6 +186,14 @@ export class QueryBuilderAggregationState implements Hashable {
163
186
  }
164
187
  }
165
188
 
189
+ disableCalendar(): void {
190
+ this.tdsState.queryBuilderState.setIsCalendarEnabled(false);
191
+ this.columns.forEach((column) => {
192
+ column.setCalendarFunction(undefined);
193
+ column.setHideCalendarColumnState(true);
194
+ });
195
+ }
196
+
166
197
  get hashCode(): string {
167
198
  return hashArray([
168
199
  QUERY_BUILDER_STATE_HASH_STRUCTURE.AGGREGATION_STATE,