@finos/legend-cube-builder 0.0.0-stage → 0.0.3

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 (379) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +64 -2
  3. package/docs/adding-an-operation.md +92 -0
  4. package/docs/hosting.md +79 -0
  5. package/docs/testing.md +83 -0
  6. package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
  7. package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
  8. package/lib/__lib__/LegendCubeCommand.js +40 -0
  9. package/lib/__lib__/LegendCubeCommand.js.map +1 -0
  10. package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
  11. package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
  12. package/lib/__lib__/LegendCubeHelpText.js +35 -0
  13. package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
  14. package/lib/__lib__/LegendCubeLabels.d.ts +87 -0
  15. package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
  16. package/lib/__lib__/LegendCubeLabels.js +128 -0
  17. package/lib/__lib__/LegendCubeLabels.js.map +1 -0
  18. package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
  19. package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
  20. package/lib/__lib__/LegendCubeTesting.js +34 -0
  21. package/lib/__lib__/LegendCubeTesting.js.map +1 -0
  22. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
  23. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
  24. package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
  25. package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
  26. package/lib/__test-utils__/CubeEngineTestSupport.d.ts +47 -0
  27. package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
  28. package/lib/__test-utils__/CubeEngineTestSupport.js +106 -0
  29. package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
  30. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
  31. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
  32. package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
  33. package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
  34. package/lib/__test-utils__/CubeOperationsTestUtils.d.ts +42 -0
  35. package/lib/__test-utils__/CubeOperationsTestUtils.d.ts.map +1 -0
  36. package/lib/__test-utils__/CubeOperationsTestUtils.js +92 -0
  37. package/lib/__test-utils__/CubeOperationsTestUtils.js.map +1 -0
  38. package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
  39. package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
  40. package/lib/__test-utils__/CubePageTestUtils.js +68 -0
  41. package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
  42. package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
  43. package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
  44. package/lib/__test-utils__/CubeTestApplication.js +57 -0
  45. package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
  46. package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
  47. package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
  48. package/lib/__test-utils__/FakeCubeEngine.js +91 -0
  49. package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
  50. package/lib/components/CubeButton.d.ts +20 -0
  51. package/lib/components/CubeButton.d.ts.map +1 -0
  52. package/lib/components/CubeButton.js +24 -0
  53. package/lib/components/CubeButton.js.map +1 -0
  54. package/lib/components/CubeEditor.d.ts +31 -0
  55. package/lib/components/CubeEditor.d.ts.map +1 -0
  56. package/lib/components/CubeEditor.js +90 -0
  57. package/lib/components/CubeEditor.js.map +1 -0
  58. package/lib/components/CubeNodeIcon.d.ts +23 -0
  59. package/lib/components/CubeNodeIcon.d.ts.map +1 -0
  60. package/lib/components/CubeNodeIcon.js +42 -0
  61. package/lib/components/CubeNodeIcon.js.map +1 -0
  62. package/lib/components/canvas/CubeCanvas.d.ts +37 -0
  63. package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
  64. package/lib/components/canvas/CubeCanvas.js +137 -0
  65. package/lib/components/canvas/CubeCanvas.js.map +1 -0
  66. package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
  67. package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
  68. package/lib/components/canvas/CubeCanvasContext.js +22 -0
  69. package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
  70. package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
  71. package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
  72. package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
  73. package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
  74. package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
  75. package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
  76. package/lib/components/canvas/CubeCanvasDnd.js +51 -0
  77. package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
  78. package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
  79. package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
  80. package/lib/components/canvas/CubeCanvasEdge.js +33 -0
  81. package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
  82. package/lib/components/canvas/CubeCanvasElements.d.ts +66 -0
  83. package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
  84. package/lib/components/canvas/CubeCanvasElements.js +97 -0
  85. package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
  86. package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
  87. package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
  88. package/lib/components/canvas/CubeCanvasLayout.js +63 -0
  89. package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
  90. package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
  91. package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
  92. package/lib/components/canvas/CubeCanvasNode.js +75 -0
  93. package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
  94. package/lib/components/editors/CubeColumnPicker.d.ts +47 -0
  95. package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
  96. package/lib/components/editors/CubeColumnPicker.js +56 -0
  97. package/lib/components/editors/CubeColumnPicker.js.map +1 -0
  98. package/lib/components/editors/CubeDistinctEditor.d.ts +23 -0
  99. package/lib/components/editors/CubeDistinctEditor.d.ts.map +1 -0
  100. package/lib/components/editors/CubeDistinctEditor.js +24 -0
  101. package/lib/components/editors/CubeDistinctEditor.js.map +1 -0
  102. package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
  103. package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
  104. package/lib/components/editors/CubeFilterEditor.js +90 -0
  105. package/lib/components/editors/CubeFilterEditor.js.map +1 -0
  106. package/lib/components/editors/CubeIntegerField.d.ts +29 -0
  107. package/lib/components/editors/CubeIntegerField.d.ts.map +1 -0
  108. package/lib/components/editors/CubeIntegerField.js +30 -0
  109. package/lib/components/editors/CubeIntegerField.js.map +1 -0
  110. package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
  111. package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
  112. package/lib/components/editors/CubeJoinEditor.js +84 -0
  113. package/lib/components/editors/CubeJoinEditor.js.map +1 -0
  114. package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
  115. package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
  116. package/lib/components/editors/CubeNodeEditorPanel.js +72 -0
  117. package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
  118. package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
  119. package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
  120. package/lib/components/editors/CubeNodeEditorRegistry.js +43 -0
  121. package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
  122. package/lib/components/editors/CubeRenameEditor.d.ts +26 -0
  123. package/lib/components/editors/CubeRenameEditor.d.ts.map +1 -0
  124. package/lib/components/editors/CubeRenameEditor.js +58 -0
  125. package/lib/components/editors/CubeRenameEditor.js.map +1 -0
  126. package/lib/components/editors/CubeRestrictEditor.d.ts +26 -0
  127. package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -0
  128. package/lib/components/editors/CubeRestrictEditor.js +23 -0
  129. package/lib/components/editors/CubeRestrictEditor.js.map +1 -0
  130. package/lib/components/editors/CubeRowCountEditor.d.ts +25 -0
  131. package/lib/components/editors/CubeRowCountEditor.d.ts.map +1 -0
  132. package/lib/components/editors/CubeRowCountEditor.js +38 -0
  133. package/lib/components/editors/CubeRowCountEditor.js.map +1 -0
  134. package/lib/components/editors/CubeSliceEditor.d.ts +25 -0
  135. package/lib/components/editors/CubeSliceEditor.d.ts.map +1 -0
  136. package/lib/components/editors/CubeSliceEditor.js +40 -0
  137. package/lib/components/editors/CubeSliceEditor.js.map +1 -0
  138. package/lib/components/editors/CubeSortEditor.d.ts +27 -0
  139. package/lib/components/editors/CubeSortEditor.d.ts.map +1 -0
  140. package/lib/components/editors/CubeSortEditor.js +72 -0
  141. package/lib/components/editors/CubeSortEditor.js.map +1 -0
  142. package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
  143. package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
  144. package/lib/components/editors/CubeSourceEditor.js +41 -0
  145. package/lib/components/editors/CubeSourceEditor.js.map +1 -0
  146. package/lib/components/editors/CubeValueEditor.d.ts +40 -0
  147. package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
  148. package/lib/components/editors/CubeValueEditor.js +178 -0
  149. package/lib/components/editors/CubeValueEditor.js.map +1 -0
  150. package/lib/components/grid/CubeGridRegion.d.ts +23 -0
  151. package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
  152. package/lib/components/grid/CubeGridRegion.js +94 -0
  153. package/lib/components/grid/CubeGridRegion.js.map +1 -0
  154. package/lib/components/grid/CubeGridValues.d.ts +25 -0
  155. package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
  156. package/lib/components/grid/CubeGridValues.js +95 -0
  157. package/lib/components/grid/CubeGridValues.js.map +1 -0
  158. package/lib/components/grid/CubeResultGrid.d.ts +39 -0
  159. package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
  160. package/lib/components/grid/CubeResultGrid.js +86 -0
  161. package/lib/components/grid/CubeResultGrid.js.map +1 -0
  162. package/lib/components/palette/CubePalette.d.ts +29 -0
  163. package/lib/components/palette/CubePalette.d.ts.map +1 -0
  164. package/lib/components/palette/CubePalette.js +73 -0
  165. package/lib/components/palette/CubePalette.js.map +1 -0
  166. package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
  167. package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
  168. package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
  169. package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
  170. package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
  171. package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
  172. package/lib/components/source-picker/CubeSourcePicker.js +89 -0
  173. package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
  174. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
  175. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
  176. package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
  177. package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
  178. package/lib/graph-manager/CubeEngine.d.ts +128 -0
  179. package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
  180. package/lib/graph-manager/CubeEngine.js +61 -0
  181. package/lib/graph-manager/CubeEngine.js.map +1 -0
  182. package/lib/graph-manager/CubeModelOutlineHelper.d.ts +33 -0
  183. package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
  184. package/lib/graph-manager/CubeModelOutlineHelper.js +45 -0
  185. package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
  186. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
  187. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
  188. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
  189. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
  190. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
  191. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
  192. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
  193. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
  194. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
  195. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
  196. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
  197. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
  198. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
  199. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
  200. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
  201. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
  202. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
  203. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
  204. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +174 -0
  205. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
  206. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
  207. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
  208. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
  209. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
  210. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
  211. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
  212. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
  213. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
  214. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
  215. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
  216. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
  217. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
  218. package/lib/index.css +17 -0
  219. package/lib/index.css.map +1 -0
  220. package/lib/index.d.ts +25 -0
  221. package/lib/index.d.ts.map +1 -0
  222. package/lib/index.js +24 -0
  223. package/lib/index.js.map +1 -0
  224. package/lib/stores/CubeEditorState.d.ts +236 -0
  225. package/lib/stores/CubeEditorState.d.ts.map +1 -0
  226. package/lib/stores/CubeEditorState.js +632 -0
  227. package/lib/stores/CubeEditorState.js.map +1 -0
  228. package/lib/stores/CubeExecutionState.d.ts +67 -0
  229. package/lib/stores/CubeExecutionState.d.ts.map +1 -0
  230. package/lib/stores/CubeExecutionState.js +212 -0
  231. package/lib/stores/CubeExecutionState.js.map +1 -0
  232. package/lib/stores/CubeGridQuickActions.d.ts +40 -0
  233. package/lib/stores/CubeGridQuickActions.d.ts.map +1 -0
  234. package/lib/stores/CubeGridQuickActions.js +86 -0
  235. package/lib/stores/CubeGridQuickActions.js.map +1 -0
  236. package/lib/stores/CubeHost.d.ts +31 -0
  237. package/lib/stores/CubeHost.d.ts.map +1 -0
  238. package/lib/stores/CubeHost.js +17 -0
  239. package/lib/stores/CubeHost.js.map +1 -0
  240. package/lib/stores/CubeNodeEditorState.d.ts +103 -0
  241. package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
  242. package/lib/stores/CubeNodeEditorState.js +262 -0
  243. package/lib/stores/CubeNodeEditorState.js.map +1 -0
  244. package/lib/stores/CubeShowPureState.d.ts +41 -0
  245. package/lib/stores/CubeShowPureState.d.ts.map +1 -0
  246. package/lib/stores/CubeShowPureState.js +100 -0
  247. package/lib/stores/CubeShowPureState.js.map +1 -0
  248. package/lib/stores/CubeSourcePickerState.d.ts +98 -0
  249. package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
  250. package/lib/stores/CubeSourcePickerState.js +334 -0
  251. package/lib/stores/CubeSourcePickerState.js.map +1 -0
  252. package/lib/stores/CubeSpecTransferState.d.ts +60 -0
  253. package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
  254. package/lib/stores/CubeSpecTransferState.js +167 -0
  255. package/lib/stores/CubeSpecTransferState.js.map +1 -0
  256. package/lib/stores/LocalModelCatalog.d.ts +37 -0
  257. package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
  258. package/lib/stores/LocalModelCatalog.js +49 -0
  259. package/lib/stores/LocalModelCatalog.js.map +1 -0
  260. package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
  261. package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
  262. package/lib/stores/editors/CubeFilterDraft.js +186 -0
  263. package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
  264. package/lib/stores/editors/CubeIntegerText.d.ts +24 -0
  265. package/lib/stores/editors/CubeIntegerText.d.ts.map +1 -0
  266. package/lib/stores/editors/CubeIntegerText.js +33 -0
  267. package/lib/stores/editors/CubeIntegerText.js.map +1 -0
  268. package/lib/stores/editors/CubeJoinDraft.d.ts +71 -0
  269. package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
  270. package/lib/stores/editors/CubeJoinDraft.js +145 -0
  271. package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
  272. package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
  273. package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
  274. package/lib/stores/editors/CubeNodeDraft.js +35 -0
  275. package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
  276. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +35 -0
  277. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
  278. package/lib/stores/editors/CubeNodeDraftRegistry.js +55 -0
  279. package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
  280. package/lib/stores/editors/CubeRenameDraft.d.ts +44 -0
  281. package/lib/stores/editors/CubeRenameDraft.d.ts.map +1 -0
  282. package/lib/stores/editors/CubeRenameDraft.js +79 -0
  283. package/lib/stores/editors/CubeRenameDraft.js.map +1 -0
  284. package/lib/stores/editors/CubeRestrictDraft.d.ts +37 -0
  285. package/lib/stores/editors/CubeRestrictDraft.d.ts.map +1 -0
  286. package/lib/stores/editors/CubeRestrictDraft.js +73 -0
  287. package/lib/stores/editors/CubeRestrictDraft.js.map +1 -0
  288. package/lib/stores/editors/CubeRowCountDraft.d.ts +42 -0
  289. package/lib/stores/editors/CubeRowCountDraft.d.ts.map +1 -0
  290. package/lib/stores/editors/CubeRowCountDraft.js +55 -0
  291. package/lib/stores/editors/CubeRowCountDraft.js.map +1 -0
  292. package/lib/stores/editors/CubeSliceDraft.d.ts +42 -0
  293. package/lib/stores/editors/CubeSliceDraft.d.ts.map +1 -0
  294. package/lib/stores/editors/CubeSliceDraft.js +72 -0
  295. package/lib/stores/editors/CubeSliceDraft.js.map +1 -0
  296. package/lib/stores/editors/CubeSortDraft.d.ts +49 -0
  297. package/lib/stores/editors/CubeSortDraft.d.ts.map +1 -0
  298. package/lib/stores/editors/CubeSortDraft.js +99 -0
  299. package/lib/stores/editors/CubeSortDraft.js.map +1 -0
  300. package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
  301. package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
  302. package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
  303. package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
  304. package/package.json +81 -3
  305. package/src/__lib__/LegendCubeCommand.ts +44 -0
  306. package/src/__lib__/LegendCubeHelpText.ts +58 -0
  307. package/src/__lib__/LegendCubeLabels.ts +171 -0
  308. package/src/__lib__/LegendCubeTesting.ts +33 -0
  309. package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
  310. package/src/__test-utils__/CubeEngineTestSupport.ts +172 -0
  311. package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
  312. package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
  313. package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
  314. package/src/__test-utils__/CubeTestApplication.ts +82 -0
  315. package/src/__test-utils__/FakeCubeEngine.ts +145 -0
  316. package/src/components/CubeButton.tsx +35 -0
  317. package/src/components/CubeEditor.tsx +239 -0
  318. package/src/components/CubeNodeIcon.tsx +64 -0
  319. package/src/components/canvas/CubeCanvas.tsx +262 -0
  320. package/src/components/canvas/CubeCanvasContext.ts +31 -0
  321. package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
  322. package/src/components/canvas/CubeCanvasDnd.ts +82 -0
  323. package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
  324. package/src/components/canvas/CubeCanvasElements.ts +153 -0
  325. package/src/components/canvas/CubeCanvasLayout.ts +88 -0
  326. package/src/components/canvas/CubeCanvasNode.tsx +149 -0
  327. package/src/components/editors/CubeColumnPicker.tsx +138 -0
  328. package/src/components/editors/CubeDistinctEditor.tsx +28 -0
  329. package/src/components/editors/CubeFilterEditor.tsx +309 -0
  330. package/src/components/editors/CubeIntegerField.tsx +51 -0
  331. package/src/components/editors/CubeJoinEditor.tsx +247 -0
  332. package/src/components/editors/CubeNodeEditorPanel.tsx +215 -0
  333. package/src/components/editors/CubeNodeEditorRegistry.ts +81 -0
  334. package/src/components/editors/CubeRenameEditor.tsx +143 -0
  335. package/src/components/editors/CubeRestrictEditor.tsx +103 -0
  336. package/src/components/editors/CubeRowCountEditor.tsx +53 -0
  337. package/src/components/editors/CubeSliceEditor.tsx +69 -0
  338. package/src/components/editors/CubeSortEditor.tsx +206 -0
  339. package/src/components/editors/CubeSourceEditor.tsx +106 -0
  340. package/src/components/editors/CubeValueEditor.tsx +333 -0
  341. package/src/components/grid/CubeGridRegion.tsx +275 -0
  342. package/src/components/grid/CubeGridValues.ts +125 -0
  343. package/src/components/grid/CubeResultGrid.tsx +138 -0
  344. package/src/components/palette/CubePalette.tsx +177 -0
  345. package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
  346. package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
  347. package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
  348. package/src/graph-manager/CubeEngine.ts +169 -0
  349. package/src/graph-manager/CubeModelOutlineHelper.ts +58 -0
  350. package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
  351. package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
  352. package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
  353. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
  354. package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +243 -0
  355. package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
  356. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
  357. package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +127 -0
  358. package/src/index.ts +41 -0
  359. package/src/stores/CubeEditorState.ts +807 -0
  360. package/src/stores/CubeExecutionState.ts +288 -0
  361. package/src/stores/CubeGridQuickActions.ts +129 -0
  362. package/src/stores/CubeHost.ts +32 -0
  363. package/src/stores/CubeNodeEditorState.ts +324 -0
  364. package/src/stores/CubeShowPureState.ts +118 -0
  365. package/src/stores/CubeSourcePickerState.ts +426 -0
  366. package/src/stores/CubeSpecTransferState.ts +198 -0
  367. package/src/stores/LocalModelCatalog.ts +70 -0
  368. package/src/stores/editors/CubeFilterDraft.ts +241 -0
  369. package/src/stores/editors/CubeIntegerText.ts +34 -0
  370. package/src/stores/editors/CubeJoinDraft.ts +224 -0
  371. package/src/stores/editors/CubeNodeDraft.ts +46 -0
  372. package/src/stores/editors/CubeNodeDraftRegistry.ts +83 -0
  373. package/src/stores/editors/CubeRenameDraft.ts +110 -0
  374. package/src/stores/editors/CubeRestrictDraft.ts +83 -0
  375. package/src/stores/editors/CubeRowCountDraft.ts +69 -0
  376. package/src/stores/editors/CubeSliceDraft.ts +87 -0
  377. package/src/stores/editors/CubeSortDraft.ts +135 -0
  378. package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
  379. package/tsconfig.json +133 -0
@@ -0,0 +1,288 @@
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
+
17
+ import {
18
+ isSchemasError,
19
+ needsDatabaseType,
20
+ type Query,
21
+ type Schema,
22
+ } from '@finos/legend-cube';
23
+ import { assertErrorThrown, type GeneratorFn } from '@finos/legend-shared';
24
+ import {
25
+ action,
26
+ computed,
27
+ flow,
28
+ flowResult,
29
+ makeObservable,
30
+ observable,
31
+ } from 'mobx';
32
+ import {
33
+ CubeEngineError,
34
+ CubeEngineErrorKind,
35
+ type CubeResult,
36
+ type CubeResultValue,
37
+ } from '../graph-manager/CubeEngine.js';
38
+ import type { CubeEditorState } from './CubeEditorState.js';
39
+
40
+ /** What the grid shows of a run: the rows within the limit, under the schema the run was made with */
41
+ export interface CubeExecutionResult {
42
+ /** Counts the page's runs: the grid is built anew for each */
43
+ readonly id: number;
44
+ /** The query that ran: results are stale once the document holds another */
45
+ readonly query: Query;
46
+ /** The capture node's schema when the run started; the grid's columns, by position */
47
+ readonly schema: Schema;
48
+ /** At most `rowLimit` rows */
49
+ readonly rows: readonly (readonly CubeResultValue[])[];
50
+ readonly rowLimit: number;
51
+ /** The engine returned more than `rowLimit` rows */
52
+ readonly limited: boolean;
53
+ readonly sql: readonly string[];
54
+ readonly durationMs: number;
55
+ }
56
+
57
+ /**
58
+ * The first error found walking up from the capture node, named by its node.
59
+ * A node that is invalid only because an input is gets passed over for that
60
+ * input's own error.
61
+ */
62
+ const findUpstreamError = (
63
+ query: Query,
64
+ validity: ReadonlyMap<string, readonly string[]>,
65
+ captureId: string,
66
+ ): string => {
67
+ const visit = (nodeId: string): string | undefined => {
68
+ const node = query.getNode(nodeId);
69
+ if (!node) {
70
+ return undefined;
71
+ }
72
+ for (const inputId of query.getInputIds(nodeId)) {
73
+ const error = inputId === undefined ? undefined : visit(inputId);
74
+ if (error) {
75
+ return error;
76
+ }
77
+ }
78
+ const error = (validity.get(nodeId) ?? []).find(
79
+ (message) => !isSchemasError(message),
80
+ );
81
+ return error === undefined ? undefined : `${node.describe()}: ${error}`;
82
+ };
83
+ return (
84
+ visit(captureId) ?? 'The node to run, or one of its inputs, has errors.'
85
+ );
86
+ };
87
+
88
+ /**
89
+ * Runs the query up to its capture node (PLAN §8.2, §9). Execution is
90
+ * explicit; while a run is in flight Execute becomes Stop, and only the latest
91
+ * run's answer is applied (Settled before M1.8).
92
+ */
93
+ export class CubeExecutionState {
94
+ readonly editorState: CubeEditorState;
95
+
96
+ result: CubeExecutionResult | undefined;
97
+ error: CubeEngineError | undefined;
98
+ /** The abort controller of the run in flight, if any */
99
+ private runController: AbortController | undefined;
100
+ private runCount = 0;
101
+
102
+ constructor(editorState: CubeEditorState) {
103
+ makeObservable<CubeExecutionState, 'runController'>(this, {
104
+ result: observable.ref,
105
+ error: observable.ref,
106
+ runController: observable.ref,
107
+ isRunning: computed,
108
+ isStale: computed,
109
+ disabledReasons: computed,
110
+ canExecute: computed,
111
+ execute: flow,
112
+ clearError: action,
113
+ stop: action,
114
+ reset: action,
115
+ });
116
+ this.editorState = editorState;
117
+ }
118
+
119
+ get isRunning(): boolean {
120
+ return this.runController !== undefined;
121
+ }
122
+
123
+ /** The shown result no longer matches the query or the row limit; it is kept until the next run */
124
+ get isStale(): boolean {
125
+ return (
126
+ this.result !== undefined &&
127
+ !this.isRunning &&
128
+ (this.result.query !== this.editorState.document.query ||
129
+ this.result.rowLimit !== this.editorState.rowLimit)
130
+ );
131
+ }
132
+
133
+ /**
134
+ * Why Execute is unavailable, if it is: it needs a source, a model and a
135
+ * runtime, and a valid capture node whose inputs are all valid. Invalid
136
+ * nodes elsewhere don't matter (PLAN §10.3).
137
+ */
138
+ get disabledReasons(): string[] {
139
+ const { document, emitter, analysis } = this.editorState;
140
+ const { query, context } = document;
141
+ if (!query.nodes.length) {
142
+ return ['Add a table first.'];
143
+ }
144
+ const reasons: string[] = [];
145
+ if (!context) {
146
+ reasons.push('The cube has no model.');
147
+ } else if (!context.runtime) {
148
+ reasons.push('The cube has no runtime.');
149
+ }
150
+ const captureId = query.selected;
151
+ if (captureId === undefined) {
152
+ reasons.push('Select the node to run.');
153
+ } else if (!emitter.canEmit(captureId)) {
154
+ reasons.push(findUpstreamError(query, analysis.validity, captureId));
155
+ }
156
+ return reasons;
157
+ }
158
+
159
+ get canExecute(): boolean {
160
+ return !this.disabledReasons.length;
161
+ }
162
+
163
+ *execute(): GeneratorFn<void> {
164
+ if (this.isRunning || !this.canExecute) {
165
+ return;
166
+ }
167
+ const { document, emitter, analysis, rowLimit, host } = this.editorState;
168
+ const { query, context } = document;
169
+ // checked by canExecute
170
+ const captureId = query.selected as string;
171
+ const model = context?.model;
172
+ const runtime = context?.runtime;
173
+ const schema = analysis.schemas.get(captureId);
174
+ if (!model || !runtime || !schema) {
175
+ return;
176
+ }
177
+ // the run starts before any wait, so Stop works and a second F9 is ignored
178
+ const controller = new AbortController();
179
+ this.runController = controller;
180
+ this.error = undefined;
181
+ this.editorState.clearHostIssues();
182
+ try {
183
+ // a Drop, Slice, Limit or Distinct is written for the database it runs on
184
+ // (PLAN §11.4), which the model's outline gives: loaded once, waited
185
+ // for only then; the query, model and runtime are the ones captured
186
+ let databaseType: string | undefined;
187
+ if (needsDatabaseType(query, captureId)) {
188
+ yield flowResult(this.editorState.loadModelOutline(model));
189
+ if (this.runController !== controller || controller.signal.aborted) {
190
+ return;
191
+ }
192
+ databaseType = this.editorState.getRunDatabaseType(
193
+ query,
194
+ captureId,
195
+ model,
196
+ runtime,
197
+ );
198
+ }
199
+ const lambda = emitter.emitExecutionLambda({
200
+ rowLimit,
201
+ runtime,
202
+ databaseType,
203
+ });
204
+ const response = (yield host.engine.execute(model, lambda, {
205
+ abortController: controller,
206
+ })) as CubeResult;
207
+ if (this.runController !== controller) {
208
+ return;
209
+ }
210
+ // rows are read by position, so the engine's columns must be the query's
211
+ if (response.columns.length !== schema.columns.length) {
212
+ throw new CubeEngineError(
213
+ CubeEngineErrorKind.EXECUTION,
214
+ `The engine returned ${response.columns.length} columns, but the query has ${schema.columns.length}`,
215
+ captureId,
216
+ );
217
+ }
218
+ const misplaced = schema.columns.findIndex(
219
+ (column, position) => response.columns[position] !== column.name,
220
+ );
221
+ if (misplaced !== -1) {
222
+ throw new CubeEngineError(
223
+ CubeEngineErrorKind.EXECUTION,
224
+ `The engine returned the column "${response.columns[misplaced]}" at position ${misplaced + 1}, but the query has "${schema.columns[misplaced]?.name}" there`,
225
+ captureId,
226
+ );
227
+ }
228
+ const limited = response.rows.length > rowLimit;
229
+ this.result = {
230
+ id: ++this.runCount,
231
+ query,
232
+ schema,
233
+ rows: limited ? response.rows.slice(0, rowLimit) : response.rows,
234
+ rowLimit,
235
+ limited,
236
+ sql: response.sql,
237
+ durationMs: response.durationMs,
238
+ };
239
+ } catch (error) {
240
+ // a stopped or replaced run shows nothing
241
+ if (this.runController !== controller || controller.signal.aborted) {
242
+ return;
243
+ }
244
+ assertErrorThrown(error);
245
+ const engineError =
246
+ error instanceof CubeEngineError
247
+ ? error
248
+ : new CubeEngineError(
249
+ CubeEngineErrorKind.EXECUTION,
250
+ error.message,
251
+ captureId,
252
+ );
253
+ // the rows of an earlier run are never shown as this run's
254
+ this.result = undefined;
255
+ // an error belongs to the query it came from: one that changed while
256
+ // the run was in flight drops it, as an edit after the run would
257
+ if (this.editorState.document.query === query) {
258
+ this.error = engineError;
259
+ this.editorState.setHostIssue(
260
+ engineError.nodeId ?? captureId,
261
+ engineError,
262
+ );
263
+ }
264
+ } finally {
265
+ if (this.runController === controller) {
266
+ this.runController = undefined;
267
+ }
268
+ }
269
+ }
270
+
271
+ /** Drops the last run's error: it described a query the cube no longer has */
272
+ clearError(): void {
273
+ this.error = undefined;
274
+ }
275
+
276
+ /** Cancels the run in flight; it shows no result and no error */
277
+ stop(): void {
278
+ this.runController?.abort();
279
+ this.runController = undefined;
280
+ }
281
+
282
+ /** Stops any run and forgets the last one's rows and error, e.g. when another cube is opened */
283
+ reset(): void {
284
+ this.stop();
285
+ this.result = undefined;
286
+ this.error = undefined;
287
+ }
288
+ }
@@ -0,0 +1,129 @@
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
+
17
+ import {
18
+ buildQuickFilterRule,
19
+ FilterOperator,
20
+ Filter,
21
+ isOperatorAvailable,
22
+ isSortableType,
23
+ Sort,
24
+ TypeFamily,
25
+ } from '@finos/legend-cube';
26
+ import {
27
+ CUBE_QUICK_ACTION_DISABLED_REASON,
28
+ FILTER_FLOAT_COMPARISON_HINT,
29
+ READ_ONLY_CUBE_TITLE,
30
+ } from '../__lib__/LegendCubeLabels.js';
31
+ import type { CubeResultValue } from '../graph-manager/CubeEngine.js';
32
+ import type { CubeEditorState } from './CubeEditorState.js';
33
+
34
+ /** One of the grid's quick actions on a cell (spec §12.4) */
35
+ export interface CubeGridQuickAction {
36
+ /** e.g. `Sort by "SHIP_COUNTRY"` */
37
+ readonly label: string;
38
+ /** Why it can't be used, its tooltip then; `undefined` when it can */
39
+ readonly disabledReason: string | undefined;
40
+ /** A note shown as its tooltip when it can be used, e.g. on comparing floats */
41
+ readonly hint: string | undefined;
42
+ /** Adds its node after the node that runs, as one undo step; nothing runs */
43
+ readonly apply: () => void;
44
+ }
45
+
46
+ /**
47
+ * The quick actions on a cell of the shown rows (spec §12.4, PLAN §11.4):
48
+ * "Sort by" adds an ascending Sort on the cell's column, and "Filter by" an
49
+ * Equal on its value (Is Empty on a null), after the node that runs, which
50
+ * they replace as the node that runs. Both need the rows to be from the
51
+ * current query, no run in flight, and a cube that can change; "Sort by" a
52
+ * type that sorts, and "Filter by" a value its column's type can compare.
53
+ * Read when the menu opens; `[]` when the position is not a column of the
54
+ * shown rows.
55
+ */
56
+ export const getCubeGridQuickActions = (
57
+ editorState: CubeEditorState,
58
+ position: number,
59
+ cell: CubeResultValue,
60
+ ): CubeGridQuickAction[] => {
61
+ const { execution, document } = editorState;
62
+ const { result } = execution;
63
+ const column = result?.schema.columns[position];
64
+ if (!result || !column) {
65
+ return [];
66
+ }
67
+ const { query } = document;
68
+ const afterId = query.selected;
69
+ const typeName = column.type.displayName;
70
+ const rule = buildQuickFilterRule(column.name, column.type, cell);
71
+ // what keeps both from being used, in order
72
+ const blocked =
73
+ result.query !== query
74
+ ? CUBE_QUICK_ACTION_DISABLED_REASON.STALE_ROWS
75
+ : execution.isRunning
76
+ ? CUBE_QUICK_ACTION_DISABLED_REASON.RUNNING
77
+ : editorState.readOnly
78
+ ? READ_ONLY_CUBE_TITLE
79
+ : undefined;
80
+ const sortReason =
81
+ blocked ??
82
+ (isSortableType(column.type)
83
+ ? undefined
84
+ : CUBE_QUICK_ACTION_DISABLED_REASON.notSortable(typeName));
85
+ const filterReason =
86
+ blocked ??
87
+ (rule
88
+ ? undefined
89
+ : isOperatorAvailable(FilterOperator.EQUAL, column.type)
90
+ ? CUBE_QUICK_ACTION_DISABLED_REASON.UNREADABLE_VALUE
91
+ : CUBE_QUICK_ACTION_DISABLED_REASON.notComparable(typeName));
92
+ return [
93
+ {
94
+ label: `Sort by "${column.name}"`,
95
+ disabledReason: sortReason,
96
+ hint: undefined,
97
+ apply: () => {
98
+ // as the menu found it: nothing changed since it opened
99
+ if (sortReason === undefined && editorState.document.query === query) {
100
+ editorState.addConfiguredNode(
101
+ Sort.byColumn(query.generateId(Sort.TYPE), column.name),
102
+ afterId,
103
+ );
104
+ }
105
+ },
106
+ },
107
+ {
108
+ label: `Filter by "${column.name}"`,
109
+ disabledReason: filterReason,
110
+ hint:
111
+ rule?.operator === FilterOperator.EQUAL &&
112
+ column.type.family === TypeFamily.FLOAT
113
+ ? FILTER_FLOAT_COMPARISON_HINT
114
+ : undefined,
115
+ apply: () => {
116
+ if (
117
+ filterReason === undefined &&
118
+ rule &&
119
+ editorState.document.query === query
120
+ ) {
121
+ editorState.addConfiguredNode(
122
+ new Filter(query.generateId(Filter.TYPE), rule),
123
+ afterId,
124
+ );
125
+ }
126
+ },
127
+ },
128
+ ];
129
+ };
@@ -0,0 +1,32 @@
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
+
17
+ import type { GenericLegendApplicationStore } from '@finos/legend-application';
18
+ import type { CubeEngine } from '../graph-manager/CubeEngine.js';
19
+ import type { LocalModelCatalog } from './LocalModelCatalog.js';
20
+
21
+ /**
22
+ * What the application hosting the Cube page gives it (PLAN §3.5, Settled
23
+ * before M1.8). The host chooses the engine and the models; Cube keeps no
24
+ * auth, config or telemetry of its own and uses the host's application store
25
+ * for commands, user data, the clipboard, the theme, notifications, alerts and
26
+ * telemetry.
27
+ */
28
+ export interface CubeHost {
29
+ readonly applicationStore: GenericLegendApplicationStore;
30
+ readonly engine: CubeEngine;
31
+ readonly modelCatalog: LocalModelCatalog;
32
+ }