@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.
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts +2 -0
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js +4 -0
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts +9 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.js +40 -22
- package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.js +4 -1
- package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.d.ts.map +1 -1
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js +7 -0
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js.map +1 -1
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts +21 -0
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts.map +1 -0
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js +29 -0
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/pages/Agents/LegendMarketplaceAgents.d.ts.map +1 -1
- package/lib/pages/Agents/LegendMarketplaceAgents.js +49 -17
- package/lib/pages/Agents/LegendMarketplaceAgents.js.map +1 -1
- package/lib/pages/Agents/MarketplaceAIChatView.d.ts +21 -0
- package/lib/pages/Agents/MarketplaceAIChatView.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIChatView.js +141 -0
- package/lib/pages/Agents/MarketplaceAIChatView.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.d.ts +22 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.js +40 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts +25 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js +86 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.d.ts +23 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.js +20 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts +19 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.js +46 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +74 -63
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js +85 -69
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js +7 -11
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts +17 -0
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js +126 -0
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js +23 -65
- package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts +29 -0
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js +60 -0
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js.map +1 -0
- package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
- package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js +3 -8
- package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts +2 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.js +8 -1
- package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
- package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts +109 -0
- package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts.map +1 -0
- package/lib/stores/ai/LegendMarketplaceAIChatStore.js +1106 -0
- package/lib/stores/ai/LegendMarketplaceAIChatStore.js.map +1 -0
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js +3 -2
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js.map +1 -1
- package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts +1 -1
- package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts.map +1 -1
- package/lib/stores/lakehouse/dataProducts/ProductCardState.js +1 -2
- package/lib/stores/lakehouse/dataProducts/ProductCardState.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +30 -3
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +94 -16
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
- package/lib/utils/EntitlementsUtils.d.ts +36 -2
- package/lib/utils/EntitlementsUtils.d.ts.map +1 -1
- package/lib/utils/EntitlementsUtils.js +225 -46
- package/lib/utils/EntitlementsUtils.js.map +1 -1
- package/lib/utils/SearchUtils.d.ts.map +1 -1
- package/lib/utils/SearchUtils.js +7 -4
- package/lib/utils/SearchUtils.js.map +1 -1
- package/package.json +10 -10
- package/src/__lib__/LegendMarketplaceNavigation.ts +11 -0
- package/src/application/LegendMarketplaceApplicationConfig.ts +62 -24
- package/src/application/LegendMarketplaceWebApplication.tsx +15 -0
- package/src/application/__test-utils__/LegendMarketplaceApplicationTestUtils.ts +7 -0
- package/src/application/providers/LegendMarketplaceAIChatStoreProvider.tsx +47 -0
- package/src/pages/Agents/LegendMarketplaceAgents.tsx +145 -23
- package/src/pages/Agents/MarketplaceAIChatView.tsx +555 -0
- package/src/pages/Agents/MarketplaceAIInputBar.tsx +91 -0
- package/src/pages/Agents/MarketplaceAIProductAutosuggest.tsx +181 -0
- package/src/pages/Agents/MarketplaceAIProductCards.tsx +111 -0
- package/src/pages/Agents/MarketplaceAIScopeSelector.tsx +84 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +131 -136
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +158 -165
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +12 -17
- package/src/pages/Lakehouse/entitlements/PermitDataAccessRequest.tsx +245 -0
- package/src/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.tsx +25 -94
- package/src/pages/Lakehouse/entitlements/showTaskActionAlert.tsx +101 -0
- package/src/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.tsx +27 -31
- package/src/stores/LegendMarketplaceBaseStore.ts +12 -0
- package/src/stores/ai/LegendMarketplaceAIChatStore.ts +1720 -0
- package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +6 -0
- package/src/stores/lakehouse/dataProducts/ProductCardState.ts +3 -4
- package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +181 -48
- package/src/utils/EntitlementsUtils.tsx +341 -86
- package/src/utils/SearchUtils.tsx +7 -4
- 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
|
|
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
|
-
|
|
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
|
|
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 {
|
|
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 [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
532
|
+
async getUnverifiedIngestDefinitions(
|
|
482
533
|
contractId: string,
|
|
483
534
|
token: string | undefined,
|
|
484
|
-
):
|
|
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 =
|
|
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
|
-
})()
|
|
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 =
|
|
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
|
-
})()
|
|
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
|
-
|
|
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 =
|
|
618
|
+
const v1DataProduct = await getDataProductFromDetails(
|
|
568
619
|
dpDetails,
|
|
569
620
|
graphManager,
|
|
570
621
|
baseStore,
|
|
571
|
-
)
|
|
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
|
-
|
|
638
|
+
await baseStore.lakehouseDataProductService.getOrFetchEnvironmentForDID(
|
|
588
639
|
liteContract.deploymentId,
|
|
589
640
|
token,
|
|
590
|
-
)
|
|
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 =
|
|
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
|
-
|
|
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
|
-
)
|
|
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
|
-
|
|
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>;
|