@finos/legend-application-query 13.8.63 → 13.8.65

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__/LegendQueryNavigation.d.ts +0 -1
  2. package/lib/__lib__/LegendQueryNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendQueryNavigation.js +0 -2
  4. package/lib/__lib__/LegendQueryNavigation.js.map +1 -1
  5. package/lib/__lib__/LegendQueryUserDataHelper.d.ts +12 -2
  6. package/lib/__lib__/LegendQueryUserDataHelper.d.ts.map +1 -1
  7. package/lib/__lib__/LegendQueryUserDataHelper.js +33 -1
  8. package/lib/__lib__/LegendQueryUserDataHelper.js.map +1 -1
  9. package/lib/__lib__/LegendQueryUserDataSpaceHelper.d.ts +10 -0
  10. package/lib/__lib__/LegendQueryUserDataSpaceHelper.d.ts.map +1 -1
  11. package/lib/__lib__/LegendQueryUserDataSpaceHelper.js +5 -0
  12. package/lib/__lib__/LegendQueryUserDataSpaceHelper.js.map +1 -1
  13. package/lib/application/Core_LegendQuery_LegendApplicationPlugin.d.ts +1 -7
  14. package/lib/application/Core_LegendQuery_LegendApplicationPlugin.d.ts.map +1 -1
  15. package/lib/application/Core_LegendQuery_LegendApplicationPlugin.js +1 -10
  16. package/lib/application/Core_LegendQuery_LegendApplicationPlugin.js.map +1 -1
  17. package/lib/application/LegendQueryApplicationConfig.d.ts +1 -24
  18. package/lib/application/LegendQueryApplicationConfig.d.ts.map +1 -1
  19. package/lib/application/LegendQueryApplicationConfig.js +1 -23
  20. package/lib/application/LegendQueryApplicationConfig.js.map +1 -1
  21. package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
  22. package/lib/components/Core_LegendQueryApplicationPlugin.js +5 -1
  23. package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
  24. package/lib/components/LegendQueryWebApplication.d.ts.map +1 -1
  25. package/lib/components/LegendQueryWebApplication.js +1 -2
  26. package/lib/components/LegendQueryWebApplication.js.map +1 -1
  27. package/lib/components/data-space/LegendQueryDataSpaceQueryBuilder.d.ts.map +1 -1
  28. package/lib/components/data-space/LegendQueryDataSpaceQueryBuilder.js +15 -12
  29. package/lib/components/data-space/LegendQueryDataSpaceQueryBuilder.js.map +1 -1
  30. package/lib/index.css +2 -2
  31. package/lib/index.css.map +1 -1
  32. package/lib/light-mode.css +1 -1
  33. package/lib/package.json +1 -2
  34. package/lib/stores/QueryEditorStore.d.ts.map +1 -1
  35. package/lib/stores/QueryEditorStore.js +2 -0
  36. package/lib/stores/QueryEditorStore.js.map +1 -1
  37. package/lib/stores/data-space/DataProductQueryCreatorStore.d.ts.map +1 -1
  38. package/lib/stores/data-space/DataProductQueryCreatorStore.js +13 -2
  39. package/lib/stores/data-space/DataProductQueryCreatorStore.js.map +1 -1
  40. package/lib/stores/data-space/query-builder/LegendQueryDataSpaceQueryBuilderState.d.ts +33 -1
  41. package/lib/stores/data-space/query-builder/LegendQueryDataSpaceQueryBuilderState.d.ts.map +1 -1
  42. package/lib/stores/data-space/query-builder/LegendQueryDataSpaceQueryBuilderState.js +120 -3
  43. package/lib/stores/data-space/query-builder/LegendQueryDataSpaceQueryBuilderState.js.map +1 -1
  44. package/package.json +14 -15
  45. package/src/__lib__/LegendQueryNavigation.ts +0 -2
  46. package/src/__lib__/LegendQueryUserDataHelper.ts +72 -1
  47. package/src/__lib__/LegendQueryUserDataSpaceHelper.ts +21 -0
  48. package/src/application/Core_LegendQuery_LegendApplicationPlugin.ts +0 -14
  49. package/src/application/LegendQueryApplicationConfig.ts +0 -46
  50. package/src/components/Core_LegendQueryApplicationPlugin.tsx +7 -1
  51. package/src/components/LegendQueryWebApplication.tsx +0 -14
  52. package/src/components/data-space/LegendQueryDataSpaceQueryBuilder.tsx +29 -22
  53. package/src/stores/QueryEditorStore.ts +2 -0
  54. package/src/stores/data-space/DataProductQueryCreatorStore.ts +19 -9
  55. package/src/stores/data-space/query-builder/LegendQueryDataSpaceQueryBuilderState.ts +167 -1
  56. package/tsconfig.json +0 -4
  57. package/lib/components/cube/LegendQueryCubePage.d.ts +0 -18
  58. package/lib/components/cube/LegendQueryCubePage.d.ts.map +0 -1
  59. package/lib/components/cube/LegendQueryCubePage.js +0 -31
  60. package/lib/components/cube/LegendQueryCubePage.js.map +0 -1
  61. package/lib/components/cube/LegendQueryCubeRoute.d.ts +0 -18
  62. package/lib/components/cube/LegendQueryCubeRoute.d.ts.map +0 -1
  63. package/lib/components/cube/LegendQueryCubeRoute.js +0 -26
  64. package/lib/components/cube/LegendQueryCubeRoute.js.map +0 -1
  65. package/lib/stores/cube/LegendQueryCubeEntry.d.ts +0 -38
  66. package/lib/stores/cube/LegendQueryCubeEntry.d.ts.map +0 -1
  67. package/lib/stores/cube/LegendQueryCubeEntry.js +0 -59
  68. package/lib/stores/cube/LegendQueryCubeEntry.js.map +0 -1
  69. package/lib/stores/cube/LegendQueryCubeHost.d.ts +0 -45
  70. package/lib/stores/cube/LegendQueryCubeHost.d.ts.map +0 -1
  71. package/lib/stores/cube/LegendQueryCubeHost.js +0 -78
  72. package/lib/stores/cube/LegendQueryCubeHost.js.map +0 -1
  73. package/src/components/cube/LegendQueryCubePage.tsx +0 -40
  74. package/src/components/cube/LegendQueryCubeRoute.tsx +0 -42
  75. package/src/stores/cube/LegendQueryCubeEntry.ts +0 -74
  76. package/src/stores/cube/LegendQueryCubeHost.ts +0 -111
@@ -1,40 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { CubeEditor } from '@finos/legend-cube-builder';
18
- import { useEffect, useState } from 'react';
19
- import {
20
- readLegendQueryCubeEntry,
21
- stripLegendQueryCubeEntry,
22
- } from '../../stores/cube/LegendQueryCubeEntry.js';
23
- import { LegendQueryCubeHost } from '../../stores/cube/LegendQueryCubeHost.js';
24
- import { useLegendQueryApplicationStore } from '../LegendQueryFrameworkProvider.js';
25
-
26
- /** The Cube page in Legend Query, with a host that lasts as long as the visit */
27
- export const LegendQueryCubePage: React.FC = () => {
28
- const applicationStore = useLegendQueryApplicationStore();
29
- const [host] = useState(() => new LegendQueryCubeHost(applicationStore));
30
- // read once, as the page opens; the address loses it once shown
31
- const [initialSource] = useState(() =>
32
- readLegendQueryCubeEntry(applicationStore.navigationService.navigator),
33
- );
34
- useEffect(
35
- () =>
36
- stripLegendQueryCubeEntry(applicationStore.navigationService.navigator),
37
- [applicationStore],
38
- );
39
- return <CubeEditor host={host} initialSource={initialSource} />;
40
- };
@@ -1,42 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import {
18
- CubesLoadingIndicator,
19
- CubesLoadingIndicatorIcon,
20
- } from '@finos/legend-art';
21
- import { lazy, Suspense } from 'react';
22
-
23
- // Loaded on the first visit, so the Cube page and its UI libraries stay out
24
- // of Query's main bundle (PLAN §3.5, Settled before M1.8)
25
- const LazyLegendQueryCubePage = lazy(() =>
26
- import('./LegendQueryCubePage.js').then((module) => ({
27
- default: module.LegendQueryCubePage,
28
- })),
29
- );
30
-
31
- /** The element of the `/cube` route */
32
- export const LegendQueryCubeRoute: React.FC = () => (
33
- <Suspense
34
- fallback={
35
- <CubesLoadingIndicator isLoading={true}>
36
- <CubesLoadingIndicatorIcon />
37
- </CubesLoadingIndicator>
38
- }
39
- >
40
- <LazyLegendQueryCubePage />
41
- </Suspense>
42
- );
@@ -1,74 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import type { NavigationService } from '@finos/legend-application';
18
- import type { CubeEntrySource } from '@finos/legend-cube-builder';
19
-
20
- /** The Cube page's address parameters (spec §17.15) */
21
- export enum LEGEND_QUERY_CUBE_PARAMETER {
22
- SOURCE_TYPE = 'sourceType',
23
- SOURCE_ID = 'sourceId',
24
- QUERY_ID = 'queryId',
25
- }
26
-
27
- /** The page's address parameters, each decoded once, as a link writes them */
28
- const readParameters = (
29
- navigator: NavigationService['navigator'],
30
- ): URLSearchParams => new URL(navigator.getCurrentAddress()).searchParams;
31
-
32
- /**
33
- * The source a link asks the Cube page to start with (spec §17.15,
34
- * QUESTIONS.md U9): `?sourceType=…&sourceId=…`. A saved query (`?queryId=`)
35
- * wins; it opens once Cube saves queries (M8). Reads only: the page takes
36
- * the parameters out of the address once it is shown
37
- * (`stripLegendQueryCubeEntry`).
38
- */
39
- export const readLegendQueryCubeEntry = (
40
- navigator: NavigationService['navigator'],
41
- ): CubeEntrySource | undefined => {
42
- const parameters = readParameters(navigator);
43
- const sourceType = parameters.get(LEGEND_QUERY_CUBE_PARAMETER.SOURCE_TYPE);
44
- const sourceId = parameters.get(LEGEND_QUERY_CUBE_PARAMETER.SOURCE_ID);
45
- return !parameters.has(LEGEND_QUERY_CUBE_PARAMETER.QUERY_ID) &&
46
- sourceType &&
47
- sourceId
48
- ? { sourceType, sourceId }
49
- : undefined;
50
- };
51
-
52
- /**
53
- * Takes a link's source out of the address, whether or not it resolves,
54
- * keeping the address's other parameters and its hash, a saved query's id
55
- * among them (U9: the address then names the cube shown)
56
- */
57
- export const stripLegendQueryCubeEntry = (
58
- navigator: NavigationService['navigator'],
59
- ): void => {
60
- const parameters = readParameters(navigator);
61
- if (
62
- !parameters.has(LEGEND_QUERY_CUBE_PARAMETER.SOURCE_TYPE) &&
63
- !parameters.has(LEGEND_QUERY_CUBE_PARAMETER.SOURCE_ID)
64
- ) {
65
- return;
66
- }
67
- // only the source's parameters: the rest, a saved query's id included, stay
68
- parameters.delete(LEGEND_QUERY_CUBE_PARAMETER.SOURCE_TYPE);
69
- parameters.delete(LEGEND_QUERY_CUBE_PARAMETER.SOURCE_ID);
70
- const rest = parameters.toString();
71
- navigator.updateCurrentLocation(
72
- `${navigator.getCurrentLocation()}${rest ? `?${rest}` : ''}${new URL(navigator.getCurrentAddress()).hash}`,
73
- );
74
- };
@@ -1,111 +0,0 @@
1
- /**
2
- * Copyright (c) 2026-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import {
18
- buildLegendCubeLakehouseServices,
19
- LegendCubeHost,
20
- type CubeConnectionExplorer,
21
- type CubeEngine,
22
- type CubeEngineConfig,
23
- type CubeLakehouseServices,
24
- type CubeProjectCatalog,
25
- type LegendCubeHostConfig,
26
- } from '@finos/legend-cube-builder';
27
- import { LegendQueryUserDataHelper } from '../../__lib__/LegendQueryUserDataHelper.js';
28
- import type { LegendQueryApplicationConfig } from '../../application/LegendQueryApplicationConfig.js';
29
- import type { LegendQueryApplicationStore } from '../LegendQueryBaseStore.js';
30
-
31
- /** Cube talks to the engine Query's own editor uses, configured the same way */
32
- export const buildLegendQueryCubeEngineConfig = (
33
- config: LegendQueryApplicationConfig,
34
- ): CubeEngineConfig => ({
35
- baseUrl: config.engineServerUrl,
36
- queryBaseUrl: config.engineQueryServerUrl,
37
- queryClientName: config.engineQueryClientName,
38
- enableCompression: true,
39
- useCookieAuthOnly: config.engineUseCookieAuthOnly,
40
- });
41
-
42
- /**
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
46
- */
47
- export const buildLegendQueryCubeHostConfig = (
48
- applicationStore: LegendQueryApplicationStore,
49
- ): LegendCubeHostConfig => {
50
- const { config } = applicationStore;
51
- return {
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,
61
- // the stereotype Studio and Marketplace mark groups open to everyone with
62
- enterpriseStereotype: config.options.dataProductConfig?.publicStereotype
63
- ? {
64
- profile: config.options.dataProductConfig.publicStereotype.profile,
65
- value: config.options.dataProductConfig.publicStereotype.stereotype,
66
- }
67
- : undefined,
68
- // the environment Query remembers for the viewer, as Query's editor uses it
69
- getPreferredEnvironment: () =>
70
- LegendQueryUserDataHelper.getLakehouseUserInfo(
71
- applicationStore.userDataService,
72
- )?.env,
73
- };
74
- };
75
-
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 = (
82
- applicationStore: LegendQueryApplicationStore,
83
- ): CubeLakehouseServices | undefined =>
84
- buildLegendCubeLakehouseServices(
85
- applicationStore,
86
- buildLegendQueryCubeHostConfig(applicationStore),
87
- );
88
-
89
- /**
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.
93
- */
94
- export class LegendQueryCubeHost extends LegendCubeHost {
95
- /**
96
- * Tests give an engine, an explorer and a project catalog; otherwise each
97
- * is built from Query's config
98
- */
99
- constructor(
100
- applicationStore: LegendQueryApplicationStore,
101
- engine?: CubeEngine,
102
- connectionExplorer?: CubeConnectionExplorer,
103
- projectCatalog?: CubeProjectCatalog,
104
- ) {
105
- super(applicationStore, buildLegendQueryCubeHostConfig(applicationStore), {
106
- engine,
107
- connectionExplorer,
108
- projectCatalog,
109
- });
110
- }
111
- }