@finos/legend-application-studio 28.21.50 → 28.21.52

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 (76) hide show
  1. package/lib/__lib__/LegendStudioNavigation.d.ts +1 -0
  2. package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioNavigation.js +1 -0
  4. package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
  5. package/lib/application/LegendStudioApplicationConfig.d.ts +4 -0
  6. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendStudioApplicationConfig.js +6 -0
  8. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  9. package/lib/components/editor/Editor.d.ts.map +1 -1
  10. package/lib/components/editor/Editor.js +2 -1
  11. package/lib/components/editor/Editor.js.map +1 -1
  12. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -1
  13. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +17 -2
  14. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
  15. package/lib/components/editor/embedded-cube/EmbeddedCube.d.ts +23 -0
  16. package/lib/components/editor/embedded-cube/EmbeddedCube.d.ts.map +1 -0
  17. package/lib/components/editor/embedded-cube/EmbeddedCube.js +38 -0
  18. package/lib/components/editor/embedded-cube/EmbeddedCube.js.map +1 -0
  19. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.d.ts +35 -0
  20. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.d.ts.map +1 -0
  21. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.js +177 -0
  22. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.js.map +1 -0
  23. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
  24. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +4 -0
  25. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
  26. package/lib/index.css +1 -1
  27. package/lib/index.d.ts +1 -1
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js +1 -1
  30. package/lib/index.js.map +1 -1
  31. package/lib/package.json +3 -1
  32. package/lib/stores/editor/EditorStore.d.ts +2 -0
  33. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  34. package/lib/stores/editor/EditorStore.js +6 -1
  35. package/lib/stores/editor/EditorStore.js.map +1 -1
  36. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.d.ts +81 -0
  37. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.d.ts.map +1 -0
  38. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.js +186 -0
  39. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.js.map +1 -0
  40. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.d.ts +51 -0
  41. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.d.ts.map +1 -0
  42. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.js +148 -0
  43. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.js.map +1 -0
  44. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.d.ts +39 -0
  45. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.d.ts.map +1 -0
  46. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.js +60 -0
  47. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.js.map +1 -0
  48. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.d.ts +57 -0
  49. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.d.ts.map +1 -0
  50. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.js +148 -0
  51. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.js.map +1 -0
  52. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.d.ts +58 -0
  53. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.d.ts.map +1 -0
  54. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.js +94 -0
  55. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.js.map +1 -0
  56. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.d.ts +57 -0
  57. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.d.ts.map +1 -0
  58. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.js +151 -0
  59. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.js.map +1 -0
  60. package/package.json +13 -11
  61. package/src/__lib__/LegendStudioNavigation.ts +4 -0
  62. package/src/application/LegendStudioApplicationConfig.ts +10 -0
  63. package/src/components/editor/Editor.tsx +2 -0
  64. package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +65 -0
  65. package/src/components/editor/embedded-cube/EmbeddedCube.tsx +57 -0
  66. package/src/components/editor/embedded-cube/EmbeddedCubeEditor.tsx +448 -0
  67. package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +4 -0
  68. package/src/index.ts +1 -0
  69. package/src/stores/editor/EditorStore.ts +6 -1
  70. package/src/stores/editor/embedded-cube/EmbeddedCubeState.ts +251 -0
  71. package/src/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.ts +242 -0
  72. package/src/stores/editor/embedded-cube/LegendStudioCubeHost.ts +82 -0
  73. package/src/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.ts +235 -0
  74. package/src/stores/editor/embedded-cube/LegendStudioCubeWorkspace.ts +151 -0
  75. package/src/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.ts +214 -0
  76. package/tsconfig.json +8 -0
@@ -0,0 +1,148 @@
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 { CubeDataProductEnvironmentType, CubeEngineError, CubeEngineErrorKind, CubeIngestDefinitionCandidate, CubeIngestEnvironment, CubeIngestProducer, formatCubeIngestUrn, parseCubeIngestUrn, readCubeIngestDataSets, } from '@finos/legend-cube-builder';
17
+ // Legend Cube in Studio: a cube reads the ingest definitions of the project
18
+ // being edited, as the workspace holds them, and runs on the project's
19
+ // lakehouse runtime, as Studio's own queries of an ingest definition do. The
20
+ // Ingest tab lists every definition of the project, under one producer that
21
+ // stands for the project, each named by the URN it would have if this
22
+ // project deployed it.
23
+ /** The one class a Studio cube reads the project's definitions as, so the Ingest tab offers no other */
24
+ const STUDIO_CUBE_INGEST_CLASS = CubeDataProductEnvironmentType.PRODUCTION;
25
+ /** The one producer deployment the tab lists: the project itself, whatever its definitions' deployments */
26
+ export const LEGEND_STUDIO_CUBE_PROJECT_PRODUCER = '0';
27
+ export const LEGEND_STUDIO_CUBE_MESSAGE = {
28
+ GONE: (definition) => `The project has no ingest definition ${definition} any more.`,
29
+ UNREADABLE: (definition) => `Cube can't read the data sets of ingest definition ${definition}.`,
30
+ NO_DATA_SET: (dataSet, definition) => `Ingest definition ${definition} has no data set "${dataSet}".`,
31
+ };
32
+ /**
33
+ * The project's own ingest definitions, for the Ingest tab and for the
34
+ * engine, which types and runs on them as the workspace holds them now
35
+ */
36
+ export class LegendStudioCubeIngestCatalog {
37
+ environmentTypes = [STUDIO_CUBE_INGEST_CLASS];
38
+ editorStore;
39
+ workspace;
40
+ constructor(editorStore, workspace) {
41
+ this.editorStore = editorStore;
42
+ this.workspace = workspace;
43
+ }
44
+ /** The project's own definitions, not its dependencies' */
45
+ get definitions() {
46
+ return this.editorStore.graphManagerState.graph.ownIngests;
47
+ }
48
+ /** The URN a cube names the project's definition by */
49
+ urnOf(definition) {
50
+ return formatCubeIngestUrn({
51
+ environmentType: STUDIO_CUBE_INGEST_CLASS,
52
+ ...this.workspace.project,
53
+ definition: definition.path,
54
+ });
55
+ }
56
+ definitionOf(urn) {
57
+ const definition = this.definitions.find((each) => this.urnOf(each) === urn);
58
+ if (!definition) {
59
+ throw new CubeEngineError(CubeEngineErrorKind.COMPILE, LEGEND_STUDIO_CUBE_MESSAGE.GONE(parseCubeIngestUrn(urn)?.definition ?? urn));
60
+ }
61
+ return definition;
62
+ }
63
+ /** The project's lakehouse runtime, which a run names, with its warehouse */
64
+ async resolveEnvironment(environmentType) {
65
+ const runtime = await this.workspace.resolveRuntime();
66
+ return new CubeIngestEnvironment({
67
+ environmentType,
68
+ name: runtime.label,
69
+ runtimeEnvironment: runtime.environment,
70
+ warehouse: runtime.warehouse,
71
+ });
72
+ }
73
+ async getRuntimeEnvironment() {
74
+ return (await this.workspace.resolveRuntime()).environment;
75
+ }
76
+ /** One producer, the project, so the tab lists every definition at once */
77
+ async listProducers() {
78
+ const { groupId, artifactId } = this.workspace.project;
79
+ return [
80
+ new CubeIngestProducer({
81
+ deploymentId: LEGEND_STUDIO_CUBE_PROJECT_PRODUCER,
82
+ urn: `${groupId}:${artifactId}`,
83
+ }),
84
+ ];
85
+ }
86
+ /** Every definition of the project, whatever its app directory deployment */
87
+ async listDefinitions() {
88
+ return {
89
+ candidates: this.definitions.map((each) => new CubeIngestDefinitionCandidate({
90
+ urn: this.urnOf(each),
91
+ definition: each.path,
92
+ ...this.workspace.project,
93
+ })),
94
+ droppedCount: 0,
95
+ };
96
+ }
97
+ /** The workspace's elements, which a typing's or a run's model holds */
98
+ getModelElements() {
99
+ return this.workspace.getModelElements();
100
+ }
101
+ /** The definition's element, as the workspace holds it now */
102
+ async getDefinitionElement(urn) {
103
+ return this.editorStore.graphManagerState.graphManager.elementToEntity(this.definitionOf(urn), { pruneSourceInformation: true }).content;
104
+ }
105
+ async describe(urn) {
106
+ const element = await this.getDefinitionElement(urn);
107
+ try {
108
+ return readCubeIngestDataSets(element);
109
+ }
110
+ catch {
111
+ throw new CubeEngineError(CubeEngineErrorKind.COMPILE, LEGEND_STUDIO_CUBE_MESSAGE.UNREADABLE(this.definitionOf(urn).path));
112
+ }
113
+ }
114
+ async resolveSchemas(environmentType, sources) {
115
+ const described = new Map();
116
+ for (const { ingestDefinitionUrn } of sources.values()) {
117
+ if (!described.has(ingestDefinitionUrn)) {
118
+ try {
119
+ described.set(ingestDefinitionUrn, await this.describe(ingestDefinitionUrn));
120
+ }
121
+ catch (error) {
122
+ described.set(ingestDefinitionUrn, error instanceof CubeEngineError
123
+ ? error
124
+ : new CubeEngineError(CubeEngineErrorKind.COMPILE, error instanceof Error ? error.message : String(error)));
125
+ }
126
+ }
127
+ }
128
+ return new Map([...sources].map(([nodeId, source]) => {
129
+ const read = described.get(source.ingestDefinitionUrn);
130
+ if (read instanceof CubeEngineError || read === undefined) {
131
+ return [
132
+ nodeId,
133
+ new CubeEngineError(read?.kind ?? CubeEngineErrorKind.COMPILE, read?.detail ??
134
+ LEGEND_STUDIO_CUBE_MESSAGE.GONE(source.ingestDefinition), nodeId),
135
+ ];
136
+ }
137
+ const dataSet = read.find((each) => each.name === source.dataSet);
138
+ return [
139
+ nodeId,
140
+ dataSet?.schema && dataSet.isPickable
141
+ ? dataSet.schema
142
+ : new CubeEngineError(CubeEngineErrorKind.COMPILE, dataSet?.disabledReason ??
143
+ LEGEND_STUDIO_CUBE_MESSAGE.NO_DATA_SET(source.dataSet, source.ingestDefinition), nodeId),
144
+ ];
145
+ }));
146
+ }
147
+ }
148
+ //# sourceMappingURL=LegendStudioCubeIngestCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeIngestCatalog.js","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.ts"],"names":[],"mappings":"AA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C,IAAI,eAAe,CACjB,mBAAmB,CAAC,OAAO,EAC3B,OAAO,EAAE,cAAc;wBACrB,0BAA0B,CAAC,WAAW,CACpC,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,gBAAgB,CACxB,EACH,MAAM,CACP;aACN,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,58 @@
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 CubeDataProductModelSource, type CubeHostProject, type CubeHostProjectRuntime, type CubeLakehouseEnvironment } from '@finos/legend-cube-builder';
17
+ import { type PackageableRuntime } from '@finos/legend-graph';
18
+ import type { PlainObject } from '@finos/legend-shared';
19
+ import type { EditorStore } from '../EditorStore.js';
20
+ /** The version a cube of the workspace's data products names: the workspace, never a release */
21
+ export declare const LEGEND_STUDIO_CUBE_WORKSPACE_VERSION = "workspace";
22
+ export declare const LEGEND_STUDIO_CUBE_WORKSPACE_MESSAGE: {
23
+ NO_RUNTIME: string;
24
+ NO_ENVIRONMENT: (runtime: string) => string;
25
+ };
26
+ /** The lakehouse runtime a run uses, read from the project */
27
+ export interface LegendStudioCubeRuntime extends CubeHostProjectRuntime {
28
+ readonly path: string;
29
+ readonly environment: string;
30
+ }
31
+ export declare class LegendStudioCubeWorkspace implements CubeHostProject, CubeLakehouseEnvironment, CubeDataProductModelSource {
32
+ readonly editorStore: EditorStore;
33
+ constructor(editorStore: EditorStore);
34
+ /** The project's coordinates, which the URNs and models of Cube's sources carry */
35
+ get project(): {
36
+ groupId: string;
37
+ artifactId: string;
38
+ };
39
+ /**
40
+ * The lakehouse runtime a run uses: the project's first, as Studio's own
41
+ * queries of an ingest definition or a data product pick
42
+ * (`getCompatibleRuntimesFromAccessorOwner`, `LakehouseDataProductExecutionState`)
43
+ */
44
+ get lakehouseRuntime(): PackageableRuntime | undefined;
45
+ resolveRuntime(): Promise<LegendStudioCubeRuntime>;
46
+ /** The environment a data product run's lakehouse runtime names: the project runtime's */
47
+ resolveEnvironment(): Promise<string>;
48
+ /**
49
+ * The elements a cube's typing and runs read, as protocol JSON: the
50
+ * workspace's own and its dependencies', as Studio's own queries send
51
+ * them, so a definition's materialized views and a data product's access
52
+ * points find what they read
53
+ */
54
+ getModelElements(): Promise<readonly PlainObject[]>;
55
+ /** The model a cube of the workspace's data products reads them from: the workspace */
56
+ getProjectModel(): Promise<PlainObject>;
57
+ }
58
+ //# sourceMappingURL=LegendStudioCubeWorkspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeWorkspace.d.ts","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeWorkspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWrD,gGAAgG;AAChG,eAAO,MAAM,oCAAoC,cAAc,CAAC;AAEhE,eAAO,MAAM,oCAAoC;;8BAGrB,MAAM,KAAG,MAAM;CAE1C,CAAC;AAEF,8DAA8D;AAC9D,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,qBAAa,yBACX,YACE,eAAe,EACf,wBAAwB,EACxB,0BAA0B;IAE5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;gBAEtB,WAAW,EAAE,WAAW;IAIpC,mFAAmF;IACnF,IAAI,OAAO,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CASrD;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IAAI,kBAAkB,GAAG,SAAS,CAIrD;IAEK,cAAc,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAwBxD,0FAA0F;IACpF,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;;;OAKG;IACG,gBAAgB,IAAI,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC;IAgBzD,uFAAuF;IACjF,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC;CAG9C"}
@@ -0,0 +1,94 @@
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, } from '@finos/legend-cube-builder';
17
+ import { LakehouseBaseRuntime, LakehouseRuntime, ModelStore, PrimitiveType, } from '@finos/legend-graph';
18
+ // The project Studio edits, as Legend Cube reads it: its coordinates, the
19
+ // lakehouse runtime its runs use, and the model its typing and runs read,
20
+ // the workspace as it is now. A cube in Studio reads only the project's own
21
+ // ingest definitions and data products, which aren't deployed: they are
22
+ // typed and run on the workspace, as Studio's own queries of them are.
23
+ /** The project's coordinates when Studio has no project configuration, which Cube's sources still name */
24
+ const UNKNOWN_PROJECT = { groupId: 'studio', artifactId: 'workspace' };
25
+ /** The version a cube of the workspace's data products names: the workspace, never a release */
26
+ export const LEGEND_STUDIO_CUBE_WORKSPACE_VERSION = 'workspace';
27
+ export const LEGEND_STUDIO_CUBE_WORKSPACE_MESSAGE = {
28
+ NO_RUNTIME: "Add a lakehouse runtime to the project: a cube runs the project's ingest data sets and data products on it, as Studio's own queries do.",
29
+ NO_ENVIRONMENT: (runtime) => `The project's lakehouse runtime ${runtime} names no environment.`,
30
+ };
31
+ export class LegendStudioCubeWorkspace {
32
+ editorStore;
33
+ constructor(editorStore) {
34
+ this.editorStore = editorStore;
35
+ }
36
+ /** The project's coordinates, which the URNs and models of Cube's sources carry */
37
+ get project() {
38
+ const configuration = this.editorStore.projectConfigurationEditorState.projectConfiguration;
39
+ return configuration
40
+ ? {
41
+ groupId: configuration.groupId,
42
+ artifactId: configuration.artifactId,
43
+ }
44
+ : UNKNOWN_PROJECT;
45
+ }
46
+ /**
47
+ * The lakehouse runtime a run uses: the project's first, as Studio's own
48
+ * queries of an ingest definition or a data product pick
49
+ * (`getCompatibleRuntimesFromAccessorOwner`, `LakehouseDataProductExecutionState`)
50
+ */
51
+ get lakehouseRuntime() {
52
+ return this.editorStore.graphManagerState.usableRuntimes.find((runtime) => runtime.runtimeValue instanceof LakehouseBaseRuntime);
53
+ }
54
+ async resolveRuntime() {
55
+ const runtime = this.lakehouseRuntime;
56
+ if (!runtime) {
57
+ throw new CubeEngineError(CubeEngineErrorKind.UNSUPPORTED_MODEL, LEGEND_STUDIO_CUBE_WORKSPACE_MESSAGE.NO_RUNTIME);
58
+ }
59
+ const value = runtime.runtimeValue;
60
+ if (!value.environment) {
61
+ throw new CubeEngineError(CubeEngineErrorKind.UNSUPPORTED_MODEL, LEGEND_STUDIO_CUBE_WORKSPACE_MESSAGE.NO_ENVIRONMENT(runtime.path));
62
+ }
63
+ return {
64
+ path: runtime.path,
65
+ environment: value.environment,
66
+ label: `${value.environment}, from ${runtime.path}`,
67
+ warehouse: value instanceof LakehouseRuntime ? value.warehouse : undefined,
68
+ };
69
+ }
70
+ /** The environment a data product run's lakehouse runtime names: the project runtime's */
71
+ async resolveEnvironment() {
72
+ return (await this.resolveRuntime()).environment;
73
+ }
74
+ /**
75
+ * The elements a cube's typing and runs read, as protocol JSON: the
76
+ * workspace's own and its dependencies', as Studio's own queries send
77
+ * them, so a definition's materialized views and a data product's access
78
+ * points find what they read
79
+ */
80
+ async getModelElements() {
81
+ const { graph, graphManager } = this.editorStore.graphManagerState;
82
+ return [...graph.allOwnElements, ...graph.dependencyManager.allOwnElements]
83
+ .filter((element) => !(element instanceof PrimitiveType) &&
84
+ !(element instanceof ModelStore))
85
+ .map((element) => graphManager.elementToEntity(element, {
86
+ pruneSourceInformation: true,
87
+ }).content);
88
+ }
89
+ /** The model a cube of the workspace's data products reads them from: the workspace */
90
+ async getProjectModel() {
91
+ return { _type: 'data', elements: await this.getModelElements() };
92
+ }
93
+ }
94
+ //# sourceMappingURL=LegendStudioCubeWorkspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeWorkspace.js","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeWorkspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,GAKpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAI7B,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,uEAAuE;AAEvE,0GAA0G;AAC1G,MAAM,eAAe,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,U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IAAI,CAAC,CAClE,CAAC;QACJ,CAAC;QACD,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,KAAK,EAAE,GAAG,KAAK,CAAC,WAAW,UAAU,OAAO,CAAC,IAAI,EAAE;YACnD,SAAS,EACP,KAAK,YAAY,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAClE,CAAC;IACJ,CAAC;IAED,0FAA0F;IAC1F,KAAK,CAAC,kBAAkB;QACtB,OAAO,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,WAAW,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC;QACnE,OAAO,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC;aACxE,MAAM,CACL,CAAC,OAA2B,EAAE,EAAE,CAC9B,CAAC,CAAC,OAAO,YAAY,aAAa,CAAC;YACnC,CAAC,CAAC,OAAO,YAAY,UAAU,CAAC,CACnC;aACA,GAAG,CACF,CAAC,OAAO,EAAE,EAAE,CACV,YAAY,CAAC,eAAe,CAAC,OAAO,EAAE;YACpC,sBAAsB,EAAE,IAAI;SAC7B,CAAC,CAAC,OAAO,CACb,CAAC;IACN,CAAC;IAED,uFAAuF;IACvF,KAAK,CAAC,eAAe;QACnB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;IACpE,CAAC;CACF"}
@@ -0,0 +1,57 @@
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 IngestDefinition } from '@finos/legend-graph';
17
+ import { type PlainObject } from '@finos/legend-shared';
18
+ /** The ingest definition's data sets, as its content holds them */
19
+ export declare const getIngestDataSetNames: (ingest: IngestDefinition) => string[];
20
+ /** What a materialized view's data set says besides its name and its query */
21
+ export interface IngestMaterializedViewOptions {
22
+ /** The columns that identify a row, in the order of the view's columns; none for no key */
23
+ readonly primaryKey: readonly string[];
24
+ /** The classification of its data, e.g. `DP10`, as a data product's access points take one */
25
+ readonly sensitivity: string;
26
+ }
27
+ /** A materialized view of an ingest definition, as its content holds it */
28
+ export interface IngestMaterializedView {
29
+ readonly name: string;
30
+ /** Its query, as protocol JSON */
31
+ readonly lambda: PlainObject;
32
+ readonly primaryKey: readonly string[];
33
+ /** The classification of its data; none for a view without one */
34
+ readonly sensitivity: string | undefined;
35
+ }
36
+ /** The materialized views of the ingest definition, as its content holds them */
37
+ export declare const getIngestMaterializedViews: (ingest: IngestDefinition) => IngestMaterializedView[];
38
+ /**
39
+ * Adds a materialized view to the ingest definition: a data set whose rows
40
+ * the lambda (protocol JSON) computes, with its primary key and the
41
+ * classification of its data. It holds every key the engine gives a data
42
+ * set it parses, its lists empty, as the engine reads them all: a view
43
+ * without a `privacyClassification` failed with a NullPointerException.
44
+ * The content is replaced, so the change is seen, and the view is listed
45
+ * for Lineage and View SQL as one read from the definition would be
46
+ */
47
+ export declare const ingestDefinition_addMaterializedView: (ingest: IngestDefinition, name: string, lambda: PlainObject, options: IngestMaterializedViewOptions) => void;
48
+ /**
49
+ * Replaces a materialized view's lambda (protocol JSON) in place: its name,
50
+ * its place among the data sets and its other keys stay, as does its place
51
+ * among the views listed for Lineage and View SQL. A primary key and a
52
+ * classification given replace the view's, and the lists the engine reads
53
+ * that the view lacks, e.g. as Studio wrote a view before it wrote them, are
54
+ * added empty
55
+ */
56
+ export declare const ingestDefinition_updateMaterializedView: (ingest: IngestDefinition, name: string, lambda: PlainObject, options?: IngestMaterializedViewOptions) => void;
57
+ //# sourceMappingURL=DSL_Ingest_GraphModifierHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSL_Ingest_GraphModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAiB5E,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,gBAAgB,KAAG,MAAM,EAKlD,CAAC;AAEtB,8EAA8E;AAC9E,MAAM,WAAW,6BAA6B;IAC5C,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,8FAA8F;IAC9F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,2EAA2E;AAC3E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,GACrC,QAAQ,gBAAgB,KACvB,sBAAsB,EA2BnB,CAAC;AAEP;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC,WAErC,gBAAgB,QAClB,MAAM,UACJ,WAAW,WACV,6BAA6B,KACrC,IA8BJ,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC,WAExC,gBAAgB,QAClB,MAAM,UACJ,WAAW,YACT,6BAA6B,KACtC,IA4DJ,CAAC"}
@@ -0,0 +1,151 @@
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 { RawLambda } from '@finos/legend-graph';
17
+ import { isObject, isString } from '@finos/legend-shared';
18
+ import { action } from 'mobx';
19
+ /** The source of a data set whose rows a function computes: a materialized view */
20
+ const MATERIALIZED_VIEW_SOURCE_TYPE = 'FunctionSource';
21
+ /**
22
+ * The lists the engine gives every data set it parses, and reads: a data set
23
+ * Studio writes holds each, empty when it has none
24
+ */
25
+ const DATA_SET_LIST_KEYS = [
26
+ 'ingestPartitionColumns',
27
+ 'preprocessors',
28
+ 'storageLayoutClusterColumns',
29
+ 'storageLayoutPartitionColumns',
30
+ ];
31
+ /** The ingest definition's data sets, as its content holds them */
32
+ export const getIngestDataSetNames = (ingest) => (Array.isArray(ingest.content.datasets) ? ingest.content.datasets : [])
33
+ .map((dataSet) => isObject(dataSet) ? dataSet.name : undefined)
34
+ .filter(isString);
35
+ /** The materialized views of the ingest definition, as its content holds them */
36
+ export const getIngestMaterializedViews = (ingest) => (Array.isArray(ingest.content.datasets) ? ingest.content.datasets : [])
37
+ .filter(isObject)
38
+ .flatMap((dataSet) => {
39
+ const { name, source, primaryKey, privacyClassification } = dataSet;
40
+ const lambda = isObject(source)
41
+ ? source.function
42
+ : undefined;
43
+ const sensitivity = isObject(privacyClassification)
44
+ ? privacyClassification.sensitivity
45
+ : undefined;
46
+ return isString(name) &&
47
+ source?._type ===
48
+ MATERIALIZED_VIEW_SOURCE_TYPE &&
49
+ isObject(lambda)
50
+ ? [
51
+ {
52
+ name,
53
+ lambda: lambda,
54
+ primaryKey: Array.isArray(primaryKey)
55
+ ? primaryKey.filter(isString)
56
+ : [],
57
+ sensitivity: isString(sensitivity) ? sensitivity : undefined,
58
+ },
59
+ ]
60
+ : [];
61
+ });
62
+ /**
63
+ * Adds a materialized view to the ingest definition: a data set whose rows
64
+ * the lambda (protocol JSON) computes, with its primary key and the
65
+ * classification of its data. It holds every key the engine gives a data
66
+ * set it parses, its lists empty, as the engine reads them all: a view
67
+ * without a `privacyClassification` failed with a NullPointerException.
68
+ * The content is replaced, so the change is seen, and the view is listed
69
+ * for Lineage and View SQL as one read from the definition would be
70
+ */
71
+ export const ingestDefinition_addMaterializedView = action((ingest, name, lambda, options) => {
72
+ const dataSets = Array.isArray(ingest.content.datasets)
73
+ ? ingest.content.datasets
74
+ : [];
75
+ ingest.content = {
76
+ ...ingest.content,
77
+ datasets: [
78
+ ...dataSets,
79
+ {
80
+ name,
81
+ primaryKey: [...options.primaryKey],
82
+ privacyClassification: { sensitivity: options.sensitivity },
83
+ source: { _type: MATERIALIZED_VIEW_SOURCE_TYPE, function: lambda },
84
+ ...Object.fromEntries(DATA_SET_LIST_KEYS.map((key) => [key, []])),
85
+ },
86
+ ],
87
+ };
88
+ ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS = [
89
+ ...(ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS ?? []),
90
+ {
91
+ name,
92
+ source: {
93
+ function: new RawLambda(Array.isArray(lambda.parameters) ? lambda.parameters : [], lambda.body),
94
+ },
95
+ },
96
+ ];
97
+ });
98
+ /**
99
+ * Replaces a materialized view's lambda (protocol JSON) in place: its name,
100
+ * its place among the data sets and its other keys stay, as does its place
101
+ * among the views listed for Lineage and View SQL. A primary key and a
102
+ * classification given replace the view's, and the lists the engine reads
103
+ * that the view lacks, e.g. as Studio wrote a view before it wrote them, are
104
+ * added empty
105
+ */
106
+ export const ingestDefinition_updateMaterializedView = action((ingest, name, lambda, options) => {
107
+ const dataSets = Array.isArray(ingest.content.datasets)
108
+ ? ingest.content.datasets
109
+ : [];
110
+ ingest.content = {
111
+ ...ingest.content,
112
+ datasets: dataSets.map((dataSet) => {
113
+ if (!isObject(dataSet)) {
114
+ return dataSet;
115
+ }
116
+ const { name: dataSetName, source, privacyClassification, } = dataSet;
117
+ if (dataSetName !== name ||
118
+ !isObject(source) ||
119
+ source._type !== MATERIALIZED_VIEW_SOURCE_TYPE) {
120
+ return dataSet;
121
+ }
122
+ return {
123
+ ...dataSet,
124
+ ...(options
125
+ ? {
126
+ primaryKey: [...options.primaryKey],
127
+ privacyClassification: {
128
+ ...(isObject(privacyClassification)
129
+ ? privacyClassification
130
+ : {}),
131
+ sensitivity: options.sensitivity,
132
+ },
133
+ }
134
+ : {}),
135
+ source: { ...source, function: lambda },
136
+ ...Object.fromEntries(DATA_SET_LIST_KEYS.filter((key) => !Array.isArray(dataSet[key])).map((key) => [key, []])),
137
+ };
138
+ }),
139
+ };
140
+ ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS =
141
+ ingest.TEMPORARY_MATVIEW_FUNCTION_DATA_SETS?.map((view) => view.name === name
142
+ ? {
143
+ ...view,
144
+ source: {
145
+ ...view.source,
146
+ function: new RawLambda(Array.isArray(lambda.parameters) ? lambda.parameters : [], lambda.body),
147
+ },
148
+ }
149
+ : view);
150
+ });
151
+ //# sourceMappingURL=DSL_Ingest_GraphModifierHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSL_Ingest_GraphModifierHelper.js","sourceRoot":"","sources":["../../../src/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.ts"],"names":[],"mappings":"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
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.21.50",
3
+ "version": "28.21.52",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -47,17 +47,19 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@dagrejs/dagre": "1.1.4",
50
- "@finos/legend-application": "16.0.127",
51
- "@finos/legend-art": "7.1.167",
52
- "@finos/legend-code-editor": "2.0.209",
53
- "@finos/legend-data-cube": "0.3.127",
54
- "@finos/legend-extension-dsl-data-product": "0.1.5",
55
- "@finos/legend-extension-dsl-diagram": "8.1.273",
56
- "@finos/legend-graph": "32.7.5",
57
- "@finos/legend-lego": "2.0.229",
58
- "@finos/legend-query-builder": "4.19.18",
50
+ "@finos/legend-application": "16.0.129",
51
+ "@finos/legend-art": "7.1.169",
52
+ "@finos/legend-code-editor": "2.0.211",
53
+ "@finos/legend-cube": "0.0.5",
54
+ "@finos/legend-cube-builder": "0.0.5",
55
+ "@finos/legend-data-cube": "0.3.129",
56
+ "@finos/legend-extension-dsl-data-product": "0.2.0",
57
+ "@finos/legend-extension-dsl-diagram": "8.1.275",
58
+ "@finos/legend-graph": "32.8.0",
59
+ "@finos/legend-lego": "2.0.231",
60
+ "@finos/legend-query-builder": "4.19.20",
59
61
  "@finos/legend-server-depot": "6.1.24",
60
- "@finos/legend-server-lakehouse": "0.3.89",
62
+ "@finos/legend-server-lakehouse": "0.4.0",
61
63
  "@finos/legend-server-sdlc": "5.5.2",
62
64
  "@finos/legend-server-showcase": "0.2.73",
63
65
  "@finos/legend-shared": "11.0.32",
@@ -363,3 +363,7 @@ export const EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig = (
363
363
  editorConfig: string,
364
364
  ): string =>
365
365
  `${base}?${LEGEND_STUDIO_QUERY_PARAMS.EDITOR_CONFIG}=${encodeURIComponent(editorConfig)}`;
366
+
367
+ export const EXTERNAL_APPLICATION_NAVIGATION__generateMarketplaceDataSpaceViewUrl =
368
+ (marketplaceApplicationUrl: string, gavPath: string): string =>
369
+ `${marketplaceApplicationUrl}dataProduct/legacy/${gavPath}`;
@@ -224,6 +224,7 @@ export interface LegendStudioApplicationConfigurationData
224
224
  queryClientName?: string;
225
225
  };
226
226
  query?: { url: string };
227
+ marketplace?: { url: string };
227
228
  showcase?: { url: string };
228
229
  pct?: { reportUrl: string };
229
230
  legendAI?: { url: string };
@@ -243,6 +244,7 @@ export class LegendStudioApplicationConfig extends LegendApplicationConfig {
243
244
  readonly sdlcEnablePopupReAuth: boolean;
244
245
  readonly sdlcUseCookieAuthOnly: boolean;
245
246
  readonly queryApplicationUrl?: string | undefined;
247
+ readonly marketplaceApplicationUrl?: string | undefined;
246
248
  readonly showcaseServerUrl?: string | undefined;
247
249
  readonly pctReportUrl?: string | undefined;
248
250
  readonly legendAIUrl?: string | undefined;
@@ -312,6 +314,14 @@ export class LegendStudioApplicationConfig extends LegendApplicationConfig {
312
314
  );
313
315
  }
314
316
 
317
+ // marketplace
318
+ if (input.configData.marketplace?.url) {
319
+ this.marketplaceApplicationUrl =
320
+ LegendApplicationConfig.resolveAbsoluteUrl(
321
+ input.configData.marketplace.url,
322
+ );
323
+ }
324
+
315
325
  // showcase
316
326
  if (input.configData.showcase?.url) {
317
327
  this.showcaseServerUrl = LegendApplicationConfig.resolveAbsoluteUrl(
@@ -55,6 +55,7 @@ import { WorkspaceType } from '@finos/legend-server-sdlc';
55
55
  import { WorkspaceSyncConflictResolver } from './side-bar/WorkspaceSyncConflictResolver.js';
56
56
  import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../__lib__/LegendStudioApplicationNavigationContext.js';
57
57
  import { EmbeddedQueryBuilder } from './EmbeddedQueryBuilder.js';
58
+ import { EmbeddedCube } from './embedded-cube/EmbeddedCube.js';
58
59
  import { GRAPH_EDITOR_MODE } from '../../stores/editor/EditorConfig.js';
59
60
  import { QuickInput } from './QuickInput.js';
60
61
  import { ShowcaseManager } from '../ShowcaseManager.js';
@@ -301,6 +302,7 @@ export const Editor = withEditorStore(
301
302
  <WorkspaceSyncConflictResolver />
302
303
  )}
303
304
  <EmbeddedQueryBuilder />
305
+ <EmbeddedCube />
304
306
  {editorStore.embeddedDataCubeViewerState && (
305
307
  <QueryDataCubeViewer
306
308
  state={editorStore.embeddedDataCubeViewerState}