@finos/legend-application-marketplace 0.0.19 → 0.0.21
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 +3 -0
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js +11 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
- package/lib/app.css +2 -2
- package/lib/app.css.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts +10 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.js +10 -0
- package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
- package/lib/application/LegendMarketplaceFrameworkProvider.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceFrameworkProvider.js +2 -2
- package/lib/application/LegendMarketplaceFrameworkProvider.js.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.js +18 -8
- package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.d.ts.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js +6 -3
- package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.d.ts.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js +9 -6
- package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js.map +1 -1
- package/lib/components/{Lakehouse/LakehouseHeader.d.ts → Header/MarketplaceLakehouseHeader.d.ts} +2 -2
- package/lib/components/Header/MarketplaceLakehouseHeader.d.ts.map +1 -0
- package/lib/components/{Lakehouse/LakehouseHeader.js → Header/MarketplaceLakehouseHeader.js} +8 -4
- package/lib/components/Header/MarketplaceLakehouseHeader.js.map +1 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts +25 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts.map +1 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.js +32 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.js.map +1 -0
- package/lib/components/ProviderCard/LegendMarketplaceProviderCard.d.ts.map +1 -1
- package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js +6 -3
- package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js.map +1 -1
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js +3 -6
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -1
- package/lib/pages/Home/LegendMarketplaceHome.d.ts.map +1 -1
- package/lib/pages/Home/LegendMarketplaceHome.js +4 -4
- package/lib/pages/Home/LegendMarketplaceHome.js.map +1 -1
- package/lib/pages/Lakehouse/DataProductDataAccess.d.ts.map +1 -0
- package/lib/{components → pages}/Lakehouse/DataProductDataAccess.js +41 -9
- package/lib/pages/Lakehouse/DataProductDataAccess.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductHolder.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductHolder.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewer.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewerActivityBar.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewerActivityBar.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductWiki.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductWiki.js.map +1 -0
- package/lib/pages/Lakehouse/LakehouseDataProduct.d.ts.map +1 -0
- package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.js +3 -3
- package/lib/pages/Lakehouse/LakehouseDataProduct.js.map +1 -0
- package/lib/{components/Lakehouse/LakehouseMarketplace.d.ts → pages/Lakehouse/MarketplaceLakehouseHome.d.ts} +2 -2
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.d.ts.map +1 -0
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js +54 -0
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js.map +1 -0
- package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.d.ts → pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts} +1 -1
- package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts.map +1 -0
- package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.js → pages/Lakehouse/MarketplaceLakehouseStoreProvider.js} +1 -1
- package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.js.map +1 -0
- package/lib/{components/Lakehouse/entitlements/LakehouseEntitlements.d.ts → pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts} +6 -5
- package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js +194 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts +24 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js +38 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts +22 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js +23 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts +21 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js +32 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts +17 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js +55 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +1 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts +21 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.js +46 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.js.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts +29 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js +152 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts +22 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js +34 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js.map +1 -0
- package/lib/pages/LegendMarketplacePage.d.ts +23 -0
- package/lib/pages/LegendMarketplacePage.d.ts.map +1 -0
- package/lib/pages/LegendMarketplacePage.js +23 -0
- package/lib/pages/LegendMarketplacePage.js.map +1 -0
- package/lib/pages/SearchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
- package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js +13 -13
- package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js.map +1 -1
- package/lib/pages/VendorData/LegendMarketplaceVendorData.d.ts.map +1 -1
- package/lib/pages/VendorData/LegendMarketplaceVendorData.js +6 -6
- package/lib/pages/VendorData/LegendMarketplaceVendorData.js.map +1 -1
- package/lib/stores/LakehouseContractServerClient.d.ts +11 -4
- package/lib/stores/LakehouseContractServerClient.d.ts.map +1 -1
- package/lib/stores/LakehouseContractServerClient.js +21 -3
- package/lib/stores/LakehouseContractServerClient.js.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts +3 -0
- 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/lakehouse/DataProductDataAccessState.d.ts +6 -7
- package/lib/stores/lakehouse/DataProductDataAccessState.d.ts.map +1 -1
- package/lib/stores/lakehouse/DataProductDataAccessState.js +47 -48
- package/lib/stores/lakehouse/DataProductDataAccessState.js.map +1 -1
- package/lib/stores/lakehouse/DataProductViewerState.d.ts +7 -3
- package/lib/stores/lakehouse/DataProductViewerState.d.ts.map +1 -1
- package/lib/stores/lakehouse/DataProductViewerState.js +51 -22
- package/lib/stores/lakehouse/DataProductViewerState.js.map +1 -1
- package/lib/stores/lakehouse/LakehouseUtils.d.ts +50 -0
- package/lib/stores/lakehouse/LakehouseUtils.d.ts.map +1 -0
- package/lib/stores/lakehouse/LakehouseUtils.js +267 -0
- package/lib/stores/lakehouse/LakehouseUtils.js.map +1 -0
- package/lib/stores/lakehouse/MarketplaceLakehouseStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/MarketplaceLakehouseStore.js +9 -4
- package/lib/stores/lakehouse/MarketplaceLakehouseStore.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +31 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +110 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts +30 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js +65 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js.map +1 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts +41 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js +146 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js.map +1 -0
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts +10 -32
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js +49 -163
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/LakehouseViewerState.d.ts +23 -0
- package/lib/stores/lakehouse/entitlements/LakehouseViewerState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/LakehouseViewerState.js +24 -0
- package/lib/stores/lakehouse/entitlements/LakehouseViewerState.js.map +1 -0
- package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.d.ts +30 -0
- package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.d.ts.map +1 -0
- package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.js +63 -0
- package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.js.map +1 -0
- package/package.json +5 -4
- package/src/__lib__/LegendMarketplaceNavigation.ts +16 -1
- package/src/application/LegendMarketplaceApplicationConfig.ts +25 -0
- package/src/application/LegendMarketplaceFrameworkProvider.tsx +2 -0
- package/src/application/LegendMarketplaceWebApplication.tsx +50 -12
- package/src/components/DataProductCard/LegendMarketplaceDataProductSearchCard.tsx +41 -33
- package/src/components/DataProductCard/LegendMarketplaceLightDataProductCard.tsx +33 -36
- package/src/components/{Lakehouse/LakehouseHeader.tsx → Header/MarketplaceLakehouseHeader.tsx} +7 -3
- package/src/components/MarketplaceCard/LegendMarketplaceCard.tsx +98 -0
- package/src/components/ProviderCard/LegendMarketplaceProviderCard.tsx +47 -39
- package/src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx +2 -14
- package/src/pages/Home/LegendMarketplaceHome.tsx +42 -51
- package/src/{components → pages}/Lakehouse/DataProductDataAccess.tsx +91 -12
- package/src/{components → pages}/Lakehouse/LakehouseDataProduct.tsx +14 -23
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +167 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsDashboard.tsx +390 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.tsx +99 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.tsx +33 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsTaskViewer.tsx +73 -0
- package/src/pages/Lakehouse/entitlements/LakehouseEntitlements.tsx +82 -0
- package/src/pages/Lakehouse/shared/GridItemViewer.tsx +105 -0
- package/src/pages/Lakehouse/subscriptions/LakehouseSubscriptions.tsx +358 -0
- package/src/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.tsx +65 -0
- package/src/pages/LegendMarketplacePage.tsx +26 -0
- package/src/pages/SearchResults/LegendMarketplaceSearchResults.tsx +58 -65
- package/src/pages/VendorData/LegendMarketplaceVendorData.tsx +44 -42
- package/src/stores/LakehouseContractServerClient.ts +78 -10
- package/src/stores/LegendMarketplaceBaseStore.ts +16 -1
- package/src/stores/lakehouse/DataProductDataAccessState.ts +67 -63
- package/src/stores/lakehouse/DataProductViewerState.ts +86 -29
- package/src/stores/lakehouse/LakehouseUtils.ts +345 -0
- package/src/stores/lakehouse/MarketplaceLakehouseStore.ts +10 -6
- package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +167 -0
- package/src/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.ts +101 -0
- package/src/stores/lakehouse/entitlements/EntitlementsTaskViewerState.ts +227 -0
- package/src/stores/lakehouse/entitlements/LakehouseEntitlementsStore.ts +69 -231
- package/src/stores/lakehouse/entitlements/LakehouseViewerState.ts +27 -0
- package/src/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.ts +100 -0
- package/tsconfig.json +26 -13
- package/lib/components/Lakehouse/DataProductDataAccess.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductDataAccess.js.map +0 -1
- package/lib/components/Lakehouse/DataProductHolder.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductHolder.js.map +0 -1
- package/lib/components/Lakehouse/DataProductViewer.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductViewer.js.map +0 -1
- package/lib/components/Lakehouse/DataProductViewerActivityBar.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductViewerActivityBar.js.map +0 -1
- package/lib/components/Lakehouse/DataProductWiki.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductWiki.js.map +0 -1
- package/lib/components/Lakehouse/LakehouseDataProduct.d.ts.map +0 -1
- package/lib/components/Lakehouse/LakehouseDataProduct.js.map +0 -1
- package/lib/components/Lakehouse/LakehouseHeader.d.ts.map +0 -1
- package/lib/components/Lakehouse/LakehouseHeader.js.map +0 -1
- package/lib/components/Lakehouse/LakehouseMarketplace.d.ts.map +0 -1
- package/lib/components/Lakehouse/LakehouseMarketplace.js +0 -57
- package/lib/components/Lakehouse/LakehouseMarketplace.js.map +0 -1
- package/lib/components/Lakehouse/MarketLakehouseStoreProvider.d.ts.map +0 -1
- package/lib/components/Lakehouse/MarketLakehouseStoreProvider.js.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js +0 -147
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +0 -1
- package/lib/stores/MarketplaceLakehouseServerClient.d.ts +0 -25
- package/lib/stores/MarketplaceLakehouseServerClient.d.ts.map +0 -1
- package/lib/stores/MarketplaceLakehouseServerClient.js +0 -27
- package/lib/stores/MarketplaceLakehouseServerClient.js.map +0 -1
- package/lib/stores/lakehouse/entitlements/DataContractState.d.ts +0 -27
- package/lib/stores/lakehouse/entitlements/DataContractState.d.ts.map +0 -1
- package/lib/stores/lakehouse/entitlements/DataContractState.js +0 -115
- package/lib/stores/lakehouse/entitlements/DataContractState.js.map +0 -1
- package/src/components/Lakehouse/LakehouseMarketplace.tsx +0 -193
- package/src/components/Lakehouse/entitlements/LakehouseEntitlements.tsx +0 -332
- package/src/stores/MarketplaceLakehouseServerClient.ts +0 -40
- package/src/stores/lakehouse/entitlements/DataContractState.ts +0 -131
- /package/lib/{components → pages}/Lakehouse/DataProductDataAccess.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductHolder.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductHolder.js +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewer.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewer.js +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.js +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductWiki.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductWiki.js +0 -0
- /package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductHolder.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductViewer.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductViewerActivityBar.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductWiki.tsx +0 -0
- /package/src/{components/Lakehouse/MarketLakehouseStoreProvider.tsx → pages/Lakehouse/MarketplaceLakehouseStoreProvider.tsx} +0 -0
- /package/src/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.tsx +0 -0
|
@@ -15,197 +15,81 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ActionState, assertErrorThrown, guaranteeNonNullable, } from '@finos/legend-shared';
|
|
17
17
|
import { deserialize } from 'serializr';
|
|
18
|
-
import {
|
|
19
|
-
import { makeObservable, flow, observable,
|
|
20
|
-
import {
|
|
18
|
+
import { V1_deserializeTaskResponse, V1_DataContractsRecordModelSchema, } from '@finos/legend-graph';
|
|
19
|
+
import { makeObservable, flow, observable, flowResult, action } from 'mobx';
|
|
20
|
+
import { EntitlementsDataContractViewerState } from './EntitlementsDataContractViewerState.js';
|
|
21
|
+
import { EntitlementsDashboardState } from './EntitlementsDashboardState.js';
|
|
22
|
+
import { EntitlementsTaskViewerState } from './EntitlementsTaskViewerState.js';
|
|
21
23
|
export const TEST_USER = undefined;
|
|
22
|
-
export
|
|
23
|
-
state;
|
|
24
|
-
value;
|
|
25
|
-
canApprove;
|
|
26
|
-
dataContract;
|
|
27
|
-
constructor(value, state) {
|
|
28
|
-
this.value = value;
|
|
29
|
-
this.state = state;
|
|
30
|
-
makeObservable(this, {
|
|
31
|
-
value: observable,
|
|
32
|
-
canApprove: observable,
|
|
33
|
-
setCanApprove: observable,
|
|
34
|
-
approve: flow,
|
|
35
|
-
deny: flow,
|
|
36
|
-
init: flow,
|
|
37
|
-
calculateApprovalRights: flow,
|
|
38
|
-
fetchContract: flow,
|
|
39
|
-
dataContract: observable,
|
|
40
|
-
});
|
|
41
|
-
this.observeContract();
|
|
42
|
-
}
|
|
43
|
-
get id() {
|
|
44
|
-
return this.value.taskId;
|
|
45
|
-
}
|
|
46
|
-
*init(token) {
|
|
47
|
-
flowResult(this.calculateApprovalRights(token)).catch(this.state.applicationStore.alertUnhandledError);
|
|
48
|
-
flowResult(this.fetchContract(token)).catch(this.state.applicationStore.alertUnhandledError);
|
|
49
|
-
}
|
|
50
|
-
setCanApprove(val) {
|
|
51
|
-
this.canApprove = val;
|
|
52
|
-
}
|
|
53
|
-
observeContract() {
|
|
54
|
-
makeObservable(this.value, {
|
|
55
|
-
status: observable,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
*approve(token) {
|
|
59
|
-
try {
|
|
60
|
-
const response = (yield this.state.lakehouseServerClient.approveTask(this.value.taskId, token));
|
|
61
|
-
const change = deserialize(V1_TaskStatusChangeResponseModelSchema, response);
|
|
62
|
-
if (change.errorMessage) {
|
|
63
|
-
throw new Error(`Unable to approve task: ${this.value.taskId}: ${change.errorMessage}`);
|
|
64
|
-
}
|
|
65
|
-
this.value.status = change.status;
|
|
66
|
-
this.setCanApprove(false);
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
assertErrorThrown(error);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
*deny(token) {
|
|
73
|
-
try {
|
|
74
|
-
const response = (yield this.state.lakehouseServerClient.denyTaskTask(this.value.taskId, token));
|
|
75
|
-
const change = deserialize(V1_TaskStatusChangeResponseModelSchema, response);
|
|
76
|
-
if (change.errorMessage) {
|
|
77
|
-
throw new Error(`Unable to deny task: ${this.value.taskId}: ${change.errorMessage}`);
|
|
78
|
-
}
|
|
79
|
-
this.value.status = change.status;
|
|
80
|
-
this.setCanApprove(false);
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
assertErrorThrown(error);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
*calculateApprovalRights(token) {
|
|
87
|
-
this.canApprove = undefined;
|
|
88
|
-
try {
|
|
89
|
-
const rawTasks = (yield this.state.lakehouseServerClient.getPendingTasks(TEST_USER, token));
|
|
90
|
-
const tasks = deserialize(V1_pendingTasksRespondModelSchema, rawTasks);
|
|
91
|
-
const allTasks = [...tasks.dataOwner, ...tasks.privilegeManager];
|
|
92
|
-
const canApprove = Boolean(allTasks.find((e) => e.taskId === this.value.taskId));
|
|
93
|
-
this.setCanApprove(canApprove);
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
assertErrorThrown(error);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
*fetchContract(token) {
|
|
100
|
-
try {
|
|
101
|
-
const contractId = this.value.dataContractId;
|
|
102
|
-
const dataContracts = (yield this.state.lakehouseServerClient.getDataContract(contractId, token));
|
|
103
|
-
const dataContract = deserialize(V1_DataContractsRecordModelSchema, dataContracts).dataContracts[0]?.dataContract;
|
|
104
|
-
this.dataContract = dataContract;
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
assertErrorThrown(error);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
get taskDetails() {
|
|
111
|
-
return [
|
|
112
|
-
{
|
|
113
|
-
name: 'Task ID',
|
|
114
|
-
value: this.value.taskId,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'Task Status',
|
|
118
|
-
value: this.value.status.toString(),
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'Task Consumer',
|
|
122
|
-
value: this.value.consumer,
|
|
123
|
-
},
|
|
124
|
-
...(this.dataContract ? buildDataContractDetail(this.dataContract) : []),
|
|
125
|
-
];
|
|
126
|
-
}
|
|
127
|
-
}
|
|
24
|
+
export const TEST_USER2 = undefined;
|
|
128
25
|
export class LakehouseEntitlementsStore {
|
|
129
26
|
applicationStore;
|
|
130
27
|
lakehouseServerClient;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
28
|
+
directoryUrl;
|
|
29
|
+
applicationIdUrl;
|
|
30
|
+
directoryCallBack;
|
|
31
|
+
applicationCallBack;
|
|
32
|
+
initializationState = ActionState.create();
|
|
33
|
+
currentViewer;
|
|
136
34
|
constructor(applicationStore, lakehouseServerClient) {
|
|
137
35
|
this.applicationStore = applicationStore;
|
|
138
36
|
this.lakehouseServerClient = lakehouseServerClient;
|
|
37
|
+
this.directoryUrl =
|
|
38
|
+
this.applicationStore.config.lakehouseEntitlementsConfig?.applicationDirectoryUrl;
|
|
39
|
+
this.applicationIdUrl =
|
|
40
|
+
this.applicationStore.config.lakehouseEntitlementsConfig?.applicationIDUrl;
|
|
41
|
+
this.directoryCallBack = this.directoryUrl
|
|
42
|
+
? (user) => {
|
|
43
|
+
this.applicationStore.navigationService.navigator.visitAddress(`${this.directoryUrl}/${user}`);
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
this.applicationCallBack = this.applicationIdUrl
|
|
47
|
+
? (id) => {
|
|
48
|
+
this.applicationStore.navigationService.navigator.visitAddress(`${this.applicationIdUrl}/${id}`);
|
|
49
|
+
}
|
|
50
|
+
: undefined;
|
|
139
51
|
makeObservable(this, {
|
|
140
52
|
init: flow,
|
|
141
|
-
|
|
53
|
+
initWithTaskId: flow,
|
|
142
54
|
initWithContract: flow,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
currentDataContract: observable,
|
|
146
|
-
tasks: observable,
|
|
147
|
-
setTasks: action,
|
|
148
|
-
setDataContract: action,
|
|
149
|
-
clear: action,
|
|
55
|
+
currentViewer: observable,
|
|
56
|
+
setCurrentViewer: action,
|
|
150
57
|
});
|
|
151
58
|
}
|
|
152
|
-
|
|
153
|
-
this.
|
|
154
|
-
}
|
|
155
|
-
setCurrentTask(val) {
|
|
156
|
-
this.currentTask = val;
|
|
157
|
-
}
|
|
158
|
-
setDataContract(val) {
|
|
159
|
-
this.currentDataContract = val;
|
|
160
|
-
}
|
|
161
|
-
clear() {
|
|
162
|
-
this.setCurrentTask(undefined);
|
|
163
|
-
this.setTasks(undefined);
|
|
164
|
-
this.setDataContract(undefined);
|
|
59
|
+
setCurrentViewer(val) {
|
|
60
|
+
this.currentViewer = val;
|
|
165
61
|
}
|
|
166
62
|
*init(taskId, contractId, token) {
|
|
167
|
-
this.
|
|
63
|
+
this.setCurrentViewer(undefined);
|
|
168
64
|
if (taskId) {
|
|
169
|
-
flowResult(this.
|
|
65
|
+
flowResult(this.initWithTaskId(taskId, token)).catch(this.applicationStore.alertUnhandledError);
|
|
170
66
|
return;
|
|
171
67
|
}
|
|
172
68
|
else if (contractId) {
|
|
173
69
|
flowResult(this.initWithContract(contractId, token)).catch(this.applicationStore.alertUnhandledError);
|
|
174
70
|
return;
|
|
175
71
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.setTasks([...tasks.dataOwner, ...tasks.privilegeManager].map((_contract) => new ContractUserEventState(_contract, this)));
|
|
181
|
-
}
|
|
182
|
-
catch (error) {
|
|
183
|
-
assertErrorThrown(error);
|
|
184
|
-
}
|
|
185
|
-
finally {
|
|
186
|
-
this.fetchingTasks.complete();
|
|
187
|
-
}
|
|
72
|
+
// TODO: similiar logic should be used above ^
|
|
73
|
+
const currentViewer = new EntitlementsDashboardState(this);
|
|
74
|
+
this.setCurrentViewer(currentViewer);
|
|
75
|
+
currentViewer.init(token);
|
|
188
76
|
}
|
|
189
|
-
*
|
|
190
|
-
this.setTasks(undefined);
|
|
77
|
+
*initWithTaskId(taskId, token) {
|
|
191
78
|
try {
|
|
192
|
-
this.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const task = guaranteeNonNullable(allTasks.find((e) => e.taskId === taskId));
|
|
199
|
-
const currentTask = new ContractUserEventState(task, this);
|
|
200
|
-
this.setCurrentTask(currentTask);
|
|
79
|
+
this.initializationState.inProgress();
|
|
80
|
+
const rawTasks = (yield this.lakehouseServerClient.getTask(taskId, token));
|
|
81
|
+
const tasks = V1_deserializeTaskResponse(rawTasks);
|
|
82
|
+
const task = guaranteeNonNullable(tasks[0], `Task with id '${taskId}' not found`);
|
|
83
|
+
const currentTask = new EntitlementsTaskViewerState(task, this);
|
|
84
|
+
this.setCurrentViewer(currentTask);
|
|
201
85
|
flowResult(currentTask.init(token)).catch(this.applicationStore.alertUnhandledError);
|
|
202
86
|
}
|
|
203
87
|
catch (error) {
|
|
204
88
|
assertErrorThrown(error);
|
|
205
|
-
|
|
89
|
+
this.applicationStore.notificationService.notifyError(`Unable to render task page: ${error.message}`);
|
|
206
90
|
}
|
|
207
91
|
finally {
|
|
208
|
-
this.
|
|
92
|
+
this.initializationState.complete();
|
|
209
93
|
}
|
|
210
94
|
}
|
|
211
95
|
*initWithContract(id, token) {
|
|
@@ -213,7 +97,9 @@ export class LakehouseEntitlementsStore {
|
|
|
213
97
|
const dataContracts = (yield this.lakehouseServerClient.getDataContract(id, token));
|
|
214
98
|
const dataContract = deserialize(V1_DataContractsRecordModelSchema, dataContracts).dataContracts[0]?.dataContract;
|
|
215
99
|
const contract = guaranteeNonNullable(dataContract, 'Data Contract not found');
|
|
216
|
-
|
|
100
|
+
const currentViewer = new EntitlementsDataContractViewerState(contract, this);
|
|
101
|
+
this.setCurrentViewer(currentViewer);
|
|
102
|
+
flowResult(currentViewer.init(token)).catch(this.applicationStore.alertUnhandledError);
|
|
217
103
|
}
|
|
218
104
|
catch (error) {
|
|
219
105
|
assertErrorThrown(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LakehouseEntitlementsStore.js","sourceRoot":"","sources":["../../../../src/stores/lakehouse/entitlements/LakehouseEntitlementsStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"LakehouseEntitlementsStore.js","sourceRoot":"","sources":["../../../../src/stores/lakehouse/entitlements/LakehouseEntitlementsStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAGL,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAG/E,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AACnC,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AAEpC,MAAM,OAAO,0BAA0B;IAC5B,gBAAgB,CAAoC;IACpD,qBAAqB,CAAgC;IACrD,YAAY,CAAqB;IACjC,gBAAgB,CAAqB;IACrC,iBAAiB,CAAuC;IACxD,mBAAmB,CAAgD;IAC5E,mBAAmB,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAC3C,aAAa,CAAmC;IAEhD,YACE,gBAAmD,EACnD,qBAAo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AC,CAAC;YACzB,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CACnD,+BAA+B,KAAK,CAAC,OAAO,EAAE,CAC/C,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QACtC,CAAC;IACH,CAAC;IAED,CAAC,gBAAgB,CAAC,EAAU,EAAE,KAAyB;QACrD,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,eAAe,CACrE,EAAE,EACF,KAAK,CACN,CAAwC,CAAC;YAE1C,MAAM,YAAY,GAAG,WAAW,CAC9B,iCAAiC,EACjC,aAAa,CACd,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC;YACjC,MAAM,QAAQ,GAAG,oBAAoB,CACnC,YAAY,EACZ,yBAAyB,CAC1B,CAAC;YACF,MAAM,aAAa,GAAG,IAAI,mCAAmC,CAC3D,QAAQ,EACR,IAAI,CACL,CAAC;YACF,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YACrC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CACzC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAC1C,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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
|
+
import { ActionState } from '@finos/legend-shared';
|
|
17
|
+
import type { LakehouseEntitlementsStore } from './LakehouseEntitlementsStore.js';
|
|
18
|
+
export declare abstract class LakehouseViewerState {
|
|
19
|
+
readonly state: LakehouseEntitlementsStore;
|
|
20
|
+
initializationState: ActionState;
|
|
21
|
+
constructor(state: LakehouseEntitlementsStore);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=LakehouseViewerState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LakehouseViewerState.d.ts","sourceRoot":"","sources":["../../../../src/stores/lakehouse/entitlements/LakehouseViewerState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,8BAAsB,oBAAoB;IACxC,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C,mBAAmB,cAAwB;gBAE/B,KAAK,EAAE,0BAA0B;CAG9C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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
|
+
import { ActionState } from '@finos/legend-shared';
|
|
17
|
+
export class LakehouseViewerState {
|
|
18
|
+
state;
|
|
19
|
+
initializationState = ActionState.create();
|
|
20
|
+
constructor(state) {
|
|
21
|
+
this.state = state;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=LakehouseViewerState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LakehouseViewerState.js","sourceRoot":"","sources":["../../../../src/stores/lakehouse/entitlements/LakehouseViewerState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,OAAgB,oBAAoB;IAC/B,KAAK,CAA6B;IAC3C,mBAAmB,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAE3C,YAAY,KAAiC;QAC3C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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
|
+
import type { LakehouseContractServerClient } from '../../LakehouseContractServerClient.js';
|
|
17
|
+
import type { LegendMarketplaceApplicationStore } from '../../LegendMarketplaceBaseStore.js';
|
|
18
|
+
import { type GeneratorFn, ActionState } from '@finos/legend-shared';
|
|
19
|
+
import { type V1_DataSubscription, type V1_DataSubscriptionTarget } from '@finos/legend-graph';
|
|
20
|
+
export declare class LakehouseSubscriptionsStore {
|
|
21
|
+
readonly applicationStore: LegendMarketplaceApplicationStore;
|
|
22
|
+
readonly lakehouseServerClient: LakehouseContractServerClient;
|
|
23
|
+
initializationState: ActionState;
|
|
24
|
+
subscriptions: V1_DataSubscription[];
|
|
25
|
+
constructor(applicationStore: LegendMarketplaceApplicationStore, lakehouseServerClient: LakehouseContractServerClient);
|
|
26
|
+
init(token: string | undefined): GeneratorFn<void>;
|
|
27
|
+
setSubscriptions(val: V1_DataSubscription[]): void;
|
|
28
|
+
createSubscription(contractId: string, target: V1_DataSubscriptionTarget, token: string | undefined): Promise<V1_DataSubscription>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=LakehouseSubscriptionsStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LakehouseSubscriptionsStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,yBAAyB,EAK/B,MAAM,qBAAqB,CAAC;AAG7B,qBAAa,2BAA2B;IACtC,QAAQ,CAAC,gBAAgB,EAAE,iCAAiC,CAAC;IAC7D,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;IAC9D,mBAAmB,cAAwB;IAC3C,aAAa,EAAE,mBAAmB,EAAE,CAAM;gBAGxC,gBAAgB,EAAE,iCAAiC,EACnD,qBAAqB,EAAE,6BAA6B;IAYrD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC;IAoBnD,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,IAAI;IAI5C,kBAAkB,CACtB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,yBAAyB,EACjC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAAC,mBAAmB,CAAC;CAehC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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
|
+
import { ActionState, assertErrorThrown, guaranteeNonNullable, } from '@finos/legend-shared';
|
|
17
|
+
import { deserialize, serialize } from 'serializr';
|
|
18
|
+
import { V1_CreateSubscriptionInput, V1_CreateSubscriptionInputModelSchema, V1_dataSubscriptionModelSchema, V1_DataSubscriptionResponseModelSchema, } from '@finos/legend-graph';
|
|
19
|
+
import { makeObservable, flow, action, observable } from 'mobx';
|
|
20
|
+
export class LakehouseSubscriptionsStore {
|
|
21
|
+
applicationStore;
|
|
22
|
+
lakehouseServerClient;
|
|
23
|
+
initializationState = ActionState.create();
|
|
24
|
+
subscriptions = [];
|
|
25
|
+
constructor(applicationStore, lakehouseServerClient) {
|
|
26
|
+
this.applicationStore = applicationStore;
|
|
27
|
+
this.lakehouseServerClient = lakehouseServerClient;
|
|
28
|
+
makeObservable(this, {
|
|
29
|
+
subscriptions: observable,
|
|
30
|
+
init: flow,
|
|
31
|
+
setSubscriptions: action,
|
|
32
|
+
createSubscription: action,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
*init(token) {
|
|
36
|
+
try {
|
|
37
|
+
this.initializationState.inProgress();
|
|
38
|
+
const rawSubscriptions = (yield this.lakehouseServerClient.getAllSubscriptions(token));
|
|
39
|
+
const subscriptions = rawSubscriptions.subscriptions?.map((rawSubscription) => deserialize(V1_dataSubscriptionModelSchema, rawSubscription));
|
|
40
|
+
this.setSubscriptions(subscriptions ?? []);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
assertErrorThrown(error);
|
|
44
|
+
// TODO: show user error
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
this.initializationState.complete();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
setSubscriptions(val) {
|
|
51
|
+
this.subscriptions = val;
|
|
52
|
+
}
|
|
53
|
+
async createSubscription(contractId, target, token) {
|
|
54
|
+
const input = new V1_CreateSubscriptionInput();
|
|
55
|
+
input.contractId = contractId;
|
|
56
|
+
input.target = target;
|
|
57
|
+
const response = await this.lakehouseServerClient.createSubscription(serialize(V1_CreateSubscriptionInputModelSchema, input), token);
|
|
58
|
+
const subscription = guaranteeNonNullable(deserialize(V1_DataSubscriptionResponseModelSchema, response)
|
|
59
|
+
.subscriptions?.[0], 'No subsription returned from server');
|
|
60
|
+
return subscription;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=LakehouseSubscriptionsStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LakehouseSubscriptionsStore.js","s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AAC,gBAAgB,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,wBAAwB;QAC1B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC;QACtC,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,GAA0B;QACzC,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,UAAkB,EAClB,MAAiC,EACjC,KAAyB;QAEzB,MAAM,KAAK,GAAG,IAAI,0BAA0B,EAAE,CAAC;QAC/C,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;QAC9B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAClE,SAAS,CAAC,qCAAqC,EAAE,KAAK,CAAC,EACvD,KAAK,CACN,CAAC;QACF,MAAM,YAAY,GAAG,oBAAoB,CACvC,WAAW,CAAC,sCAAsC,EAAE,QAAQ,CAAC;aAC1D,aAAa,EAAE,CAAC,CAAC,CAAC,EACrB,qCAAqC,CACtC,CAAC;QACF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-marketplace",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Legend Marketplace application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
"test:watch": "jest --watch"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@finos/legend-application": "16.0.
|
|
48
|
+
"@finos/legend-application": "16.0.41",
|
|
49
49
|
"@finos/legend-art": "7.1.95",
|
|
50
|
-
"@finos/legend-
|
|
51
|
-
"@finos/legend-
|
|
50
|
+
"@finos/legend-code-editor": "workspace:^",
|
|
51
|
+
"@finos/legend-graph": "32.1.27",
|
|
52
|
+
"@finos/legend-lego": "2.0.73",
|
|
52
53
|
"@finos/legend-server-depot": "6.0.90",
|
|
53
54
|
"@finos/legend-server-marketplace": "0.0.3",
|
|
54
55
|
"@finos/legend-shared": "11.0.11",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { generatePath } from '@finos/legend-application/browser';
|
|
17
|
+
import { generatePath, matchPath } from '@finos/legend-application/browser';
|
|
18
18
|
import {
|
|
19
19
|
addQueryParametersToUrl,
|
|
20
20
|
stringifyQueryParams,
|
|
@@ -53,8 +53,23 @@ export const LEGEND_MARKETPLACE_ROUTE_PATTERN = Object.freeze({
|
|
|
53
53
|
LAKEHOUSE_ENTITLEMENTS_TASKS: `/lakehouse/entitlements/tasks/:${LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN.TASK_ID}`,
|
|
54
54
|
LAKEHOUSE_ENTITLEMENTS_CONTRACTS: `/lakehouse/entitlements/contracts/:${LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN.CONTRACT_ID}`,
|
|
55
55
|
LAKEHOUSE_PRODUCT: `/lakehouse/dataProduct/:${LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN.GAV}/:${LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN.DATA_PRODUCT_PATH}`,
|
|
56
|
+
LAKEHOUSE_SUBSCRIPTIONS: '/lakehouse/subscriptions',
|
|
56
57
|
});
|
|
57
58
|
|
|
59
|
+
export const LAKEHOUSE_ROUTES = Object.freeze([
|
|
60
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN.LAKEHOUSE,
|
|
61
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN.LAKEHOUSE_ENTITLEMENTS,
|
|
62
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN.LAKEHOUSE_ENTITLEMENTS_TASKS,
|
|
63
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN.LAKEHOUSE_ENTITLEMENTS_CONTRACTS,
|
|
64
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN.LAKEHOUSE_PRODUCT,
|
|
65
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN.LAKEHOUSE_SUBSCRIPTIONS,
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
export const isLakehouseRoute = (pathName: string): boolean =>
|
|
69
|
+
LAKEHOUSE_ROUTES.some(
|
|
70
|
+
(route) => matchPath(route as string, pathName) !== null,
|
|
71
|
+
);
|
|
72
|
+
|
|
58
73
|
export const generateLakehouseDataProduct = (
|
|
59
74
|
gav: string,
|
|
60
75
|
path: string,
|
|
@@ -60,12 +60,24 @@ export interface LegendMarketplaceApplicationConfigurationData
|
|
|
60
60
|
};
|
|
61
61
|
lakehouse?: {
|
|
62
62
|
url: string;
|
|
63
|
+
entitlements: {
|
|
64
|
+
applicationDirectoryUrl: string;
|
|
65
|
+
applicationIDUrl: string;
|
|
66
|
+
};
|
|
63
67
|
};
|
|
64
68
|
studio?: {
|
|
65
69
|
url: string;
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
export class LegendLakehouseEntitlementsConfig {
|
|
74
|
+
applicationDirectoryUrl: string;
|
|
75
|
+
applicationIDUrl: string;
|
|
76
|
+
constructor(applicationDirectoryUrl: string, applicationIDUrl: string) {
|
|
77
|
+
this.applicationDirectoryUrl = applicationDirectoryUrl;
|
|
78
|
+
this.applicationIDUrl = applicationIDUrl;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
69
81
|
export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig {
|
|
70
82
|
readonly options = new LegendMarketplaceApplicationCoreOptions();
|
|
71
83
|
|
|
@@ -74,6 +86,9 @@ export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig
|
|
|
74
86
|
readonly engineServerUrl: string;
|
|
75
87
|
readonly depotServerUrl: string;
|
|
76
88
|
readonly lakehouseServerUrl?: string;
|
|
89
|
+
readonly lakehouseEntitlementsConfig:
|
|
90
|
+
| LegendLakehouseEntitlementsConfig
|
|
91
|
+
| undefined;
|
|
77
92
|
readonly studioServerUrl?: string;
|
|
78
93
|
|
|
79
94
|
constructor(
|
|
@@ -127,6 +142,16 @@ export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig
|
|
|
127
142
|
`Can't configure application: 'lakehouse.url' field is missing or empty`,
|
|
128
143
|
),
|
|
129
144
|
);
|
|
145
|
+
this.lakehouseEntitlementsConfig = new LegendLakehouseEntitlementsConfig(
|
|
146
|
+
guaranteeNonEmptyString(
|
|
147
|
+
input.configData.lakehouse.entitlements.applicationDirectoryUrl,
|
|
148
|
+
`Can't configure application: 'lakehouse.entitlements.applicationDirectoryUrl' field is missing or empty`,
|
|
149
|
+
),
|
|
150
|
+
guaranteeNonEmptyString(
|
|
151
|
+
input.configData.lakehouse.entitlements.applicationIDUrl,
|
|
152
|
+
`Can't configure application: 'lakehouse.entitlements.applicationIDUrl' field is missing or empty`,
|
|
153
|
+
),
|
|
154
|
+
);
|
|
130
155
|
}
|
|
131
156
|
// studio
|
|
132
157
|
if (input.configData.studio) {
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
ApplicationFrameworkProvider,
|
|
22
22
|
BlockingAlert,
|
|
23
23
|
useApplicationStore,
|
|
24
|
+
NotificationManager,
|
|
24
25
|
} from '@finos/legend-application';
|
|
25
26
|
import {
|
|
26
27
|
type LegendMarketplaceApplicationStore,
|
|
@@ -65,6 +66,7 @@ export const LegendMarketplaceFrameworkProvider: React.FC<{
|
|
|
65
66
|
}> = ({ children }) => (
|
|
66
67
|
<ApplicationFrameworkProvider simple={true} enableTransitions={true}>
|
|
67
68
|
<BlockingAlert />
|
|
69
|
+
<NotificationManager />
|
|
68
70
|
<LegendMarketplaceBaseStoreProvider>
|
|
69
71
|
{children}
|
|
70
72
|
</LegendMarketplaceBaseStoreProvider>
|