@finos/legend-cube-builder 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) hide show
  1. package/README.md +9 -3
  2. package/docs/adding-an-operation.md +22 -12
  3. package/docs/demo/DEMO-FAST-NOTES.md +67 -0
  4. package/docs/demo/README.md +102 -0
  5. package/docs/demo/specs/duckdb-sales-pivot.cube.json +110 -0
  6. package/docs/demo/specs/trades-desks-1-joined.cube.json +123 -0
  7. package/docs/demo/specs/trades-desks-2-grouped.cube.json +140 -0
  8. package/docs/demo/specs/trades-desks-3-ranked.cube.json +158 -0
  9. package/docs/demo/specs/trades-desks-4-extended.cube.json +208 -0
  10. package/docs/demo/specs/trades-desks-5-final.cube.json +248 -0
  11. package/docs/hosting.md +50 -3
  12. package/docs/testing.md +32 -0
  13. package/lib/__lib__/LegendCubeCommand.d.ts +2 -0
  14. package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -1
  15. package/lib/__lib__/LegendCubeCommand.js +7 -0
  16. package/lib/__lib__/LegendCubeCommand.js.map +1 -1
  17. package/lib/__lib__/LegendCubeFunctionLabels.d.ts +29 -0
  18. package/lib/__lib__/LegendCubeFunctionLabels.d.ts.map +1 -0
  19. package/lib/__lib__/LegendCubeFunctionLabels.js +31 -0
  20. package/lib/__lib__/LegendCubeFunctionLabels.js.map +1 -0
  21. package/lib/__lib__/LegendCubeHelpText.d.ts +5 -1
  22. package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -1
  23. package/lib/__lib__/LegendCubeHelpText.js +14 -2
  24. package/lib/__lib__/LegendCubeHelpText.js.map +1 -1
  25. package/lib/__lib__/LegendCubeLabels.d.ts +100 -8
  26. package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -1
  27. package/lib/__lib__/LegendCubeLabels.js +129 -14
  28. package/lib/__lib__/LegendCubeLabels.js.map +1 -1
  29. package/lib/__lib__/LegendCubeProjectSourceLabels.d.ts +26 -0
  30. package/lib/__lib__/LegendCubeProjectSourceLabels.d.ts.map +1 -0
  31. package/lib/__lib__/LegendCubeProjectSourceLabels.js +26 -0
  32. package/lib/__lib__/LegendCubeProjectSourceLabels.js.map +1 -0
  33. package/lib/__lib__/LegendCubeServiceLabels.d.ts +27 -0
  34. package/lib/__lib__/LegendCubeServiceLabels.d.ts.map +1 -0
  35. package/lib/__lib__/LegendCubeServiceLabels.js +32 -0
  36. package/lib/__lib__/LegendCubeServiceLabels.js.map +1 -0
  37. package/lib/__lib__/LegendCubeTesting.d.ts +7 -0
  38. package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -1
  39. package/lib/__lib__/LegendCubeTesting.js +7 -0
  40. package/lib/__lib__/LegendCubeTesting.js.map +1 -1
  41. package/lib/__test-utils__/CubeEngineTestSupport.d.ts +1 -1
  42. package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -1
  43. package/lib/__test-utils__/CubeEngineTestSupport.js +2 -2
  44. package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -1
  45. package/lib/__test-utils__/CubeExpressionTestUtils.d.ts +8 -1
  46. package/lib/__test-utils__/CubeExpressionTestUtils.d.ts.map +1 -1
  47. package/lib/__test-utils__/CubeExpressionTestUtils.js +20 -3
  48. package/lib/__test-utils__/CubeExpressionTestUtils.js.map +1 -1
  49. package/lib/__test-utils__/CubeFunctionTestOutline.d.ts +26 -0
  50. package/lib/__test-utils__/CubeFunctionTestOutline.d.ts.map +1 -0
  51. package/lib/__test-utils__/CubeFunctionTestOutline.js +56 -0
  52. package/lib/__test-utils__/CubeFunctionTestOutline.js.map +1 -0
  53. package/lib/__test-utils__/CubeLambdaCorpus.d.ts +36 -0
  54. package/lib/__test-utils__/CubeLambdaCorpus.d.ts.map +1 -0
  55. package/lib/__test-utils__/CubeLambdaCorpus.js +83 -0
  56. package/lib/__test-utils__/CubeLambdaCorpus.js.map +1 -0
  57. package/lib/__test-utils__/CubePageTestUtils.d.ts +6 -0
  58. package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -1
  59. package/lib/__test-utils__/CubePageTestUtils.js +21 -0
  60. package/lib/__test-utils__/CubePageTestUtils.js.map +1 -1
  61. package/lib/__test-utils__/CubeTestApplication.d.ts +9 -0
  62. package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -1
  63. package/lib/__test-utils__/CubeTestApplication.js +16 -0
  64. package/lib/__test-utils__/CubeTestApplication.js.map +1 -1
  65. package/lib/__test-utils__/FakeCubeEngine.d.ts +5 -0
  66. package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -1
  67. package/lib/__test-utils__/FakeCubeEngine.js +17 -0
  68. package/lib/__test-utils__/FakeCubeEngine.js.map +1 -1
  69. package/lib/__test-utils__/FakeCubeIngestCatalog.d.ts +7 -1
  70. package/lib/__test-utils__/FakeCubeIngestCatalog.d.ts.map +1 -1
  71. package/lib/__test-utils__/FakeCubeIngestCatalog.js +16 -0
  72. package/lib/__test-utils__/FakeCubeIngestCatalog.js.map +1 -1
  73. package/lib/__test-utils__/FakeCubeServiceCatalog.d.ts +26 -0
  74. package/lib/__test-utils__/FakeCubeServiceCatalog.d.ts.map +1 -0
  75. package/lib/__test-utils__/FakeCubeServiceCatalog.js +40 -0
  76. package/lib/__test-utils__/FakeCubeServiceCatalog.js.map +1 -0
  77. package/lib/components/CubeAddItems.d.ts.map +1 -1
  78. package/lib/components/CubeAddItems.js +9 -6
  79. package/lib/components/CubeAddItems.js.map +1 -1
  80. package/lib/components/CubeDialogTheme.d.ts +25 -0
  81. package/lib/components/CubeDialogTheme.d.ts.map +1 -0
  82. package/lib/components/CubeDialogTheme.js +25 -0
  83. package/lib/components/CubeDialogTheme.js.map +1 -0
  84. package/lib/components/CubeEditor.d.ts +12 -1
  85. package/lib/components/CubeEditor.d.ts.map +1 -1
  86. package/lib/components/CubeEditor.js +16 -14
  87. package/lib/components/CubeEditor.js.map +1 -1
  88. package/lib/components/CubeFileMenu.d.ts +28 -0
  89. package/lib/components/CubeFileMenu.d.ts.map +1 -0
  90. package/lib/components/CubeFileMenu.js +77 -0
  91. package/lib/components/CubeFileMenu.js.map +1 -0
  92. package/lib/components/CubeLambdaImportBanner.d.ts +26 -0
  93. package/lib/components/CubeLambdaImportBanner.d.ts.map +1 -0
  94. package/lib/components/CubeLambdaImportBanner.js +47 -0
  95. package/lib/components/CubeLambdaImportBanner.js.map +1 -0
  96. package/lib/components/CubeNodeIcon.d.ts.map +1 -1
  97. package/lib/components/CubeNodeIcon.js +5 -1
  98. package/lib/components/CubeNodeIcon.js.map +1 -1
  99. package/lib/components/CubeSchemaColumnsTable.d.ts.map +1 -1
  100. package/lib/components/CubeSchemaColumnsTable.js +2 -2
  101. package/lib/components/CubeSchemaColumnsTable.js.map +1 -1
  102. package/lib/components/canvas/CubeCanvas.d.ts.map +1 -1
  103. package/lib/components/canvas/CubeCanvas.js +38 -5
  104. package/lib/components/canvas/CubeCanvas.js.map +1 -1
  105. package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -1
  106. package/lib/components/canvas/CubeCanvasContextMenu.js +2 -1
  107. package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -1
  108. package/lib/components/canvas/CubeCanvasElements.d.ts +18 -1
  109. package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -1
  110. package/lib/components/canvas/CubeCanvasElements.js +58 -3
  111. package/lib/components/canvas/CubeCanvasElements.js.map +1 -1
  112. package/lib/components/canvas/CubeCanvasLayout.js +1 -1
  113. package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -1
  114. package/lib/components/canvas/CubeCanvasNode.js +8 -4
  115. package/lib/components/canvas/CubeCanvasNode.js.map +1 -1
  116. package/lib/components/dev-settings/CubeDevSettings.d.ts +35 -0
  117. package/lib/components/dev-settings/CubeDevSettings.d.ts.map +1 -0
  118. package/lib/components/dev-settings/CubeDevSettings.js +50 -0
  119. package/lib/components/dev-settings/CubeDevSettings.js.map +1 -0
  120. package/lib/components/editors/CubeColumnChecklist.d.ts.map +1 -1
  121. package/lib/components/editors/CubeColumnChecklist.js +2 -2
  122. package/lib/components/editors/CubeColumnChecklist.js.map +1 -1
  123. package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -1
  124. package/lib/components/editors/CubeColumnPicker.js +3 -3
  125. package/lib/components/editors/CubeColumnPicker.js.map +1 -1
  126. package/lib/components/editors/CubeConcatEditor.js +2 -2
  127. package/lib/components/editors/CubeConcatEditor.js.map +1 -1
  128. package/lib/components/editors/CubeExpressionFilterEditor.d.ts +25 -0
  129. package/lib/components/editors/CubeExpressionFilterEditor.d.ts.map +1 -0
  130. package/lib/components/editors/CubeExpressionFilterEditor.js +83 -0
  131. package/lib/components/editors/CubeExpressionFilterEditor.js.map +1 -0
  132. package/lib/components/editors/CubeExtendEditor.d.ts +2 -0
  133. package/lib/components/editors/CubeExtendEditor.d.ts.map +1 -1
  134. package/lib/components/editors/CubeExtendEditor.js +3 -3
  135. package/lib/components/editors/CubeExtendEditor.js.map +1 -1
  136. package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -1
  137. package/lib/components/editors/CubeFilterEditor.js +13 -2
  138. package/lib/components/editors/CubeFilterEditor.js.map +1 -1
  139. package/lib/components/editors/CubeFunctionSourceEditor.d.ts +25 -0
  140. package/lib/components/editors/CubeFunctionSourceEditor.d.ts.map +1 -0
  141. package/lib/components/editors/CubeFunctionSourceEditor.js +55 -0
  142. package/lib/components/editors/CubeFunctionSourceEditor.js.map +1 -0
  143. package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -1
  144. package/lib/components/editors/CubeJoinEditor.js +16 -4
  145. package/lib/components/editors/CubeJoinEditor.js.map +1 -1
  146. package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -1
  147. package/lib/components/editors/CubeNodeEditorPanel.js +18 -8
  148. package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -1
  149. package/lib/components/editors/CubeNodeEditorPopper.d.ts +5 -1
  150. package/lib/components/editors/CubeNodeEditorPopper.d.ts.map +1 -1
  151. package/lib/components/editors/CubeNodeEditorPopper.js +10 -2
  152. package/lib/components/editors/CubeNodeEditorPopper.js.map +1 -1
  153. package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -1
  154. package/lib/components/editors/CubeNodeEditorRegistry.js +9 -1
  155. package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -1
  156. package/lib/components/editors/CubePivotEditor.d.ts +26 -0
  157. package/lib/components/editors/CubePivotEditor.d.ts.map +1 -0
  158. package/lib/components/editors/CubePivotEditor.js +93 -0
  159. package/lib/components/editors/CubePivotEditor.js.map +1 -0
  160. package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -1
  161. package/lib/components/editors/CubeRestrictEditor.js +2 -2
  162. package/lib/components/editors/CubeRestrictEditor.js.map +1 -1
  163. package/lib/components/editors/CubeServiceSourceEditor.d.ts +25 -0
  164. package/lib/components/editors/CubeServiceSourceEditor.d.ts.map +1 -0
  165. package/lib/components/editors/CubeServiceSourceEditor.js +41 -0
  166. package/lib/components/editors/CubeServiceSourceEditor.js.map +1 -0
  167. package/lib/components/grid/CubeColumnFormatDialog.d.ts +28 -0
  168. package/lib/components/grid/CubeColumnFormatDialog.d.ts.map +1 -0
  169. package/lib/components/grid/CubeColumnFormatDialog.js +94 -0
  170. package/lib/components/grid/CubeColumnFormatDialog.js.map +1 -0
  171. package/lib/components/grid/CubeDrilldownBar.d.ts +37 -0
  172. package/lib/components/grid/CubeDrilldownBar.d.ts.map +1 -0
  173. package/lib/components/grid/CubeDrilldownBar.js +77 -0
  174. package/lib/components/grid/CubeDrilldownBar.js.map +1 -0
  175. package/lib/components/grid/CubeGridRegion.d.ts.map +1 -1
  176. package/lib/components/grid/CubeGridRegion.js +40 -26
  177. package/lib/components/grid/CubeGridRegion.js.map +1 -1
  178. package/lib/components/grid/CubeGridValues.d.ts +31 -1
  179. package/lib/components/grid/CubeGridValues.d.ts.map +1 -1
  180. package/lib/components/grid/CubeGridValues.js +108 -1
  181. package/lib/components/grid/CubeGridValues.js.map +1 -1
  182. package/lib/components/grid/CubeResultGrid.d.ts +68 -5
  183. package/lib/components/grid/CubeResultGrid.d.ts.map +1 -1
  184. package/lib/components/grid/CubeResultGrid.js +308 -35
  185. package/lib/components/grid/CubeResultGrid.js.map +1 -1
  186. package/lib/components/grid/CubeRunStatsPanel.d.ts +28 -0
  187. package/lib/components/grid/CubeRunStatsPanel.d.ts.map +1 -0
  188. package/lib/components/grid/CubeRunStatsPanel.js +61 -0
  189. package/lib/components/grid/CubeRunStatsPanel.js.map +1 -0
  190. package/lib/components/grid/CubeServerSideGrid.d.ts +36 -0
  191. package/lib/components/grid/CubeServerSideGrid.d.ts.map +1 -0
  192. package/lib/components/grid/CubeServerSideGrid.js +114 -0
  193. package/lib/components/grid/CubeServerSideGrid.js.map +1 -0
  194. package/lib/components/grid/CubeSqlDialog.d.ts +24 -0
  195. package/lib/components/grid/CubeSqlDialog.d.ts.map +1 -0
  196. package/lib/components/grid/CubeSqlDialog.js +39 -0
  197. package/lib/components/grid/CubeSqlDialog.js.map +1 -0
  198. package/lib/components/grid/CubeSqlFormat.d.ts +20 -0
  199. package/lib/components/grid/CubeSqlFormat.d.ts.map +1 -0
  200. package/lib/components/grid/CubeSqlFormat.js +32 -0
  201. package/lib/components/grid/CubeSqlFormat.js.map +1 -0
  202. package/lib/components/palette/CubePalette.d.ts.map +1 -1
  203. package/lib/components/palette/CubePalette.js +32 -13
  204. package/lib/components/palette/CubePalette.js.map +1 -1
  205. package/lib/components/show-pure/CubeShowPureDialog.d.ts +4 -1
  206. package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -1
  207. package/lib/components/show-pure/CubeShowPureDialog.js +8 -4
  208. package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -1
  209. package/lib/components/source-picker/CubeDataProductTab.d.ts.map +1 -1
  210. package/lib/components/source-picker/CubeDataProductTab.js +37 -16
  211. package/lib/components/source-picker/CubeDataProductTab.js.map +1 -1
  212. package/lib/components/source-picker/CubeDirectConnectionTab.d.ts.map +1 -1
  213. package/lib/components/source-picker/CubeDirectConnectionTab.js +6 -4
  214. package/lib/components/source-picker/CubeDirectConnectionTab.js.map +1 -1
  215. package/lib/components/source-picker/CubeFunctionSteps.d.ts +36 -0
  216. package/lib/components/source-picker/CubeFunctionSteps.d.ts.map +1 -0
  217. package/lib/components/source-picker/CubeFunctionSteps.js +76 -0
  218. package/lib/components/source-picker/CubeFunctionSteps.js.map +1 -0
  219. package/lib/components/source-picker/CubeIngestTab.d.ts.map +1 -1
  220. package/lib/components/source-picker/CubeIngestTab.js +39 -16
  221. package/lib/components/source-picker/CubeIngestTab.js.map +1 -1
  222. package/lib/components/source-picker/CubeInlineModelTab.d.ts +3 -2
  223. package/lib/components/source-picker/CubeInlineModelTab.d.ts.map +1 -1
  224. package/lib/components/source-picker/CubeInlineModelTab.js +23 -13
  225. package/lib/components/source-picker/CubeInlineModelTab.js.map +1 -1
  226. package/lib/components/source-picker/CubePickerListItem.d.ts +47 -0
  227. package/lib/components/source-picker/CubePickerListItem.d.ts.map +1 -0
  228. package/lib/components/source-picker/CubePickerListItem.js +62 -0
  229. package/lib/components/source-picker/CubePickerListItem.js.map +1 -0
  230. package/lib/components/source-picker/CubeProjectTab.d.ts +4 -3
  231. package/lib/components/source-picker/CubeProjectTab.d.ts.map +1 -1
  232. package/lib/components/source-picker/CubeProjectTab.js +7 -4
  233. package/lib/components/source-picker/CubeProjectTab.js.map +1 -1
  234. package/lib/components/source-picker/CubeServiceTab.d.ts +27 -0
  235. package/lib/components/source-picker/CubeServiceTab.d.ts.map +1 -0
  236. package/lib/components/source-picker/CubeServiceTab.js +36 -0
  237. package/lib/components/source-picker/CubeServiceTab.js.map +1 -0
  238. package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -1
  239. package/lib/components/source-picker/CubeSourcePicker.js +16 -3
  240. package/lib/components/source-picker/CubeSourcePicker.js.map +1 -1
  241. package/lib/components/source-picker/CubeTablePreview.d.ts +29 -0
  242. package/lib/components/source-picker/CubeTablePreview.d.ts.map +1 -0
  243. package/lib/components/source-picker/CubeTablePreview.js +10 -0
  244. package/lib/components/source-picker/CubeTablePreview.js.map +1 -0
  245. package/lib/components/spec-transfer/CubeImportPureDialog.d.ts +27 -0
  246. package/lib/components/spec-transfer/CubeImportPureDialog.d.ts.map +1 -0
  247. package/lib/components/spec-transfer/CubeImportPureDialog.js +38 -0
  248. package/lib/components/spec-transfer/CubeImportPureDialog.js.map +1 -0
  249. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -1
  250. package/lib/components/spec-transfer/CubeSpecTransferDialog.js +9 -3
  251. package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -1
  252. package/lib/graph-manager/CubeDataProductCatalog.d.ts +10 -0
  253. package/lib/graph-manager/CubeDataProductCatalog.d.ts.map +1 -1
  254. package/lib/graph-manager/CubeDataProductCatalog.js.map +1 -1
  255. package/lib/graph-manager/CubeEngine.d.ts +46 -1
  256. package/lib/graph-manager/CubeEngine.d.ts.map +1 -1
  257. package/lib/graph-manager/CubeEngine.js.map +1 -1
  258. package/lib/graph-manager/CubeEngineClientSettings.d.ts +43 -0
  259. package/lib/graph-manager/CubeEngineClientSettings.d.ts.map +1 -0
  260. package/lib/graph-manager/CubeEngineClientSettings.js +51 -0
  261. package/lib/graph-manager/CubeEngineClientSettings.js.map +1 -0
  262. package/lib/graph-manager/CubeIngest.d.ts +5 -0
  263. package/lib/graph-manager/CubeIngest.d.ts.map +1 -1
  264. package/lib/graph-manager/CubeIngest.js +10 -0
  265. package/lib/graph-manager/CubeIngest.js.map +1 -1
  266. package/lib/graph-manager/CubeIngestCatalog.d.ts +26 -0
  267. package/lib/graph-manager/CubeIngestCatalog.d.ts.map +1 -1
  268. package/lib/graph-manager/CubeIngestCatalog.js +6 -0
  269. package/lib/graph-manager/CubeIngestCatalog.js.map +1 -1
  270. package/lib/graph-manager/CubeLakehouseRuntime.d.ts +29 -0
  271. package/lib/graph-manager/CubeLakehouseRuntime.d.ts.map +1 -0
  272. package/lib/graph-manager/CubeLakehouseRuntime.js +40 -0
  273. package/lib/graph-manager/CubeLakehouseRuntime.js.map +1 -0
  274. package/lib/graph-manager/CubeProjectCatalog.d.ts +3 -3
  275. package/lib/graph-manager/CubeService.d.ts +20 -0
  276. package/lib/graph-manager/CubeService.d.ts.map +1 -0
  277. package/lib/graph-manager/CubeService.js +22 -0
  278. package/lib/graph-manager/CubeService.js.map +1 -0
  279. package/lib/graph-manager/CubeServiceCatalog.d.ts +31 -0
  280. package/lib/graph-manager/CubeServiceCatalog.d.ts.map +1 -0
  281. package/lib/graph-manager/CubeServiceCatalog.js +17 -0
  282. package/lib/graph-manager/CubeServiceCatalog.js.map +1 -0
  283. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +52 -5
  284. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -1
  285. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +63 -5
  286. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -1
  287. package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.d.ts +9 -6
  288. package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.d.ts.map +1 -1
  289. package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.js +12 -8
  290. package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.js.map +1 -1
  291. package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.d.ts +30 -0
  292. package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.d.ts.map +1 -0
  293. package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.js +229 -0
  294. package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.js.map +1 -0
  295. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.d.ts.map +1 -1
  296. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.js +18 -9
  297. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.js.map +1 -1
  298. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.d.ts +4 -9
  299. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.d.ts.map +1 -1
  300. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.js +2 -1
  301. package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.js.map +1 -1
  302. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.d.ts +34 -0
  303. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.d.ts.map +1 -0
  304. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.js +332 -0
  305. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.js.map +1 -0
  306. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -1
  307. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +49 -10
  308. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -1
  309. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +1 -1
  310. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -1
  311. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +3 -1
  312. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -1
  313. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.d.ts +2 -1
  314. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.d.ts.map +1 -1
  315. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.js +2 -1
  316. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.js.map +1 -1
  317. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +18 -0
  318. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -1
  319. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +74 -6
  320. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -1
  321. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.d.ts.map +1 -1
  322. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.js +7 -4
  323. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.js.map +1 -1
  324. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.d.ts +31 -0
  325. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.d.ts.map +1 -0
  326. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.js +69 -0
  327. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.js.map +1 -0
  328. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -1
  329. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +6 -2
  330. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -1
  331. package/lib/index.css +2 -2
  332. package/lib/index.css.map +1 -1
  333. package/lib/index.d.ts +12 -3
  334. package/lib/index.d.ts.map +1 -1
  335. package/lib/index.js +10 -1
  336. package/lib/index.js.map +1 -1
  337. package/lib/stores/CubeAddPlacement.d.ts +10 -3
  338. package/lib/stores/CubeAddPlacement.d.ts.map +1 -1
  339. package/lib/stores/CubeAddPlacement.js +16 -5
  340. package/lib/stores/CubeAddPlacement.js.map +1 -1
  341. package/lib/stores/CubeDevSettingsState.d.ts +47 -0
  342. package/lib/stores/CubeDevSettingsState.d.ts.map +1 -0
  343. package/lib/stores/CubeDevSettingsState.js +99 -0
  344. package/lib/stores/CubeDevSettingsState.js.map +1 -0
  345. package/lib/stores/CubeEditorState.d.ts +173 -43
  346. package/lib/stores/CubeEditorState.d.ts.map +1 -1
  347. package/lib/stores/CubeEditorState.js +498 -113
  348. package/lib/stores/CubeEditorState.js.map +1 -1
  349. package/lib/stores/CubeEngineChecks.d.ts +59 -0
  350. package/lib/stores/CubeEngineChecks.d.ts.map +1 -0
  351. package/lib/stores/CubeEngineChecks.js +100 -0
  352. package/lib/stores/CubeEngineChecks.js.map +1 -0
  353. package/lib/stores/CubeExamples.d.ts.map +1 -1
  354. package/lib/stores/CubeExamples.js +39 -2
  355. package/lib/stores/CubeExamples.js.map +1 -1
  356. package/lib/stores/CubeExamplesState.d.ts +1 -1
  357. package/lib/stores/CubeExamplesState.d.ts.map +1 -1
  358. package/lib/stores/CubeExamplesState.js +2 -2
  359. package/lib/stores/CubeExamplesState.js.map +1 -1
  360. package/lib/stores/CubeExecutionState.d.ts.map +1 -1
  361. package/lib/stores/CubeExecutionState.js +24 -33
  362. package/lib/stores/CubeExecutionState.js.map +1 -1
  363. package/lib/stores/CubeExportState.d.ts +41 -0
  364. package/lib/stores/CubeExportState.d.ts.map +1 -0
  365. package/lib/stores/CubeExportState.js +134 -0
  366. package/lib/stores/CubeExportState.js.map +1 -0
  367. package/lib/stores/CubeExpressionFilterCheck.d.ts +51 -0
  368. package/lib/stores/CubeExpressionFilterCheck.d.ts.map +1 -0
  369. package/lib/stores/CubeExpressionFilterCheck.js +134 -0
  370. package/lib/stores/CubeExpressionFilterCheck.js.map +1 -0
  371. package/lib/stores/CubeExtendTyping.d.ts +6 -14
  372. package/lib/stores/CubeExtendTyping.d.ts.map +1 -1
  373. package/lib/stores/CubeExtendTyping.js +6 -33
  374. package/lib/stores/CubeExtendTyping.js.map +1 -1
  375. package/lib/stores/CubeFunctionRecheck.d.ts +30 -0
  376. package/lib/stores/CubeFunctionRecheck.d.ts.map +1 -0
  377. package/lib/stores/CubeFunctionRecheck.js +67 -0
  378. package/lib/stores/CubeFunctionRecheck.js.map +1 -0
  379. package/lib/stores/CubeGridFetcher.d.ts +75 -0
  380. package/lib/stores/CubeGridFetcher.d.ts.map +1 -0
  381. package/lib/stores/CubeGridFetcher.js +197 -0
  382. package/lib/stores/CubeGridFetcher.js.map +1 -0
  383. package/lib/stores/CubeGridQuickActions.d.ts +18 -6
  384. package/lib/stores/CubeGridQuickActions.d.ts.map +1 -1
  385. package/lib/stores/CubeGridQuickActions.js +32 -12
  386. package/lib/stores/CubeGridQuickActions.js.map +1 -1
  387. package/lib/stores/CubeGridState.d.ts +136 -0
  388. package/lib/stores/CubeGridState.d.ts.map +1 -0
  389. package/lib/stores/CubeGridState.js +317 -0
  390. package/lib/stores/CubeGridState.js.map +1 -0
  391. package/lib/stores/CubeHost.d.ts +42 -0
  392. package/lib/stores/CubeHost.d.ts.map +1 -1
  393. package/lib/stores/CubeHost.js +4 -0
  394. package/lib/stores/CubeHost.js.map +1 -1
  395. package/lib/stores/CubeLambdaImportState.d.ts +118 -0
  396. package/lib/stores/CubeLambdaImportState.d.ts.map +1 -0
  397. package/lib/stores/CubeLambdaImportState.js +302 -0
  398. package/lib/stores/CubeLambdaImportState.js.map +1 -0
  399. package/lib/stores/CubeLambdaSources.d.ts +45 -0
  400. package/lib/stores/CubeLambdaSources.d.ts.map +1 -0
  401. package/lib/stores/CubeLambdaSources.js +261 -0
  402. package/lib/stores/CubeLambdaSources.js.map +1 -0
  403. package/lib/stores/CubeQueryRun.d.ts +59 -0
  404. package/lib/stores/CubeQueryRun.d.ts.map +1 -0
  405. package/lib/stores/CubeQueryRun.js +101 -0
  406. package/lib/stores/CubeQueryRun.js.map +1 -0
  407. package/lib/stores/CubeRunStatsState.d.ts +61 -0
  408. package/lib/stores/CubeRunStatsState.d.ts.map +1 -0
  409. package/lib/stores/CubeRunStatsState.js +54 -0
  410. package/lib/stores/CubeRunStatsState.js.map +1 -0
  411. package/lib/stores/CubeRunningStepLambda.d.ts +25 -0
  412. package/lib/stores/CubeRunningStepLambda.d.ts.map +1 -0
  413. package/lib/stores/CubeRunningStepLambda.js +45 -0
  414. package/lib/stores/CubeRunningStepLambda.js.map +1 -0
  415. package/lib/stores/CubeServiceRecheck.d.ts +29 -0
  416. package/lib/stores/CubeServiceRecheck.d.ts.map +1 -0
  417. package/lib/stores/CubeServiceRecheck.js +33 -0
  418. package/lib/stores/CubeServiceRecheck.js.map +1 -0
  419. package/lib/stores/CubeShowPureState.d.ts +14 -1
  420. package/lib/stores/CubeShowPureState.d.ts.map +1 -1
  421. package/lib/stores/CubeShowPureState.js +41 -11
  422. package/lib/stores/CubeShowPureState.js.map +1 -1
  423. package/lib/stores/CubeSourcePickerState.d.ts +20 -4
  424. package/lib/stores/CubeSourcePickerState.d.ts.map +1 -1
  425. package/lib/stores/CubeSourcePickerState.js +75 -14
  426. package/lib/stores/CubeSourcePickerState.js.map +1 -1
  427. package/lib/stores/LocalModelCatalog.d.ts.map +1 -1
  428. package/lib/stores/LocalModelCatalog.js +3 -1
  429. package/lib/stores/LocalModelCatalog.js.map +1 -1
  430. package/lib/stores/editors/CubeExpressionFilterDraft.d.ts +91 -0
  431. package/lib/stores/editors/CubeExpressionFilterDraft.d.ts.map +1 -0
  432. package/lib/stores/editors/CubeExpressionFilterDraft.js +254 -0
  433. package/lib/stores/editors/CubeExpressionFilterDraft.js.map +1 -0
  434. package/lib/stores/editors/CubeFunctionDraft.d.ts +34 -0
  435. package/lib/stores/editors/CubeFunctionDraft.d.ts.map +1 -0
  436. package/lib/stores/editors/CubeFunctionDraft.js +69 -0
  437. package/lib/stores/editors/CubeFunctionDraft.js.map +1 -0
  438. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +4 -2
  439. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -1
  440. package/lib/stores/editors/CubeNodeDraftRegistry.js +20 -3
  441. package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -1
  442. package/lib/stores/editors/CubePivotDraft.d.ts +93 -0
  443. package/lib/stores/editors/CubePivotDraft.d.ts.map +1 -0
  444. package/lib/stores/editors/CubePivotDraft.js +267 -0
  445. package/lib/stores/editors/CubePivotDraft.js.map +1 -0
  446. package/lib/stores/fixtures/CubeSalesDuckDbModel.d.ts +26 -0
  447. package/lib/stores/fixtures/CubeSalesDuckDbModel.d.ts.map +1 -0
  448. package/lib/stores/fixtures/CubeSalesDuckDbModel.js +46 -0
  449. package/lib/stores/fixtures/CubeSalesDuckDbModel.js.map +1 -0
  450. package/lib/stores/fixtures/CubeTradesModel.d.ts +4 -0
  451. package/lib/stores/fixtures/CubeTradesModel.d.ts.map +1 -1
  452. package/lib/stores/fixtures/CubeTradesModel.js +31 -1
  453. package/lib/stores/fixtures/CubeTradesModel.js.map +1 -1
  454. package/lib/stores/source-picker/CubeDataProductTabState.d.ts +34 -5
  455. package/lib/stores/source-picker/CubeDataProductTabState.d.ts.map +1 -1
  456. package/lib/stores/source-picker/CubeDataProductTabState.js +111 -26
  457. package/lib/stores/source-picker/CubeDataProductTabState.js.map +1 -1
  458. package/lib/stores/source-picker/CubeDirectConnectionTabState.d.ts +25 -2
  459. package/lib/stores/source-picker/CubeDirectConnectionTabState.d.ts.map +1 -1
  460. package/lib/stores/source-picker/CubeDirectConnectionTabState.js +183 -31
  461. package/lib/stores/source-picker/CubeDirectConnectionTabState.js.map +1 -1
  462. package/lib/stores/source-picker/CubeIngestTabState.d.ts +22 -9
  463. package/lib/stores/source-picker/CubeIngestTabState.d.ts.map +1 -1
  464. package/lib/stores/source-picker/CubeIngestTabState.js +84 -29
  465. package/lib/stores/source-picker/CubeIngestTabState.js.map +1 -1
  466. package/lib/stores/source-picker/CubeInlineModelTabState.d.ts +100 -4
  467. package/lib/stores/source-picker/CubeInlineModelTabState.d.ts.map +1 -1
  468. package/lib/stores/source-picker/CubeInlineModelTabState.js +415 -28
  469. package/lib/stores/source-picker/CubeInlineModelTabState.js.map +1 -1
  470. package/lib/stores/source-picker/CubeProjectTabState.d.ts +18 -3
  471. package/lib/stores/source-picker/CubeProjectTabState.d.ts.map +1 -1
  472. package/lib/stores/source-picker/CubeProjectTabState.js +26 -1
  473. package/lib/stores/source-picker/CubeProjectTabState.js.map +1 -1
  474. package/lib/stores/source-picker/CubeServiceTabState.d.ts +74 -0
  475. package/lib/stores/source-picker/CubeServiceTabState.d.ts.map +1 -0
  476. package/lib/stores/source-picker/CubeServiceTabState.js +216 -0
  477. package/lib/stores/source-picker/CubeServiceTabState.js.map +1 -0
  478. package/lib/stores/source-picker/CubeSourcePickerTab.d.ts +15 -3
  479. package/lib/stores/source-picker/CubeSourcePickerTab.d.ts.map +1 -1
  480. package/lib/stores/source-picker/CubeSourcePickerTab.js +21 -0
  481. package/lib/stores/source-picker/CubeSourcePickerTab.js.map +1 -1
  482. package/package.json +10 -9
  483. package/src/__lib__/LegendCubeCommand.ts +7 -0
  484. package/src/__lib__/LegendCubeFunctionLabels.ts +41 -0
  485. package/src/__lib__/LegendCubeHelpText.ts +23 -1
  486. package/src/__lib__/LegendCubeLabels.ts +170 -13
  487. package/src/__lib__/LegendCubeProjectSourceLabels.ts +26 -0
  488. package/src/__lib__/LegendCubeServiceLabels.ts +41 -0
  489. package/src/__lib__/LegendCubeTesting.ts +7 -0
  490. package/src/__test-utils__/CubeEngineTestSupport.ts +2 -1
  491. package/src/__test-utils__/CubeExpressionTestUtils.ts +29 -2
  492. package/src/__test-utils__/CubeFunctionTestOutline.ts +78 -0
  493. package/src/__test-utils__/CubeLambdaCorpus.ts +137 -0
  494. package/src/__test-utils__/CubePageTestUtils.tsx +34 -0
  495. package/src/__test-utils__/CubeTestApplication.ts +25 -0
  496. package/src/__test-utils__/FakeCubeEngine.ts +27 -0
  497. package/src/__test-utils__/FakeCubeIngestCatalog.ts +18 -0
  498. package/src/__test-utils__/FakeCubeServiceCatalog.ts +57 -0
  499. package/src/components/CubeAddItems.tsx +13 -6
  500. package/src/components/CubeDialogTheme.ts +25 -0
  501. package/src/components/CubeEditor.tsx +155 -129
  502. package/src/components/CubeFileMenu.tsx +127 -0
  503. package/src/components/CubeLambdaImportBanner.tsx +97 -0
  504. package/src/components/CubeNodeIcon.tsx +7 -0
  505. package/src/components/CubeSchemaColumnsTable.tsx +7 -2
  506. package/src/components/canvas/CubeCanvas.tsx +52 -13
  507. package/src/components/canvas/CubeCanvasContextMenu.tsx +33 -2
  508. package/src/components/canvas/CubeCanvasElements.ts +76 -3
  509. package/src/components/canvas/CubeCanvasLayout.ts +1 -1
  510. package/src/components/canvas/CubeCanvasNode.tsx +30 -3
  511. package/src/components/dev-settings/CubeDevSettings.tsx +154 -0
  512. package/src/components/editors/CubeColumnChecklist.tsx +8 -2
  513. package/src/components/editors/CubeColumnPicker.tsx +6 -3
  514. package/src/components/editors/CubeConcatEditor.tsx +2 -2
  515. package/src/components/editors/CubeExpressionFilterEditor.tsx +193 -0
  516. package/src/components/editors/CubeExtendEditor.tsx +3 -3
  517. package/src/components/editors/CubeFilterEditor.tsx +13 -1
  518. package/src/components/editors/CubeFunctionSourceEditor.tsx +140 -0
  519. package/src/components/editors/CubeJoinEditor.tsx +23 -4
  520. package/src/components/editors/CubeNodeEditorPanel.tsx +22 -10
  521. package/src/components/editors/CubeNodeEditorPopper.tsx +9 -1
  522. package/src/components/editors/CubeNodeEditorRegistry.ts +12 -0
  523. package/src/components/editors/CubePivotEditor.tsx +277 -0
  524. package/src/components/editors/CubeRestrictEditor.tsx +8 -2
  525. package/src/components/editors/CubeServiceSourceEditor.tsx +77 -0
  526. package/src/components/grid/CubeColumnFormatDialog.tsx +289 -0
  527. package/src/components/grid/CubeDrilldownBar.tsx +219 -0
  528. package/src/components/grid/CubeGridRegion.tsx +170 -54
  529. package/src/components/grid/CubeGridValues.ts +146 -1
  530. package/src/components/grid/CubeResultGrid.tsx +443 -41
  531. package/src/components/grid/CubeRunStatsPanel.tsx +156 -0
  532. package/src/components/grid/CubeServerSideGrid.tsx +200 -0
  533. package/src/components/grid/CubeSqlDialog.tsx +90 -0
  534. package/src/components/grid/CubeSqlFormat.ts +37 -0
  535. package/src/components/palette/CubePalette.tsx +45 -12
  536. package/src/components/show-pure/CubeShowPureDialog.tsx +19 -5
  537. package/src/components/source-picker/CubeDataProductTab.tsx +169 -75
  538. package/src/components/source-picker/CubeDirectConnectionTab.tsx +42 -30
  539. package/src/components/source-picker/CubeFunctionSteps.tsx +244 -0
  540. package/src/components/source-picker/CubeIngestTab.tsx +159 -79
  541. package/src/components/source-picker/CubeInlineModelTab.tsx +110 -81
  542. package/src/components/source-picker/CubePickerListItem.tsx +118 -0
  543. package/src/components/source-picker/CubeProjectTab.tsx +6 -3
  544. package/src/components/source-picker/CubeServiceTab.tsx +151 -0
  545. package/src/components/source-picker/CubeSourcePicker.tsx +54 -18
  546. package/src/components/source-picker/CubeTablePreview.tsx +49 -0
  547. package/src/components/spec-transfer/CubeImportPureDialog.tsx +122 -0
  548. package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +21 -8
  549. package/src/graph-manager/CubeDataProductCatalog.ts +11 -0
  550. package/src/graph-manager/CubeEngine.ts +51 -1
  551. package/src/graph-manager/CubeEngineClientSettings.ts +64 -0
  552. package/src/graph-manager/CubeIngest.ts +15 -0
  553. package/src/graph-manager/CubeIngestCatalog.ts +33 -0
  554. package/src/graph-manager/CubeLakehouseRuntime.ts +43 -0
  555. package/src/graph-manager/CubeProjectCatalog.ts +3 -3
  556. package/src/graph-manager/CubeService.ts +29 -0
  557. package/src/graph-manager/CubeServiceCatalog.ts +35 -0
  558. package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +115 -5
  559. package/src/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.ts +13 -7
  560. package/src/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.ts +312 -0
  561. package/src/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.ts +35 -9
  562. package/src/graph-manager/protocol/pure/v1/V1_CubeIngestModel.ts +6 -15
  563. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.ts +471 -0
  564. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +70 -15
  565. package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +3 -1
  566. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.ts +7 -1
  567. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +122 -7
  568. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.ts +9 -4
  569. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.ts +92 -0
  570. package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +6 -1
  571. package/src/index.ts +32 -2
  572. package/src/stores/CubeAddPlacement.ts +25 -5
  573. package/src/stores/CubeDevSettingsState.ts +117 -0
  574. package/src/stores/CubeEditorState.ts +687 -197
  575. package/src/stores/CubeEngineChecks.ts +240 -0
  576. package/src/stores/CubeExamples.ts +70 -1
  577. package/src/stores/CubeExamplesState.ts +4 -2
  578. package/src/stores/CubeExecutionState.ts +26 -57
  579. package/src/stores/CubeExportState.ts +196 -0
  580. package/src/stores/CubeExpressionFilterCheck.ts +218 -0
  581. package/src/stores/CubeExtendTyping.ts +6 -46
  582. package/src/stores/CubeFunctionRecheck.ts +97 -0
  583. package/src/stores/CubeGridFetcher.ts +302 -0
  584. package/src/stores/CubeGridQuickActions.ts +33 -11
  585. package/src/stores/CubeGridState.ts +450 -0
  586. package/src/stores/CubeHost.ts +48 -0
  587. package/src/stores/CubeLambdaImportState.ts +434 -0
  588. package/src/stores/CubeLambdaSources.ts +390 -0
  589. package/src/stores/CubeQueryRun.ts +169 -0
  590. package/src/stores/CubeRunStatsState.ts +91 -0
  591. package/src/stores/CubeRunningStepLambda.ts +62 -0
  592. package/src/stores/CubeServiceRecheck.ts +53 -0
  593. package/src/stores/CubeShowPureState.ts +51 -12
  594. package/src/stores/CubeSourcePickerState.ts +89 -13
  595. package/src/stores/LocalModelCatalog.ts +6 -1
  596. package/src/stores/editors/CubeExpressionFilterDraft.ts +385 -0
  597. package/src/stores/editors/CubeFunctionDraft.ts +92 -0
  598. package/src/stores/editors/CubeNodeDraftRegistry.ts +27 -2
  599. package/src/stores/editors/CubePivotDraft.ts +355 -0
  600. package/src/stores/fixtures/CubeSalesDuckDbModel.ts +54 -0
  601. package/src/stores/fixtures/CubeTradesModel.ts +36 -1
  602. package/src/stores/source-picker/CubeDataProductTabState.ts +162 -35
  603. package/src/stores/source-picker/CubeDirectConnectionTabState.ts +246 -47
  604. package/src/stores/source-picker/CubeIngestTabState.ts +112 -38
  605. package/src/stores/source-picker/CubeInlineModelTabState.ts +514 -34
  606. package/src/stores/source-picker/CubeProjectTabState.ts +35 -3
  607. package/src/stores/source-picker/CubeServiceTabState.ts +288 -0
  608. package/src/stores/source-picker/CubeSourcePickerTab.ts +31 -2
  609. package/tsconfig.json +50 -0
@@ -13,10 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { isSchemasError, needsDatabaseType, } from '@finos/legend-cube';
16
+ import { isSchemasError, } from '@finos/legend-cube';
17
17
  import { assertErrorThrown } from '@finos/legend-shared';
18
- import { action, computed, flow, flowResult, makeObservable, observable, } from 'mobx';
18
+ import { action, computed, flow, makeObservable, observable } from 'mobx';
19
19
  import { CubeEngineError, CubeEngineErrorKind, } from '../graph-manager/CubeEngine.js';
20
+ import { CUBE_RUN_LABEL } from '../__lib__/LegendCubeLabels.js';
21
+ import { runCubeQuery } from './CubeQueryRun.js';
20
22
  /**
21
23
  * The first error found walking up from the capture node, named by its node.
22
24
  * A node that is invalid only because an input is gets passed over for that
@@ -100,7 +102,7 @@ export class CubeExecutionState {
100
102
  }
101
103
  const captureId = query.selected;
102
104
  if (captureId === undefined) {
103
- reasons.push('Select the node to run.');
105
+ reasons.push('Pick the step to run: Run this step, from its menu or editor.');
104
106
  }
105
107
  else if (!emitter.canEmit(captureId) ||
106
108
  // as the editor sees it: an Extend typed for another input waits
@@ -116,7 +118,7 @@ export class CubeExecutionState {
116
118
  if (this.isRunning || !this.canExecute) {
117
119
  return;
118
120
  }
119
- const { document, emitter, analysis, rowLimit, host } = this.editorState;
121
+ const { document, analysis, rowLimit } = this.editorState;
120
122
  const { query, context } = document;
121
123
  const warehouse = this.editorState.dataProductRuntime.effectiveWarehouse;
122
124
  // checked by canExecute
@@ -132,49 +134,33 @@ export class CubeExecutionState {
132
134
  this.runController = controller;
133
135
  this.error = undefined;
134
136
  this.editorState.clearHostIssues();
137
+ // an export's failure is of the run it exported
138
+ this.editorState.export.clearError();
135
139
  try {
136
- // a Drop, Slice, Limit or Distinct is written for the database it runs on
137
- // (PLAN §11.4), which the model's outline gives: loaded once, waited
138
- // for only then; the query, model and runtime are the ones captured
139
- let databaseType;
140
- if (needsDatabaseType(query, captureId)) {
141
- yield flowResult(this.editorState.loadModelOutline(model));
142
- if (this.runController !== controller || controller.signal.aborted) {
143
- return;
144
- }
145
- databaseType = this.editorState.getRunDatabaseType(query, captureId, model, runtime);
146
- }
147
- const lambda = emitter.emitExecutionLambda({
148
- rowLimit,
140
+ // the query, model and runtime are the ones captured
141
+ const run = (yield runCubeQuery(this.editorState, {
142
+ query,
143
+ model,
149
144
  runtime,
150
- databaseType,
151
- });
152
- const response = (yield host.engine.execute(model, lambda, {
145
+ schema,
146
+ rowLimit,
153
147
  abortController: controller,
148
+ label: CUBE_RUN_LABEL.EXECUTE,
154
149
  }));
155
150
  if (this.runController !== controller) {
156
151
  return;
157
152
  }
158
- // rows are read by position, so the engine's columns must be the query's
159
- if (response.columns.length !== schema.columns.length) {
160
- throw new CubeEngineError(CubeEngineErrorKind.EXECUTION, `The engine returned ${response.columns.length} columns, but the query has ${schema.columns.length}`, captureId);
161
- }
162
- const misplaced = schema.columns.findIndex((column, position) => response.columns[position] !== column.name);
163
- if (misplaced !== -1) {
164
- throw new CubeEngineError(CubeEngineErrorKind.EXECUTION, `The engine returned the column "${response.columns[misplaced]}" at position ${misplaced + 1}, but the query has "${schema.columns[misplaced]?.name}" there`, captureId);
165
- }
166
- const limited = response.rows.length > rowLimit;
167
153
  this.result = {
168
154
  id: ++this.runCount,
169
155
  query,
170
156
  context,
171
157
  warehouse,
172
158
  schema,
173
- rows: limited ? response.rows.slice(0, rowLimit) : response.rows,
159
+ rows: run.rows,
174
160
  rowLimit,
175
- limited,
176
- sql: response.sql,
177
- durationMs: response.durationMs,
161
+ limited: run.limited,
162
+ sql: run.sql,
163
+ durationMs: run.durationMs,
178
164
  };
179
165
  }
180
166
  catch (error) {
@@ -215,6 +201,11 @@ export class CubeExecutionState {
215
201
  /** Stops any run and forgets the last one's rows and error, e.g. when another cube is opened */
216
202
  reset() {
217
203
  this.stop();
204
+ this.editorState.gridFetcher.purge();
205
+ this.editorState.export.stop();
206
+ // an export's failure is of the run it exported (review of M7)
207
+ this.editorState.export.clearError();
208
+ this.editorState.grid.closeSettings();
218
209
  this.result = undefined;
219
210
  this.error = undefined;
220
211
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CubeExecutionState.js","sourceRoot":"","sources":["../../src/stores/CubeExecutionState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,cAAc,EACd,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EACL,eAAe,EACf,mBAAmB,GAGpB,MAAM,gCAAgC,CAAC;AAwBxC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CACxB,KAAY,EACZ,QAAgD,EAChD,SAAiB,EACT,EAAE;IACV,MAAM,KAAK,GAAG,CAAC,MAAc,EAAsB,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB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KAAK;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC/B,+DAA+D;QAC/D,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACrC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { type ColumnDirection } from '@finos/legend-cube';
17
+ import { type GeneratorFn } from '@finos/legend-shared';
18
+ import { CubeEngineError } from '../graph-manager/CubeEngine.js';
19
+ import type { CubeEditorState } from './CubeEditorState.js';
20
+ import type { CubeExecutionResult } from './CubeExecutionState.js';
21
+ export declare const CUBE_EXPORT_CONTEXT_CHANGED = "The cube's model, runtime or warehouse changed since this run: execute again to export it.";
22
+ /** A file name for a cube's export, from its name, e.g. `Largest_buys.csv` */
23
+ export declare const getCubeExportFileName: (name: string | undefined, extension: "csv" | "xlsx") => string;
24
+ /**
25
+ * The results' export (spec §12.5, PLAN §11.10): CSV of the whole query,
26
+ * run on the engine with no row limit, sorted as the grid is, saved by the
27
+ * browser. Only the run on screen is exported, in the context it ran in. A
28
+ * failure is kept for the grid region; Stop aborts the export.
29
+ */
30
+ export declare class CubeExportState {
31
+ readonly editorState: CubeEditorState;
32
+ error: CubeEngineError | undefined;
33
+ private controller;
34
+ constructor(editorState: CubeEditorState);
35
+ get isExporting(): boolean;
36
+ /** The run's whole query as CSV, sorted as the grid is (by the run's column names) */
37
+ exportCsv(result: CubeExecutionResult, sorts?: readonly ColumnDirection[]): GeneratorFn<void>;
38
+ stop(): void;
39
+ clearError(): void;
40
+ }
41
+ //# sourceMappingURL=CubeExportState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeExportState.d.ts","sourceRoot":"","sources":["../../src/stores/CubeExportState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,eAAe,EAKrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EACL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,eAAO,MAAM,2BAA2B,+FACsD,CAAC;AAE/F,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,GAAG,SAAS,EACxB,WAAW,KAAK,GAAG,MAAM,KACxB,MAGF,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC,OAAO,CAAC,UAAU,CAA8B;gBAEpC,WAAW,EAAE,eAAe;IAYxC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,sFAAsF;IACrF,SAAS,CACR,MAAM,EAAE,mBAAmB,EAC3B,KAAK,GAAE,SAAS,eAAe,EAAO,GACrC,WAAW,CAAC,IAAI,CAAC;IAkGpB,IAAI,IAAI,IAAI;IAKZ,UAAU,IAAI,IAAI;CAGnB"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { checkDrilldown, deriveDrilldownLevel, needsDatabaseType, QueryEmitter, } from '@finos/legend-cube';
17
+ import { assertErrorThrown, ContentType, downloadFileUsingDataURI, } from '@finos/legend-shared';
18
+ import { action, computed, flow, flowResult, makeObservable, observable, } from 'mobx';
19
+ import { CubeEngineError, CubeEngineErrorKind, } from '../graph-manager/CubeEngine.js';
20
+ import { CUBE_RUN_LABEL } from '../__lib__/LegendCubeLabels.js';
21
+ export const CUBE_EXPORT_CONTEXT_CHANGED = "The cube's model, runtime or warehouse changed since this run: execute again to export it.";
22
+ /** A file name for a cube's export, from its name, e.g. `Largest_buys.csv` */
23
+ export const getCubeExportFileName = (name, extension) => {
24
+ const base = name?.trim().replace(/[^\w.-]+/gu, '_') ?? '';
25
+ return `${base.length ? base : 'cube'}.${extension}`;
26
+ };
27
+ /**
28
+ * The results' export (spec §12.5, PLAN §11.10): CSV of the whole query,
29
+ * run on the engine with no row limit, sorted as the grid is, saved by the
30
+ * browser. Only the run on screen is exported, in the context it ran in. A
31
+ * failure is kept for the grid region; Stop aborts the export.
32
+ */
33
+ export class CubeExportState {
34
+ editorState;
35
+ error;
36
+ controller;
37
+ constructor(editorState) {
38
+ makeObservable(this, {
39
+ error: observable.ref,
40
+ controller: observable.ref,
41
+ isExporting: computed,
42
+ exportCsv: flow,
43
+ stop: action,
44
+ clearError: action,
45
+ });
46
+ this.editorState = editorState;
47
+ }
48
+ get isExporting() {
49
+ return this.controller !== undefined;
50
+ }
51
+ /** The run's whole query as CSV, sorted as the grid is (by the run's column names) */
52
+ *exportCsv(result, sorts = []) {
53
+ const { editorState } = this;
54
+ const model = result.context?.model;
55
+ const runtime = result.context?.runtime;
56
+ const captureId = result.query.selected;
57
+ if (this.isExporting || !model || !runtime || captureId === undefined) {
58
+ return;
59
+ }
60
+ this.error = undefined;
61
+ // the warehouse is read from the page when the query runs
62
+ if (result.context !== editorState.document.context ||
63
+ result.warehouse !== editorState.dataProductRuntime.effectiveWarehouse) {
64
+ this.error = new CubeEngineError(CubeEngineErrorKind.EXECUTION, CUBE_EXPORT_CONTEXT_CHANGED, captureId);
65
+ return;
66
+ }
67
+ const controller = new AbortController();
68
+ this.controller = controller;
69
+ const startedAt = Date.now();
70
+ // kept for the Runs panel, once written (PLAN §11.16)
71
+ let lambda;
72
+ try {
73
+ // the run's rows, sorted as the grid is: no drill-down level
74
+ const { query } = deriveDrilldownLevel({
75
+ query: result.query,
76
+ captureId,
77
+ schema: result.schema,
78
+ drilldown: checkDrilldown({ columns: [], aggregations: [] }, result.schema),
79
+ keys: [],
80
+ sorts,
81
+ });
82
+ const runId = query.selected;
83
+ let databaseType;
84
+ if (needsDatabaseType(query, runId)) {
85
+ yield flowResult(editorState.loadModelOutline(model));
86
+ databaseType = editorState.getRunDatabaseType(query, runId, model, runtime);
87
+ }
88
+ if (controller.signal.aborted) {
89
+ return;
90
+ }
91
+ lambda = new QueryEmitter(query, editorState.registry).emitExecutionLambda({ runtime, databaseType });
92
+ const csv = (yield editorState.host.engine.exportCsv(model, lambda, {
93
+ abortController: controller,
94
+ }));
95
+ // stopped while it ran: `stop()` lets go of it
96
+ if (this.controller !== controller) {
97
+ return;
98
+ }
99
+ downloadFileUsingDataURI(getCubeExportFileName(editorState.document.name, 'csv'), csv, ContentType.TEXT_CSV);
100
+ editorState.runStats.record(CUBE_RUN_LABEL.EXPORT_CSV, {
101
+ durationMs: Date.now() - startedAt,
102
+ lambda,
103
+ });
104
+ }
105
+ catch (error) {
106
+ if (controller.signal.aborted) {
107
+ return;
108
+ }
109
+ assertErrorThrown(error);
110
+ this.error =
111
+ error instanceof CubeEngineError
112
+ ? error
113
+ : new CubeEngineError(CubeEngineErrorKind.EXECUTION, error.message, captureId);
114
+ editorState.runStats.record(CUBE_RUN_LABEL.EXPORT_CSV, {
115
+ durationMs: Date.now() - startedAt,
116
+ lambda,
117
+ error: this.error.firstLine,
118
+ });
119
+ }
120
+ finally {
121
+ if (this.controller === controller) {
122
+ this.controller = undefined;
123
+ }
124
+ }
125
+ }
126
+ stop() {
127
+ this.controller?.abort();
128
+ this.controller = undefined;
129
+ }
130
+ clearError() {
131
+ this.error = undefined;
132
+ }
133
+ }
134
+ //# sourceMappingURL=CubeExportState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeExportState.js","sourceRoot":"","sources":["../../src/stores/CubeExportState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,cAAc,EAEd,oBAAoB,EAEpB,iBAAiB,EACjB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIhE,MAAM,CAAC,MAAM,2BAA2B,GACtC,4FAA4F,CAAC;AAE/F,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAwB,EACxB,SAAyB,EACjB,EAAE;IACV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YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { type ExpressionCheck, type ExpressionFilter, type IR, type JsonObject, type NodeRegistry, type Query, Schema } from '@finos/legend-cube';
17
+ import { CubeEngineError, type NodeId } from '../graph-manager/CubeEngine.js';
18
+ /** A name for the condition typed alone that no input column has, as databases that ignore case compare names */
19
+ export declare const getConditionColumnName: (input: Schema) => string;
20
+ /**
21
+ * The lambdas that check a condition, by key: the input's relation filtered
22
+ * with it, and the input's relation extended with it under a name no input
23
+ * column has. A located lambda keeps its locations, so an error points into
24
+ * its text; a stored one is marked with the filter, so an error lands on it.
25
+ * The input must be valid.
26
+ */
27
+ export declare const buildCubeConditionCheckLambdas: (query: Query, filter: ExpressionFilter, condition: JsonObject, input: Schema, registry: NodeRegistry, located: boolean) => Map<NodeId, IR>;
28
+ /** What checking a condition gave: the check to store, and the error the engine gave, if it failed */
29
+ export interface CubeConditionCheckResult {
30
+ readonly check: ExpressionCheck;
31
+ readonly error?: CubeEngineError | undefined;
32
+ }
33
+ /**
34
+ * The check the engine's answers give, for this input and this condition:
35
+ * checked when the filter types; else failed, with the condition's type when
36
+ * it types alone but isn't one Boolean, and the engine's error: the
37
+ * condition's own when it fails alone, as it names no `filter`, else the
38
+ * filter's (a network failure when there is neither)
39
+ */
40
+ export declare const readCubeConditionCheck: (answers: ReadonlyMap<NodeId, Schema | CubeEngineError>, filter: ExpressionFilter, input: Schema, upstream: string | undefined) => CubeConditionCheckResult;
41
+ /** The digest of what the engine was given for the input, which the check recorded */
42
+ export declare const getCubeConditionCheckUpstream: (check: ExpressionCheck) => string | undefined;
43
+ /**
44
+ * Whether the filter's check says its condition is one Boolean for this
45
+ * input: checked, for this schema and this condition, and for this input as
46
+ * the engine is given it, or recorded without it, as when loaded
47
+ */
48
+ export declare const isCubeConditionCheckCurrent: (filter: ExpressionFilter, input: Schema, upstream: string | undefined) => boolean;
49
+ /** Whether two checks say the same: the same kind, signature and input as the engine was given it, and the same failure */
50
+ export declare const isSameCubeConditionCheck: (a: ExpressionCheck, b: ExpressionCheck) => boolean;
51
+ //# sourceMappingURL=CubeExpressionFilterCheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeExpressionFilterCheck.d.ts","sourceRoot":"","sources":["../../src/stores/CubeExpressionFilterCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAIrB,KAAK,EAAE,EACP,KAAK,UAAU,EAGf,KAAK,YAAY,EAEjB,KAAK,KAAK,EAEV,MAAM,EAGP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EAEf,KAAK,MAAM,EACZ,MAAM,gCAAgC,CAAC;AAexC,iHAAiH;AACjH,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,MAOtD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GACzC,OAAO,KAAK,EACZ,QAAQ,gBAAgB,EACxB,WAAW,UAAU,EACrB,OAAO,MAAM,EACb,UAAU,YAAY,EACtB,SAAS,OAAO,KACf,GAAG,CAAC,MAAM,EAAE,EAAE,CAgChB,CAAC;AAMF,sGAAsG;AACtG,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,EACtD,QAAQ,gBAAgB,EACxB,OAAO,MAAM,EACb,UAAU,MAAM,GAAG,SAAS,KAC3B,wBAmCF,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,6BAA6B,GACxC,OAAO,eAAe,KACrB,MAAM,GAAG,SAC8C,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GACtC,QAAQ,gBAAgB,EACxB,OAAO,MAAM,EACb,UAAU,MAAM,GAAG,SAAS,KAC3B,OAQF,CAAC;AAEF,2HAA2H;AAC3H,eAAO,MAAM,wBAAwB,GACnC,GAAG,eAAe,EAClB,GAAG,eAAe,KACjB,OAeF,CAAC"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { colSpec, colSpecArray, EmitRole, foldColumnName, func, getExpressionFilterSignature, lambda, lambdaJson, originOf, QueryEmitter, Schema, TypeFamily, } from '@finos/legend-cube';
17
+ import { CubeEngineError, CubeEngineErrorKind, } from '../graph-manager/CubeEngine.js';
18
+ import { withoutEngineContext } from './CubeExtendTyping.js';
19
+ // Checking a Filter by Expression's condition with the engine (PLAN §11.11):
20
+ // its input's relation, as Cube types any node, then `filter` with the
21
+ // condition. A condition that isn't one Boolean fails there with no location
22
+ // and the whole relation type, so the same call types the condition alone,
23
+ // as an extend column, which gives its type for Cube's own message.
24
+ /** The key of the lambda that filters the input with the condition */
25
+ const filterKeyOf = (filterId) => `${filterId}#filter`;
26
+ /** The key of the lambda that types the condition alone, as an extend column */
27
+ const conditionKeyOf = (filterId) => `${filterId}#condition`;
28
+ /** A name for the condition typed alone that no input column has, as databases that ignore case compare names */
29
+ export const getConditionColumnName = (input) => {
30
+ const taken = new Set(input.names().map(foldColumnName));
31
+ let name = 'cube_condition';
32
+ for (let suffix = 2; taken.has(foldColumnName(name)); suffix += 1) {
33
+ name = `cube_condition_${suffix}`;
34
+ }
35
+ return name;
36
+ };
37
+ /**
38
+ * The lambdas that check a condition, by key: the input's relation filtered
39
+ * with it, and the input's relation extended with it under a name no input
40
+ * column has. A located lambda keeps its locations, so an error points into
41
+ * its text; a stored one is marked with the filter, so an error lands on it.
42
+ * The input must be valid.
43
+ */
44
+ export const buildCubeConditionCheckLambdas = (query, filter, condition, input, registry, located) => {
45
+ const [inputId] = query.getInputIds(filter.id);
46
+ if (inputId === undefined) {
47
+ throw new Error(`Filter by expression "${filter.id}" has no input to check it on`);
48
+ }
49
+ const relation = new QueryEmitter(query, registry).emitRelation(inputId);
50
+ const origin = located ? undefined : originOf(filter.id, EmitRole.EXPRESSION);
51
+ return new Map([
52
+ [
53
+ filterKeyOf(filter.id),
54
+ lambda([], [func('filter', [relation, lambdaJson(condition, origin)])]),
55
+ ],
56
+ [
57
+ conditionKeyOf(filter.id),
58
+ lambda([], [
59
+ func('extend', [
60
+ relation,
61
+ colSpecArray([
62
+ colSpec(getConditionColumnName(input), lambdaJson(condition, origin)),
63
+ ]),
64
+ ]),
65
+ ]),
66
+ ],
67
+ ]);
68
+ };
69
+ /** A condition's type as the message names it: `Integer`, `Boolean[0..1]` */
70
+ const describeConditionType = (column) => `${column.type.displayName}${column.nullable ? '[0..1]' : ''}`;
71
+ /**
72
+ * The check the engine's answers give, for this input and this condition:
73
+ * checked when the filter types; else failed, with the condition's type when
74
+ * it types alone but isn't one Boolean, and the engine's error: the
75
+ * condition's own when it fails alone, as it names no `filter`, else the
76
+ * filter's (a network failure when there is neither)
77
+ */
78
+ export const readCubeConditionCheck = (answers, filter, input, upstream) => {
79
+ const signature = getExpressionFilterSignature(input, filter.lambda);
80
+ const filtered = answers.get(filterKeyOf(filter.id));
81
+ if (filtered instanceof Schema) {
82
+ return { check: { kind: 'checked', signature, upstream } };
83
+ }
84
+ const alone = answers.get(conditionKeyOf(filter.id));
85
+ const conditionColumn = alone instanceof Schema ? alone.columns.at(-1) : undefined;
86
+ const resultType = conditionColumn &&
87
+ !(conditionColumn.type.family === TypeFamily.BOOLEAN &&
88
+ !conditionColumn.nullable)
89
+ ? describeConditionType(conditionColumn)
90
+ : undefined;
91
+ const error = (alone instanceof CubeEngineError ? alone : undefined) ??
92
+ filtered ??
93
+ new CubeEngineError(CubeEngineErrorKind.NETWORK, 'The engine gave no answer for this condition', filter.id);
94
+ return {
95
+ check: {
96
+ kind: 'failed',
97
+ signature,
98
+ message: withoutEngineContext(error.detail),
99
+ resultType,
100
+ upstream,
101
+ },
102
+ error,
103
+ };
104
+ };
105
+ /** The digest of what the engine was given for the input, which the check recorded */
106
+ export const getCubeConditionCheckUpstream = (check) => check.kind === 'unresolved' ? undefined : check.upstream;
107
+ /**
108
+ * Whether the filter's check says its condition is one Boolean for this
109
+ * input: checked, for this schema and this condition, and for this input as
110
+ * the engine is given it, or recorded without it, as when loaded
111
+ */
112
+ export const isCubeConditionCheckCurrent = (filter, input, upstream) => {
113
+ const { check } = filter;
114
+ const recorded = getCubeConditionCheckUpstream(check);
115
+ return (check.kind === 'checked' &&
116
+ filter.currentCheck(input) === check &&
117
+ (recorded === undefined || recorded === upstream));
118
+ };
119
+ /** Whether two checks say the same: the same kind, signature and input as the engine was given it, and the same failure */
120
+ export const isSameCubeConditionCheck = (a, b) => {
121
+ if (getCubeConditionCheckUpstream(a) !== getCubeConditionCheckUpstream(b)) {
122
+ return false;
123
+ }
124
+ if (a.kind === 'checked' && b.kind === 'checked') {
125
+ return a.signature === b.signature;
126
+ }
127
+ if (a.kind === 'failed' && b.kind === 'failed') {
128
+ return (a.signature === b.signature &&
129
+ a.message === b.message &&
130
+ a.resultType === b.resultType);
131
+ }
132
+ return a.kind === 'unresolved' && b.kind === 'unresolved';
133
+ };
134
+ //# sourceMappingURL=CubeExpressionFilterCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeExpressionFilterCheck.js","sourceRoot":"","sources":["../../src/stores/CubeExpressionFilterCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,QAAQ,EAGR,cAAc,EACd,IAAI,EACJ,4BAA4B,EAG5B,MAAM,EACN,UAAU,EAEV,QAAQ,EAER,YAAY,EACZ,MAAM,EAEN,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,mBAAmB,GAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,6EAA6E;AAC7E,uEAAuE;AACvE,6EAA6E;AAC7E,2EAA2E;AAC3E,oEAAoE;AAEpE,sEAAsE;AACtE,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,GAAG,QAAQ,SAAS,CAAC;AAEvE,gFAAgF;AAChF,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,GAAG,QAAQ,YAAY,CAAC;AAE7E,iHAAiH;AACjH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9D,MAAM,KAAK,GAAG,IAAI,GA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AAK,6BAA6B,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACjD,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC;IACrC,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/C,OAAO,CACL,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS;YAC3B,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;YACvB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,CAC9B,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC;AAC5D,CAAC,CAAC"}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Extend, type ExtendTyping, type IR, type JsonObject, type ModelContext, type NodeRegistry, type Query, QueryEmitter, type QueryRule, type Schema } from '@finos/legend-cube';
16
+ import { type Extend, type ExtendTyping, type IR, type JsonObject, type ModelContext, type NodeRegistry, type Query, QueryEmitter, type Schema } from '@finos/legend-cube';
17
17
  import { CubeEngineError, type NodeId } from '../graph-manager/CubeEngine.js';
18
18
  /** An engine message without the compiler's ` - Context:[…]` trail, which repeats what it was doing */
19
19
  export declare const withoutEngineContext: (message: string) => string;
@@ -30,10 +30,11 @@ export interface CubeExtendTypingColumn {
30
30
  */
31
31
  export declare const buildCubeExtendTypingLambdas: (query: Query, extend: Extend, columns: readonly CubeExtendTypingColumn[], registry: NodeRegistry, located: boolean) => Map<NodeId, IR>;
32
32
  /**
33
- * What the engine is given for an Extend's input when it types it, digested
34
- * (PLAN §11.7): the input's relation as emitted, and the model. A typing
35
- * records it (`upstream`), since the engine sees more than Cube's schema
36
- * does; `undefined` when the input can't be emitted, e.g. it is invalid.
33
+ * What the engine is given for a node's input when it types an Extend or
34
+ * checks a Filter by Expression, digested (PLAN §11.7, §11.11): the input's
35
+ * relation as emitted, and the model. A typing or a check records it
36
+ * (`upstream`), since the engine sees more than Cube's schema does;
37
+ * `undefined` when the input can't be emitted, e.g. it is invalid.
37
38
  */
38
39
  export declare const getCubeExtendUpstream: (emitter: QueryEmitter, extendId: string, model: ModelContext) => string | undefined;
39
40
  /** The digest of what the engine was given for the input, which the typing recorded */
@@ -44,15 +45,6 @@ export declare const getCubeExtendTypingUpstream: (typing: ExtendTyping) => stri
44
45
  * it, or recorded without it, as when loaded
45
46
  */
46
47
  export declare const isCubeExtendTypingCurrent: (extend: Extend, input: Schema, upstream: string | undefined) => boolean;
47
- /**
48
- * A query rule for the editor (PLAN §11.7): an Extend whose typing recorded
49
- * another input than the engine would be given now waits to be typed again
50
- * (`ERR_TYPING`), e.g. after an Extend above it gains `->toOne()`, which
51
- * Cube's schema doesn't show. A typing that recorded nothing, as one loaded,
52
- * is used as it is; an Extend that already waits, or whose input is invalid,
53
- * is left to its own checks.
54
- */
55
- export declare const createStaleCubeExtendTypingRule: (registry: NodeRegistry, modelOf: () => ModelContext | undefined) => QueryRule;
56
48
  /** What typing an Extend gave: the typing to store, and the error the engine gave, if it failed */
57
49
  export interface CubeExtendTypingResult {
58
50
  readonly typing: ExtendTyping;
@@ -1 +1 @@
1
- {"version":3,"file":"CubeExtendTyping.d.ts","sourceRoot":"","sources":["../../src/stores/CubeExtendTyping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAML,MAAM,EACN,KAAK,YAAY,EAIjB,KAAK,EAAE,EAEP,KAAK,UAAU,EAGf,KAAK,YAAY,EACjB,KAAK,YAAY,EAGjB,KAAK,KAAK,EACV,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ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