@finos/legend-application-marketplace 0.2.13 → 0.2.15

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 (120) hide show
  1. package/lib/__lib__/LegendMarketplaceNavigation.d.ts +2 -0
  2. package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendMarketplaceNavigation.js +4 -0
  4. package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
  5. package/lib/application/LegendMarketplaceApplicationConfig.d.ts +9 -0
  6. package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendMarketplaceApplicationConfig.js +40 -22
  8. package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
  9. package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
  10. package/lib/application/LegendMarketplaceWebApplication.js +4 -1
  11. package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
  12. package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.d.ts.map +1 -1
  13. package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js +7 -0
  14. package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js.map +1 -1
  15. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts +21 -0
  16. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts.map +1 -0
  17. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js +29 -0
  18. package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js.map +1 -0
  19. package/lib/index.css +2 -2
  20. package/lib/index.css.map +1 -1
  21. package/lib/package.json +1 -1
  22. package/lib/pages/Agents/LegendMarketplaceAgents.d.ts.map +1 -1
  23. package/lib/pages/Agents/LegendMarketplaceAgents.js +49 -17
  24. package/lib/pages/Agents/LegendMarketplaceAgents.js.map +1 -1
  25. package/lib/pages/Agents/MarketplaceAIChatView.d.ts +21 -0
  26. package/lib/pages/Agents/MarketplaceAIChatView.d.ts.map +1 -0
  27. package/lib/pages/Agents/MarketplaceAIChatView.js +141 -0
  28. package/lib/pages/Agents/MarketplaceAIChatView.js.map +1 -0
  29. package/lib/pages/Agents/MarketplaceAIInputBar.d.ts +22 -0
  30. package/lib/pages/Agents/MarketplaceAIInputBar.d.ts.map +1 -0
  31. package/lib/pages/Agents/MarketplaceAIInputBar.js +40 -0
  32. package/lib/pages/Agents/MarketplaceAIInputBar.js.map +1 -0
  33. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts +25 -0
  34. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts.map +1 -0
  35. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js +86 -0
  36. package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js.map +1 -0
  37. package/lib/pages/Agents/MarketplaceAIProductCards.d.ts +23 -0
  38. package/lib/pages/Agents/MarketplaceAIProductCards.d.ts.map +1 -0
  39. package/lib/pages/Agents/MarketplaceAIProductCards.js +20 -0
  40. package/lib/pages/Agents/MarketplaceAIProductCards.js.map +1 -0
  41. package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts +19 -0
  42. package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts.map +1 -0
  43. package/lib/pages/Agents/MarketplaceAIScopeSelector.js +46 -0
  44. package/lib/pages/Agents/MarketplaceAIScopeSelector.js.map +1 -0
  45. package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
  46. package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +74 -63
  47. package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js.map +1 -1
  48. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.d.ts.map +1 -1
  49. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js +85 -69
  50. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js.map +1 -1
  51. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.d.ts.map +1 -1
  52. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js +7 -11
  53. package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
  54. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts +17 -0
  55. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts.map +1 -0
  56. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js +126 -0
  57. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js.map +1 -0
  58. package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.d.ts.map +1 -1
  59. package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js +23 -65
  60. package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js.map +1 -1
  61. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts +29 -0
  62. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts.map +1 -0
  63. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js +60 -0
  64. package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js.map +1 -0
  65. package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
  66. package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js +3 -8
  67. package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js.map +1 -1
  68. package/lib/stores/LegendMarketplaceBaseStore.d.ts +2 -1
  69. package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
  70. package/lib/stores/LegendMarketplaceBaseStore.js +8 -1
  71. package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
  72. package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts +109 -0
  73. package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts.map +1 -0
  74. package/lib/stores/ai/LegendMarketplaceAIChatStore.js +1106 -0
  75. package/lib/stores/ai/LegendMarketplaceAIChatStore.js.map +1 -0
  76. package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.d.ts.map +1 -1
  77. package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js +3 -2
  78. package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js.map +1 -1
  79. package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts +1 -1
  80. package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts.map +1 -1
  81. package/lib/stores/lakehouse/dataProducts/ProductCardState.js +1 -2
  82. package/lib/stores/lakehouse/dataProducts/ProductCardState.js.map +1 -1
  83. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +30 -3
  84. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
  85. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +94 -16
  86. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
  87. package/lib/utils/EntitlementsUtils.d.ts +36 -2
  88. package/lib/utils/EntitlementsUtils.d.ts.map +1 -1
  89. package/lib/utils/EntitlementsUtils.js +225 -46
  90. package/lib/utils/EntitlementsUtils.js.map +1 -1
  91. package/lib/utils/SearchUtils.d.ts.map +1 -1
  92. package/lib/utils/SearchUtils.js +7 -4
  93. package/lib/utils/SearchUtils.js.map +1 -1
  94. package/package.json +10 -10
  95. package/src/__lib__/LegendMarketplaceNavigation.ts +11 -0
  96. package/src/application/LegendMarketplaceApplicationConfig.ts +62 -24
  97. package/src/application/LegendMarketplaceWebApplication.tsx +15 -0
  98. package/src/application/__test-utils__/LegendMarketplaceApplicationTestUtils.ts +7 -0
  99. package/src/application/providers/LegendMarketplaceAIChatStoreProvider.tsx +47 -0
  100. package/src/pages/Agents/LegendMarketplaceAgents.tsx +145 -23
  101. package/src/pages/Agents/MarketplaceAIChatView.tsx +555 -0
  102. package/src/pages/Agents/MarketplaceAIInputBar.tsx +91 -0
  103. package/src/pages/Agents/MarketplaceAIProductAutosuggest.tsx +181 -0
  104. package/src/pages/Agents/MarketplaceAIProductCards.tsx +111 -0
  105. package/src/pages/Agents/MarketplaceAIScopeSelector.tsx +84 -0
  106. package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +131 -136
  107. package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +158 -165
  108. package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +12 -17
  109. package/src/pages/Lakehouse/entitlements/PermitDataAccessRequest.tsx +245 -0
  110. package/src/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.tsx +25 -94
  111. package/src/pages/Lakehouse/entitlements/showTaskActionAlert.tsx +101 -0
  112. package/src/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.tsx +27 -31
  113. package/src/stores/LegendMarketplaceBaseStore.ts +12 -0
  114. package/src/stores/ai/LegendMarketplaceAIChatStore.ts +1720 -0
  115. package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +6 -0
  116. package/src/stores/lakehouse/dataProducts/ProductCardState.ts +3 -4
  117. package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +181 -48
  118. package/src/utils/EntitlementsUtils.tsx +341 -86
  119. package/src/utils/SearchUtils.tsx +7 -4
  120. package/tsconfig.json +9 -0
@@ -77,6 +77,7 @@ import {
77
77
  EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl,
78
78
  generateLakehouseDataProductPath,
79
79
  generateContractPagePath,
80
+ generatePermitDataAccessRequestPagePath,
80
81
  } from '../../__lib__/LegendMarketplaceNavigation.js';
81
82
  import {
82
83
  DataSpaceViewerState,
@@ -443,7 +444,12 @@ export class LegendMarketplaceProductViewerStore {
443
444
  this.marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
444
445
  generateLakehouseDataProductPath(_dataProductId, _deploymentId),
445
446
  ),
447
+ getTaskPageUrl: (id: string) =>
448
+ this.marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
449
+ generatePermitDataAccessRequestPagePath(id),
450
+ ),
446
451
  },
452
+ this.marketplaceBaseStore.permitWorkflowServerClient,
447
453
  );
448
454
  this.setDataProductViewer(dataProductViewerState);
449
455
  this.setDataProductDataAccess(dataProductDataAccessState);
@@ -67,7 +67,7 @@ export class ProductCardState {
67
67
  searchResult: DataProductSearchResult,
68
68
  graphManager: V1_PureGraphManager,
69
69
  vendorImageMap: ReadonlyMap<string, string>,
70
- usedImages?: Set<string> | undefined,
70
+ usedImages?: Set<string>,
71
71
  ) {
72
72
  makeObservable(this, {
73
73
  dataProductElement: observable,
@@ -87,8 +87,7 @@ export class ProductCardState {
87
87
  }
88
88
 
89
89
  get title(): string {
90
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
91
- return this.searchResult.dataProductTitle || this.dataProductId;
90
+ return this.searchResult.dataProductTitle ?? this.dataProductId;
92
91
  }
93
92
 
94
93
  get description(): string {
@@ -232,7 +231,7 @@ export class ProductCardState {
232
231
 
233
232
  private resolveDisplayImage(
234
233
  vendorImageMap: ReadonlyMap<string, string>,
235
- usedImages?: Set<string> | undefined,
234
+ usedImages?: Set<string>,
236
235
  ): string {
237
236
  const GENERIC_IMAGE_COUNT = 20;
238
237
  const guidUpper = this.guid.toUpperCase();
@@ -19,7 +19,9 @@ import {
19
19
  assertErrorThrown,
20
20
  guaranteeNonNullable,
21
21
  guaranteeType,
22
+ HttpStatus,
22
23
  isNonNullable,
24
+ NetworkClientError,
23
25
  type GeneratorFn,
24
26
  type PlainObject,
25
27
  } from '@finos/legend-shared';
@@ -28,7 +30,6 @@ import {
28
30
  type PureProtocolProcessorPlugin,
29
31
  type V1_DataProduct,
30
32
  type V1_EnrichedUserApprovalStatus,
31
- type V1_EntitlementsDataProductDetails,
32
33
  type V1_LiteDataContract,
33
34
  type V1_LiteDataContractWithUserStatus,
34
35
  type V1_PendingTasksResponse,
@@ -38,6 +39,7 @@ import {
38
39
  RawLambda,
39
40
  V1_DataProductAccessor,
40
41
  V1_deserializeDataContractResponse,
42
+ type V1_DataRequestWithWorkflow,
41
43
  V1_entitlementsDataProductDetailsResponseToDataProductDetails,
42
44
  V1_IngestDefinitionAccessor,
43
45
  V1_LakehouseAccessPoint,
@@ -49,9 +51,11 @@ import {
49
51
  V1_SdlcDeploymentDataProductOrigin,
50
52
  V1_TaskStatusChangeResponseModelSchema,
51
53
  V1_transformDataContractToLiteDatacontract,
54
+ V1_deserializeDataRequestsWithWorkflowResponse,
55
+ type V1_DataRequestsWithWorkflowResponse,
52
56
  } from '@finos/legend-graph';
53
57
  import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
54
- import { type IngestDeploymentServerConfig } from '@finos/legend-server-lakehouse';
58
+ import type { ContractErrorLayer } from '@finos/legend-extension-dsl-data-product';
55
59
  import {
56
60
  makeObservable,
57
61
  flow,
@@ -66,6 +70,18 @@ import {
66
70
  } from './LakehouseEntitlementsStore.js';
67
71
  import { getDataProductFromDetails } from '../../../utils/LakehouseUtils.js';
68
72
 
73
+ export enum ContractSyncStatus {
74
+ NEVER_SYNCED = 'NEVER_SYNCED',
75
+ NOT_FULLY_SYNCED = 'NOT_FULLY_SYNCED',
76
+ }
77
+
78
+ export type LakehouseContractSyncStatusResponse = {
79
+ status: string;
80
+ unsyncedUsers?: { username: string }[];
81
+ unsyncedAccessPoints?: { accessPointName: string }[];
82
+ unsyncedTargetAccounts?: string[];
83
+ };
84
+
69
85
  const collectIngestSpecPathsFromOriginDp = (
70
86
  rootDataProduct: V1_DataProduct,
71
87
  accessPointGroupId: string,
@@ -186,12 +202,14 @@ export class EntitlementsDashboardState {
186
202
  // consolidated user information from the tasks.
187
203
  allContractsCreatedByUserMap: Map<string, ContractCreatedByUserDetails> =
188
204
  new Map();
205
+ dataRequestsCreatedByUser: V1_DataRequestWithWorkflow[] | undefined;
189
206
  selectedTaskIds: Set<string> = new Set();
190
207
 
191
208
  readonly initializationState = ActionState.create();
192
209
  readonly fetchingPendingTasksState = ActionState.create();
193
210
  readonly fetchingContractsForUserState = ActionState.create();
194
211
  readonly fetchingContractsByUserState = ActionState.create();
212
+ readonly fetchingDataRequestsCreatedByUserState = ActionState.create();
195
213
  readonly changingState = ActionState.create();
196
214
 
197
215
  constructor(state: LakehouseEntitlementsStore) {
@@ -203,6 +221,7 @@ export class EntitlementsDashboardState {
203
221
  allContractsCreatedByUserMap: observable,
204
222
  pendingTaskContractMap: observable,
205
223
  selectedTaskIds: observable,
224
+ dataRequestsCreatedByUser: observable,
206
225
  pendingTaskContracts: computed,
207
226
  allContractsCreatedByUser: computed,
208
227
  setSelectedTaskIds: action,
@@ -214,8 +233,8 @@ export class EntitlementsDashboardState {
214
233
  fetchContractsForUser: flow,
215
234
  fetchContractsCreatedByUser: flow,
216
235
  fetchContractDeploymentEnvironments: flow,
217
- getUnverifiedIngestDefinitions: flow,
218
236
  updateContract: flow,
237
+ fetchDataRequestsCreatedByUser: flow,
219
238
  });
220
239
  }
221
240
 
@@ -238,37 +257,44 @@ export class EntitlementsDashboardState {
238
257
  this.fetchingPendingTasksState.inProgress();
239
258
  this.fetchingContractsForUserState.inProgress();
240
259
  this.fetchingContractsByUserState.inProgress();
260
+ this.fetchingDataRequestsCreatedByUserState.inProgress();
241
261
 
242
- const [pendingTasksData, contractsForUser, contractsCreatedByUserMap] =
243
- (yield Promise.all([
244
- (async () => {
245
- try {
246
- const tasks = await flowResult(this.fetchPendingTasks(token));
247
- const taskContractMap = await flowResult(
248
- this.fetchPendingTaskContracts(token, tasks),
249
- );
250
- return { tasks, taskContractMap };
251
- } catch (error) {
252
- assertErrorThrown(error);
253
- this.lakehouseEntitlementsStore.applicationStore.alertUnhandledError(
254
- error,
255
- );
256
- return {
257
- tasks: [] as V1_ContractUserEventRecord[],
258
- taskContractMap: new Map<string, V1_LiteDataContract>(),
259
- };
260
- }
261
- })(),
262
- flowResult(this.fetchContractsForUser(token)),
263
- flowResult(this.fetchContractsCreatedByUser(token)),
264
- ])) as [
265
- {
266
- tasks: V1_ContractUserEventRecord[];
267
- taskContractMap: Map<string, V1_LiteDataContract>;
268
- },
269
- V1_LiteDataContractWithUserStatus[],
270
- Map<string, ContractCreatedByUserDetails>,
271
- ];
262
+ const [
263
+ pendingTasksData,
264
+ contractsForUser,
265
+ contractsCreatedByUserMap,
266
+ dataRequestsCreatedByUser,
267
+ ] = (yield Promise.all([
268
+ (async () => {
269
+ try {
270
+ const tasks = await flowResult(this.fetchPendingTasks(token));
271
+ const taskContractMap = await flowResult(
272
+ this.fetchPendingTaskContracts(token, tasks),
273
+ );
274
+ return { tasks, taskContractMap };
275
+ } catch (error) {
276
+ assertErrorThrown(error);
277
+ this.lakehouseEntitlementsStore.applicationStore.alertUnhandledError(
278
+ error,
279
+ );
280
+ return {
281
+ tasks: [] as V1_ContractUserEventRecord[],
282
+ taskContractMap: new Map<string, V1_LiteDataContract>(),
283
+ };
284
+ }
285
+ })(),
286
+ flowResult(this.fetchContractsForUser(token)),
287
+ flowResult(this.fetchContractsCreatedByUser(token)),
288
+ flowResult(this.fetchDataRequestsCreatedByUser(token)),
289
+ ])) as [
290
+ {
291
+ tasks: V1_ContractUserEventRecord[];
292
+ taskContractMap: Map<string, V1_LiteDataContract>;
293
+ },
294
+ V1_LiteDataContractWithUserStatus[],
295
+ Map<string, ContractCreatedByUserDetails>,
296
+ V1_DataRequestWithWorkflow[],
297
+ ];
272
298
 
273
299
  const allContracts: V1_LiteDataContract[] = [
274
300
  ...Array.from(pendingTasksData.taskContractMap.values()),
@@ -295,10 +321,12 @@ export class EntitlementsDashboardState {
295
321
  this.pendingTasks = filteredTasks;
296
322
  this.allContractsForUser = filteredContractsForUser;
297
323
  this.allContractsCreatedByUserMap = filteredCreatedByUserMap;
324
+ this.dataRequestsCreatedByUser = dataRequestsCreatedByUser;
298
325
 
299
326
  this.fetchingPendingTasksState.complete();
300
327
  this.fetchingContractsForUserState.complete();
301
328
  this.fetchingContractsByUserState.complete();
329
+ this.fetchingDataRequestsCreatedByUserState.complete();
302
330
  } catch (error) {
303
331
  assertErrorThrown(error);
304
332
  this.lakehouseEntitlementsStore.applicationStore.alertUnhandledError(
@@ -441,6 +469,29 @@ export class EntitlementsDashboardState {
441
469
  }
442
470
  }
443
471
 
472
+ *fetchDataRequestsCreatedByUser(
473
+ token: string | undefined,
474
+ ): GeneratorFn<V1_DataRequestWithWorkflow[]> {
475
+ try {
476
+ const raw =
477
+ (yield this.lakehouseEntitlementsStore.lakehouseContractServerClient.getDataAccessRequestsCreatedBy(
478
+ this.lakehouseEntitlementsStore.applicationStore.identityService
479
+ .currentUser,
480
+ token,
481
+ )) as PlainObject<V1_DataRequestsWithWorkflowResponse>;
482
+ return V1_deserializeDataRequestsWithWorkflowResponse(
483
+ raw,
484
+ this.lakehouseEntitlementsStore.applicationStore.pluginManager.getPureProtocolProcessorPlugins(),
485
+ );
486
+ } catch (error) {
487
+ assertErrorThrown(error);
488
+ this.lakehouseEntitlementsStore.applicationStore.notificationService.notifyError(
489
+ `Error fetching data requests created by user: ${error.message}`,
490
+ );
491
+ return [];
492
+ }
493
+ }
494
+
444
495
  *fetchContractDeploymentEnvironments(
445
496
  allContracts: V1_LiteDataContract[],
446
497
  token: string | undefined,
@@ -478,10 +529,10 @@ export class EntitlementsDashboardState {
478
529
  return didToEnvType;
479
530
  }
480
531
 
481
- *getUnverifiedIngestDefinitions(
532
+ async getUnverifiedIngestDefinitions(
482
533
  contractId: string,
483
534
  token: string | undefined,
484
- ): GeneratorFn<string[] | undefined> {
535
+ ): Promise<string[]> {
485
536
  const entitlementsStore = this.lakehouseEntitlementsStore;
486
537
  const baseStore = entitlementsStore.marketplaceBaseStore;
487
538
  const applicationStore = entitlementsStore.applicationStore;
@@ -493,7 +544,7 @@ export class EntitlementsDashboardState {
493
544
  const SDLC_DEPLOYMENT = 'alloy-git';
494
545
 
495
546
  try {
496
- const liteContract = (yield (async () => {
547
+ const liteContract = await (async () => {
497
548
  try {
498
549
  const rawContractResponse = await contractClient.getDataContract(
499
550
  contractId,
@@ -512,7 +563,7 @@ export class EntitlementsDashboardState {
512
563
  assertErrorThrown(error);
513
564
  return undefined;
514
565
  }
515
- })()) as V1_LiteDataContract | undefined;
566
+ })();
516
567
  if (!liteContract) {
517
568
  return [];
518
569
  }
@@ -525,7 +576,7 @@ export class EntitlementsDashboardState {
525
576
  return [];
526
577
  }
527
578
 
528
- const dpDetails = (yield (async () => {
579
+ const dpDetails = await (async () => {
529
580
  try {
530
581
  const raw = await contractClient.getDataProductByIdAndDID(
531
582
  liteContract.resourceId,
@@ -539,7 +590,7 @@ export class EntitlementsDashboardState {
539
590
  assertErrorThrown(error);
540
591
  return undefined;
541
592
  }
542
- })()) as V1_EntitlementsDataProductDetails | undefined;
593
+ })();
543
594
  if (!dpDetails) {
544
595
  return [];
545
596
  }
@@ -553,7 +604,7 @@ export class EntitlementsDashboardState {
553
604
  applicationStore.logService,
554
605
  baseStore.remoteEngine,
555
606
  );
556
- yield graphManager.initialize(
607
+ await graphManager.initialize(
557
608
  {
558
609
  env: applicationStore.config.env,
559
610
  tabSize: DEFAULT_TAB_SIZE,
@@ -564,11 +615,11 @@ export class EntitlementsDashboardState {
564
615
  { engine: baseStore.remoteEngine },
565
616
  );
566
617
 
567
- const v1DataProduct = (yield getDataProductFromDetails(
618
+ const v1DataProduct = await getDataProductFromDetails(
568
619
  dpDetails,
569
620
  graphManager,
570
621
  baseStore,
571
- )) as V1_DataProduct | undefined;
622
+ );
572
623
  if (!v1DataProduct) {
573
624
  return [];
574
625
  }
@@ -584,10 +635,10 @@ export class EntitlementsDashboardState {
584
635
  }
585
636
 
586
637
  const ingestEnvironment =
587
- (yield baseStore.lakehouseDataProductService.getOrFetchEnvironmentForDID(
638
+ await baseStore.lakehouseDataProductService.getOrFetchEnvironmentForDID(
588
639
  liteContract.deploymentId,
589
640
  token,
590
- )) as IngestDeploymentServerConfig | undefined;
641
+ );
591
642
  const ingestServerUrl = ingestEnvironment?.ingestServerUrl;
592
643
  if (ingestServerUrl === undefined) {
593
644
  return [];
@@ -604,7 +655,7 @@ export class EntitlementsDashboardState {
604
655
  }));
605
656
 
606
657
  const ingestClient = baseStore.lakehouseIngestServerClient;
607
- const settled = (yield Promise.all(
658
+ const settled = await Promise.all(
608
659
  specsToVerify.map(async (entry) => {
609
660
  try {
610
661
  await ingestClient.getIngestDefinitionDetail(
@@ -615,18 +666,100 @@ export class EntitlementsDashboardState {
615
666
  return undefined;
616
667
  } catch (error) {
617
668
  assertErrorThrown(error);
618
- return entry.specPath;
669
+ if (
670
+ error instanceof NetworkClientError &&
671
+ error.response.status === HttpStatus.NOT_FOUND
672
+ ) {
673
+ return entry.specPath;
674
+ }
675
+ return undefined;
619
676
  }
620
677
  }),
621
- )) as (string | undefined)[];
678
+ );
622
679
  return settled.filter(isNonNullable);
680
+ } catch (error) {
681
+ assertErrorThrown(error);
682
+ return [];
683
+ }
684
+ }
685
+
686
+ async getContractSyncErrors(
687
+ contractId: string,
688
+ token: string | undefined,
689
+ ): Promise<ContractErrorLayer | undefined> {
690
+ try {
691
+ const response =
692
+ (await this.lakehouseEntitlementsStore.lakehouseContractServerClient.getContractSyncStatus(
693
+ contractId,
694
+ token,
695
+ )) as LakehouseContractSyncStatusResponse;
696
+
697
+ const status = response.status.toUpperCase();
698
+
699
+ if (status === ContractSyncStatus.NEVER_SYNCED) {
700
+ return { title: 'Sync Error: Contract Never Synced' };
701
+ }
702
+
703
+ if (status === ContractSyncStatus.NOT_FULLY_SYNCED) {
704
+ const unsyncedUsers =
705
+ response.unsyncedUsers?.map((user) => user.username) ?? [];
706
+ const unsyncedAccessPoints =
707
+ response.unsyncedAccessPoints?.map(
708
+ (accessPoint) => accessPoint.accessPointName,
709
+ ) ?? [];
710
+ const unsyncedTargetAccounts = response.unsyncedTargetAccounts ?? [];
711
+
712
+ const syncGroupingLayers: ContractErrorLayer[] = [
713
+ { title: 'Users', errorItems: unsyncedUsers },
714
+ { title: 'Target Accounts', errorItems: unsyncedTargetAccounts },
715
+ { title: 'Access Points', errorItems: unsyncedAccessPoints },
716
+ ].filter((layer) => layer.errorItems.length > 0);
717
+
718
+ if (syncGroupingLayers.length === 0) {
719
+ return undefined;
720
+ }
721
+
722
+ return {
723
+ title: 'Unsynced Entities',
724
+ childLayers: syncGroupingLayers,
725
+ };
726
+ }
727
+
728
+ return undefined;
623
729
  } catch (error) {
624
730
  assertErrorThrown(error);
625
731
  return undefined;
626
732
  }
627
733
  }
628
734
 
629
- private filterByUserEnvironment(
735
+ async getContractErrors(
736
+ contractId: string,
737
+ token: string | undefined,
738
+ checkSyncStatus = false,
739
+ ): Promise<ContractErrorLayer | undefined> {
740
+ const [unverifiedIngestDefinitions, syncErrorsLayer] = await Promise.all([
741
+ this.getUnverifiedIngestDefinitions(contractId, token),
742
+ checkSyncStatus
743
+ ? this.getContractSyncErrors(contractId, token)
744
+ : Promise.resolve(undefined),
745
+ ]);
746
+
747
+ const childLayers: ContractErrorLayer[] = [
748
+ unverifiedIngestDefinitions.length > 0
749
+ ? {
750
+ title: `Ingest${unverifiedIngestDefinitions.length === 1 ? '' : 's'} Not Found`,
751
+ errorItems: unverifiedIngestDefinitions,
752
+ }
753
+ : undefined,
754
+ syncErrorsLayer,
755
+ ].filter(isNonNullable);
756
+
757
+ return childLayers.length > 0
758
+ ? { title: 'Contract Errors', childLayers }
759
+ : undefined;
760
+ }
761
+
762
+ filterByUserEnvironment(
630
763
  pendingData: {
631
764
  tasks: V1_ContractUserEventRecord[];
632
765
  taskContractMap: Map<string, V1_LiteDataContract>;