@finos/legend-extension-dsl-data-space 10.4.256 → 10.4.258

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 (86) hide show
  1. package/lib/components/DataSpaceDataAccess.d.ts +1 -1
  2. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -1
  3. package/lib/components/DataSpaceDataAccess.js +7 -16
  4. package/lib/components/DataSpaceDataAccess.js.map +1 -1
  5. package/lib/components/DataSpaceDescription.d.ts.map +1 -1
  6. package/lib/components/DataSpaceDescription.js +2 -6
  7. package/lib/components/DataSpaceDescription.js.map +1 -1
  8. package/lib/components/DataSpaceExecutionContextViewer.d.ts +14 -0
  9. package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -1
  10. package/lib/components/DataSpaceExecutionContextViewer.js +23 -23
  11. package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -1
  12. package/lib/components/DataSpaceQualityEmote.d.ts.map +1 -1
  13. package/lib/components/DataSpaceQualityEmote.js +6 -4
  14. package/lib/components/DataSpaceQualityEmote.js.map +1 -1
  15. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
  16. package/lib/components/DataSpaceQuickStart.js +90 -22
  17. package/lib/components/DataSpaceQuickStart.js.map +1 -1
  18. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  19. package/lib/components/DataSpaceViewer.js +27 -9
  20. package/lib/components/DataSpaceViewer.js.map +1 -1
  21. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
  22. package/lib/components/DataSpaceViewerActivityBar.js +9 -5
  23. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
  24. package/lib/components/__test-utils__/DataSpaceViewerTestUtils.d.ts +1 -1
  25. package/lib/components/__test-utils__/DataSpaceViewerTestUtils.d.ts.map +1 -1
  26. package/lib/components/__test-utils__/DataSpaceViewerTestUtils.js.map +1 -1
  27. package/lib/components/query-builder/DataSpaceQueryBuilder.d.ts.map +1 -1
  28. package/lib/components/query-builder/DataSpaceQueryBuilder.js +24 -15
  29. package/lib/components/query-builder/DataSpaceQueryBuilder.js.map +1 -1
  30. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts +16 -0
  31. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  32. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js +16 -0
  33. package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +31 -2
  36. package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +18 -0
  38. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +48 -0
  40. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/package.json +1 -1
  44. package/lib/stores/{DataSpaceMappingProviderAccessState.d.ts → DataSpaceDataProductAccessState.d.ts} +16 -10
  45. package/lib/stores/DataSpaceDataProductAccessState.d.ts.map +1 -0
  46. package/lib/stores/{DataSpaceMappingProviderAccessState.js → DataSpaceDataProductAccessState.js} +27 -16
  47. package/lib/stores/DataSpaceDataProductAccessState.js.map +1 -0
  48. package/lib/stores/DataSpaceLayoutState.d.ts +7 -34
  49. package/lib/stores/DataSpaceLayoutState.d.ts.map +1 -1
  50. package/lib/stores/DataSpaceLayoutState.js +22 -159
  51. package/lib/stores/DataSpaceLayoutState.js.map +1 -1
  52. package/lib/stores/DataSpaceViewerDiagramViewerState.js +1 -2
  53. package/lib/stores/DataSpaceViewerDiagramViewerState.js.map +1 -1
  54. package/lib/stores/DataSpaceViewerState.d.ts +54 -24
  55. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  56. package/lib/stores/DataSpaceViewerState.js +139 -55
  57. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  58. package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
  59. package/lib/stores/query/DataSpaceAdvancedSearchState.js +7 -1
  60. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  61. package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts +2 -0
  62. package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts.map +1 -1
  63. package/lib/stores/query-builder/DataSpaceQueryBuilderState.js +36 -9
  64. package/lib/stores/query-builder/DataSpaceQueryBuilderState.js.map +1 -1
  65. package/package.json +14 -14
  66. package/src/components/DataSpaceDataAccess.tsx +26 -68
  67. package/src/components/DataSpaceDescription.tsx +8 -41
  68. package/src/components/DataSpaceExecutionContextViewer.tsx +68 -69
  69. package/src/components/DataSpaceQualityEmote.tsx +6 -4
  70. package/src/components/DataSpaceQuickStart.tsx +284 -114
  71. package/src/components/DataSpaceViewer.tsx +83 -45
  72. package/src/components/DataSpaceViewerActivityBar.tsx +11 -7
  73. package/src/components/__test-utils__/DataSpaceViewerTestUtils.ts +1 -6
  74. package/src/components/query-builder/DataSpaceQueryBuilder.tsx +117 -101
  75. package/src/graph-manager/action/analytics/DataSpaceAnalysis.ts +19 -0
  76. package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +37 -0
  77. package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +85 -0
  78. package/src/stores/{DataSpaceMappingProviderAccessState.ts → DataSpaceDataProductAccessState.ts} +40 -18
  79. package/src/stores/DataSpaceLayoutState.ts +25 -209
  80. package/src/stores/DataSpaceViewerDiagramViewerState.ts +1 -1
  81. package/src/stores/DataSpaceViewerState.ts +188 -88
  82. package/src/stores/query/DataSpaceAdvancedSearchState.ts +9 -2
  83. package/src/stores/query-builder/DataSpaceQueryBuilderState.ts +48 -12
  84. package/tsconfig.json +1 -1
  85. package/lib/stores/DataSpaceMappingProviderAccessState.d.ts.map +0 -1
  86. package/lib/stores/DataSpaceMappingProviderAccessState.js.map +0 -1
@@ -38,8 +38,6 @@ import {
38
38
  resolveUsableDataSpaceClasses,
39
39
  } from '../../stores/query-builder/DataSpaceQueryBuilderState.js';
40
40
  import {
41
- buildRuntimeValueOption,
42
- getRuntimeOptionFormatter,
43
41
  QueryBuilderClassSelector,
44
42
  type EntityWithOriginOption,
45
43
  } from '@finos/legend-query-builder';
@@ -99,7 +97,9 @@ const resolveExecutionContextRuntimes = (
99
97
  const executionContext = Array.from(
100
98
  queryBuilderState.dataSpaceAnalysisResult.executionContextsIndex.values(),
101
99
  ).find((e) => e.mapping.path === currentMapping.path);
102
- return guaranteeNonNullable(executionContext).compatibleRuntimes;
100
+ if (executionContext) {
101
+ return executionContext.compatibleRuntimes;
102
+ }
103
103
  }
104
104
  return getMappingCompatibleRuntimes(
105
105
  currentMapping,
@@ -212,19 +212,27 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
212
212
  };
213
213
 
214
214
  // runtime
215
+ const buildRuntimePointerOption = (
216
+ runtime: PackageableRuntime,
217
+ ): { label: string; value: Runtime } => ({
218
+ label: runtime.name,
219
+ value: new RuntimePointer(
220
+ PackageableElementExplicitReference.create(runtime),
221
+ ),
222
+ });
215
223
  const runtimeOptions = resolveExecutionContextRuntimes(queryBuilderState)
216
- .map(
217
- (rt) =>
218
- new RuntimePointer(PackageableElementExplicitReference.create(rt)),
219
- )
220
- .map(buildRuntimeValueOption)
224
+ .map(buildRuntimePointerOption)
221
225
  .sort(compareLabelFn);
222
- const selectedRuntimeOption = queryBuilderState.executionContextState
223
- .runtimeValue
224
- ? buildRuntimeValueOption(
225
- queryBuilderState.executionContextState.runtimeValue,
226
- )
227
- : null;
226
+ const selectedRuntimeOption =
227
+ queryBuilderState.executionContextState.runtimeValue instanceof
228
+ RuntimePointer
229
+ ? {
230
+ label:
231
+ queryBuilderState.executionContextState.runtimeValue
232
+ .packageableRuntime.value.name,
233
+ value: queryBuilderState.executionContextState.runtimeValue,
234
+ }
235
+ : null;
228
236
  const changeRuntime = (option: { value: Runtime }): void => {
229
237
  if (
230
238
  option.value === queryBuilderState.executionContextState.runtimeValue
@@ -282,22 +290,24 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
282
290
  title="Show Settings..."
283
291
  content={
284
292
  <MenuContent>
285
- <MenuContentItem
286
- onClick={(): void =>
287
- queryBuilderState.setShowRuntimeSelector(
288
- !queryBuilderState.showRuntimeSelector,
289
- )
290
- }
291
- >
292
- <MenuContentItemIcon>
293
- {queryBuilderState.showRuntimeSelector ? (
294
- <CheckIcon />
295
- ) : null}
296
- </MenuContentItemIcon>
297
- <MenuContentItemLabel>
298
- Show Runtime Selector
299
- </MenuContentItemLabel>
300
- </MenuContentItem>
293
+ {!queryBuilderState.executionContext.defaultRuntime && (
294
+ <MenuContentItem
295
+ onClick={(): void =>
296
+ queryBuilderState.setShowRuntimeSelector(
297
+ !queryBuilderState.showRuntimeSelector,
298
+ )
299
+ }
300
+ >
301
+ <MenuContentItemIcon>
302
+ {queryBuilderState.showRuntimeSelector ? (
303
+ <CheckIcon />
304
+ ) : null}
305
+ </MenuContentItemIcon>
306
+ <MenuContentItemLabel>
307
+ Show Runtime Selector
308
+ </MenuContentItemLabel>
309
+ </MenuContentItem>
310
+ )}
301
311
  </MenuContent>
302
312
  }
303
313
  menuProps={{
@@ -310,48 +320,52 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
310
320
  </PanelHeaderActions>
311
321
  </PanelHeader>
312
322
  <div className="query-builder__setup__config-group__content">
313
- <div className="query-builder__setup__config-group__item">
314
- <label
315
- className="btn--sm query-builder__setup__config-group__data-product"
316
- title="data space"
317
- htmlFor="query-builder__setup__data-space-selector"
318
- >
319
- Data Space
320
- </label>
321
- <CustomSelectorInput
322
- inputId="query-builder__setup__data-space-selector"
323
- className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
324
- options={allOptions}
325
- isLoading={queryBuilderState.loadEntitiesState.isInProgress}
326
- onChange={onDataSpaceOptionChange}
327
- value={selectedDataSpaceOption}
328
- placeholder="Search for data space..."
329
- escapeClearsValue={true}
330
- darkMode={
331
- !applicationStore.layoutService
332
- .TEMPORARY__isLightColorThemeEnabled
333
- }
334
- formatOptionLabel={formatDataSpaceOptionLabel}
335
- />
336
- {queryBuilderState.isAdvancedDataSpaceSearchEnabled && (
337
- <>
338
- <button
339
- tabIndex={-1}
340
- className="query-builder__setup__data-space-searcher__btn btn--dark"
341
- onClick={openDataSpaceAdvancedSearch}
342
- title="Open advanced search for data space..."
343
- >
344
- <SearchIcon />
345
- </button>
346
- {queryBuilderState.advancedSearchState && (
347
- <DataSpaceAdvancedSearchModal
348
- searchState={queryBuilderState.advancedSearchState}
349
- onClose={() => queryBuilderState.hideAdvancedSearchPanel()}
350
- />
351
- )}
352
- </>
353
- )}
354
- </div>
323
+ {!queryBuilderState.restrictToCurrentDataSpace && (
324
+ <div className="query-builder__setup__config-group__item">
325
+ <label
326
+ className="btn--sm query-builder__setup__config-group__data-product"
327
+ title="data space"
328
+ htmlFor="query-builder__setup__data-space-selector"
329
+ >
330
+ Data Space
331
+ </label>
332
+ <CustomSelectorInput
333
+ inputId="query-builder__setup__data-space-selector"
334
+ className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
335
+ options={allOptions}
336
+ isLoading={queryBuilderState.loadEntitiesState.isInProgress}
337
+ onChange={onDataSpaceOptionChange}
338
+ value={selectedDataSpaceOption}
339
+ placeholder="Search for data space..."
340
+ escapeClearsValue={true}
341
+ darkMode={
342
+ !applicationStore.layoutService
343
+ .TEMPORARY__isLightColorThemeEnabled
344
+ }
345
+ formatOptionLabel={formatDataSpaceOptionLabel}
346
+ />
347
+ {queryBuilderState.isAdvancedDataSpaceSearchEnabled && (
348
+ <>
349
+ <button
350
+ tabIndex={-1}
351
+ className="query-builder__setup__data-space-searcher__btn btn--dark"
352
+ onClick={openDataSpaceAdvancedSearch}
353
+ title="Open advanced search for data space..."
354
+ >
355
+ <SearchIcon />
356
+ </button>
357
+ {queryBuilderState.advancedSearchState && (
358
+ <DataSpaceAdvancedSearchModal
359
+ searchState={queryBuilderState.advancedSearchState}
360
+ onClose={() =>
361
+ queryBuilderState.hideAdvancedSearchPanel()
362
+ }
363
+ />
364
+ )}
365
+ </>
366
+ )}
367
+ </div>
368
+ )}
355
369
  {Boolean(showExecutionContextOptions) && (
356
370
  <div className="query-builder__setup__config-group__item">
357
371
  <label
@@ -381,36 +395,38 @@ const DataSpaceQueryBuilderSetupPanelContent = observer(
381
395
  />
382
396
  </div>
383
397
  )}
384
- {queryBuilderState.showRuntimeSelector && (
385
- <div className="query-builder__setup__config-group__item">
386
- <label
387
- className="btn--sm query-builder__setup__config-group__item__label"
388
- title="runtime"
389
- htmlFor="query-builder__setup__runtime-selector"
390
- >
391
- Runtime
392
- </label>
393
- <CustomSelectorInput
394
- inputId="query-builder__setup__runtime-selector"
395
- className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
396
- placeholder="Choose a runtime..."
397
- noMatchMessage="No compatible runtime found for specified execution context"
398
- options={runtimeOptions}
399
- onChange={changeRuntime}
400
- value={selectedRuntimeOption}
401
- darkMode={
402
- !applicationStore.layoutService
403
- .TEMPORARY__isLightColorThemeEnabled
404
- }
405
- filterOption={runtimeFilterOption}
406
- formatOptionLabel={getRuntimeOptionFormatter({
407
- darkMode:
398
+ {queryBuilderState.showRuntimeSelector &&
399
+ !queryBuilderState.executionContext.defaultRuntime && (
400
+ <div className="query-builder__setup__config-group__item">
401
+ <label
402
+ className="btn--sm query-builder__setup__config-group__item__label"
403
+ title="runtime"
404
+ htmlFor="query-builder__setup__runtime-selector"
405
+ >
406
+ Runtime
407
+ </label>
408
+ <CustomSelectorInput
409
+ inputId="query-builder__setup__runtime-selector"
410
+ className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
411
+ placeholder={
412
+ runtimeOptions.length === 0
413
+ ? 'No compatible runtimes available'
414
+ : 'Choose a runtime...'
415
+ }
416
+ noMatchMessage="No compatible runtime found for specified execution context"
417
+ options={runtimeOptions}
418
+ disabled={runtimeOptions.length < 1}
419
+ onChange={changeRuntime}
420
+ value={selectedRuntimeOption}
421
+ hasError={runtimeOptions.length === 0}
422
+ darkMode={
408
423
  !applicationStore.layoutService
409
- .TEMPORARY__isLightColorThemeEnabled,
410
- })}
411
- />
412
- </div>
413
- )}
424
+ .TEMPORARY__isLightColorThemeEnabled
425
+ }
426
+ filterOption={runtimeFilterOption}
427
+ />
428
+ </div>
429
+ )}
414
430
  <div className="query-builder__setup__config-group__item">
415
431
  <QueryBuilderClassSelector
416
432
  queryBuilderState={queryBuilderState}
@@ -126,6 +126,14 @@ export class DataSpaceExecutableTDSResult extends DataSpaceExecutableResult {
126
126
  columns: DataSpaceExecutableTDSResultColumn[] = [];
127
127
  }
128
128
 
129
+ export abstract class DataSpaceExecutableAccessorInfo {}
130
+
131
+ export class LakehouseDataProductExecutableAccessorInfo extends DataSpaceExecutableAccessorInfo {
132
+ dataProductPath!: string;
133
+ accessPointGroupId!: string;
134
+ accessPointId!: string;
135
+ }
136
+
129
137
  export class DataSpaceExecutableAnalysisResult {
130
138
  readonly uuid = uuid();
131
139
  title!: string;
@@ -134,6 +142,15 @@ export class DataSpaceExecutableAnalysisResult {
134
142
  info?: DataSpaceExecutableInfo | undefined;
135
143
  result?: DataSpaceExecutableResult | undefined;
136
144
  executableReturnType?: GenericType | undefined;
145
+ executableAccessorInfo: DataSpaceExecutableAccessorInfo[] = [];
146
+ }
147
+
148
+ export abstract class DataSpaceReferencesMetadata {}
149
+
150
+ export class DataproductReferenceMetadata extends DataSpaceReferencesMetadata {
151
+ dataproductPath!: string;
152
+ production?: string | undefined;
153
+ prodParallel?: string | undefined;
137
154
  }
138
155
 
139
156
  export class DataSpaceAnalysisResult {
@@ -171,6 +188,8 @@ export class DataSpaceAnalysisResult {
171
188
  functionInfos?: Map<string, FunctionAnalysisInfo>;
172
189
  dependencyFunctionInfos?: Map<string, FunctionAnalysisInfo>;
173
190
 
191
+ dataSpaceReferencesMetadataInfo: DataSpaceReferencesMetadata[] = [];
192
+
174
193
  __INTERNAL__useRelationTDS = false;
175
194
 
176
195
  get displayName(): string {
@@ -103,6 +103,8 @@ import {
103
103
  DataSpaceFunctionPointerExecutableInfo,
104
104
  DataSpaceExecutionContextRuntimeMetadata,
105
105
  DataSpaceMappingProviderAnalysisResult,
106
+ DataproductReferenceMetadata,
107
+ LakehouseDataProductExecutableAccessorInfo,
106
108
  } from '../../../action/analytics/DataSpaceAnalysis.js';
107
109
  import { DiagramAnalysisResult } from '@finos/legend-extension-dsl-diagram';
108
110
  import { DSL_DataSpace_PureGraphManagerExtension } from '../DSL_DataSpace_PureGraphManagerExtension.js';
@@ -117,6 +119,8 @@ import {
117
119
  V1_DataSpaceMultiExecutionServiceExecutableInfo,
118
120
  V1_DataSpaceTemplateExecutableInfo,
119
121
  V1_DataSpaceFunctionPointerExecutableInfo,
122
+ V1_DataproductReferenceMetadata,
123
+ V1_LakehouseDataProductExecutableAccessorInfo,
120
124
  } from './engine/analytics/V1_DataSpaceAnalysis.js';
121
125
  import { getDiagram } from '@finos/legend-extension-dsl-diagram/graph';
122
126
  import { resolveVersion } from '@finos/legend-server-depot';
@@ -1249,10 +1253,43 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
1249
1253
  );
1250
1254
  }
1251
1255
  }
1256
+ executable.executableAccessorInfo =
1257
+ executableProtocol.executableAccessorInfo
1258
+ .map((accessorInfoProtocol) => {
1259
+ if (
1260
+ accessorInfoProtocol instanceof
1261
+ V1_LakehouseDataProductExecutableAccessorInfo
1262
+ ) {
1263
+ const accessorInfo =
1264
+ new LakehouseDataProductExecutableAccessorInfo();
1265
+ accessorInfo.dataProductPath =
1266
+ accessorInfoProtocol.dataProductPath;
1267
+ accessorInfo.accessPointGroupId =
1268
+ accessorInfoProtocol.accessPointGroupId;
1269
+ accessorInfo.accessPointId = accessorInfoProtocol.accessPointId;
1270
+ return accessorInfo;
1271
+ }
1272
+ return undefined;
1273
+ })
1274
+ .filter(isNonNullable);
1252
1275
  return executable;
1253
1276
  },
1254
1277
  );
1255
1278
 
1279
+ result.dataSpaceReferencesMetadataInfo =
1280
+ analysisResult.dataSpaceReferencesMetadataInfo
1281
+ .map((metadataProtocol) => {
1282
+ if (metadataProtocol instanceof V1_DataproductReferenceMetadata) {
1283
+ const metadata = new DataproductReferenceMetadata();
1284
+ metadata.dataproductPath = metadataProtocol.dataproductPath;
1285
+ metadata.production = metadataProtocol.production;
1286
+ metadata.prodParallel = metadataProtocol.prodParallel;
1287
+ return metadata;
1288
+ }
1289
+ return undefined;
1290
+ })
1291
+ .filter(isNonNullable);
1292
+
1256
1293
  result.mappingToMappingCoverageResult = mappingToMappingCoverageResult;
1257
1294
 
1258
1295
  return result;
@@ -510,6 +510,44 @@ const V1_deserializeDataSpaceExecutableResult = (
510
510
  }
511
511
  };
512
512
 
513
+ export abstract class V1_DataSpaceExecutableAccessorInfo {}
514
+
515
+ const V1_DATA_SPACE_LAKEHOUSE_DATA_PRODUCT_EXECUTABLE_ACCESSOR_INFO_TYPE =
516
+ 'lakehouseDataProductExecutableAccessorInfo';
517
+
518
+ export class V1_LakehouseDataProductExecutableAccessorInfo extends V1_DataSpaceExecutableAccessorInfo {
519
+ dataProductPath!: string;
520
+ accessPointGroupId!: string;
521
+ accessPointId!: string;
522
+
523
+ static readonly serialization = new SerializationFactory(
524
+ createModelSchema(V1_LakehouseDataProductExecutableAccessorInfo, {
525
+ _type: usingConstantValueSchema(
526
+ V1_DATA_SPACE_LAKEHOUSE_DATA_PRODUCT_EXECUTABLE_ACCESSOR_INFO_TYPE,
527
+ ),
528
+ accessPointGroupId: primitive(),
529
+ accessPointId: primitive(),
530
+ dataProductPath: primitive(),
531
+ }),
532
+ );
533
+ }
534
+
535
+ const V1_deserializeDataSpaceExecutableAccessorInfo = (
536
+ json: PlainObject<V1_DataSpaceExecutableAccessorInfo>,
537
+ ): V1_DataSpaceExecutableAccessorInfo => {
538
+ switch (json._type) {
539
+ case V1_DATA_SPACE_LAKEHOUSE_DATA_PRODUCT_EXECUTABLE_ACCESSOR_INFO_TYPE:
540
+ return deserialize(
541
+ V1_LakehouseDataProductExecutableAccessorInfo.serialization.schema,
542
+ json,
543
+ );
544
+ default:
545
+ throw new UnsupportedOperationError(
546
+ `Can't deserialize data space executable accessor info of type '${json._type}'`,
547
+ );
548
+ }
549
+ };
550
+
513
551
  export class V1_DataSpaceExecutableAnalysisResult {
514
552
  title!: string;
515
553
  description?: string | undefined;
@@ -517,6 +555,7 @@ export class V1_DataSpaceExecutableAnalysisResult {
517
555
  info?: V1_DataSpaceExecutableInfo | undefined;
518
556
  result?: V1_DataSpaceExecutableResult | undefined;
519
557
  executableReturnType?: V1_GenericType | undefined;
558
+ executableAccessorInfo: V1_DataSpaceExecutableAccessorInfo[] = [];
520
559
  }
521
560
 
522
561
  const V1_dataSpaceExecutableAnalysisResultModelSchema = (
@@ -525,6 +564,9 @@ const V1_dataSpaceExecutableAnalysisResultModelSchema = (
525
564
  createModelSchema(V1_DataSpaceExecutableAnalysisResult, {
526
565
  executable: optional(primitive()),
527
566
  description: optional(primitive()),
567
+ executableAccessorInfo: list(
568
+ custom(() => SKIP, V1_deserializeDataSpaceExecutableAccessorInfo),
569
+ ),
528
570
  info: optionalCustom(
529
571
  () => SKIP,
530
572
  (val: PlainObject<V1_DataSpaceExecutableInfo>) =>
@@ -538,6 +580,44 @@ const V1_dataSpaceExecutableAnalysisResultModelSchema = (
538
580
  ),
539
581
  });
540
582
 
583
+ export abstract class V1_DataSpaceReferencesMetadata {}
584
+
585
+ const V1_DATA_SPACE_DATAPRODUCT_REFERENCE_METADATA_TYPE =
586
+ 'dataproductReferenceMetadata';
587
+
588
+ export class V1_DataproductReferenceMetadata extends V1_DataSpaceReferencesMetadata {
589
+ dataproductPath!: string;
590
+ production?: string | undefined;
591
+ prodParallel?: string | undefined;
592
+
593
+ static readonly serialization = new SerializationFactory(
594
+ createModelSchema(V1_DataproductReferenceMetadata, {
595
+ _type: usingConstantValueSchema(
596
+ V1_DATA_SPACE_DATAPRODUCT_REFERENCE_METADATA_TYPE,
597
+ ),
598
+ dataproductPath: primitive(),
599
+ prodParallel: optional(primitive()),
600
+ production: optional(primitive()),
601
+ }),
602
+ );
603
+ }
604
+
605
+ const V1_deserializeDataSpaceReferencesMetadata = (
606
+ json: PlainObject<V1_DataSpaceReferencesMetadata>,
607
+ ): V1_DataSpaceReferencesMetadata => {
608
+ switch (json._type) {
609
+ case V1_DATA_SPACE_DATAPRODUCT_REFERENCE_METADATA_TYPE:
610
+ return deserialize(
611
+ V1_DataproductReferenceMetadata.serialization.schema,
612
+ json,
613
+ );
614
+ default:
615
+ throw new UnsupportedOperationError(
616
+ `Can't deserialize data space references metadata of type '${json._type}'`,
617
+ );
618
+ }
619
+ };
620
+
541
621
  export class V1_DataSpaceAnalysisResult {
542
622
  name!: string;
543
623
  package!: string;
@@ -566,6 +646,8 @@ export class V1_DataSpaceAnalysisResult {
566
646
  string,
567
647
  V1_MappingModelCoverageAnalysisResult
568
648
  >;
649
+
650
+ dataSpaceReferencesMetadataInfo: V1_DataSpaceReferencesMetadata[] = [];
569
651
  }
570
652
 
571
653
  export const V1_dataSpaceAnalysisResultModelSchema = (
@@ -625,6 +707,9 @@ export const V1_dataSpaceAnalysisResultModelSchema = (
625
707
  ),
626
708
  ),
627
709
  ),
710
+ dataSpaceReferencesMetadataInfo: list(
711
+ custom(() => SKIP, V1_deserializeDataSpaceReferencesMetadata),
712
+ ),
628
713
  });
629
714
 
630
715
  export const V1_deserializeDataSpaceAnalysisResult = (
@@ -39,7 +39,14 @@ import {
39
39
  guaranteeType,
40
40
  LogEvent,
41
41
  } from '@finos/legend-shared';
42
- import { action, flow, flowResult, makeObservable, observable } from 'mobx';
42
+ import {
43
+ action,
44
+ computed,
45
+ flow,
46
+ flowResult,
47
+ makeObservable,
48
+ observable,
49
+ } from 'mobx';
43
50
  import {
44
51
  type DataProductConfig,
45
52
  type DataProductDataAccess_LegendApplicationPlugin_Extension,
@@ -47,7 +54,7 @@ import {
47
54
  type DataProductAPGState,
48
55
  DataProductDataAccessState,
49
56
  DataProductViewerState,
50
- resolveEntitlementsDataProductFromSDLC,
57
+ resolveEntitlementsDataProductByDID,
51
58
  } from '@finos/legend-extension-dsl-data-product';
52
59
 
53
60
  export type DataSpaceMappingProviderAccessConfig = {
@@ -65,18 +72,23 @@ export type DataSpaceMappingProviderAccessConfig = {
65
72
  };
66
73
 
67
74
  /**
68
- * Backing state for the DataSpace viewer's "Request Access" flow on
69
- * mappingProvider execution contexts. Lazily resolves the referenced Lakehouse
70
- * DataProduct from the depot artifact generation for the DataSpace's own GAV,
71
- * then materializes the same viewer + data-access state stack that the LH
72
- * DataProduct viewer uses so that the access-request button and its dialogs
73
- * can be rendered as-is.
75
+ * Backing state for the DataSpace viewer's "Request Access" flow against a
76
+ * single referenced Lakehouse Data Product. Serves both the mappingProvider
77
+ * execution context entry and the per-executable accessor panels.
78
+ *
79
+ * The Lakehouse deployment id is supplied by the caller (it comes from the
80
+ * DataSpace analytics' `dataSpaceReferencesMetadataInfo`), so this state
81
+ * resolves the Data Product straight from Lakehouse without a depot
82
+ * artifact-generation lookup. It then materializes the same viewer +
83
+ * data-access state stack that the Lakehouse DataProduct viewer uses, so the
84
+ * access-request button and its dialogs can be rendered as-is.
74
85
  */
75
- export class DataSpaceMappingProviderAccessState {
86
+ export class DataSpaceDataProductAccessState {
76
87
  readonly applicationStore: GenericLegendApplicationStore;
77
88
  readonly graphManagerState: GraphManagerState;
78
89
  readonly gav: ProjectGAVCoordinates;
79
- readonly mappingProviderPath: string;
90
+ readonly dataProductPath: string;
91
+ readonly deploymentId: number;
80
92
  readonly config: DataSpaceMappingProviderAccessConfig;
81
93
 
82
94
  readonly initializingState = ActionState.create();
@@ -90,7 +102,8 @@ export class DataSpaceMappingProviderAccessState {
90
102
  applicationStore: GenericLegendApplicationStore,
91
103
  graphManagerState: GraphManagerState,
92
104
  gav: ProjectGAVCoordinates,
93
- mappingProviderPath: string,
105
+ dataProductPath: string,
106
+ deploymentId: number,
94
107
  config: DataSpaceMappingProviderAccessConfig,
95
108
  ) {
96
109
  makeObservable(this, {
@@ -102,15 +115,24 @@ export class DataSpaceMappingProviderAccessState {
102
115
  setDataAccessState: action,
103
116
  setModelAPGState: action,
104
117
  setErrorMessage: action,
118
+ isDataProductUnresolved: computed,
105
119
  initialize: flow,
106
120
  });
107
121
  this.applicationStore = applicationStore;
108
122
  this.graphManagerState = graphManagerState;
109
123
  this.gav = gav;
110
- this.mappingProviderPath = mappingProviderPath;
124
+ this.dataProductPath = dataProductPath;
125
+ this.deploymentId = deploymentId;
111
126
  this.config = config;
112
127
  }
113
128
 
129
+ get isDataProductUnresolved(): boolean {
130
+ return (
131
+ this.errorMessage !== undefined &&
132
+ this.dataProductViewerState === undefined
133
+ );
134
+ }
135
+
114
136
  setDataProductViewerState(val: DataProductViewerState | undefined): void {
115
137
  this.dataProductViewerState = val;
116
138
  }
@@ -141,14 +163,14 @@ export class DataSpaceMappingProviderAccessState {
141
163
  V1_PureGraphManager,
142
164
  'GraphManager must be a V1_PureGraphManager',
143
165
  );
144
- const resolved = (yield resolveEntitlementsDataProductFromSDLC(
145
- this.gav,
146
- this.mappingProviderPath,
166
+ const resolved = (yield resolveEntitlementsDataProductByDID(
167
+ this.dataProductPath,
168
+ this.deploymentId,
147
169
  this.config.depotServerClient,
148
170
  this.config.lakehouseContractServerClient,
149
171
  graphManager,
150
172
  this.config.tokenProvider,
151
- )) as Awaited<ReturnType<typeof resolveEntitlementsDataProductFromSDLC>>;
173
+ )) as Awaited<ReturnType<typeof resolveEntitlementsDataProductByDID>>;
152
174
  const dataProductViewerState = new DataProductViewerState(
153
175
  resolved.dataProduct,
154
176
  this.applicationStore,
@@ -177,7 +199,7 @@ export class DataSpaceMappingProviderAccessState {
177
199
  const modelAPG = dataProductViewerState.getModelAccessPointGroup();
178
200
  if (!modelAPG) {
179
201
  this.setErrorMessage(
180
- `Data Product '${this.mappingProviderPath}' has no model access point group.`,
202
+ `Data Product '${this.dataProductPath}' has no model access point group.`,
181
203
  );
182
204
  } else {
183
205
  const modelAPGState = dataProductViewerState.apgStates.find(
@@ -190,7 +212,7 @@ export class DataSpaceMappingProviderAccessState {
190
212
  assertErrorThrown(error);
191
213
  this.applicationStore.logService.warn(
192
214
  LogEvent.create(APPLICATION_EVENT.GENERIC_FAILURE),
193
- `Failed to initialize DataSpace mapping provider access for '${this.mappingProviderPath}' (${this.gav.groupId}:${this.gav.artifactId}:${this.gav.versionId}): ${error.message}`,
215
+ `Failed to initialize DataSpace Data Product access for '${this.dataProductPath}' (${this.gav.groupId}:${this.gav.artifactId}:${this.gav.versionId}): ${error.message}`,
194
216
  );
195
217
  this.setErrorMessage(error.message);
196
218
  } finally {