@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,186 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { action, computed, flowResult, makeObservable, observable } from 'mobx';
17
+ import { getIngestDataSetNames, getIngestMaterializedViews, ingestDefinition_addMaterializedView, ingestDefinition_updateMaterializedView, } from '../../graph-modifier/DSL_Ingest_GraphModifierHelper.js';
18
+ import { IngestDefinitionEditorState } from '../editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js';
19
+ /** A data set's name: a letter or an underscore, then letters, digits and underscores */
20
+ const DATA_SET_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/u;
21
+ /**
22
+ * Legend Cube, opened full screen from an ingest definition's editor to build
23
+ * a materialized view of it from the project's ingest data sets (Create
24
+ * MatView). Studio's own shortcuts are off while it is open. Cube
25
+ * itself, and its host, are loaded with the dialog (`EmbeddedCube`), so
26
+ * nothing here imports them.
27
+ */
28
+ export class EmbeddedCubeState {
29
+ editorStore;
30
+ /** The definition the materialized view is added to; none while closed */
31
+ ingest;
32
+ /**
33
+ * The materialized view opened to edit (Edit MatView, PLAN §11.18), by
34
+ * name: Cube opens on its lambda, and Save MatView replaces it; none for a
35
+ * new one
36
+ */
37
+ matView;
38
+ constructor(editorStore) {
39
+ makeObservable(this, {
40
+ ingest: observable.ref,
41
+ matView: observable,
42
+ matViewDataSet: computed,
43
+ matViewLambda: computed,
44
+ open: action,
45
+ close: action,
46
+ addMaterializedView: action,
47
+ saveMaterializedView: action,
48
+ });
49
+ this.editorStore = editorStore;
50
+ }
51
+ get isOpen() {
52
+ return this.ingest !== undefined;
53
+ }
54
+ /** Opens Cube on a new materialized view of the definition, or on one of its views to edit */
55
+ open(ingest, matView) {
56
+ this.ingest = ingest;
57
+ this.matView = matView;
58
+ }
59
+ close() {
60
+ this.ingest = undefined;
61
+ this.matView = undefined;
62
+ }
63
+ /** The materialized view opened to edit, as the definition holds it */
64
+ get matViewDataSet() {
65
+ const { ingest, matView } = this;
66
+ return ingest && matView !== undefined
67
+ ? getIngestMaterializedViews(ingest).find((view) => view.name === matView)
68
+ : undefined;
69
+ }
70
+ /** The lambda (protocol JSON) of the materialized view opened to edit */
71
+ get matViewLambda() {
72
+ return this.matViewDataSet?.lambda;
73
+ }
74
+ /** Why the name can't be the new materialized view's; none when it can */
75
+ getMaterializedViewNameProblem(name) {
76
+ const trimmed = name.trim();
77
+ if (!trimmed) {
78
+ return 'Name the materialized view.';
79
+ }
80
+ if (!DATA_SET_NAME_PATTERN.test(trimmed)) {
81
+ return 'A data set name is letters, digits and underscores, and starts with a letter or an underscore.';
82
+ }
83
+ return this.ingest && getIngestDataSetNames(this.ingest).includes(trimmed)
84
+ ? `The ingest definition already has a data set named ${trimmed}.`
85
+ : undefined;
86
+ }
87
+ /**
88
+ * The classifications a materialized view's data can take: those a data
89
+ * product's access points offer; none when Studio's config gives none,
90
+ * and the classification is then typed
91
+ */
92
+ get classifications() {
93
+ return (this.editorStore.applicationStore.config.options.dataProductConfig
94
+ ?.classifications ?? []);
95
+ }
96
+ /** Why the classification can't be the new materialized view's; none when it can */
97
+ getMaterializedViewClassificationProblem(sensitivity) {
98
+ const trimmed = sensitivity.trim();
99
+ if (!trimmed) {
100
+ return "Classify the materialized view's data.";
101
+ }
102
+ const { classifications } = this;
103
+ return classifications.length && !classifications.includes(trimmed)
104
+ ? `${trimmed} isn't one of the data classifications.`
105
+ : undefined;
106
+ }
107
+ /**
108
+ * Adds the lambda to the ingest definition as a materialized view, with
109
+ * its primary key and the classification of its data, closes the cube and
110
+ * shows the definition with it
111
+ */
112
+ addMaterializedView(name, lambda, options) {
113
+ const { ingest } = this;
114
+ if (!ingest ||
115
+ this.getMaterializedViewNameProblem(name) !== undefined ||
116
+ this.getMaterializedViewClassificationProblem(options.sensitivity) !==
117
+ undefined) {
118
+ return;
119
+ }
120
+ ingestDefinition_addMaterializedView(ingest, name.trim(), lambda, {
121
+ primaryKey: options.primaryKey,
122
+ sensitivity: options.sensitivity.trim(),
123
+ });
124
+ this.closeOn(ingest, `Added materialized view ${name.trim()} to ${ingest.name}`);
125
+ }
126
+ /**
127
+ * Why Save MatView must ask again before it replaces the view opened to
128
+ * edit with the step that runs, given the step's columns (unknown, the key
129
+ * isn't checked): its data has no classification, as Studio wrote a view
130
+ * before it asked for one, or one that isn't among the classifications; or
131
+ * its primary key has a column the step no longer has. None when the view
132
+ * can be saved as it is
133
+ */
134
+ getMaterializedViewSaveProblems(columns) {
135
+ const view = this.matViewDataSet;
136
+ if (!view) {
137
+ return [];
138
+ }
139
+ const problems = [];
140
+ const classificationProblem = view.sensitivity === undefined
141
+ ? `${view.name} has no classification of its data.`
142
+ : this.getMaterializedViewClassificationProblem(view.sensitivity);
143
+ if (classificationProblem !== undefined) {
144
+ problems.push(classificationProblem);
145
+ }
146
+ const gone = columns
147
+ ? view.primaryKey.filter((column) => !columns.includes(column))
148
+ : [];
149
+ if (gone.length) {
150
+ problems.push(gone.length === 1
151
+ ? `Its primary key's ${gone.join(', ')} is no longer a column of the cube.`
152
+ : `Its primary key's ${gone.join(', ')} are no longer columns of the cube.`);
153
+ }
154
+ return problems;
155
+ }
156
+ /**
157
+ * Replaces the lambda of the materialized view opened to edit, in place
158
+ * (Save MatView), with the primary key and classification given, or its
159
+ * own; closes the cube and shows the definition with it. As a view added,
160
+ * a view saved has a classification of its data
161
+ */
162
+ saveMaterializedView(lambda, options) {
163
+ const { ingest, matView, matViewDataSet } = this;
164
+ if (!ingest ||
165
+ matView === undefined ||
166
+ !matViewDataSet ||
167
+ this.getMaterializedViewClassificationProblem((options ? options.sensitivity : matViewDataSet.sensitivity) ?? '') !== undefined) {
168
+ return;
169
+ }
170
+ ingestDefinition_updateMaterializedView(ingest, matView, lambda, options && {
171
+ primaryKey: options.primaryKey,
172
+ sensitivity: options.sensitivity.trim(),
173
+ });
174
+ this.closeOn(ingest, `Saved materialized view ${matView} of ${ingest.name}`);
175
+ }
176
+ /** Closes the cube, then shows the definition's grammar with the change */
177
+ closeOn(ingest, message) {
178
+ this.close();
179
+ const editorState = this.editorStore.tabManagerState.tabs.find((tab) => tab instanceof IngestDefinitionEditorState && tab.ingest === ingest);
180
+ if (editorState) {
181
+ flowResult(editorState.generateElementGrammar()).catch(this.editorStore.applicationStore.alertUnhandledError);
182
+ }
183
+ this.editorStore.applicationStore.notificationService.notifySuccess(message);
184
+ }
185
+ }
186
+ //# sourceMappingURL=EmbeddedCubeState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbeddedCubeState.js","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/EmbeddedCubeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChF,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,EACpC,uCAAuC,GAGxC,MAAM,wDAAwD,CAAC;AAEhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4EAA4E,CAAC;AAEzH,yFAAyF;AACzF,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACnB,WAAW,CAAc;IAClC,0EAA0E;IAC1E,MAAM,CAA+B;IACrC;;;;OAIG;IACH,OAAO,CAAqB;IAE5B,YAAY,WAAwB;QAClC,cAAc,CAAC,IAAI,EAAE;YACnB,MAAM,EAAE,UAAU,CAAC,GAAG;YACtB,OAAO,EAAE,UAAU;YACnB,cAAc,EAAE,QAAQ;YACxB,aAAa,EAAE,QAAQ;YACvB,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;YACb,mBAAmB,EAAE,MAAM;YAC3B,oBAAoB,EAAE,MAA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CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,CACnE,KAAK,SAAS,EACf,CAAC;YACD,OAAO;QACT,CAAC;QACD,uCAAuC,CACrC,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,IAAI;YACT,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE;SACxC,CACF,CAAC;QACF,IAAI,CAAC,OAAO,CACV,MAAM,EACN,2BAA2B,OAAO,OAAO,MAAM,CAAC,IAAI,EAAE,CACvD,CAAC;IACJ,CAAC;IAED,2EAA2E;IACnE,OAAO,CAAC,MAAwB,EAAE,OAAe;QACvD,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAC5D,CAAC,GAAG,EAAsC,EAAE,CAC1C,GAAG,YAAY,2BAA2B,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,CACtE,CAAC;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,UAAU,CAAC,WAAW,CAAC,sBAAsB,EAAE,CAAC,CAAC,KAAK,CACpD,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CACtD,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,aAAa,CACjE,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,51 @@
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 { CubeDataProductCandidate, CubeDataProductDescription, CubeDataProductEnvironmentType, CubeEngineError, type CubeAccessPointLocation, type CubeDataProductCatalog, type CubeDataProductProject, type CubeEngine, type NodeId } from '@finos/legend-cube-builder';
18
+ import type { EditorStore } from '../EditorStore.js';
19
+ import { type LegendStudioCubeWorkspace } from './LegendStudioCubeWorkspace.js';
20
+ export declare const LEGEND_STUDIO_CUBE_DATA_PRODUCT_MESSAGE: {
21
+ GONE: (dataProduct: string) => string;
22
+ NOT_LAKEHOUSE: string;
23
+ NO_ACCESS_POINT: (accessPoint: string, dataProduct: string) => string;
24
+ };
25
+ /**
26
+ * The project's own data products, for the Data Product tab and for
27
+ * re-checking saved sources. Their access points are typed by the engine, a
28
+ * product's in one call, on the workspace
29
+ */
30
+ export declare class LegendStudioCubeDataProductCatalog implements CubeDataProductCatalog {
31
+ readonly environmentTypes: CubeDataProductEnvironmentType[];
32
+ readonly editorStore: EditorStore;
33
+ readonly workspace: LegendStudioCubeWorkspace;
34
+ private readonly engine;
35
+ constructor(editorStore: EditorStore, workspace: LegendStudioCubeWorkspace, engine: CubeEngine);
36
+ /** The project's own data products, not its dependencies' */
37
+ private get dataProducts();
38
+ /** The model a cube of the workspace's data products names */
39
+ private get model();
40
+ private candidateOf;
41
+ private dataProductOf;
42
+ /** Every data product of the project; the tab matches the text itself */
43
+ search(): Promise<readonly CubeDataProductCandidate[]>;
44
+ /** A product's access point groups, its lakehouse access points typed on the workspace */
45
+ describe(candidate: CubeDataProductCandidate): Promise<CubeDataProductDescription>;
46
+ /** The saved sources' schemas, typed on the workspace in one call */
47
+ resolveSchemas(project: CubeDataProductProject, sources: ReadonlyMap<NodeId, CubeAccessPointLocation>): Promise<Map<NodeId, Schema | CubeEngineError>>;
48
+ /** No marketplace: a workspace data product has no page there yet */
49
+ getMarketplaceLink(): string | undefined;
50
+ }
51
+ //# sourceMappingURL=LegendStudioCubeDataProductCatalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendStudioCubeDataProductCatalog.d.ts","sourceRoot":"","sources":["../../../../src/stores/editor/embedded-cube/LegendStudioCubeDataProductCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,wBAAwB,EACxB,0BAA0B,EAC1B,8BAA8B,EAC9B,eAAe,EAEf,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAexC,eAAO,MAAM,uCAAuC;wBAC9B,MAAM,KAAG,MAAM;;mCAGJ,MAAM,eAAe,MAAM,KAAG,MAAM;CAEpE,CAAC;AASF;;;;GAIG;AACH,qBAAa,kCACX,YAAW,sBAAsB;IAEjC,QAAQ,CAAC,gBAAgB,mCAAoC;IAC7D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;gBAGlC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,yBAAyB,EACpC,MAAM,EAAE,UAAU;IAOpB,6DAA6D;IAC7D,OAAO,KAAK,YAAY,GAEvB;IAED,8DAA8D;IAC9D,OAAO,KAAK,KAAK,GAMhB;IAED,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,aAAa;IAWrB,yEAAyE;IACnE,MAAM,IAAI,OAAO,CAAC,SAAS,wBAAwB,EAAE,CAAC;IAI5D,0FAA0F;IACpF,QAAQ,CACZ,SAAS,EAAE,wBAAwB,GAClC,OAAO,CAAC,0BAA0B,CAAC;IA6CtC,qEAAqE;IAC/D,cAAc,CAClB,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,uBAAuB,CAAC,GACpD,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC;IA8CjD,qEAAqE;IACrE,kBAAkB,IAAI,MAAM,GAAG,SAAS;CAGzC"}
@@ -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,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,8BAA8B,EAC9B,eAAe,EACf,mBAAmB,GAMpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAoB,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EACL,oCAAoC,GAErC,MAAM,gCAAgC,CAAC;AAExC,6EAA6E;AAC7E,2EAA2E;AAC3E,6EAA6E;AAC7E,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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;IACtB,gBAAgB,CAA+B;IAC/C,MAAM,CAAa;IACnB,YAAY,CAAoB;IAChC,OAAO,CAA4B;IACnC,aAAa,CAAgC;IAC7C,kBAAkB,CAAqC;IACvD,gBAAgB,GAAG,KAAK,CAAC;IAElC,YAAY,WAAwB;QAClC,MAAM,EAAE,gBAAgB,EAAE,GAAG,WAAW,CAAC;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,yBAAyB,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,aAAa,GAAG,IAAI,6BAA6B,CACpD,WAAW,EACX,IAAI,CAAC,OAAO,CACb,CAAC;QACF,sEAAsE;QACtE,qEAAqE;QACrE,IAAI,CAAC,MAAM,GAAG,eAAe,CAC3B;YACE,OAAO,EACL,WAAW,CAAC,YAAY,EAAE,eAAe,IAAI,MAAM,CAAC,eAAe;YACrE,YAAY,EACV,WAAW,CAAC,YAAY,EAAE,oBAAoB;gBAC9C,MAAM,CAAC,oBAAoB;YAC7B,eAAe,EAAE,MAAM,CAAC,qBAAqB;YAC7C,iBAAiB,EAAE,IAAI;YACvB,iBAAiB,EAAE,MAAM,CAAC,uBAAuB;SAClD,EACD,gBAAgB,CAAC,aAAa,EAC9B;YACE,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,sBAAsB,EAAE,IAAI,CAAC,aAAa;YAC1C,oBAAoB,EAAE,IAAI,CAAC,OAAO;YAClC,sBAAsB,EAAE,IAAI,CAAC,OAAO;SACrC,CACF,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,IAAI,kCAAkC,CAC9D,WAAW,EACX,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,MAAM,CACZ,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,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 { 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,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAYhF,2GAA2G;AAC3G,eAAO,MAAM,mCAAmC,MAAM,CAAC;AAEvD,eAAO,MAAM,0BAA0B;uBAClB,MAAM,KAAG,MAAM;6BAET,MAAM,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