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

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 (301) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +5 -2
  3. package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
  4. package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
  5. package/lib/__lib__/LegendCubeCommand.js +40 -0
  6. package/lib/__lib__/LegendCubeCommand.js.map +1 -0
  7. package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
  8. package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
  9. package/lib/__lib__/LegendCubeHelpText.js +27 -0
  10. package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
  11. package/lib/__lib__/LegendCubeLabels.d.ts +68 -0
  12. package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
  13. package/lib/__lib__/LegendCubeLabels.js +109 -0
  14. package/lib/__lib__/LegendCubeLabels.js.map +1 -0
  15. package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
  16. package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
  17. package/lib/__lib__/LegendCubeTesting.js +34 -0
  18. package/lib/__lib__/LegendCubeTesting.js.map +1 -0
  19. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
  20. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
  21. package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
  22. package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
  23. package/lib/__test-utils__/CubeEngineTestSupport.d.ts +41 -0
  24. package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
  25. package/lib/__test-utils__/CubeEngineTestSupport.js +76 -0
  26. package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
  27. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
  28. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
  29. package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
  30. package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
  31. package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
  32. package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
  33. package/lib/__test-utils__/CubePageTestUtils.js +68 -0
  34. package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
  35. package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
  36. package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
  37. package/lib/__test-utils__/CubeTestApplication.js +57 -0
  38. package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
  39. package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
  40. package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
  41. package/lib/__test-utils__/FakeCubeEngine.js +85 -0
  42. package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
  43. package/lib/components/CubeButton.d.ts +20 -0
  44. package/lib/components/CubeButton.d.ts.map +1 -0
  45. package/lib/components/CubeButton.js +24 -0
  46. package/lib/components/CubeButton.js.map +1 -0
  47. package/lib/components/CubeEditor.d.ts +31 -0
  48. package/lib/components/CubeEditor.d.ts.map +1 -0
  49. package/lib/components/CubeEditor.js +90 -0
  50. package/lib/components/CubeEditor.js.map +1 -0
  51. package/lib/components/CubeNodeIcon.d.ts +23 -0
  52. package/lib/components/CubeNodeIcon.d.ts.map +1 -0
  53. package/lib/components/CubeNodeIcon.js +32 -0
  54. package/lib/components/CubeNodeIcon.js.map +1 -0
  55. package/lib/components/canvas/CubeCanvas.d.ts +37 -0
  56. package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
  57. package/lib/components/canvas/CubeCanvas.js +135 -0
  58. package/lib/components/canvas/CubeCanvas.js.map +1 -0
  59. package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
  60. package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
  61. package/lib/components/canvas/CubeCanvasContext.js +22 -0
  62. package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
  63. package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
  64. package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
  65. package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
  66. package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
  67. package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
  68. package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
  69. package/lib/components/canvas/CubeCanvasDnd.js +51 -0
  70. package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
  71. package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
  72. package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
  73. package/lib/components/canvas/CubeCanvasEdge.js +33 -0
  74. package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
  75. package/lib/components/canvas/CubeCanvasElements.d.ts +64 -0
  76. package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
  77. package/lib/components/canvas/CubeCanvasElements.js +96 -0
  78. package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
  79. package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
  80. package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
  81. package/lib/components/canvas/CubeCanvasLayout.js +63 -0
  82. package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
  83. package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
  84. package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
  85. package/lib/components/canvas/CubeCanvasNode.js +72 -0
  86. package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
  87. package/lib/components/editors/CubeColumnPicker.d.ts +40 -0
  88. package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
  89. package/lib/components/editors/CubeColumnPicker.js +51 -0
  90. package/lib/components/editors/CubeColumnPicker.js.map +1 -0
  91. package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
  92. package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
  93. package/lib/components/editors/CubeFilterEditor.js +90 -0
  94. package/lib/components/editors/CubeFilterEditor.js.map +1 -0
  95. package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
  96. package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
  97. package/lib/components/editors/CubeJoinEditor.js +76 -0
  98. package/lib/components/editors/CubeJoinEditor.js.map +1 -0
  99. package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
  100. package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
  101. package/lib/components/editors/CubeNodeEditorPanel.js +71 -0
  102. package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
  103. package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
  104. package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
  105. package/lib/components/editors/CubeNodeEditorRegistry.js +30 -0
  106. package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
  107. package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
  108. package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
  109. package/lib/components/editors/CubeSourceEditor.js +42 -0
  110. package/lib/components/editors/CubeSourceEditor.js.map +1 -0
  111. package/lib/components/editors/CubeValueEditor.d.ts +40 -0
  112. package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
  113. package/lib/components/editors/CubeValueEditor.js +177 -0
  114. package/lib/components/editors/CubeValueEditor.js.map +1 -0
  115. package/lib/components/grid/CubeGridRegion.d.ts +23 -0
  116. package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
  117. package/lib/components/grid/CubeGridRegion.js +94 -0
  118. package/lib/components/grid/CubeGridRegion.js.map +1 -0
  119. package/lib/components/grid/CubeGridValues.d.ts +25 -0
  120. package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
  121. package/lib/components/grid/CubeGridValues.js +95 -0
  122. package/lib/components/grid/CubeGridValues.js.map +1 -0
  123. package/lib/components/grid/CubeResultGrid.d.ts +26 -0
  124. package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
  125. package/lib/components/grid/CubeResultGrid.js +50 -0
  126. package/lib/components/grid/CubeResultGrid.js.map +1 -0
  127. package/lib/components/palette/CubePalette.d.ts +29 -0
  128. package/lib/components/palette/CubePalette.d.ts.map +1 -0
  129. package/lib/components/palette/CubePalette.js +73 -0
  130. package/lib/components/palette/CubePalette.js.map +1 -0
  131. package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
  132. package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
  133. package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
  134. package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
  135. package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
  136. package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
  137. package/lib/components/source-picker/CubeSourcePicker.js +89 -0
  138. package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
  139. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
  140. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
  141. package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
  142. package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
  143. package/lib/graph-manager/CubeEngine.d.ts +115 -0
  144. package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
  145. package/lib/graph-manager/CubeEngine.js +61 -0
  146. package/lib/graph-manager/CubeEngine.js.map +1 -0
  147. package/lib/graph-manager/CubeModelOutlineHelper.d.ts +25 -0
  148. package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
  149. package/lib/graph-manager/CubeModelOutlineHelper.js +24 -0
  150. package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
  151. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
  152. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
  153. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
  154. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
  155. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
  156. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
  157. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
  158. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
  159. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
  160. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
  161. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
  162. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
  163. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
  164. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
  165. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
  166. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
  167. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
  168. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
  169. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +121 -0
  170. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
  171. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
  172. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
  173. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
  174. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
  175. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
  176. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
  177. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
  178. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
  179. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
  180. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
  181. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
  182. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
  183. package/lib/index.css +17 -0
  184. package/lib/index.css.map +1 -0
  185. package/lib/index.d.ts +25 -0
  186. package/lib/index.d.ts.map +1 -0
  187. package/lib/index.js +24 -0
  188. package/lib/index.js.map +1 -0
  189. package/lib/stores/CubeEditorState.d.ts +206 -0
  190. package/lib/stores/CubeEditorState.d.ts.map +1 -0
  191. package/lib/stores/CubeEditorState.js +551 -0
  192. package/lib/stores/CubeEditorState.js.map +1 -0
  193. package/lib/stores/CubeExecutionState.d.ts +67 -0
  194. package/lib/stores/CubeExecutionState.d.ts.map +1 -0
  195. package/lib/stores/CubeExecutionState.js +196 -0
  196. package/lib/stores/CubeExecutionState.js.map +1 -0
  197. package/lib/stores/CubeHost.d.ts +31 -0
  198. package/lib/stores/CubeHost.d.ts.map +1 -0
  199. package/lib/stores/CubeHost.js +17 -0
  200. package/lib/stores/CubeHost.js.map +1 -0
  201. package/lib/stores/CubeNodeEditorState.d.ts +85 -0
  202. package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
  203. package/lib/stores/CubeNodeEditorState.js +207 -0
  204. package/lib/stores/CubeNodeEditorState.js.map +1 -0
  205. package/lib/stores/CubeShowPureState.d.ts +38 -0
  206. package/lib/stores/CubeShowPureState.d.ts.map +1 -0
  207. package/lib/stores/CubeShowPureState.js +83 -0
  208. package/lib/stores/CubeShowPureState.js.map +1 -0
  209. package/lib/stores/CubeSourcePickerState.d.ts +98 -0
  210. package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
  211. package/lib/stores/CubeSourcePickerState.js +334 -0
  212. package/lib/stores/CubeSourcePickerState.js.map +1 -0
  213. package/lib/stores/CubeSpecTransferState.d.ts +60 -0
  214. package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
  215. package/lib/stores/CubeSpecTransferState.js +167 -0
  216. package/lib/stores/CubeSpecTransferState.js.map +1 -0
  217. package/lib/stores/LocalModelCatalog.d.ts +37 -0
  218. package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
  219. package/lib/stores/LocalModelCatalog.js +49 -0
  220. package/lib/stores/LocalModelCatalog.js.map +1 -0
  221. package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
  222. package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
  223. package/lib/stores/editors/CubeFilterDraft.js +186 -0
  224. package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
  225. package/lib/stores/editors/CubeJoinDraft.d.ts +63 -0
  226. package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
  227. package/lib/stores/editors/CubeJoinDraft.js +136 -0
  228. package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
  229. package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
  230. package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
  231. package/lib/stores/editors/CubeNodeDraft.js +35 -0
  232. package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
  233. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +29 -0
  234. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
  235. package/lib/stores/editors/CubeNodeDraftRegistry.js +33 -0
  236. package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
  237. package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
  238. package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
  239. package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
  240. package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
  241. package/package.json +81 -3
  242. package/src/__lib__/LegendCubeCommand.ts +44 -0
  243. package/src/__lib__/LegendCubeHelpText.ts +38 -0
  244. package/src/__lib__/LegendCubeLabels.ts +141 -0
  245. package/src/__lib__/LegendCubeTesting.ts +33 -0
  246. package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
  247. package/src/__test-utils__/CubeEngineTestSupport.ts +137 -0
  248. package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
  249. package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
  250. package/src/__test-utils__/CubeTestApplication.ts +82 -0
  251. package/src/__test-utils__/FakeCubeEngine.ts +139 -0
  252. package/src/components/CubeButton.tsx +35 -0
  253. package/src/components/CubeEditor.tsx +239 -0
  254. package/src/components/CubeNodeIcon.tsx +47 -0
  255. package/src/components/canvas/CubeCanvas.tsx +260 -0
  256. package/src/components/canvas/CubeCanvasContext.ts +31 -0
  257. package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
  258. package/src/components/canvas/CubeCanvasDnd.ts +82 -0
  259. package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
  260. package/src/components/canvas/CubeCanvasElements.ts +150 -0
  261. package/src/components/canvas/CubeCanvasLayout.ts +88 -0
  262. package/src/components/canvas/CubeCanvasNode.tsx +141 -0
  263. package/src/components/editors/CubeColumnPicker.tsx +114 -0
  264. package/src/components/editors/CubeFilterEditor.tsx +309 -0
  265. package/src/components/editors/CubeJoinEditor.tsx +224 -0
  266. package/src/components/editors/CubeNodeEditorPanel.tsx +204 -0
  267. package/src/components/editors/CubeNodeEditorRegistry.ts +61 -0
  268. package/src/components/editors/CubeSourceEditor.tsx +116 -0
  269. package/src/components/editors/CubeValueEditor.tsx +332 -0
  270. package/src/components/grid/CubeGridRegion.tsx +274 -0
  271. package/src/components/grid/CubeGridValues.ts +125 -0
  272. package/src/components/grid/CubeResultGrid.tsx +84 -0
  273. package/src/components/palette/CubePalette.tsx +177 -0
  274. package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
  275. package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
  276. package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
  277. package/src/graph-manager/CubeEngine.ts +155 -0
  278. package/src/graph-manager/CubeModelOutlineHelper.ts +32 -0
  279. package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
  280. package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
  281. package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
  282. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
  283. package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +157 -0
  284. package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
  285. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
  286. package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +124 -0
  287. package/src/index.ts +41 -0
  288. package/src/stores/CubeEditorState.ts +702 -0
  289. package/src/stores/CubeExecutionState.ts +255 -0
  290. package/src/stores/CubeHost.ts +32 -0
  291. package/src/stores/CubeNodeEditorState.ts +255 -0
  292. package/src/stores/CubeShowPureState.ts +96 -0
  293. package/src/stores/CubeSourcePickerState.ts +426 -0
  294. package/src/stores/CubeSpecTransferState.ts +198 -0
  295. package/src/stores/LocalModelCatalog.ts +70 -0
  296. package/src/stores/editors/CubeFilterDraft.ts +241 -0
  297. package/src/stores/editors/CubeJoinDraft.ts +197 -0
  298. package/src/stores/editors/CubeNodeDraft.ts +46 -0
  299. package/src/stores/editors/CubeNodeDraftRegistry.ts +49 -0
  300. package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
  301. package/tsconfig.json +118 -0
@@ -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
+ /** Why a table can't be picked as it is, read from its definition (PLAN §6.2.6) */
17
+ export var CubeTableFlag;
18
+ (function (CubeTableFlag) {
19
+ /** a binary column: the engine can't type the table */
20
+ CubeTableFlag["UNAVAILABLE"] = "unavailable";
21
+ /** a CHAR(n) column: typed with a length of 1 */
22
+ CubeTableFlag["LENGTH_UNKNOWN"] = "lengthUnknown";
23
+ /** an OTHER or ARRAY column: typed as a bare String */
24
+ CubeTableFlag["TYPE_UNKNOWN"] = "typeUnknown";
25
+ })(CubeTableFlag || (CubeTableFlag = {}));
26
+ export var CubeEngineErrorKind;
27
+ (function (CubeEngineErrorKind) {
28
+ /** the model or a lambda doesn't compile, or a table can't be typed */
29
+ CubeEngineErrorKind["COMPILE"] = "compile";
30
+ /** the query failed while running, or its result can't be read */
31
+ CubeEngineErrorKind["EXECUTION"] = "execution";
32
+ /** the cube's model is of a kind this version can't run */
33
+ CubeEngineErrorKind["UNSUPPORTED_MODEL"] = "unsupportedModel";
34
+ /** the engine couldn't be reached, or answered with no readable error */
35
+ CubeEngineErrorKind["NETWORK"] = "network";
36
+ })(CubeEngineErrorKind || (CubeEngineErrorKind = {}));
37
+ /**
38
+ * An engine failure, placed on the node it concerns: the node a stamp in the
39
+ * error points to, else the source being typed or the node being run.
40
+ */
41
+ export class CubeEngineError extends Error {
42
+ kind;
43
+ nodeId;
44
+ /** The part of the node the error points to (an `EmitRole`), when it is located */
45
+ role;
46
+ /** The first line of the engine's message, shown on the node */
47
+ firstLine;
48
+ /** The engine's whole message, without its Java trace, shown in the panel */
49
+ detail;
50
+ constructor(kind, detail, nodeId, role) {
51
+ const firstLine = detail.split('\n', 1)[0]?.trim() ?? '';
52
+ super(firstLine);
53
+ this.name = 'CubeEngineError';
54
+ this.kind = kind;
55
+ this.detail = detail;
56
+ this.firstLine = firstLine;
57
+ this.nodeId = nodeId;
58
+ this.role = role;
59
+ }
60
+ }
61
+ //# sourceMappingURL=CubeEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeEngine.js","sourceRoot":"","sources":["../../src/graph-manager/CubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH,mFAAmF;AACnF,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,uDAAuD;IACvD,4CAA2B,CAAA;IAC3B,iDAAiD;IACjD,iDAAgC,CAAA;IAChC,uDAAuD;IACvD,6CAA4B,CAAA;AAC9B,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB;AAsCD,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,uEAAuE;IACvE,0CAAmB,CAAA;IACnB,kEAAkE;IAClE,8CAAuB,CAAA;IACvB,2DAA2D;IAC3D,6DAAsC,CAAA;IACtC,yEAAyE;IACzE,0CAAmB,CAAA;AACrB,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAED;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,CAAsB;IAC1B,MAAM,CAAqB;IACpC,mFAAmF;IAC1E,IAAI,CAAqB;IAClC,gEAAgE;IACvD,SAAS,CAAS;IAC3B,6EAA6E;IACpE,MAAM,CAAS;IAExB,YACE,IAAyB,EACzB,MAAc,EACd,MAAe,EACf,IAAa;QAEb,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACzD,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -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
+ import type { CubeModelOutline, CubeOutlineRuntime } from './CubeEngine.js';
17
+ /**
18
+ * The runtimes a query on the database can run with: those with a connection
19
+ * keyed by exactly that database. The engine matches stores by exact element
20
+ * and silently falls back to the first connection otherwise, so a runtime
21
+ * that only reaches the database through an include is not offered (PLAN
22
+ * §6.2.5).
23
+ */
24
+ export declare const getRuntimesForDatabase: (outline: CubeModelOutline, databasePath: string) => CubeOutlineRuntime[];
25
+ //# sourceMappingURL=CubeModelOutlineHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeModelOutlineHelper.d.ts","sourceRoot":"","sources":["../../src/graph-manager/CubeModelOutlineHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,gBAAgB,EACzB,cAAc,MAAM,KACnB,kBAAkB,EAGlB,CAAC"}
@@ -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 runtimes a query on the database can run with: those with a connection
18
+ * keyed by exactly that database. The engine matches stores by exact element
19
+ * and silently falls back to the first connection otherwise, so a runtime
20
+ * that only reaches the database through an include is not offered (PLAN
21
+ * §6.2.5).
22
+ */
23
+ export const getRuntimesForDatabase = (outline, databasePath) => outline.runtimes.filter((runtime) => runtime.storePaths.includes(databasePath));
24
+ //# sourceMappingURL=CubeModelOutlineHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeModelOutlineHelper.js","sourceRoot":"","sources":["../../src/graph-manager/CubeModelOutlineHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAyB,EACzB,YAAoB,EACE,EAAE,CACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAClC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAC1C,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { TracerService } from '@finos/legend-shared';
17
+ import type { CubeEngine } from '../../CubeEngine.js';
18
+ import { type V1_CubeEngineConfig } from './v1/V1_LegendCubeEngine.js';
19
+ /** The engine client's configuration, as the host gives it (e.g. Legend Query's engine server URL) */
20
+ export type CubeEngineConfig = V1_CubeEngineConfig;
21
+ /**
22
+ * The Cube engine of a host (PLAN §3.2): the only place that builds the
23
+ * Legend implementation, so hosts never name a V1_* symbol
24
+ */
25
+ export declare const buildCubeEngine: (config: CubeEngineConfig, tracerService: TracerService) => CubeEngine;
26
+ //# sourceMappingURL=CubeEngineBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeEngineBuilder.d.ts","sourceRoot":"","sources":["../../../../src/graph-manager/protocol/pure/CubeEngineBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,6BAA6B,CAAC;AAErC,sGAAsG;AACtG,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,gBAAgB,EACxB,eAAe,aAAa,KAC3B,UAA4D,CAAC"}
@@ -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 { V1_LegendCubeEngine, } from './v1/V1_LegendCubeEngine.js';
17
+ /**
18
+ * The Cube engine of a host (PLAN §3.2): the only place that builds the
19
+ * Legend implementation, so hosts never name a V1_* symbol
20
+ */
21
+ export const buildCubeEngine = (config, tracerService) => new V1_LegendCubeEngine(config, tracerService);
22
+ //# sourceMappingURL=CubeEngineBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeEngineBuilder.js","sourceRoot":"","sources":["../../../../src/graph-manager/protocol/pure/CubeEngineBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAEL,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAKrC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,MAAwB,EACxB,aAA4B,EAChB,EAAE,CAAC,IAAI,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
@@ -0,0 +1,27 @@
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 { CubeEngineError, CubeEngineErrorKind, type NodeId } from '../../../CubeEngine.js';
17
+ /**
18
+ * The error of an engine payload (a failed call's, or a batch key's), placed
19
+ * on the stamped node, or else on the fallback node. Its Java trace is dropped.
20
+ */
21
+ export declare const V1_buildCubeEngineError: (payload: unknown, fallbackNodeId: NodeId | undefined, kind: CubeEngineErrorKind) => CubeEngineError | undefined;
22
+ /**
23
+ * The error of a failed engine call: the engine's own message when it sent
24
+ * one, else a network error
25
+ */
26
+ export declare const V1_toCubeEngineError: (error: unknown, fallbackNodeId: NodeId | undefined, kind: CubeEngineErrorKind) => CubeEngineError;
27
+ //# sourceMappingURL=V1_CubeEngineErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeEngineErrors.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,MAAM,EACZ,MAAM,wBAAwB,CAAC;AAgChC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,OAAO,EAChB,gBAAgB,MAAM,GAAG,SAAS,EAClC,MAAM,mBAAmB,KACxB,eAAe,GAAG,SAcpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,OAAO,EACd,gBAAgB,MAAM,GAAG,SAAS,EAClC,MAAM,mBAAmB,KACxB,eAuBF,CAAC"}
@@ -0,0 +1,76 @@
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 { NetworkClientError } from '@finos/legend-shared';
17
+ import { CubeEngineError, CubeEngineErrorKind, } from '../../../CubeEngine.js';
18
+ import { V1_parseCubeSourceId } from './V1_CubeLambdaSerializer.js';
19
+ // Engine errors → `CubeEngineError`s on canvas nodes (PLAN §8.7). A compile
20
+ // error echoes the stamp of the innermost failing protocol node, so it goes on
21
+ // that node; plan-time, database and network errors carry no stamp, so they
22
+ // go on the node being typed or run.
23
+ const COMPILATION_ERROR_TYPES = new Set(['COMPILATION', 'PARSER']);
24
+ /** The engine's error payload: `{message, errorType?, sourceInformation?, trace?}` */
25
+ const readPayload = (payload) => {
26
+ if (!payload || typeof payload !== 'object') {
27
+ return undefined;
28
+ }
29
+ const { message, errorType, sourceInformation } = payload;
30
+ if (typeof message !== 'string' || !message.trim()) {
31
+ return undefined;
32
+ }
33
+ const sourceId = sourceInformation && typeof sourceInformation === 'object'
34
+ ? sourceInformation.sourceId
35
+ : undefined;
36
+ return {
37
+ message,
38
+ ...(typeof errorType === 'string' ? { errorType } : {}),
39
+ ...(typeof sourceId === 'string' ? { sourceId } : {}),
40
+ };
41
+ };
42
+ /**
43
+ * The error of an engine payload (a failed call's, or a batch key's), placed
44
+ * on the stamped node, or else on the fallback node. Its Java trace is dropped.
45
+ */
46
+ export const V1_buildCubeEngineError = (payload, fallbackNodeId, kind) => {
47
+ const read = readPayload(payload);
48
+ if (!read) {
49
+ return undefined;
50
+ }
51
+ const origin = V1_parseCubeSourceId(read.sourceId);
52
+ return new CubeEngineError(read.errorType && COMPILATION_ERROR_TYPES.has(read.errorType)
53
+ ? CubeEngineErrorKind.COMPILE
54
+ : kind, read.message, origin?.nodeId ?? fallbackNodeId, origin?.role);
55
+ };
56
+ /**
57
+ * The error of a failed engine call: the engine's own message when it sent
58
+ * one, else a network error
59
+ */
60
+ export const V1_toCubeEngineError = (error, fallbackNodeId, kind) => {
61
+ if (error instanceof CubeEngineError) {
62
+ return error.nodeId !== undefined || fallbackNodeId === undefined
63
+ ? error
64
+ : new CubeEngineError(error.kind, error.detail, fallbackNodeId);
65
+ }
66
+ if (error instanceof NetworkClientError) {
67
+ const fromPayload = V1_buildCubeEngineError(error.payload, fallbackNodeId, kind);
68
+ if (fromPayload) {
69
+ return fromPayload;
70
+ }
71
+ }
72
+ return new CubeEngineError(CubeEngineErrorKind.NETWORK, error instanceof Error && error.message
73
+ ? error.message
74
+ : `The engine couldn't be reached`, fallbackNodeId);
75
+ };
76
+ //# sourceMappingURL=V1_CubeEngineErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeEngineErrors.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAoB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,GAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,4EAA4E;AAC5E,+EAA+E;AAC/E,4EAA4E;AAC5E,qCAAqC;AAErC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnE,sFAAsF;AACtF,MAAM,WAAW,GAAG,CAClB,OAAgB,EACwD,EAAE;IAC1E,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,OAAsB,CAAC;IACzE,IAAI,OAAO,OAAO,KAA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AAO,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS;YAC/D,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;QACxC,MAAM,WAAW,GAAG,uBAAuB,CACzC,KAAK,CAAC,OAAO,EACb,cAAc,EACd,IAAI,CACL,CAAC;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAW,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,eAAe,CACxB,mBAAmB,CAAC,OAAO,EAC3B,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO;QACrC,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,CAAC,CAAC,gCAAgC,EACpC,cAAc,CACf,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeResultValue } from '../../../CubeEngine.js';
17
+ export interface V1_CubeExecutionResult {
18
+ readonly columns: readonly string[];
19
+ readonly rows: readonly (readonly CubeResultValue[])[];
20
+ readonly sql: readonly string[];
21
+ }
22
+ /** Thrown when the body can't be read, e.g. a stack trace streamed into a 200 */
23
+ export declare class V1_CubeUnreadableResultError extends Error {
24
+ }
25
+ /** The columns, rows and SQL of an execution response's text */
26
+ export declare const V1_readCubeExecutionResult: (text: string) => V1_CubeExecutionResult;
27
+ //# sourceMappingURL=V1_CubeExecutionResultReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeExecutionResultReader.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAW9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC;IACvD,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,iFAAiF;AACjF,qBAAa,4BAA6B,SAAQ,KAAK;CAAG;AA8B1D,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,GACrC,MAAM,MAAM,KACX,sBA6CF,CAAC"}
@@ -0,0 +1,82 @@
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 { resolveCubeType, TypeFamily } from '@finos/legend-cube';
17
+ import { parseLosslessJSON } from '@finos/legend-shared';
18
+ // An execution response (DEFAULT format, relation result) read losslessly
19
+ // (PLAN §8.7). Each column's values keep one JS type, decided by the type the
20
+ // result builder gives it: Float values are numbers; any other number, an
21
+ // Integer or Decimal value above all, is its exact text ("9007199254740993",
22
+ // "12.30"). Nothing is inferred from the kind of JSON token, since a Float
23
+ // column may hold 5124 and a String column 32.38.
24
+ const RELATIONAL_ACTIVITY_TYPE = 'relational';
25
+ /** Thrown when the body can't be read, e.g. a stack trace streamed into a 200 */
26
+ export class V1_CubeUnreadableResultError extends Error {
27
+ }
28
+ const isLosslessNumber = (value) => typeof value === 'object' &&
29
+ value !== null &&
30
+ value.isLosslessNumber === true;
31
+ const asObject = (value) => value && typeof value === 'object' && !Array.isArray(value)
32
+ ? value
33
+ : {};
34
+ const readCell = (value, asNumber) => {
35
+ if (isLosslessNumber(value)) {
36
+ return asNumber ? Number(value.value) : value.value;
37
+ }
38
+ if (value === null ||
39
+ typeof value === 'string' ||
40
+ typeof value === 'boolean') {
41
+ return value;
42
+ }
43
+ throw new V1_CubeUnreadableResultError(`A result value is not a scalar: ${JSON.stringify(value)}`);
44
+ };
45
+ /** The columns, rows and SQL of an execution response's text */
46
+ export const V1_readCubeExecutionResult = (text) => {
47
+ let json;
48
+ try {
49
+ json = asObject(parseLosslessJSON(text));
50
+ }
51
+ catch (error) {
52
+ throw new V1_CubeUnreadableResultError(`The engine's response can't be read: ${error.message}`);
53
+ }
54
+ const result = asObject(json.result);
55
+ if (!Array.isArray(result.columns) || !Array.isArray(result.rows)) {
56
+ throw new V1_CubeUnreadableResultError(`The engine's response has no relation result`);
57
+ }
58
+ const columns = result.columns.map((name) => String(name));
59
+ const builderTypes = new Map((Array.isArray(asObject(json.builder).columns)
60
+ ? asObject(json.builder).columns
61
+ : []).map((column) => [
62
+ String(asObject(column).name),
63
+ String(asObject(column).type ?? ''),
64
+ ]));
65
+ const asNumber = columns.map((name) => {
66
+ const type = builderTypes.get(name);
67
+ return type ? resolveCubeType(type).family === TypeFamily.FLOAT : false;
68
+ });
69
+ const rows = result.rows.map((row) => {
70
+ const values = asObject(row).values;
71
+ if (!Array.isArray(values) || values.length !== columns.length) {
72
+ throw new V1_CubeUnreadableResultError(`A result row doesn't have one value per column`);
73
+ }
74
+ return values.map((value, index) => readCell(value, asNumber[index] ?? false));
75
+ });
76
+ const sql = (Array.isArray(json.activities) ? json.activities : [])
77
+ .map(asObject)
78
+ .filter((activity) => activity._type === RELATIONAL_ACTIVITY_TYPE)
79
+ .map((activity) => String(activity.sql));
80
+ return { columns, rows, sql };
81
+ };
82
+ //# sourceMappingURL=V1_CubeExecutionResultReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeExecutionResultReader.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAG3E,0EAA0E;AAC1E,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,kDAAkD;AAElD,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAQ9C,iFAAiF;AACjF,MAAM,OAAO,4BAA6B,SAAQ,KAAK;CAAG;AAE1D,MAAM,gBAAgB,GAAG,CACvB,KAAc,EACsC,EAAE,CACtD,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACb,KAAwC,CAAC,gBAAgB,KAAK,IAAI,CAAC;AAEtE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAe,EAAE,CAC/C,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC,CAAE,KAAqB;IACxB,CAAC,CAAC,EAAE,CAAC;AAET,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,QAAiB,EAAmB,EAAE;IACtE,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC,CAAC,CAA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,CAAC;SACb,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,wBAAwB,CAAC;SACjE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAChC,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IR, Origin } from '@finos/legend-cube';
17
+ import { type PlainObject } from '@finos/legend-shared';
18
+ /** The prefix of the source ids Cube stamps, `cube:<nodeId>:<role>` */
19
+ export declare const V1_CUBE_SOURCE_ID_PREFIX = "cube:";
20
+ /** The source id of an origin */
21
+ export declare const V1_buildCubeSourceId: (origin: Origin) => string;
22
+ /**
23
+ * The origin a source id names, or none when Cube didn't stamp it. A role
24
+ * never contains `:`, so a node id that does still reads back whole.
25
+ */
26
+ export declare const V1_parseCubeSourceId: (sourceId: string | undefined) => Origin | undefined;
27
+ /**
28
+ * The protocol JSON of a lambda Cube emitted (a typing or an execution
29
+ * lambda), with lossless numbers: write it with `stringifyLosslessJSON`.
30
+ */
31
+ export declare const V1_serializeCubeLambda: (ir: IR) => PlainObject;
32
+ //# sourceMappingURL=V1_CubeLambdaSerializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V1_CubeLambdaSerializer.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAO3E,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAKhD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MACQ,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,GAAG,SAAS,KAC3B,MAAM,GAAG,SAUX,CAAC;AAqMF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,IAAI,EAAE,KAAG,WAK/C,CAAC"}