@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,49 @@
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 { CUBE_NORTHWIND_MODEL } from './fixtures/CubeNorthwindModel.js';
17
+ export const BUNDLED_MODELS = Object.freeze([
18
+ {
19
+ id: 'cube-northwind',
20
+ label: 'Northwind (Cube fixture)',
21
+ model: CUBE_NORTHWIND_MODEL,
22
+ },
23
+ ]);
24
+ /** The model context of pasted Pure text */
25
+ export const createTextModel = (code) => Object.freeze({ _type: 'text', code });
26
+ /**
27
+ * Loads the outlines of models through the engine port, each model's once:
28
+ * the picker asks again whenever it opens
29
+ */
30
+ export class LocalModelCatalog {
31
+ models = BUNDLED_MODELS;
32
+ engine;
33
+ outlines = new Map();
34
+ constructor(engine) {
35
+ this.engine = engine;
36
+ }
37
+ loadOutline(model) {
38
+ const key = JSON.stringify(model);
39
+ let outline = this.outlines.get(key);
40
+ if (!outline) {
41
+ outline = this.engine.loadModel(model);
42
+ // a failed load is tried again next time
43
+ outline.catch(() => this.outlines.delete(key));
44
+ this.outlines.set(key, outline);
45
+ }
46
+ return outline;
47
+ }
48
+ }
49
+ //# sourceMappingURL=LocalModelCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalModelCatalog.js","sourceRoot":"","sources":["../../src/stores/LocalModelCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAYxE,MAAM,CAAC,MAAM,cAAc,GAA4B,MAAM,CAAC,MAAM,CAAC;IACnE;QACE,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,0BAA0B;QACjC,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAgB,EAAE,CAC5D,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IACnB,MAAM,GAAG,cAAc,CAAC;IAChB,MAAM,CAAa;IACnB,QAAQ,GAAG,IAAI,GAAG,EAAqC,CAAC;IAEzE,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,WAAW,CAAC,KAAmB;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACvC,yCAAyC;YACzC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,61 @@
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 { CompositeFilter, CompositeFilterOperator, type Filter, type FilterOperator, type FilterRule, type FilterValue, type Schema } from '@finos/legend-cube';
17
+ import { CubeNodeDraft } from './CubeNodeDraft.js';
18
+ /** A condition with no column picked and no value: what Add puts in a group */
19
+ export declare const isBlankFilterRow: (rule: FilterRule) => boolean;
20
+ /**
21
+ * The rule without its blank conditions, and without the groups and
22
+ * negations left empty by that; `undefined` when nothing else is left
23
+ */
24
+ export declare const pruneBlankFilterRows: (rule: FilterRule) => FilterRule | undefined;
25
+ /**
26
+ * The Filter editor's draft (spec §8.5, §17.6): the filter as a tree that
27
+ * always has an And/Or group at its top, so rows can be added to it. Each
28
+ * rule keeps its key across edits, so the editor's rows keep theirs.
29
+ *
30
+ * When built, blank conditions are left out, and a tree of nothing else
31
+ * stores no filter at all (user's choice, 2026-10-07): an Apply with an
32
+ * untouched blank row changes nothing. Rules this version can't read are
33
+ * kept as they were.
34
+ */
35
+ export declare class CubeFilterDraft extends CubeNodeDraft<Filter> {
36
+ tree: CompositeFilter;
37
+ /** Anything was changed; until then, `build()` gives the original back */
38
+ private touched;
39
+ constructor(original: Filter);
40
+ private update;
41
+ setGroupOperator(groupKey: number, operator: CompositeFilterOperator): void;
42
+ /** Adds a blank condition at the end of the group */
43
+ addCondition(groupKey: number): void;
44
+ /** Adds a group holding one blank condition at the end of the group */
45
+ addGroup(groupKey: number): void;
46
+ /** Removes a rule; the top group stays */
47
+ removeRule(key: number): void;
48
+ /**
49
+ * Negates a rule as simply as it can (`negateFilter`): a comparison takes
50
+ * its negated operator, e.g. `is` and `is not`, a negation gives back its
51
+ * rule, anything else is wrapped in Not. The top group can't be negated.
52
+ */
53
+ toggleNegation(key: number): void;
54
+ /** Changes a condition's column, keeping its operator and value when they still fit */
55
+ setColumn(key: number, columnName: string, schema: Schema): void;
56
+ /** Changes a condition's operator, dropping its value when the operator takes another shape */
57
+ setOperator(key: number, operator: FilterOperator): void;
58
+ setValue(key: number, value: FilterValue | undefined): void;
59
+ build(): Filter;
60
+ }
61
+ //# sourceMappingURL=CubeFilterDraft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeFilterDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeFilterDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,eAAe,EACf,uBAAuB,EAEvB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAIhB,KAAK,MAAM,EAEZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,GAAI,MAAM,UAAU,KAAG,OAG1B,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,UAAU,KACf,UAAU,GAAG,SAyBf,CAAC;AAqCF;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,aAAa,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,eAAe,CAAC;IACtB,0EAA0E;IAC1E,OAAO,CAAC,OAAO,CAAS;gBAEZ,QAAQ,EAAE,MAAM;IAiB5B,OAAO,CAAC,MAAM;IAYd,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB,GAAG,IAAI;IAM3E,qDAAqD;IACrD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQpC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAWhC,0CAA0C;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAM7B;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMjC,uFAAuF;IACvF,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQhE,+FAA+F;IAC/F,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;IAQxD,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;IAM3D,KAAK,IAAI,MAAM;CAiBhB"}
@@ -0,0 +1,186 @@
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 { changeFilterColumn, changeFilterOperator, ColumnComparisonFilter, CompositeFilter, CompositeFilterOperator, encodeFilterRule, negateFilter, normalizeFilter, NotFilter, unwrapFilter, } from '@finos/legend-cube';
17
+ import { action, makeObservable, observable } from 'mobx';
18
+ import { CubeNodeDraft } from './CubeNodeDraft.js';
19
+ /** A condition with no column picked and no value: what Add puts in a group */
20
+ export const isBlankFilterRow = (rule) => rule instanceof ColumnComparisonFilter &&
21
+ rule.columnName === '' &&
22
+ rule.value === undefined;
23
+ /**
24
+ * The rule without its blank conditions, and without the groups and
25
+ * negations left empty by that; `undefined` when nothing else is left
26
+ */
27
+ export const pruneBlankFilterRows = (rule) => {
28
+ if (isBlankFilterRow(rule)) {
29
+ return undefined;
30
+ }
31
+ if (rule instanceof CompositeFilter) {
32
+ const rules = rule.rules
33
+ .map(pruneBlankFilterRows)
34
+ .filter((child) => child !== undefined);
35
+ if (!rules.length) {
36
+ return undefined;
37
+ }
38
+ return rules.length === rule.rules.length &&
39
+ rules.every((child, index) => child === rule.rules[index])
40
+ ? rule
41
+ : rule.withRules(rules);
42
+ }
43
+ if (rule instanceof NotFilter) {
44
+ const inner = pruneBlankFilterRows(rule.rule);
45
+ return inner === undefined
46
+ ? undefined
47
+ : inner === rule.rule
48
+ ? rule
49
+ : rule.withRule(inner);
50
+ }
51
+ return rule;
52
+ };
53
+ /**
54
+ * The tree with the rule of `key` replaced by what `replace` gives, or
55
+ * removed when it gives `undefined`; a negation whose rule is removed goes
56
+ * too. Rules that don't change stay the same objects.
57
+ */
58
+ const replaceRule = (rule, key, replace) => {
59
+ if (rule.key === key) {
60
+ return replace(rule);
61
+ }
62
+ if (rule instanceof CompositeFilter) {
63
+ const rules = rule.rules
64
+ .map((child) => replaceRule(child, key, replace))
65
+ .filter((child) => child !== undefined);
66
+ return rules.length === rule.rules.length &&
67
+ rules.every((child, index) => child === rule.rules[index])
68
+ ? rule
69
+ : rule.withRules(rules);
70
+ }
71
+ if (rule instanceof NotFilter) {
72
+ const inner = replaceRule(rule.rule, key, replace);
73
+ return inner === undefined
74
+ ? undefined
75
+ : inner === rule.rule
76
+ ? rule
77
+ : rule.withRule(inner);
78
+ }
79
+ return rule;
80
+ };
81
+ const blankRow = () => new ColumnComparisonFilter('');
82
+ /**
83
+ * The Filter editor's draft (spec §8.5, §17.6): the filter as a tree that
84
+ * always has an And/Or group at its top, so rows can be added to it. Each
85
+ * rule keeps its key across edits, so the editor's rows keep theirs.
86
+ *
87
+ * When built, blank conditions are left out, and a tree of nothing else
88
+ * stores no filter at all (user's choice, 2026-10-07): an Apply with an
89
+ * untouched blank row changes nothing. Rules this version can't read are
90
+ * kept as they were.
91
+ */
92
+ export class CubeFilterDraft extends CubeNodeDraft {
93
+ tree;
94
+ /** Anything was changed; until then, `build()` gives the original back */
95
+ touched = false;
96
+ constructor(original) {
97
+ super(original);
98
+ makeObservable(this, {
99
+ tree: observable.ref,
100
+ touched: observable,
101
+ setGroupOperator: action,
102
+ addCondition: action,
103
+ addGroup: action,
104
+ removeRule: action,
105
+ toggleNegation: action,
106
+ setColumn: action,
107
+ setOperator: action,
108
+ setValue: action,
109
+ });
110
+ this.tree = normalizeFilter(original.filter);
111
+ }
112
+ update(key, replace) {
113
+ const tree = replaceRule(this.tree, key, replace);
114
+ // the top group stays a group
115
+ if (tree instanceof CompositeFilter && tree !== this.tree) {
116
+ this.tree = tree;
117
+ this.touched = true;
118
+ }
119
+ }
120
+ setGroupOperator(groupKey, operator) {
121
+ this.update(groupKey, (rule) => rule instanceof CompositeFilter ? rule.withOperator(operator) : rule);
122
+ }
123
+ /** Adds a blank condition at the end of the group */
124
+ addCondition(groupKey) {
125
+ this.update(groupKey, (rule) => rule instanceof CompositeFilter
126
+ ? rule.withRules([...rule.rules, blankRow()])
127
+ : rule);
128
+ }
129
+ /** Adds a group holding one blank condition at the end of the group */
130
+ addGroup(groupKey) {
131
+ this.update(groupKey, (rule) => rule instanceof CompositeFilter
132
+ ? rule.withRules([
133
+ ...rule.rules,
134
+ new CompositeFilter(CompositeFilterOperator.AND, [blankRow()]),
135
+ ])
136
+ : rule);
137
+ }
138
+ /** Removes a rule; the top group stays */
139
+ removeRule(key) {
140
+ if (key !== this.tree.key) {
141
+ this.update(key, () => undefined);
142
+ }
143
+ }
144
+ /**
145
+ * Negates a rule as simply as it can (`negateFilter`): a comparison takes
146
+ * its negated operator, e.g. `is` and `is not`, a negation gives back its
147
+ * rule, anything else is wrapped in Not. The top group can't be negated.
148
+ */
149
+ toggleNegation(key) {
150
+ if (key !== this.tree.key) {
151
+ this.update(key, negateFilter);
152
+ }
153
+ }
154
+ /** Changes a condition's column, keeping its operator and value when they still fit */
155
+ setColumn(key, columnName, schema) {
156
+ this.update(key, (rule) => rule instanceof ColumnComparisonFilter
157
+ ? changeFilterColumn(rule, columnName, schema)
158
+ : rule);
159
+ }
160
+ /** Changes a condition's operator, dropping its value when the operator takes another shape */
161
+ setOperator(key, operator) {
162
+ this.update(key, (rule) => rule instanceof ColumnComparisonFilter
163
+ ? changeFilterOperator(rule, operator)
164
+ : rule);
165
+ }
166
+ setValue(key, value) {
167
+ this.update(key, (rule) => rule instanceof ColumnComparisonFilter ? rule.withValue(value) : rule);
168
+ }
169
+ build() {
170
+ const { original } = this;
171
+ if (!this.touched) {
172
+ return original;
173
+ }
174
+ const pruned = pruneBlankFilterRows(this.tree);
175
+ const filter = pruned === undefined ? undefined : unwrapFilter(pruned);
176
+ // a saved group of one rule comes back as the rule: it saves differently
177
+ // but means the same, so it is no change
178
+ const isUnchanged = filter === undefined
179
+ ? original.filter === undefined
180
+ : original.filter !== undefined &&
181
+ JSON.stringify(encodeFilterRule(filter)) ===
182
+ JSON.stringify(encodeFilterRule(unwrapFilter(original.filter)));
183
+ return isUnchanged ? original : original.withFilter(filter);
184
+ }
185
+ }
186
+ //# sourceMappingURL=CubeFilterDraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeFilterDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeFilterDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAKhB,YAAY,EACZ,eAAe,EACf,SAAS,EAET,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAgB,EAAW,EAAE,CAC5D,IAAI,YAAY,sBAAsB;IACtC,IAAI,CAAC,UAAU,KAAK,EAAE;IACtB,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;AAE3B;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAgB,EACQ,EAAE;IAC1B,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,YAAY,eAAe,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK;aACrB,GAAG,CAAC,oBAAoB,CAAC;aACzB,MAAM,CAAC,CAAC,KAAK,EAAuB,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,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AC/C,MAAM,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACvE,yEAAyE;QACzE,yCAAyC;QACzC,MAAM,WAAW,GACf,MAAM,KAAK,SAAS;YAClB,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS;YAC/B,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS;gBAC7B,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;oBACtC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACxE,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -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
+ /**
17
+ * The number a size or row index field holds. Text that isn't a whole number,
18
+ * empty text included, gives `undefined`, which the node then reports: never
19
+ * a default. It doesn't use `Number()` on the raw text, which reads `''` as 0,
20
+ * `0x10` as 16 and `1e3` as 1000. Spaces around the digits are allowed; a
21
+ * number too long for a double gives `undefined`.
22
+ */
23
+ export declare const parseWholeNumberText: (text: string) => number | undefined;
24
+ //# sourceMappingURL=CubeIntegerText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeIntegerText.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeIntegerText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,SAO5D,CAAC"}
@@ -0,0 +1,33 @@
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
+ /** Whole-number text: an optional sign, then digits */
17
+ const WHOLE_NUMBER_TEXT = /^[+-]?\d+$/u;
18
+ /**
19
+ * The number a size or row index field holds. Text that isn't a whole number,
20
+ * empty text included, gives `undefined`, which the node then reports: never
21
+ * a default. It doesn't use `Number()` on the raw text, which reads `''` as 0,
22
+ * `0x10` as 16 and `1e3` as 1000. Spaces around the digits are allowed; a
23
+ * number too long for a double gives `undefined`.
24
+ */
25
+ export const parseWholeNumberText = (text) => {
26
+ const trimmed = text.trim();
27
+ if (!WHOLE_NUMBER_TEXT.test(trimmed)) {
28
+ return undefined;
29
+ }
30
+ const value = Number(trimmed);
31
+ return Number.isFinite(value) ? value : undefined;
32
+ };
33
+ //# sourceMappingURL=CubeIntegerText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeIntegerText.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeIntegerText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,uDAAuD;AACvD,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAsB,EAAE;IACvE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC,CAAC"}
@@ -0,0 +1,71 @@
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 { Join, JoinType, type Query, RelationalTableSource, type SchemaInferenceResult } from '@finos/legend-cube';
17
+ import type { CubeModelOutline } from '../../graph-manager/CubeEngine.js';
18
+ import { CubeNodeDraft } from './CubeNodeDraft.js';
19
+ /** One pair of key columns, matched by position; `''` until a column is picked */
20
+ export interface CubeJoinKeyPair {
21
+ /** Identifies the row in the editor */
22
+ readonly key: number;
23
+ readonly left: string;
24
+ readonly right: string;
25
+ }
26
+ /**
27
+ * The Join editor's draft (spec §17.6): the join type and the key column
28
+ * pairs. A pair with no column picked on either side is left out when built,
29
+ * as a Filter's blank rows are (user's choice, 2026-10-07).
30
+ */
31
+ export declare class CubeJoinDraft extends CubeNodeDraft<Join> {
32
+ joinType: JoinType;
33
+ pairs: CubeJoinKeyPair[];
34
+ /** Anything was changed; until then, `build()` gives the original back */
35
+ private touched;
36
+ /**
37
+ * The key lists the pairs built before any edit, so edits undone by hand
38
+ * give the original back, even for saved lists of unequal length
39
+ */
40
+ private readonly initialKeyLists;
41
+ constructor(original: Join);
42
+ setJoinType(joinType: JoinType): void;
43
+ addPair(): void;
44
+ removePair(key: number): void;
45
+ setLeftColumn(key: number, left: string): void;
46
+ setRightColumn(key: number, right: string): void;
47
+ build(): Join;
48
+ }
49
+ /** Where a column of a node's output comes from: a table, and the column's name in it */
50
+ export interface CubeColumnOrigin {
51
+ readonly source: RelationalTableSource;
52
+ readonly column: string;
53
+ }
54
+ /**
55
+ * The table columns a column of a node's output comes from: followed back
56
+ * through the inputs whose output has it, and through a Rename to its old
57
+ * name. A join key of the same name on both sides comes from the side the
58
+ * join keeps (the left for INNER and LEFT OUTER, the right for RIGHT OUTER),
59
+ * and from both for FULL OUTER, which merges them. A column the node's output
60
+ * doesn't have, e.g. one a Restrict dropped, comes from nowhere.
61
+ */
62
+ export declare const findColumnOrigins: (query: Query, analysis: SchemaInferenceResult, nodeId: string, columnName: string) => CubeColumnOrigin[];
63
+ /** The table sources a column of a node's output comes from (`findColumnOrigins`) */
64
+ export declare const findColumnSources: (query: Query, analysis: SchemaInferenceResult, nodeId: string, columnName: string) => RelationalTableSource[];
65
+ /**
66
+ * Whether the column of the node's output comes from a table column whose
67
+ * type Cube can't read (OTHER or ARRAY), so it was typed as a bare String
68
+ * (PLAN §8.7). Unknown until the model's outline has loaded.
69
+ */
70
+ export declare const isUntypedColumn: (outline: CubeModelOutline | undefined, query: Query, analysis: SchemaInferenceResult, nodeId: string, columnName: string) => boolean;
71
+ //# sourceMappingURL=CubeJoinDraft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeJoinDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeJoinDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,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ACjB,gBAAgB,EA8BlB,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,KAAK,EACZ,UAAU,qBAAqB,EAC/B,QAAQ,MAAM,EACd,YAAY,MAAM,KACjB,qBAAqB,EAGrB,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,gBAAgB,GAAG,SAAS,EACrC,OAAO,KAAK,EACZ,UAAU,qBAAqB,EAC/B,QAAQ,MAAM,EACd,YAAY,MAAM,KACjB,OASA,CAAC"}
@@ -0,0 +1,145 @@
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 { getSameNamedJoinKeys, Join, JoinType, RelationalTableSource, Rename, } from '@finos/legend-cube';
17
+ import { action, makeObservable, observable } from 'mobx';
18
+ import { CubeNodeDraft } from './CubeNodeDraft.js';
19
+ let nextPairKey = 1;
20
+ const isSameList = (a, b) => a.length === b.length && a.every((name, index) => name === b[index]);
21
+ /** The key lists pairs build: a pair with no column picked is left out */
22
+ const toKeyLists = (pairs) => {
23
+ const kept = pairs.filter((pair) => pair.left || pair.right);
24
+ return [kept.map((pair) => pair.left), kept.map((pair) => pair.right)];
25
+ };
26
+ /**
27
+ * The Join editor's draft (spec §17.6): the join type and the key column
28
+ * pairs. A pair with no column picked on either side is left out when built,
29
+ * as a Filter's blank rows are (user's choice, 2026-10-07).
30
+ */
31
+ export class CubeJoinDraft extends CubeNodeDraft {
32
+ joinType;
33
+ pairs;
34
+ /** Anything was changed; until then, `build()` gives the original back */
35
+ touched = false;
36
+ /**
37
+ * The key lists the pairs built before any edit, so edits undone by hand
38
+ * give the original back, even for saved lists of unequal length
39
+ */
40
+ initialKeyLists;
41
+ constructor(original) {
42
+ super(original);
43
+ makeObservable(this, {
44
+ joinType: observable,
45
+ pairs: observable.ref,
46
+ touched: observable,
47
+ setJoinType: action,
48
+ addPair: action,
49
+ removePair: action,
50
+ setLeftColumn: action,
51
+ setRightColumn: action,
52
+ });
53
+ this.joinType = original.joinType;
54
+ this.pairs = Array.from({
55
+ length: Math.max(original.leftColumns.length, original.rightColumns.length),
56
+ }, (_, index) => ({
57
+ key: nextPairKey++,
58
+ left: original.leftColumns[index] ?? '',
59
+ right: original.rightColumns[index] ?? '',
60
+ }));
61
+ this.initialKeyLists = toKeyLists(this.pairs);
62
+ }
63
+ setJoinType(joinType) {
64
+ this.joinType = joinType;
65
+ this.touched = true;
66
+ }
67
+ addPair() {
68
+ this.pairs = [...this.pairs, { key: nextPairKey++, left: '', right: '' }];
69
+ this.touched = true;
70
+ }
71
+ removePair(key) {
72
+ this.pairs = this.pairs.filter((pair) => pair.key !== key);
73
+ this.touched = true;
74
+ }
75
+ setLeftColumn(key, left) {
76
+ this.pairs = this.pairs.map((pair) => pair.key === key ? { ...pair, left } : pair);
77
+ this.touched = true;
78
+ }
79
+ setRightColumn(key, right) {
80
+ this.pairs = this.pairs.map((pair) => pair.key === key ? { ...pair, right } : pair);
81
+ this.touched = true;
82
+ }
83
+ build() {
84
+ const [leftColumns, rightColumns] = toKeyLists(this.pairs);
85
+ const [initialLeft, initialRight] = this.initialKeyLists;
86
+ const { original } = this;
87
+ return !this.touched ||
88
+ (this.joinType === original.joinType &&
89
+ isSameList(leftColumns, initialLeft) &&
90
+ isSameList(rightColumns, initialRight))
91
+ ? original
92
+ : original.withSettings({
93
+ joinType: this.joinType,
94
+ leftColumns,
95
+ rightColumns,
96
+ });
97
+ }
98
+ }
99
+ /**
100
+ * The table columns a column of a node's output comes from: followed back
101
+ * through the inputs whose output has it, and through a Rename to its old
102
+ * name. A join key of the same name on both sides comes from the side the
103
+ * join keeps (the left for INNER and LEFT OUTER, the right for RIGHT OUTER),
104
+ * and from both for FULL OUTER, which merges them. A column the node's output
105
+ * doesn't have, e.g. one a Restrict dropped, comes from nowhere.
106
+ */
107
+ export const findColumnOrigins = (query, analysis, nodeId, columnName) => {
108
+ const node = query.getNode(nodeId);
109
+ if (node instanceof RelationalTableSource) {
110
+ return node.resolution.kind === 'resolved' &&
111
+ node.resolution.schema.lookup(columnName)
112
+ ? [{ source: node, column: columnName }]
113
+ : [];
114
+ }
115
+ if (!node || !analysis.schemas.get(nodeId)?.lookup(columnName)) {
116
+ return [];
117
+ }
118
+ const inputIds = query.getInputIds(nodeId);
119
+ const [leftId, rightId] = inputIds;
120
+ const inputName = node instanceof Rename
121
+ ? (node.mappings.find(({ to }) => to === columnName)?.from ?? columnName)
122
+ : columnName;
123
+ const followed = node instanceof Join &&
124
+ node.joinType !== JoinType.FULL_OUTER &&
125
+ getSameNamedJoinKeys(node.leftColumns, node.rightColumns).includes(columnName)
126
+ ? [node.joinType === JoinType.RIGHT_OUTER ? rightId : leftId]
127
+ : inputIds;
128
+ return followed.flatMap((inputId) => inputId !== undefined && analysis.schemas.get(inputId)?.lookup(inputName)
129
+ ? findColumnOrigins(query, analysis, inputId, inputName)
130
+ : []);
131
+ };
132
+ /** The table sources a column of a node's output comes from (`findColumnOrigins`) */
133
+ export const findColumnSources = (query, analysis, nodeId, columnName) => findColumnOrigins(query, analysis, nodeId, columnName).map(({ source }) => source);
134
+ /**
135
+ * Whether the column of the node's output comes from a table column whose
136
+ * type Cube can't read (OTHER or ARRAY), so it was typed as a bare String
137
+ * (PLAN §8.7). Unknown until the model's outline has loaded.
138
+ */
139
+ export const isUntypedColumn = (outline, query, analysis, nodeId, columnName) => outline !== undefined &&
140
+ findColumnOrigins(query, analysis, nodeId, columnName).some(({ source, column }) => outline.databases
141
+ .find((database) => database.path === source.database)
142
+ ?.schemas.find((schema) => schema.name === source.schema)
143
+ ?.tables.find((table) => table.name === source.table)
144
+ ?.untypedColumns.includes(column));
145
+ //# sourceMappingURL=CubeJoinDraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeJoinDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeJoinDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EACpB,IAAI,EACJ,QAAQ,EAER,qBAAqB,EACrB,MAAM,GAEP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD,IAAI,WAAW,GAAG,CAAC,CAAC;AAEpB,MAAM,UAAU,GAAG,CAAC,CAAoB,EAAE,CAAoB,EAAW,EAAE,CACzE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAEvE,0EAA0E;AAC1E,MAAM,UAAU,GAAG,CACjB,KAAiC,EACX,EAAE;IACxB,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAmB;IACpD,QAAQ,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