@finos/legend-application-studio 28.21.51 → 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 (61) hide show
  1. package/lib/components/editor/Editor.d.ts.map +1 -1
  2. package/lib/components/editor/Editor.js +2 -1
  3. package/lib/components/editor/Editor.js.map +1 -1
  4. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -1
  5. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +17 -2
  6. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
  7. package/lib/components/editor/embedded-cube/EmbeddedCube.d.ts +23 -0
  8. package/lib/components/editor/embedded-cube/EmbeddedCube.d.ts.map +1 -0
  9. package/lib/components/editor/embedded-cube/EmbeddedCube.js +38 -0
  10. package/lib/components/editor/embedded-cube/EmbeddedCube.js.map +1 -0
  11. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.d.ts +35 -0
  12. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.d.ts.map +1 -0
  13. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.js +177 -0
  14. package/lib/components/editor/embedded-cube/EmbeddedCubeEditor.js.map +1 -0
  15. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
  16. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +4 -0
  17. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/package.json +3 -1
  20. package/lib/stores/editor/EditorStore.d.ts +2 -0
  21. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  22. package/lib/stores/editor/EditorStore.js +6 -1
  23. package/lib/stores/editor/EditorStore.js.map +1 -1
  24. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.d.ts +81 -0
  25. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.d.ts.map +1 -0
  26. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.js +186 -0
  27. package/lib/stores/editor/embedded-cube/EmbeddedCubeState.js.map +1 -0
  28. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.d.ts +51 -0
  29. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.d.ts.map +1 -0
  30. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.js +148 -0
  31. package/lib/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.js.map +1 -0
  32. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.d.ts +39 -0
  33. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.d.ts.map +1 -0
  34. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.js +60 -0
  35. package/lib/stores/editor/embedded-cube/LegendStudioCubeHost.js.map +1 -0
  36. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.d.ts +57 -0
  37. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.d.ts.map +1 -0
  38. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.js +148 -0
  39. package/lib/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.js.map +1 -0
  40. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.d.ts +58 -0
  41. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.d.ts.map +1 -0
  42. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.js +94 -0
  43. package/lib/stores/editor/embedded-cube/LegendStudioCubeWorkspace.js.map +1 -0
  44. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.d.ts +57 -0
  45. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.d.ts.map +1 -0
  46. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.js +151 -0
  47. package/lib/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.js.map +1 -0
  48. package/package.json +13 -11
  49. package/src/components/editor/Editor.tsx +2 -0
  50. package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +65 -0
  51. package/src/components/editor/embedded-cube/EmbeddedCube.tsx +57 -0
  52. package/src/components/editor/embedded-cube/EmbeddedCubeEditor.tsx +448 -0
  53. package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +4 -0
  54. package/src/stores/editor/EditorStore.ts +6 -1
  55. package/src/stores/editor/embedded-cube/EmbeddedCubeState.ts +251 -0
  56. package/src/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.ts +242 -0
  57. package/src/stores/editor/embedded-cube/LegendStudioCubeHost.ts +82 -0
  58. package/src/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.ts +235 -0
  59. package/src/stores/editor/embedded-cube/LegendStudioCubeWorkspace.ts +151 -0
  60. package/src/stores/graph-modifier/DSL_Ingest_GraphModifierHelper.ts +214 -0
  61. 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 { dataProductAccessor, lambda, } from '@finos/legend-cube';
17
+ import { createCubeDataProductModel, CubeAccessPoint, CubeAccessPointGroup, CubeDataProductCandidate, CubeDataProductDescription, CubeDataProductEnvironmentType, CubeEngineError, CubeEngineErrorKind, } from '@finos/legend-cube-builder';
18
+ import { LakehouseAccessPoint } from '@finos/legend-graph';
19
+ import { LEGEND_STUDIO_CUBE_WORKSPACE_VERSION, } from './LegendStudioCubeWorkspace.js';
20
+ // Legend Cube in Studio: a cube reads the data products of the project being
21
+ // edited, as the workspace holds them, never the platform's deployed ones.
22
+ // Their lakehouse access points are typed by Cube's engine on the workspace,
23
+ // as Studio types them for its own queries, and run on the project's
24
+ // lakehouse runtime.
25
+ /** The one class a Studio cube reads the project's data products as, so the tab offers no other */
26
+ const STUDIO_CUBE_DATA_PRODUCT_CLASS = CubeDataProductEnvironmentType.PRODUCTION;
27
+ /** The deployment a workspace data product is picked from: none yet */
28
+ const NO_DEPLOYMENT_ID = '0';
29
+ export const LEGEND_STUDIO_CUBE_DATA_PRODUCT_MESSAGE = {
30
+ GONE: (dataProduct) => `The project has no data product ${dataProduct} any more.`,
31
+ NOT_LAKEHOUSE: 'Cube reads lakehouse access points only',
32
+ NO_ACCESS_POINT: (accessPoint, dataProduct) => `Data product ${dataProduct} has no lakehouse access point "${accessPoint}".`,
33
+ };
34
+ const keyOf = (group, accessPoint) => `${group}\u0000${accessPoint}`;
35
+ /** The lambda that types an access point: `{| #P{dataProduct.accessPoint}#}` */
36
+ const typingLambdaOf = (dataProduct, accessPoint) => lambda([], [dataProductAccessor([dataProduct, accessPoint])]);
37
+ /**
38
+ * The project's own data products, for the Data Product tab and for
39
+ * re-checking saved sources. Their access points are typed by the engine, a
40
+ * product's in one call, on the workspace
41
+ */
42
+ export class LegendStudioCubeDataProductCatalog {
43
+ environmentTypes = [STUDIO_CUBE_DATA_PRODUCT_CLASS];
44
+ editorStore;
45
+ workspace;
46
+ engine;
47
+ constructor(editorStore, workspace, engine) {
48
+ this.editorStore = editorStore;
49
+ this.workspace = workspace;
50
+ this.engine = engine;
51
+ }
52
+ /** The project's own data products, not its dependencies' */
53
+ get dataProducts() {
54
+ return this.editorStore.graphManagerState.graph.ownDataProducts;
55
+ }
56
+ /** The model a cube of the workspace's data products names */
57
+ get model() {
58
+ return createCubeDataProductModel({
59
+ ...this.workspace.project,
60
+ versionId: LEGEND_STUDIO_CUBE_WORKSPACE_VERSION,
61
+ environmentType: STUDIO_CUBE_DATA_PRODUCT_CLASS,
62
+ });
63
+ }
64
+ candidateOf(dataProduct) {
65
+ return new CubeDataProductCandidate({
66
+ id: dataProduct.path,
67
+ deploymentId: NO_DEPLOYMENT_ID,
68
+ dataProductPath: dataProduct.path,
69
+ title: dataProduct.title ?? dataProduct.name,
70
+ description: dataProduct.description,
71
+ ...this.workspace.project,
72
+ versionId: LEGEND_STUDIO_CUBE_WORKSPACE_VERSION,
73
+ environmentType: STUDIO_CUBE_DATA_PRODUCT_CLASS,
74
+ });
75
+ }
76
+ dataProductOf(path) {
77
+ const dataProduct = this.dataProducts.find((each) => each.path === path);
78
+ if (!dataProduct) {
79
+ throw new CubeEngineError(CubeEngineErrorKind.COMPILE, LEGEND_STUDIO_CUBE_DATA_PRODUCT_MESSAGE.GONE(path));
80
+ }
81
+ return dataProduct;
82
+ }
83
+ /** Every data product of the project; the tab matches the text itself */
84
+ async search() {
85
+ return this.dataProducts.map((each) => this.candidateOf(each));
86
+ }
87
+ /** A product's access point groups, its lakehouse access points typed on the workspace */
88
+ async describe(candidate) {
89
+ const dataProduct = this.dataProductOf(candidate.dataProductPath);
90
+ const lambdas = new Map();
91
+ dataProduct.accessPointGroups.forEach((group) => group.accessPoints
92
+ .filter((point) => point instanceof LakehouseAccessPoint)
93
+ .forEach((point) => lambdas.set(keyOf(group.id, point.id), typingLambdaOf(dataProduct.path, point.id))));
94
+ const schemas = lambdas.size
95
+ ? await this.engine.typeLambdas(this.model, lambdas)
96
+ : new Map();
97
+ return new CubeDataProductDescription(candidate, dataProduct.accessPointGroups
98
+ .filter((group) => group.accessPoints.length > 0)
99
+ .map((group) => new CubeAccessPointGroup({
100
+ id: group.id,
101
+ title: group.title,
102
+ accessPoints: group.accessPoints.map((point) => {
103
+ const typed = schemas.get(keyOf(group.id, point.id));
104
+ return new CubeAccessPoint({
105
+ id: point.id,
106
+ title: point.title,
107
+ description: point.description,
108
+ schema: typed instanceof CubeEngineError ? undefined : typed,
109
+ disabledReason: point instanceof LakehouseAccessPoint
110
+ ? typed instanceof CubeEngineError
111
+ ? typed.firstLine
112
+ : undefined
113
+ : LEGEND_STUDIO_CUBE_DATA_PRODUCT_MESSAGE.NOT_LAKEHOUSE,
114
+ });
115
+ }),
116
+ })));
117
+ }
118
+ /** The saved sources' schemas, typed on the workspace in one call */
119
+ async resolveSchemas(project, sources) {
120
+ const resolved = new Map();
121
+ const lambdas = new Map();
122
+ sources.forEach((source, nodeId) => {
123
+ const point = this.dataProducts
124
+ .find((each) => each.path === source.dataProduct)
125
+ ?.accessPointGroups.find((group) => group.id === source.accessPointGroup)
126
+ ?.accessPoints.find((each) => each.id === source.accessPoint);
127
+ if (point instanceof LakehouseAccessPoint) {
128
+ lambdas.set(nodeId, typingLambdaOf(source.dataProduct, source.accessPoint));
129
+ }
130
+ else {
131
+ resolved.set(nodeId, new CubeEngineError(CubeEngineErrorKind.COMPILE, LEGEND_STUDIO_CUBE_DATA_PRODUCT_MESSAGE.NO_ACCESS_POINT(source.accessPoint, source.dataProduct), nodeId));
132
+ }
133
+ });
134
+ if (lambdas.size) {
135
+ (await this.engine.typeLambdas(createCubeDataProductModel(project), lambdas)).forEach((schema, nodeId) => resolved.set(nodeId, schema));
136
+ }
137
+ // in the order the sources were given
138
+ return new Map([...sources.keys()].map((nodeId) => [
139
+ nodeId,
140
+ resolved.get(nodeId),
141
+ ]));
142
+ }
143
+ /** No marketplace: a workspace data product has no page there yet */
144
+ getMarketplaceLink() {
145
+ return undefined;
146
+ }
147
+ }
148
+ //# sourceMappingURL=LegendStudioCubeDataProductCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeDataProductCatalog.js","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,mBAAmB,EACnB,MAAM,GAIP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACp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AAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CACvD,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,GAAG,CACV,MAAM,EACN,IAAI,eAAe,CACjB,mBAAmB,CAAC,OAAO,EAC3B,uCAAuC,CAAC,eAAe,CACrD,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,CACnB,EACD,MAAM,CACP,CACF,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,CACE,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3B,0BAA0B,CAAC,OAAO,CAAC,EACnC,OAAO,CACR,CACF,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,sCAAsC;QACtC,OAAO,IAAI,GAAG,CACZ,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YAClC,MAAM;YACN,QAAQ,CAAC,GAAG,CAAC,MAAM,CAA6B;SACjD,CAAC,CACH,CAAC;IACJ,CAAC;IAED,qEAAqE;IACrE,kBAAkB;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,39 @@
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 { LocalModelCatalog, type CubeEngine, type CubeHost } from '@finos/legend-cube-builder';
17
+ import type { LegendStudioApplicationStore } from '../../LegendStudioBaseStore.js';
18
+ import type { EditorStore } from '../EditorStore.js';
19
+ import { LegendStudioCubeDataProductCatalog } from './LegendStudioCubeDataProductCatalog.js';
20
+ import { LegendStudioCubeIngestCatalog } from './LegendStudioCubeIngestCatalog.js';
21
+ import { LegendStudioCubeWorkspace } from './LegendStudioCubeWorkspace.js';
22
+ /**
23
+ * Studio as the host of Legend Cube: Studio's engine and application store,
24
+ * and the project's own ingest definitions and data products as the only
25
+ * sources, typed and run on the workspace and the project's lakehouse
26
+ * runtime. No sample data, examples, databases or services. One per opening
27
+ * of the cube.
28
+ */
29
+ export declare class LegendStudioCubeHost implements CubeHost {
30
+ readonly applicationStore: LegendStudioApplicationStore;
31
+ readonly engine: CubeEngine;
32
+ readonly modelCatalog: LocalModelCatalog;
33
+ readonly project: LegendStudioCubeWorkspace;
34
+ readonly ingestCatalog: LegendStudioCubeIngestCatalog;
35
+ readonly dataProductCatalog: LegendStudioCubeDataProductCatalog;
36
+ readonly offersSampleData = false;
37
+ constructor(editorStore: EditorStore);
38
+ }
39
+ //# sourceMappingURL=LegendStudioCubeHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeHost.d.ts","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;;;;GAMG;AACH,qBAAa,oBAAqB,YAAW,QAAQ;IACnD,QAAQ,CAAC,gBAAgB,EAAE,4BAA4B,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,yBAAyB,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,6BAA6B,CAAC;IACtD,QAAQ,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;IAChE,QAAQ,CAAC,gBAAgB,SAAS;gBAEtB,WAAW,EAAE,WAAW;CAqCrC"}
@@ -0,0 +1,60 @@
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 { buildCubeEngine, LocalModelCatalog, } from '@finos/legend-cube-builder';
17
+ import { LegendStudioCubeDataProductCatalog } from './LegendStudioCubeDataProductCatalog.js';
18
+ import { LegendStudioCubeIngestCatalog } from './LegendStudioCubeIngestCatalog.js';
19
+ import { LegendStudioCubeWorkspace } from './LegendStudioCubeWorkspace.js';
20
+ /**
21
+ * Studio as the host of Legend Cube: Studio's engine and application store,
22
+ * and the project's own ingest definitions and data products as the only
23
+ * sources, typed and run on the workspace and the project's lakehouse
24
+ * runtime. No sample data, examples, databases or services. One per opening
25
+ * of the cube.
26
+ */
27
+ export class LegendStudioCubeHost {
28
+ applicationStore;
29
+ engine;
30
+ modelCatalog;
31
+ project;
32
+ ingestCatalog;
33
+ dataProductCatalog;
34
+ offersSampleData = false;
35
+ constructor(editorStore) {
36
+ const { applicationStore } = editorStore;
37
+ const { config } = applicationStore;
38
+ this.applicationStore = applicationStore;
39
+ this.project = new LegendStudioCubeWorkspace(editorStore);
40
+ this.ingestCatalog = new LegendStudioCubeIngestCatalog(editorStore, this.project);
41
+ // the engine Studio's own editor uses, configured the same way; a run
42
+ // reads the workspace, and names the project's lakehouse environment
43
+ this.engine = buildCubeEngine({
44
+ baseUrl: editorStore.editorConfig?.engineServerUrl ?? config.engineServerUrl,
45
+ queryBaseUrl: editorStore.editorConfig?.engineQueryServerUrl ??
46
+ config.engineQueryServerUrl,
47
+ queryClientName: config.engineQueryClientName,
48
+ enableCompression: true,
49
+ useCookieAuthOnly: config.engineUseCookieAuthOnly,
50
+ }, applicationStore.tracerService, {
51
+ ingestCatalog: this.ingestCatalog,
52
+ ingestDefinitionSource: this.ingestCatalog,
53
+ lakehouseEnvironment: this.project,
54
+ dataProductModelSource: this.project,
55
+ });
56
+ this.dataProductCatalog = new LegendStudioCubeDataProductCatalog(editorStore, this.project, this.engine);
57
+ this.modelCatalog = new LocalModelCatalog(this.engine);
58
+ }
59
+ }
60
+ //# sourceMappingURL=LegendStudioCubeHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeHost.js","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,eAAe,EACf,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB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
@@ -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 { Schema } from '@finos/legend-cube';
17
+ import { CubeDataProductEnvironmentType, CubeEngineError, CubeIngestEnvironment, CubeIngestProducer, type CubeIngestCatalog, type CubeIngestDataSet, type CubeIngestDataSetLocation, type CubeIngestDefinitionList, type CubeIngestDefinitionSource, type NodeId } from '@finos/legend-cube-builder';
18
+ import type { IngestDefinition } from '@finos/legend-graph';
19
+ import type { PlainObject } from '@finos/legend-shared';
20
+ import type { EditorStore } from '../EditorStore.js';
21
+ import type { LegendStudioCubeWorkspace } from './LegendStudioCubeWorkspace.js';
22
+ /** The one producer deployment the tab lists: the project itself, whatever its definitions' deployments */
23
+ export declare const LEGEND_STUDIO_CUBE_PROJECT_PRODUCER = "0";
24
+ export declare const LEGEND_STUDIO_CUBE_MESSAGE: {
25
+ GONE: (definition: string) => string;
26
+ UNREADABLE: (definition: string) => string;
27
+ NO_DATA_SET: (dataSet: string, definition: string) => string;
28
+ };
29
+ /**
30
+ * The project's own ingest definitions, for the Ingest tab and for the
31
+ * engine, which types and runs on them as the workspace holds them now
32
+ */
33
+ export declare class LegendStudioCubeIngestCatalog implements CubeIngestCatalog, CubeIngestDefinitionSource {
34
+ readonly environmentTypes: CubeDataProductEnvironmentType[];
35
+ readonly editorStore: EditorStore;
36
+ readonly workspace: LegendStudioCubeWorkspace;
37
+ constructor(editorStore: EditorStore, workspace: LegendStudioCubeWorkspace);
38
+ /** The project's own definitions, not its dependencies' */
39
+ private get definitions();
40
+ /** The URN a cube names the project's definition by */
41
+ urnOf(definition: IngestDefinition): string;
42
+ private definitionOf;
43
+ /** The project's lakehouse runtime, which a run names, with its warehouse */
44
+ resolveEnvironment(environmentType: CubeDataProductEnvironmentType): Promise<CubeIngestEnvironment>;
45
+ getRuntimeEnvironment(): Promise<string>;
46
+ /** One producer, the project, so the tab lists every definition at once */
47
+ listProducers(): Promise<readonly CubeIngestProducer[]>;
48
+ /** Every definition of the project, whatever its app directory deployment */
49
+ listDefinitions(): Promise<CubeIngestDefinitionList>;
50
+ /** The workspace's elements, which a typing's or a run's model holds */
51
+ getModelElements(): Promise<readonly PlainObject[]>;
52
+ /** The definition's element, as the workspace holds it now */
53
+ getDefinitionElement(urn: string): Promise<PlainObject>;
54
+ describe(urn: string): Promise<readonly CubeIngestDataSet[]>;
55
+ resolveSchemas(environmentType: CubeDataProductEnvironmentType, sources: ReadonlyMap<NodeId, CubeIngestDataSetLocation>): Promise<Map<NodeId, Schema | CubeEngineError>>;
56
+ }
57
+ //# sourceMappingURL=LegendStudioCubeIngestCatalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeIngestCatalog.d.ts","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeIngestCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,8BAA8B,EAC9B,eAAe,EAGf,qBAAqB,EACrB,kBAAkB,EAIlB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,M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8BAA8B,EAC/C,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,yBAAyB,CAAC,GACtD,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC;CAyDlD"}
@@ -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":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,8BAA8B,EAC9B,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GAOvB,MAAM,4BAA4B,CAAC;AAMpC,4EAA4E;AAC5E,uEAAuE;AACvE,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,uBAAuB;AAEvB,wGAAwG;AACxG,MAAM,wBAAwB,GAAG,8BAA8B,CAAC,UAAU,CAAC;AAE3E,2GAA2G;AAC3G,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,CAAC;AAEvD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,CAAC,UAAkB,EAAU,EAAE,CACnC,wCAAwC,UAAU,YAAY;IAChE,UAAU,EAAE,CAAC,UAAkB,EAAU,EAAE,CACzC,sDAAsD,UAAU,GAAG;IACrE,WAAW,EAAE,CAAC,OAAe,EAAE,UAAkB,EAAU,EAAE,CAC3D,qBAAqB,UAAU,qBAAqB,OAAO,IAAI;CAClE,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,6BAA6B;IAG/B,gBAAgB,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC9C,WAAW,CAAc;IACzB,SAAS,CAA4B;IAE9C,YAAY,WAAwB,EAAE,SAAoC;QACxE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,C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,CAAC,EAC1D,MAAM,CACP;iBACF,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC;YAClE,OAAO;gBACL,MAAM;gBACN,OAAO,EAAE,MAAM,IAAI,OAAO,CAAC,UAAU;oBACnC,CAAC,CAAC,OAAO,CAAC,MAAM;oBAChB,CAAC,CAAC,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,MA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