@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,171 @@
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 { EmitRole, lambda, storeAccessor, } from '@finos/legend-cube';
17
+ import { V1_EngineServerClient, V1_RenderStyle } from '@finos/legend-graph';
18
+ import { stringifyLosslessJSON, } from '@finos/legend-shared';
19
+ import { CubeEngineError, CubeEngineErrorKind, } from '../../../CubeEngine.js';
20
+ import { V1_buildCubeEngineError, V1_toCubeEngineError, } from './V1_CubeEngineErrors.js';
21
+ import { V1_CubeUnreadableResultError, V1_readCubeExecutionResult, } from './V1_CubeExecutionResultReader.js';
22
+ import { V1_serializeCubeLambda } from './V1_CubeLambdaSerializer.js';
23
+ import { V1_buildCubeModelOutline } from './V1_CubeModelOutlineBuilder.js';
24
+ import { V1_buildCubeSchema } from './V1_CubeRelationTypeAdapter.js';
25
+ /** The only model kind the slice runs: Pure text (PLAN §6.2.2) */
26
+ const TEXT_MODEL_TYPE = 'text';
27
+ const EXECUTION_CLIENT_VERSION = 'vX_X_X';
28
+ /**
29
+ * The node an execution lambda runs: the one its `from` call is stamped with
30
+ * (`{| <relation>->limit(…)->from(runtime)}`), where errors without a stamp go
31
+ */
32
+ const captureNodeOf = (executionLambda) => {
33
+ const from = executionLambda.k === 'lambda' ? executionLambda.body[0] : undefined;
34
+ return from?.k === 'func' ? from.origin?.nodeId : undefined;
35
+ };
36
+ /** The message for a model of a kind this version can't run (PLAN §8.7) */
37
+ export const V1_unsupportedModelMessage = (type) => `This cube's model kind "${type}" isn't supported yet.`;
38
+ /**
39
+ * The Legend engine behind the Cube engine port (PLAN §8.7). It sends the
40
+ * cube's saved model context as it is, lambdas as protocol JSON with lossless
41
+ * numbers, and reads every response itself: the graph manager's wrappers drop
42
+ * type parameters and read numbers lossily (D8).
43
+ */
44
+ export class V1_LegendCubeEngine {
45
+ client;
46
+ constructor(config, tracerService) {
47
+ this.client = new V1_EngineServerClient(config);
48
+ // every call throws without one
49
+ this.client.setTracerService(tracerService);
50
+ }
51
+ /** The model's Pure text, or an unsupported-model error for any other kind */
52
+ textOf(model, nodeId) {
53
+ if (model._type !== TEXT_MODEL_TYPE || typeof model.code !== 'string') {
54
+ throw new CubeEngineError(CubeEngineErrorKind.UNSUPPORTED_MODEL, V1_unsupportedModelMessage(model._type), nodeId);
55
+ }
56
+ return model.code;
57
+ }
58
+ async loadModel(model) {
59
+ const code = this.textOf(model);
60
+ try {
61
+ return V1_buildCubeModelOutline(await this.client.grammarToJSON_model(code));
62
+ }
63
+ catch (error) {
64
+ throw V1_toCubeEngineError(error, undefined, CubeEngineErrorKind.COMPILE);
65
+ }
66
+ }
67
+ resolveSchemas(model, accessors) {
68
+ return this.typeAll(model, new Map([...accessors].map(([nodeId, path]) => [
69
+ nodeId,
70
+ lambda([], [storeAccessor(path, { nodeId, role: EmitRole.ACCESSOR })]),
71
+ ])));
72
+ }
73
+ typeLambdas(model, lambdas) {
74
+ return this.typeAll(model, lambdas);
75
+ }
76
+ /** Types every lambda in one batch call: one entry per key, whatever fails */
77
+ async typeAll(model, lambdas) {
78
+ const typed = new Map();
79
+ if (!lambdas.size) {
80
+ return typed;
81
+ }
82
+ const failAll = (error) => new Map([...lambdas.keys()].map((nodeId) => [
83
+ nodeId,
84
+ V1_toCubeEngineError(error, nodeId, CubeEngineErrorKind.COMPILE),
85
+ ]));
86
+ let response;
87
+ try {
88
+ this.textOf(model);
89
+ const body = stringifyLosslessJSON({
90
+ model,
91
+ lambdas: Object.fromEntries([...lambdas].map(([nodeId, ir]) => [
92
+ nodeId,
93
+ V1_serializeCubeLambda(ir),
94
+ ])),
95
+ });
96
+ // sent as text, so numbers keep every digit; the client sends a string body as it is
97
+ response = (await this.client.batchLambdasRelationType(body));
98
+ }
99
+ catch (error) {
100
+ return failAll(error);
101
+ }
102
+ // the engine answers `result`; legend-graph's response type says `results` (LG-1)
103
+ const results = (response.result ?? response.results ?? {});
104
+ const errors = (response.errors ?? {});
105
+ // own keys only: a node id like `__proto__` mustn't read Object.prototype
106
+ lambdas.forEach((_, nodeId) => {
107
+ const relationType = Object.hasOwn(results, nodeId)
108
+ ? results[nodeId]
109
+ : undefined;
110
+ if (relationType) {
111
+ try {
112
+ typed.set(nodeId, V1_buildCubeSchema(relationType));
113
+ }
114
+ catch (error) {
115
+ typed.set(nodeId, new CubeEngineError(CubeEngineErrorKind.COMPILE, error.message, nodeId));
116
+ }
117
+ return;
118
+ }
119
+ typed.set(nodeId, V1_buildCubeEngineError(Object.hasOwn(errors, nodeId) ? errors[nodeId] : undefined, nodeId, CubeEngineErrorKind.COMPILE) ??
120
+ new CubeEngineError(CubeEngineErrorKind.NETWORK, `The engine gave no type for this node`, nodeId));
121
+ });
122
+ return typed;
123
+ }
124
+ async execute(model, executionLambda, options) {
125
+ const captureId = captureNodeOf(executionLambda);
126
+ const startedAt = Date.now();
127
+ let text;
128
+ try {
129
+ this.textOf(model);
130
+ const body = stringifyLosslessJSON({
131
+ clientVersion: EXECUTION_CLIENT_VERSION,
132
+ function: V1_serializeCubeLambda(executionLambda),
133
+ model,
134
+ context: { _type: 'BaseExecutionContext' },
135
+ parameterValues: [],
136
+ });
137
+ // `returnAsResponse` leaves the body unread, so it can be read losslessly
138
+ const response = (await this.client.runQuery(body, {
139
+ returnAsResponse: true,
140
+ abortController: options?.abortController,
141
+ }));
142
+ text = await response.text();
143
+ }
144
+ catch (error) {
145
+ throw V1_toCubeEngineError(error, captureId, CubeEngineErrorKind.EXECUTION);
146
+ }
147
+ try {
148
+ return {
149
+ ...V1_readCubeExecutionResult(text),
150
+ durationMs: Date.now() - startedAt,
151
+ };
152
+ }
153
+ catch (error) {
154
+ if (error instanceof V1_CubeUnreadableResultError) {
155
+ throw new CubeEngineError(CubeEngineErrorKind.EXECUTION, error.message, captureId);
156
+ }
157
+ throw error;
158
+ }
159
+ }
160
+ async renderPure(lambdaIR) {
161
+ try {
162
+ // sent as text, as typing and execution are: the serialized lambda holds
163
+ // lossless numbers, which plain JSON.stringify would write as objects
164
+ return await this.client.JSONToGrammar_lambda(stringifyLosslessJSON(V1_serializeCubeLambda(lambdaIR)), V1_RenderStyle.PRETTY);
165
+ }
166
+ catch (error) {
167
+ throw V1_toCubeEngineError(error, undefined, CubeEngineErrorKind.COMPILE);
168
+ }
169
+ }
170
+ }
171
+ //# sourceMappingURL=V1_LegendCubeEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_LegendCub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AI,CAAC,MAAM,CAAC,oBAAoB,CAC3C,qBAAqB,CACnB,sBAAsB,CAAC,QAAQ,CAAC,CACP,EAC3B,cAAc,CAAC,MAAM,CACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,oBAAoB,CAAC,KAAK,EAAE,SAAS,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,22 @@
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 { jest } from '@jest/globals';
17
+ import { V1_LegendCubeEngine } from '../V1_LegendCubeEngine.js';
18
+ export declare const V1_createEngineBackedCubeEngine: () => {
19
+ engine: V1_LegendCubeEngine;
20
+ calls: Record<"grammarToJSON_model" | "batchLambdasRelationType" | "runQuery", jest.Mock>;
21
+ };
22
+ //# sourceMappingURL=V1_CubeEngineTestUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeEngineTestUtils.d.ts","sourceRoot":"","sources":["../../../../../../src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAgBrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAuChE,eAAO,MAAM,+BAA+B,QAAO;IACjD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,MAAM,CACX,qBAAqB,GAAG,0BAA0B,GAAG,UAAU,EAC/D,IAAI,CAAC,IAAI,CACV,CAAC;CAkDH,CAAC"}
@@ -0,0 +1,79 @@
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 { jest } from '@jest/globals';
17
+ import { ENGINE_TEST_SUPPORT__grammarToJSON_model, ENGINE_TEST_SUPPORT_API_URL, } from '@finos/legend-graph/test';
18
+ import { NetworkClientError, TracerService, } from '@finos/legend-shared';
19
+ import { AxiosError } from 'axios';
20
+ import { CUBE_ENGINE_TEST__execute, CUBE_ENGINE_TEST__jsonToGrammar_lambda, CUBE_ENGINE_TEST__lambdaRelationTypeBatch, } from '../../../../../__test-utils__/CubeEngineTestSupport.js';
21
+ import { V1_LegendCubeEngine } from '../V1_LegendCubeEngine.js';
22
+ // The real Cube engine, its client's calls routed to the engine on :6300 by
23
+ // Cube's own test helpers (PLAN §3.4): the test environment refuses network
24
+ // calls, and the execute helper hands back the body unread, so the lossless
25
+ // reader runs as in the browser. Every helper fails as the client does.
26
+ /** A failed call, as the engine client throws it: a `NetworkClientError` with the engine's payload */
27
+ const clientError = (status, payload) => new NetworkClientError({
28
+ status,
29
+ statusText: String(status),
30
+ url: ENGINE_TEST_SUPPORT_API_URL,
31
+ }, payload);
32
+ /** The payload of a failed call, as the client reads it: JSON when it parses, else its text */
33
+ const parseOrText = (text) => {
34
+ try {
35
+ return JSON.parse(text);
36
+ }
37
+ catch {
38
+ return text;
39
+ }
40
+ };
41
+ /** A helper's non-2xx response, rethrown as the client throws it */
42
+ const rethrowAsClientError = (error) => {
43
+ if (error instanceof AxiosError && error.response) {
44
+ const data = error.response.data;
45
+ throw clientError(error.response.status, typeof data === 'string' ? parseOrText(data) : data);
46
+ }
47
+ throw error;
48
+ };
49
+ export const V1_createEngineBackedCubeEngine = () => {
50
+ const engine = new V1_LegendCubeEngine({ baseUrl: ENGINE_TEST_SUPPORT_API_URL }, new TracerService());
51
+ const { client } = engine;
52
+ const grammarToJSON_model = jest
53
+ .spyOn(client, 'grammarToJSON_model')
54
+ .mockImplementation(async (code) => (await ENGINE_TEST_SUPPORT__grammarToJSON_model(code).catch(rethrowAsClientError)));
55
+ const batchLambdasRelationType = jest
56
+ .spyOn(client, 'batchLambdasRelationType')
57
+ .mockImplementation(async (input) => (await CUBE_ENGINE_TEST__lambdaRelationTypeBatch(input).catch(rethrowAsClientError)));
58
+ const runQuery = jest
59
+ .spyOn(client, 'runQuery')
60
+ .mockImplementation(async (input) => {
61
+ const response = await CUBE_ENGINE_TEST__execute(input);
62
+ if (!response.ok) {
63
+ throw clientError(response.status, parseOrText(await response.text()));
64
+ }
65
+ return response;
66
+ });
67
+ jest
68
+ .spyOn(client, 'JSONToGrammar_lambda')
69
+ .mockImplementation(async (lambda, renderStyle) => CUBE_ENGINE_TEST__jsonToGrammar_lambda(lambda, renderStyle).catch(rethrowAsClientError));
70
+ return {
71
+ engine,
72
+ calls: {
73
+ grammarToJSON_model: grammarToJSON_model,
74
+ batchLambdasRelationType: batchLambdasRelationType,
75
+ runQuery: runQuery,
76
+ },
77
+ };
78
+ };
79
+ //# sourceMappingURL=V1_CubeEngineTestUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeEngineTestUtils.js","sourceRoot":"","sources":["../../../../../../src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,I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E,WAAW,CAAC,CAAC,KAAK,CAC/D,oBAAoB,CACrB,CACF,CAAC;IACJ,OAAO;QACL,MAAM;QACN,KAAK,EAAE;YACL,mBAAmB,EAAE,mBAA2C;YAChE,wBAAwB,EACtB,wBAAgD;YAClD,QAAQ,EAAE,QAAgC;SAC3C;KACF,CAAC;AACJ,CAAC,CAAC"}
package/lib/index.css ADDED
@@ -0,0 +1,17 @@
1
+ /** @license @finos/legend-cube-builder v0.0.3
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ .legend-cube{height:100%;width:100%}/*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../style/index.scss"],"names":[],"mappings":"AAmBA,aACE,YACA","file":"index.css"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,25 @@
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
+ export { LEGEND_CUBE_COMMAND_CONFIG, LEGEND_CUBE_COMMAND_KEY, } from './__lib__/LegendCubeCommand.js';
17
+ export { LEGEND_CUBE_TEST_ID } from './__lib__/LegendCubeTesting.js';
18
+ export { CubeEditor } from './components/CubeEditor.js';
19
+ export * from './graph-manager/CubeEngine.js';
20
+ export { getRuntimesForDatabase } from './graph-manager/CubeModelOutlineHelper.js';
21
+ export { buildCubeEngine, type CubeEngineConfig, } from './graph-manager/protocol/pure/CubeEngineBuilder.js';
22
+ export type { CubeHost } from './stores/CubeHost.js';
23
+ export { BUNDLED_MODELS, type BundledModel, createTextModel, LocalModelCatalog, } from './stores/LocalModelCatalog.js';
24
+ export { CUBE_NORTHWIND_DATABASE, CUBE_NORTHWIND_MODEL, CUBE_NORTHWIND_RUNTIME, } from './stores/fixtures/CubeNorthwindModel.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,oDAAoD,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,eAAe,EACf,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yCAAyC,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,24 @@
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
+ export { LEGEND_CUBE_COMMAND_CONFIG, LEGEND_CUBE_COMMAND_KEY, } from './__lib__/LegendCubeCommand.js';
17
+ export { LEGEND_CUBE_TEST_ID } from './__lib__/LegendCubeTesting.js';
18
+ export { CubeEditor } from './components/CubeEditor.js';
19
+ export * from './graph-manager/CubeEngine.js';
20
+ export { getRuntimesForDatabase } from './graph-manager/CubeModelOutlineHelper.js';
21
+ export { buildCubeEngine, } from './graph-manager/protocol/pure/CubeEngineBuilder.js';
22
+ export { BUNDLED_MODELS, createTextModel, LocalModelCatalog, } from './stores/LocalModelCatalog.js';
23
+ export { CUBE_NORTHWIND_DATABASE, CUBE_NORTHWIND_MODEL, CUBE_NORTHWIND_RUNTIME, } from './stores/fixtures/CubeNorthwindModel.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EACL,eAAe,GAEhB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EACL,cAAc,EAEd,eAAe,EACf,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1,236 @@
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 { CubeDocument, type ModelContext, type NodeRegistry, type Query, QueryEmitter, type QueryNode, RelationalTableSource, type SchemaInferenceResult } from '@finos/legend-cube';
17
+ import type { CommandRegistrar } from '@finos/legend-application';
18
+ import type { GeneratorFn } from '@finos/legend-shared';
19
+ import { CubeEngineError, type CubeModelOutline } from '../graph-manager/CubeEngine.js';
20
+ import { CubeExecutionState } from './CubeExecutionState.js';
21
+ import type { CubeHost } from './CubeHost.js';
22
+ import { CubeNodeEditorState } from './CubeNodeEditorState.js';
23
+ import { CubeShowPureState } from './CubeShowPureState.js';
24
+ import { CubeSourcePickerState } from './CubeSourcePickerState.js';
25
+ import { CubeSpecTransferState } from './CubeSpecTransferState.js';
26
+ /** An engine error placed on a node: its first line shows on the node, its detail in the grid */
27
+ export interface CubeHostIssue {
28
+ readonly firstLine: string;
29
+ readonly detail: string;
30
+ }
31
+ /**
32
+ * The state of one Cube page (PLAN §7.8). The document is immutable: every
33
+ * edit makes a new one through `applyDocument`, which keeps the previous one
34
+ * for undo. Domain and port values are held by reference, never observed
35
+ * deeply.
36
+ */
37
+ export declare class CubeEditorState implements CommandRegistrar {
38
+ readonly host: CubeHost;
39
+ /** One registry for inference, emission and the saved spec */
40
+ readonly registry: NodeRegistry;
41
+ readonly execution: CubeExecutionState;
42
+ readonly sourcePicker: CubeSourcePickerState;
43
+ readonly specTransfer: CubeSpecTransferState;
44
+ readonly showPure: CubeShowPureState;
45
+ readonly nodeEditor: CubeNodeEditorState;
46
+ document: CubeDocument;
47
+ /** Earlier documents, oldest first */
48
+ history: readonly CubeDocument[];
49
+ /** Engine errors by node id: shown with the node's own errors, never part of inference */
50
+ hostIssues: ReadonlyMap<string, CubeHostIssue>;
51
+ /**
52
+ * Warnings by node key, e.g. a table that changed since the cube was saved:
53
+ * shown on the node, never errors, and gone once the node is replaced
54
+ */
55
+ warnings: ReadonlyMap<number, readonly string[]>;
56
+ /**
57
+ * The outline of each model the cube used, loaded when an editor needs it,
58
+ * e.g. for the Join's 'type unknown' warning; by reference, never observed
59
+ * deeply
60
+ */
61
+ private modelOutlines;
62
+ /** Sources sent to the engine to be typed again, until it answers */
63
+ private pendingSources;
64
+ /** The rows a run returns; kept per user, never in the cube */
65
+ rowLimit: number;
66
+ /** The palette shows icons only; kept per user, never in the cube */
67
+ isPaletteCollapsed: boolean;
68
+ /**
69
+ * The cube was saved by a newer version of Cube: it can be viewed and run,
70
+ * but not changed, undone or exported (Settled before M1.8)
71
+ */
72
+ readOnly: boolean;
73
+ /** Documents in the undo history that were read-only, so undo restores the flag */
74
+ private readonly readOnlyDocuments;
75
+ /** Documents an import replaced: undoing back to one opens another cube again */
76
+ private readonly importedOver;
77
+ constructor(host: CubeHost, document?: CubeDocument);
78
+ /** Each node's schema and errors, query-level rules included, as the emitter sees them */
79
+ get analysis(): SchemaInferenceResult;
80
+ get emitter(): QueryEmitter;
81
+ /** The cube shown has tables being typed again, after an import */
82
+ get isResolvingSources(): boolean;
83
+ /** The source is being typed again by the engine, e.g. after an import */
84
+ isPendingSource(node: QueryNode): boolean;
85
+ /**
86
+ * Warnings worked out from the query, by node id: a Sort whose order is
87
+ * lost before it is used (PLAN §11.4). Never stored and never errors, so
88
+ * Execute stays enabled; they go as soon as the query no longer loses it.
89
+ * A partial loss names each node that removes some of the Sort's columns,
90
+ * then the columns that came after a removed one. A loss waits until the
91
+ * Sort and every node it names have no errors, e.g. a Restrict just added,
92
+ * with no column yet: their own errors come first.
93
+ */
94
+ get derivedWarnings(): ReadonlyMap<string, readonly string[]>;
95
+ /** A node's warnings: the stored ones (by key), then the derived ones (by id) */
96
+ getNodeWarnings(node: QueryNode): readonly string[];
97
+ /**
98
+ * The node's errors, each once: its own and those of the query rules, then
99
+ * the first line of the engine's error on it
100
+ */
101
+ getNodeErrors(nodeId: string): readonly string[];
102
+ /** The outline of the cube's model, once an editor has loaded it */
103
+ get modelOutline(): CubeModelOutline | undefined;
104
+ /** The outline of a model, once loaded */
105
+ getModelOutline(model: ModelContext): CubeModelOutline | undefined;
106
+ /**
107
+ * The database type a run of the query up to the node needs, with the
108
+ * model's runtime (PLAN §11.4), from the model's outline once it is loaded
109
+ * (`loadModelOutline`): the type of the runtime's connections to the
110
+ * databases the node reads. None without an outline, which writes every
111
+ * operation the native way.
112
+ */
113
+ getRunDatabaseType(query: Query, nodeId: string, model: ModelContext, runtime: string): string | undefined;
114
+ /**
115
+ * Loads the outline of a model, the cube's by default, once per model. It
116
+ * only adds warnings and database types, so a model that fails to load
117
+ * shows none and runs every operation the native way.
118
+ */
119
+ loadModelOutline(model?: ModelContext | undefined): GeneratorFn<void>;
120
+ /** One of Cube's dialogs is open: the source picker, Import or Export, Show Pure */
121
+ get isDialogOpen(): boolean;
122
+ /**
123
+ * The page's keyboard shortcuts, while it is open (spec §17.12). Each does
124
+ * nothing when its button can't be used, and nothing while a Cube dialog
125
+ * is open, since a dialog doesn't stop the app's shortcuts (user's choice,
126
+ * 2026-10-07). Undo leaves Ctrl+Z to a text field that has the focus.
127
+ */
128
+ registerCommands(): void;
129
+ deregisterCommands(): void;
130
+ get canUndo(): boolean;
131
+ /** The one way to change the cube; the document before goes to the undo history */
132
+ applyDocument(next: CubeDocument): void;
133
+ /**
134
+ * Opens another cube in place of this one, e.g. an imported spec: one undo
135
+ * step. Stops any run and any table being added, closes the node editor
136
+ * without applying its edits, and drops the last run's rows and errors,
137
+ * which belong to the cube before. Never runs the cube.
138
+ */
139
+ importDocument(next: CubeDocument, readOnly: boolean): void;
140
+ /**
141
+ * Types the cube's tables again, in one engine call, outside the undo
142
+ * history (PLAN §10.3, Settled before M1.8):
143
+ * - a table whose columns are the saved ones is left as it is;
144
+ * - a table that changed takes its new columns, with a warning listing the
145
+ * changes;
146
+ * - a table with saved columns that can't be typed keeps them, with a
147
+ * warning; one without them shows the engine's error.
148
+ *
149
+ * Then filter values saved as invalid text are read again against the
150
+ * columns. The answer goes to every document holding the very source
151
+ * objects that were typed: the cube shown and the undo snapshots taken
152
+ * meanwhile, so undoing an edit made while the tables were typed keeps
153
+ * them typed. A source the user changed meanwhile is a new object, and is
154
+ * left alone.
155
+ *
156
+ * `only` types just these sources of the cube shown, e.g. one Refresh. A
157
+ * table found unchanged loses any earlier warning.
158
+ */
159
+ reresolveSources(only?: readonly RelationalTableSource[]): GeneratorFn<void>;
160
+ /**
161
+ * Types a table again with the engine, from its Source panel (spec §17.6),
162
+ * as a re-check after an import does: no undo step, nothing changes when
163
+ * its columns are the same, and a warning lists any change.
164
+ */
165
+ refreshSource(nodeId: string): GeneratorFn<void>;
166
+ /**
167
+ * Restores the document before the last edit; does nothing when there is
168
+ * no history. A restored query is a new object (PLAN §4.3), so rows that
169
+ * ran before the edit show as stale. An edit that left the query alone,
170
+ * such as a rename, keeps it, with its rows and engine errors. Undoing an
171
+ * import closes the node editor and the picker, as the import did.
172
+ */
173
+ undo(): void;
174
+ private pushHistory;
175
+ /** Engine errors belong to the query they came from, so they are dropped when the query changes */
176
+ private replaceDocument;
177
+ applyQuery(next: Query): void;
178
+ /** Makes a node the capture node, the one Execute runs */
179
+ select(nodeId: string): void;
180
+ /**
181
+ * Feeds a node into another, on the port if given, else the first free one.
182
+ * Does nothing when the query doesn't allow it or the cube is read-only.
183
+ */
184
+ connect(sourceId: string, targetId: string, port?: string): void;
185
+ /**
186
+ * Whether a node of the type can be added: a transform, unconnected or
187
+ * spliced in after `afterId`, when the query allows it; a source only
188
+ * unconnected, through the source picker. Never while the cube is read-only.
189
+ */
190
+ canAddNode(type: string, afterId?: string): boolean;
191
+ /**
192
+ * Adds a node of the type, as the palette and the context menu do (spec
193
+ * §17.4): a transform with its default settings, unconnected or spliced in
194
+ * after `afterId`; a source opens the source picker, which adds it once
195
+ * the engine has typed it. Does nothing `canAddNode` refuses.
196
+ */
197
+ addNode(type: string, afterId?: string): void;
198
+ /**
199
+ * Adds a node made elsewhere, with its settings, as the grid's quick
200
+ * actions do (spec §12.4): spliced in after `afterId`, so it becomes the
201
+ * node that runs when that one did, as one undo step. Does nothing in a
202
+ * read-only cube, or when the query can't take it.
203
+ */
204
+ addConfiguredNode(node: QueryNode, afterId?: string): void;
205
+ /** Whether dropping a node on another does anything: connect it, or else move it after it */
206
+ canDropNode(nodeId: string, targetId: string): boolean;
207
+ /**
208
+ * Drops a node on another (spec §17.4): it feeds the target's first free
209
+ * port if it can, else it moves to after the target
210
+ */
211
+ dropNode(nodeId: string, targetId: string): void;
212
+ canRemoveNode(nodeId: string): boolean;
213
+ /**
214
+ * Removes a node, healing the chain around it. Removing the last node also
215
+ * clears the cube's model and runtime, in the same undo step, so the next
216
+ * table can come from any model (user's choice, 2026-10-07).
217
+ */
218
+ removeNode(nodeId: string): void;
219
+ canSwapInputs(nodeId: string): boolean;
220
+ /** Swaps a binary node's two inputs; its settings follow them, e.g. a Join's key columns */
221
+ swapInputs(nodeId: string): void;
222
+ /**
223
+ * Shows or hides the graph, which the cube saves (spec §17.1). An undoable
224
+ * edit that leaves the query, and so the rows, as they are (M1.8b).
225
+ */
226
+ setShowGraph(showGraph: boolean): void;
227
+ setHostIssue(nodeId: string, error: CubeEngineError): void;
228
+ clearHostIssues(): void;
229
+ /** Sets and remembers the row limit; a value that isn't a whole number of at least 1 is refused */
230
+ setRowLimit(value: number): boolean;
231
+ /** Collapses or expands the palette, and remembers it for the user */
232
+ setPaletteCollapsed(collapsed: boolean): void;
233
+ /** Stops any run; call when the page closes */
234
+ dispose(): void;
235
+ }
236
+ //# sourceMappingURL=CubeEditorState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeEditorState.d.ts","sourceRoot":"","sources":["../../src/stores/CubeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,YAAY,EAMZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EAGrB,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAkBxD,OAAO,EACL,eAAe,EAEf,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,iGAAiG;AACjG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAeD;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,YAA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