@finos/legend-application-query 13.8.61 → 13.8.63

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.
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-query v13.8.61
1
+ /** @license @finos/legend-application-query v13.8.63
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-query v13.8.61
1
+ /** @license @finos/legend-application-query v13.8.63
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-query",
3
- "version": "13.8.61",
3
+ "version": "13.8.63",
4
4
  "description": "Legend Query application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -55,7 +55,6 @@
55
55
  "@finos/legend-query-builder": "workspace:*",
56
56
  "@finos/legend-server-depot": "workspace:*",
57
57
  "@finos/legend-server-lakehouse": "workspace:*",
58
- "@finos/legend-server-marketplace": "workspace:*",
59
58
  "@finos/legend-shared": "workspace:*",
60
59
  "@finos/legend-storage": "workspace:*",
61
60
  "@testing-library/dom": "10.4.0",
@@ -13,34 +13,29 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { type CubeConnectionExplorer, type CubeDataProductCatalog, type CubeEngine, type CubeIngestCatalog, type CubeLakehouseServices, type CubeProjectCatalog, type CubeEngineConfig, type CubeHost, LocalModelCatalog } from '@finos/legend-cube-builder';
16
+ import { LegendCubeHost, type CubeConnectionExplorer, type CubeEngine, type CubeEngineConfig, type CubeLakehouseServices, type CubeProjectCatalog, type LegendCubeHostConfig } from '@finos/legend-cube-builder';
17
17
  import type { LegendQueryApplicationConfig } from '../../application/LegendQueryApplicationConfig.js';
18
18
  import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
19
19
  /** Cube talks to the engine Query's own editor uses, configured the same way */
20
20
  export declare const buildLegendQueryCubeEngineConfig: (config: LegendQueryApplicationConfig) => CubeEngineConfig;
21
+ /**
22
+ * Query's servers, as Cube's host reads them (PLAN §11.18): Query's engine,
23
+ * depot, lakehouse and marketplace, configured as Query's own, and the
24
+ * lakehouse environment Query remembers for the viewer
25
+ */
26
+ export declare const buildLegendQueryCubeHostConfig: (applicationStore: LegendQueryApplicationStore) => LegendCubeHostConfig;
21
27
  /**
22
28
  * What Cube needs to read and run data products (PLAN §6.8), with Query's
23
- * lakehouse and depot, configured as Query's own: none when Query has no
24
- * lakehouse, so an open-source deployment without one offers no data
25
- * products. With a marketplace server too, its search is used
29
+ * lakehouse and depot: none when Query has no lakehouse, so an open-source
30
+ * deployment without one offers no data products
26
31
  */
27
32
  export declare const buildLegendQueryCubeLakehouseServices: (applicationStore: LegendQueryApplicationStore) => CubeLakehouseServices | undefined;
28
- /** The published projects in Query's depot, or none without a depot */
29
- export declare const buildLegendQueryCubeProjectCatalog: (applicationStore: LegendQueryApplicationStore) => CubeProjectCatalog | undefined;
30
33
  /**
31
- * Legend Query as the host of the Cube page (PLAN §3.5): Query's engine and
32
- * application store, the bundled models, direct database connections read
33
- * through Query's engine, and, when Query has a lakehouse, its deployed data
34
- * products (PLAN §6.8). One per visit to the page.
34
+ * Legend Query as the host of the Cube page (PLAN §3.5): the host a Legend
35
+ * deployment gives Cube (PLAN §11.18), from Query's config. One per visit to
36
+ * the page.
35
37
  */
36
- export declare class LegendQueryCubeHost implements CubeHost {
37
- readonly applicationStore: LegendQueryApplicationStore;
38
- readonly engine: CubeEngine;
39
- readonly modelCatalog: LocalModelCatalog;
40
- readonly connectionExplorer: CubeConnectionExplorer;
41
- readonly dataProductCatalog: CubeDataProductCatalog | undefined;
42
- readonly ingestCatalog: CubeIngestCatalog | undefined;
43
- readonly projectCatalog: CubeProjectCatalog | undefined;
38
+ export declare class LegendQueryCubeHost extends LegendCubeHost {
44
39
  /**
45
40
  * Tests give an engine, an explorer and a project catalog; otherwise each
46
41
  * is built from Query's config
@@ -1 +1 @@
1
- {"version":3,"file":"LegendQueryCubeHost.d.ts","sourceRoot":"","sources":["../../../src/stores/cube/LegendQueryCubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EASL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAUpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACtG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9E,gFAAgF;AAChF,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,4BAA4B,KACnC,gBAMD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,GAChD,kBAAkB,2BAA2B,KAC5C,qBAAqB,GAAG,SAwE1B,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,kCAAkC,GAC7C,kBAAkB,2BAA2B,KAC5C,kBAAkB,GAAG,SAUvB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,QAAQ;IAClD,QAAQ,CAAC,gBAAgB,EAAE,2BAA2B,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,kBAAkB,EAAE,sBAAsB,CAAC;IACpD,QAAQ,CAAC,kBAAkB,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAChE,QAAQ,CAAC,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,cAAc,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAExD;;;OAGG;gBAED,gBAAgB,EAAE,2BAA2B,EAC7C,MAAM,CAAC,EAAE,UAAU,EACnB,kBAAkB,CAAC,EAAE,sBAAsB,EAC3C,cAAc,CAAC,EAAE,kBAAkB;CAmCtC"}
1
+ {"version":3,"file":"LegendQueryCubeHost.d.ts","sourceRoot":"","sources":["../../../src/stores/cube/LegendQueryCubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,cAAc,EACd,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACtG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9E,gFAAgF;AAChF,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,4BAA4B,KACnC,gBAMD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,kBAAkB,2BAA2B,KAC5C,oBAyBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,GAChD,kBAAkB,2BAA2B,KAC5C,qBAAqB,GAAG,SAIxB,CAAC;AAEJ;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD;;;OAGG;gBAED,gBAAgB,EAAE,2BAA2B,EAC7C,MAAM,CAAC,EAAE,UAAU,EACnB,kBAAkB,CAAC,EAAE,sBAAsB,EAC3C,cAAc,CAAC,EAAE,kBAAkB;CAQtC"}
@@ -13,11 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { buildCubeConnectionExplorer, buildCubeDataProductCatalog, buildCubeEngine, buildCubeIngestCatalog, buildCubeLakehouseEnvironment, buildCubeProjectCatalog, CubeDataProductEnvironmentType, getCubeRememberedWarehouse, LocalModelCatalog, } from '@finos/legend-cube-builder';
17
- import { DepotServerClient } from '@finos/legend-server-depot';
18
- import { LakehouseContractServerClient, LakehouseIngestServerClient, LakehousePlatformServerClient, } from '@finos/legend-server-lakehouse';
19
- import { MarketplaceServerClient } from '@finos/legend-server-marketplace';
20
- import { EXTERNAL_APPLICATION_NAVIGATION__generateMarketplaceDataProductUrl } from '../../__lib__/LegendQueryNavigation.js';
16
+ import { buildLegendCubeLakehouseServices, LegendCubeHost, } from '@finos/legend-cube-builder';
21
17
  import { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
22
18
  /** Cube talks to the engine Query's own editor uses, configured the same way */
23
19
  export const buildLegendQueryCubeEngineConfig = (config) => ({
@@ -28,53 +24,22 @@ export const buildLegendQueryCubeEngineConfig = (config) => ({
28
24
  useCookieAuthOnly: config.engineUseCookieAuthOnly,
29
25
  });
30
26
  /**
31
- * What Cube needs to read and run data products (PLAN §6.8), with Query's
32
- * lakehouse and depot, configured as Query's own: none when Query has no
33
- * lakehouse, so an open-source deployment without one offers no data
34
- * products. With a marketplace server too, its search is used
27
+ * Query's servers, as Cube's host reads them (PLAN §11.18): Query's engine,
28
+ * depot, lakehouse and marketplace, configured as Query's own, and the
29
+ * lakehouse environment Query remembers for the viewer
35
30
  */
36
- export const buildLegendQueryCubeLakehouseServices = (applicationStore) => {
37
- const { config, tracerService } = applicationStore;
38
- if (!config.lakehouseContractUrl || !config.depotServerUrl) {
39
- return undefined;
40
- }
41
- const contractServerClient = new LakehouseContractServerClient({
42
- baseUrl: config.lakehouseContractUrl,
43
- });
44
- contractServerClient.setTracerService(tracerService);
45
- const depotServerClient = new DepotServerClient({
46
- serverUrl: config.depotServerUrl,
47
- });
48
- depotServerClient.setTracerService(tracerService);
49
- let marketplaceServerClient;
50
- if (config.marketplaceServerUrl) {
51
- marketplaceServerClient = new MarketplaceServerClient({
52
- serverUrl: config.marketplaceServerUrl,
53
- // the client only stores it, never reading it, and Cube calls no subscription route
54
- subscriptionUrl: '',
55
- });
56
- marketplaceServerClient.setTracerService(tracerService);
57
- }
58
- // ingest data sets need the platform, which names the ingest servers; the
59
- // ingest client has no server of its own: each call names one
60
- let platformServerClient;
61
- let ingestServerClient;
62
- if (config.lakehousePlatformUrl) {
63
- platformServerClient = new LakehousePlatformServerClient(config.lakehousePlatformUrl);
64
- platformServerClient.setTracerService(tracerService);
65
- ingestServerClient = new LakehouseIngestServerClient(undefined);
66
- ingestServerClient.setTracerService(tracerService);
67
- }
31
+ export const buildLegendQueryCubeHostConfig = (applicationStore) => {
32
+ const { config } = applicationStore;
68
33
  return {
69
- platformServerClient,
70
- ingestServerClient,
71
- contractServerClient,
72
- depotServerClient,
73
- marketplaceServerClient,
74
- getAccessToken: () => applicationStore.getAccessToken(),
75
- getCurrentUser: () => applicationStore.identityService.currentUser,
76
- // the environment Query remembers for the viewer, as Query's editor uses it
77
- getPreferredEnvironment: () => LegendQueryUserDataHelper.getLakehouseUserInfo(applicationStore.userDataService)?.env,
34
+ engine: buildLegendQueryCubeEngineConfig(config),
35
+ depotServerUrl: config.depotServerUrl,
36
+ lakehouseContractUrl: config.lakehouseContractUrl,
37
+ lakehousePlatformUrl: config.lakehousePlatformUrl,
38
+ marketplaceServerUrl: config.marketplaceServerUrl,
39
+ // a data product links to the marketplace of its deployment's class;
40
+ // Query's own links choose by a SNAPSHOT version instead
41
+ marketplaceApplicationUrl: config.marketplaceApplicationUrl,
42
+ marketplaceProductionParallelUrl: config.marketplaceProductionParallelUrl,
78
43
  // the stereotype Studio and Marketplace mark groups open to everyone with
79
44
  enterpriseStereotype: config.options.dataProductConfig?.publicStereotype
80
45
  ? {
@@ -82,77 +47,32 @@ export const buildLegendQueryCubeLakehouseServices = (applicationStore) => {
82
47
  value: config.options.dataProductConfig.publicStereotype.stereotype,
83
48
  }
84
49
  : undefined,
85
- // the marketplace of the deployment's class, where its deployment is;
86
- // Query's own links choose by a SNAPSHOT version instead
87
- getMarketplaceLink: (target) => {
88
- const marketplaceUrl = target.environmentType ===
89
- CubeDataProductEnvironmentType.PRODUCTION_PARALLEL
90
- ? config.marketplaceProductionParallelUrl
91
- : config.marketplaceApplicationUrl;
92
- return marketplaceUrl
93
- ? EXTERNAL_APPLICATION_NAVIGATION__generateMarketplaceDataProductUrl(marketplaceUrl, target.dataProductId, target.deploymentId, target.accessPointGroup)
94
- : undefined;
95
- },
50
+ // the environment Query remembers for the viewer, as Query's editor uses it
51
+ getPreferredEnvironment: () => LegendQueryUserDataHelper.getLakehouseUserInfo(applicationStore.userDataService)?.env,
96
52
  };
97
53
  };
98
- /** The published projects in Query's depot, or none without a depot */
99
- export const buildLegendQueryCubeProjectCatalog = (applicationStore) => {
100
- const { config, tracerService } = applicationStore;
101
- if (!config.depotServerUrl) {
102
- return undefined;
103
- }
104
- const depotServerClient = new DepotServerClient({
105
- serverUrl: config.depotServerUrl,
106
- });
107
- depotServerClient.setTracerService(tracerService);
108
- return buildCubeProjectCatalog(depotServerClient);
109
- };
110
54
  /**
111
- * Legend Query as the host of the Cube page (PLAN §3.5): Query's engine and
112
- * application store, the bundled models, direct database connections read
113
- * through Query's engine, and, when Query has a lakehouse, its deployed data
114
- * products (PLAN §6.8). One per visit to the page.
55
+ * What Cube needs to read and run data products (PLAN §6.8), with Query's
56
+ * lakehouse and depot: none when Query has no lakehouse, so an open-source
57
+ * deployment without one offers no data products
58
+ */
59
+ export const buildLegendQueryCubeLakehouseServices = (applicationStore) => buildLegendCubeLakehouseServices(applicationStore, buildLegendQueryCubeHostConfig(applicationStore));
60
+ /**
61
+ * Legend Query as the host of the Cube page (PLAN §3.5): the host a Legend
62
+ * deployment gives Cube (PLAN §11.18), from Query's config. One per visit to
63
+ * the page.
115
64
  */
116
- export class LegendQueryCubeHost {
117
- applicationStore;
118
- engine;
119
- modelCatalog;
120
- connectionExplorer;
121
- dataProductCatalog;
122
- ingestCatalog;
123
- projectCatalog;
65
+ export class LegendQueryCubeHost extends LegendCubeHost {
124
66
  /**
125
67
  * Tests give an engine, an explorer and a project catalog; otherwise each
126
68
  * is built from Query's config
127
69
  */
128
70
  constructor(applicationStore, engine, connectionExplorer, projectCatalog) {
129
- this.applicationStore = applicationStore;
130
- const config = buildLegendQueryCubeEngineConfig(applicationStore.config);
131
- const lakehouse = buildLegendQueryCubeLakehouseServices(applicationStore);
132
- this.ingestCatalog = lakehouse
133
- ? buildCubeIngestCatalog(config, applicationStore.tracerService, lakehouse)
134
- : undefined;
135
- this.engine =
136
- engine ??
137
- buildCubeEngine(config, applicationStore.tracerService, {
138
- ingestCatalog: this.ingestCatalog,
139
- lakehouseEnvironment: lakehouse
140
- ? buildCubeLakehouseEnvironment(lakehouse)
141
- : undefined,
142
- getRememberedWarehouse: () => getCubeRememberedWarehouse(applicationStore.userDataService),
143
- });
144
- this.dataProductCatalog = lakehouse
145
- ? buildCubeDataProductCatalog(lakehouse)
146
- : undefined;
147
- this.modelCatalog = new LocalModelCatalog(this.engine);
148
- // its own client, configured as the engine's
149
- this.connectionExplorer =
150
- connectionExplorer ??
151
- buildCubeConnectionExplorer(config, applicationStore.tracerService);
152
- // the published projects in Query's depot (PLAN §6.3); it reads nothing
153
- // until the source dialog's Project tab opens
154
- this.projectCatalog =
155
- projectCatalog ?? buildLegendQueryCubeProjectCatalog(applicationStore);
71
+ super(applicationStore, buildLegendQueryCubeHostConfig(applicationStore), {
72
+ engine,
73
+ connectionExplorer,
74
+ projectCatalog,
75
+ });
156
76
  }
157
77
  }
158
78
  //# sourceMappingURL=LegendQueryCubeHost.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LegendQueryCubeHost.js","sourceRoot":"","sources":["../../../src/stores/cube/LegendQueryCubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,EACvB,8BAA8B,E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AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,gBAA6C,EACV,EAAE,CACrC,gCAAgC,CAC9B,gBAAgB,EAChB,8BAA8B,CAAC,gBAAgB,CAAC,CACjD,CAAC;AAEJ;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD;;;OAGG;IACH,YACE,gBAA6C,EAC7C,MAAmB,EACnB,kBAA2C,EAC3C,cAAmC;QAEnC,KAAK,CAAC,gBAAgB,EAAE,8BAA8B,CAAC,gBAAgB,CAAC,EAAE;YACxE,MAAM;YACN,kBAAkB;YAClB,cAAc;SACf,CAAC,CAAC;IACL,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-query",
3
- "version": "13.8.61",
3
+ "version": "13.8.63",
4
4
  "description": "Legend Query application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -44,18 +44,17 @@
44
44
  "test:watch": "jest --watch"
45
45
  },
46
46
  "dependencies": {
47
- "@finos/legend-application": "16.0.128",
48
- "@finos/legend-art": "7.1.168",
49
- "@finos/legend-code-editor": "2.0.210",
50
- "@finos/legend-cube-builder": "0.0.4",
51
- "@finos/legend-data-cube": "0.3.128",
52
- "@finos/legend-extension-dsl-data-space": "10.4.263",
53
- "@finos/legend-graph": "32.7.6",
54
- "@finos/legend-lego": "2.0.230",
55
- "@finos/legend-query-builder": "4.19.19",
47
+ "@finos/legend-application": "16.0.129",
48
+ "@finos/legend-art": "7.1.169",
49
+ "@finos/legend-code-editor": "2.0.211",
50
+ "@finos/legend-cube-builder": "0.0.6",
51
+ "@finos/legend-data-cube": "0.3.129",
52
+ "@finos/legend-extension-dsl-data-space": "10.4.265",
53
+ "@finos/legend-graph": "32.8.0",
54
+ "@finos/legend-lego": "2.0.231",
55
+ "@finos/legend-query-builder": "4.19.20",
56
56
  "@finos/legend-server-depot": "6.1.24",
57
- "@finos/legend-server-lakehouse": "0.3.90",
58
- "@finos/legend-server-marketplace": "0.2.17",
57
+ "@finos/legend-server-lakehouse": "0.4.0",
59
58
  "@finos/legend-shared": "11.0.32",
60
59
  "@finos/legend-storage": "3.0.154",
61
60
  "@testing-library/dom": "10.4.0",
@@ -15,32 +15,15 @@
15
15
  */
16
16
 
17
17
  import {
18
- buildCubeConnectionExplorer,
19
- buildCubeDataProductCatalog,
20
- buildCubeEngine,
21
- buildCubeIngestCatalog,
22
- buildCubeLakehouseEnvironment,
23
- buildCubeProjectCatalog,
24
- CubeDataProductEnvironmentType,
25
- getCubeRememberedWarehouse,
18
+ buildLegendCubeLakehouseServices,
19
+ LegendCubeHost,
26
20
  type CubeConnectionExplorer,
27
- type CubeDataProductCatalog,
28
21
  type CubeEngine,
29
- type CubeIngestCatalog,
22
+ type CubeEngineConfig,
30
23
  type CubeLakehouseServices,
31
24
  type CubeProjectCatalog,
32
- type CubeEngineConfig,
33
- type CubeHost,
34
- LocalModelCatalog,
25
+ type LegendCubeHostConfig,
35
26
  } from '@finos/legend-cube-builder';
36
- import { DepotServerClient } from '@finos/legend-server-depot';
37
- import {
38
- LakehouseContractServerClient,
39
- LakehouseIngestServerClient,
40
- LakehousePlatformServerClient,
41
- } from '@finos/legend-server-lakehouse';
42
- import { MarketplaceServerClient } from '@finos/legend-server-marketplace';
43
- import { EXTERNAL_APPLICATION_NAVIGATION__generateMarketplaceDataProductUrl } from '../../__lib__/LegendQueryNavigation.js';
44
27
  import { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
45
28
  import type { LegendQueryApplicationConfig } from '../../application/LegendQueryApplicationConfig.js';
46
29
  import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
@@ -57,60 +40,24 @@ export const buildLegendQueryCubeEngineConfig = (
57
40
  });
58
41
 
59
42
  /**
60
- * What Cube needs to read and run data products (PLAN §6.8), with Query's
61
- * lakehouse and depot, configured as Query's own: none when Query has no
62
- * lakehouse, so an open-source deployment without one offers no data
63
- * products. With a marketplace server too, its search is used
43
+ * Query's servers, as Cube's host reads them (PLAN §11.18): Query's engine,
44
+ * depot, lakehouse and marketplace, configured as Query's own, and the
45
+ * lakehouse environment Query remembers for the viewer
64
46
  */
65
- export const buildLegendQueryCubeLakehouseServices = (
47
+ export const buildLegendQueryCubeHostConfig = (
66
48
  applicationStore: LegendQueryApplicationStore,
67
- ): CubeLakehouseServices | undefined => {
68
- const { config, tracerService } = applicationStore;
69
- if (!config.lakehouseContractUrl || !config.depotServerUrl) {
70
- return undefined;
71
- }
72
- const contractServerClient = new LakehouseContractServerClient({
73
- baseUrl: config.lakehouseContractUrl,
74
- });
75
- contractServerClient.setTracerService(tracerService);
76
- const depotServerClient = new DepotServerClient({
77
- serverUrl: config.depotServerUrl,
78
- });
79
- depotServerClient.setTracerService(tracerService);
80
- let marketplaceServerClient: MarketplaceServerClient | undefined;
81
- if (config.marketplaceServerUrl) {
82
- marketplaceServerClient = new MarketplaceServerClient({
83
- serverUrl: config.marketplaceServerUrl,
84
- // the client only stores it, never reading it, and Cube calls no subscription route
85
- subscriptionUrl: '',
86
- });
87
- marketplaceServerClient.setTracerService(tracerService);
88
- }
89
- // ingest data sets need the platform, which names the ingest servers; the
90
- // ingest client has no server of its own: each call names one
91
- let platformServerClient: LakehousePlatformServerClient | undefined;
92
- let ingestServerClient: LakehouseIngestServerClient | undefined;
93
- if (config.lakehousePlatformUrl) {
94
- platformServerClient = new LakehousePlatformServerClient(
95
- config.lakehousePlatformUrl,
96
- );
97
- platformServerClient.setTracerService(tracerService);
98
- ingestServerClient = new LakehouseIngestServerClient(undefined);
99
- ingestServerClient.setTracerService(tracerService);
100
- }
49
+ ): LegendCubeHostConfig => {
50
+ const { config } = applicationStore;
101
51
  return {
102
- platformServerClient,
103
- ingestServerClient,
104
- contractServerClient,
105
- depotServerClient,
106
- marketplaceServerClient,
107
- getAccessToken: () => applicationStore.getAccessToken(),
108
- getCurrentUser: () => applicationStore.identityService.currentUser,
109
- // the environment Query remembers for the viewer, as Query's editor uses it
110
- getPreferredEnvironment: () =>
111
- LegendQueryUserDataHelper.getLakehouseUserInfo(
112
- applicationStore.userDataService,
113
- )?.env,
52
+ engine: buildLegendQueryCubeEngineConfig(config),
53
+ depotServerUrl: config.depotServerUrl,
54
+ lakehouseContractUrl: config.lakehouseContractUrl,
55
+ lakehousePlatformUrl: config.lakehousePlatformUrl,
56
+ marketplaceServerUrl: config.marketplaceServerUrl,
57
+ // a data product links to the marketplace of its deployment's class;
58
+ // Query's own links choose by a SNAPSHOT version instead
59
+ marketplaceApplicationUrl: config.marketplaceApplicationUrl,
60
+ marketplaceProductionParallelUrl: config.marketplaceProductionParallelUrl,
114
61
  // the stereotype Studio and Marketplace mark groups open to everyone with
115
62
  enterpriseStereotype: config.options.dataProductConfig?.publicStereotype
116
63
  ? {
@@ -118,56 +65,33 @@ export const buildLegendQueryCubeLakehouseServices = (
118
65
  value: config.options.dataProductConfig.publicStereotype.stereotype,
119
66
  }
120
67
  : undefined,
121
- // the marketplace of the deployment's class, where its deployment is;
122
- // Query's own links choose by a SNAPSHOT version instead
123
- getMarketplaceLink: (target) => {
124
- const marketplaceUrl =
125
- target.environmentType ===
126
- CubeDataProductEnvironmentType.PRODUCTION_PARALLEL
127
- ? config.marketplaceProductionParallelUrl
128
- : config.marketplaceApplicationUrl;
129
- return marketplaceUrl
130
- ? EXTERNAL_APPLICATION_NAVIGATION__generateMarketplaceDataProductUrl(
131
- marketplaceUrl,
132
- target.dataProductId,
133
- target.deploymentId,
134
- target.accessPointGroup,
135
- )
136
- : undefined;
137
- },
68
+ // the environment Query remembers for the viewer, as Query's editor uses it
69
+ getPreferredEnvironment: () =>
70
+ LegendQueryUserDataHelper.getLakehouseUserInfo(
71
+ applicationStore.userDataService,
72
+ )?.env,
138
73
  };
139
74
  };
140
75
 
141
- /** The published projects in Query's depot, or none without a depot */
142
- export const buildLegendQueryCubeProjectCatalog = (
76
+ /**
77
+ * What Cube needs to read and run data products (PLAN §6.8), with Query's
78
+ * lakehouse and depot: none when Query has no lakehouse, so an open-source
79
+ * deployment without one offers no data products
80
+ */
81
+ export const buildLegendQueryCubeLakehouseServices = (
143
82
  applicationStore: LegendQueryApplicationStore,
144
- ): CubeProjectCatalog | undefined => {
145
- const { config, tracerService } = applicationStore;
146
- if (!config.depotServerUrl) {
147
- return undefined;
148
- }
149
- const depotServerClient = new DepotServerClient({
150
- serverUrl: config.depotServerUrl,
151
- });
152
- depotServerClient.setTracerService(tracerService);
153
- return buildCubeProjectCatalog(depotServerClient);
154
- };
83
+ ): CubeLakehouseServices | undefined =>
84
+ buildLegendCubeLakehouseServices(
85
+ applicationStore,
86
+ buildLegendQueryCubeHostConfig(applicationStore),
87
+ );
155
88
 
156
89
  /**
157
- * Legend Query as the host of the Cube page (PLAN §3.5): Query's engine and
158
- * application store, the bundled models, direct database connections read
159
- * through Query's engine, and, when Query has a lakehouse, its deployed data
160
- * products (PLAN §6.8). One per visit to the page.
90
+ * Legend Query as the host of the Cube page (PLAN §3.5): the host a Legend
91
+ * deployment gives Cube (PLAN §11.18), from Query's config. One per visit to
92
+ * the page.
161
93
  */
162
- export class LegendQueryCubeHost implements CubeHost {
163
- readonly applicationStore: LegendQueryApplicationStore;
164
- readonly engine: CubeEngine;
165
- readonly modelCatalog: LocalModelCatalog;
166
- readonly connectionExplorer: CubeConnectionExplorer;
167
- readonly dataProductCatalog: CubeDataProductCatalog | undefined;
168
- readonly ingestCatalog: CubeIngestCatalog | undefined;
169
- readonly projectCatalog: CubeProjectCatalog | undefined;
170
-
94
+ export class LegendQueryCubeHost extends LegendCubeHost {
171
95
  /**
172
96
  * Tests give an engine, an explorer and a project catalog; otherwise each
173
97
  * is built from Query's config
@@ -178,37 +102,10 @@ export class LegendQueryCubeHost implements CubeHost {
178
102
  connectionExplorer?: CubeConnectionExplorer,
179
103
  projectCatalog?: CubeProjectCatalog,
180
104
  ) {
181
- this.applicationStore = applicationStore;
182
- const config = buildLegendQueryCubeEngineConfig(applicationStore.config);
183
- const lakehouse = buildLegendQueryCubeLakehouseServices(applicationStore);
184
- this.ingestCatalog = lakehouse
185
- ? buildCubeIngestCatalog(
186
- config,
187
- applicationStore.tracerService,
188
- lakehouse,
189
- )
190
- : undefined;
191
- this.engine =
192
- engine ??
193
- buildCubeEngine(config, applicationStore.tracerService, {
194
- ingestCatalog: this.ingestCatalog,
195
- lakehouseEnvironment: lakehouse
196
- ? buildCubeLakehouseEnvironment(lakehouse)
197
- : undefined,
198
- getRememberedWarehouse: () =>
199
- getCubeRememberedWarehouse(applicationStore.userDataService),
200
- });
201
- this.dataProductCatalog = lakehouse
202
- ? buildCubeDataProductCatalog(lakehouse)
203
- : undefined;
204
- this.modelCatalog = new LocalModelCatalog(this.engine);
205
- // its own client, configured as the engine's
206
- this.connectionExplorer =
207
- connectionExplorer ??
208
- buildCubeConnectionExplorer(config, applicationStore.tracerService);
209
- // the published projects in Query's depot (PLAN §6.3); it reads nothing
210
- // until the source dialog's Project tab opens
211
- this.projectCatalog =
212
- projectCatalog ?? buildLegendQueryCubeProjectCatalog(applicationStore);
105
+ super(applicationStore, buildLegendQueryCubeHostConfig(applicationStore), {
106
+ engine,
107
+ connectionExplorer,
108
+ projectCatalog,
109
+ });
213
110
  }
214
111
  }