@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.
Files changed (248) hide show
  1. package/lib/__lib__/LegendMarketplaceNavigation.d.ts +3 -0
  2. package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendMarketplaceNavigation.js +11 -1
  4. package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
  5. package/lib/app.css +2 -2
  6. package/lib/app.css.map +1 -1
  7. package/lib/application/LegendMarketplaceApplicationConfig.d.ts +10 -0
  8. package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
  9. package/lib/application/LegendMarketplaceApplicationConfig.js +10 -0
  10. package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
  11. package/lib/application/LegendMarketplaceFrameworkProvider.d.ts.map +1 -1
  12. package/lib/application/LegendMarketplaceFrameworkProvider.js +2 -2
  13. package/lib/application/LegendMarketplaceFrameworkProvider.js.map +1 -1
  14. package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
  15. package/lib/application/LegendMarketplaceWebApplication.js +18 -8
  16. package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
  17. package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.d.ts.map +1 -1
  18. package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js +6 -3
  19. package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js.map +1 -1
  20. package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.d.ts.map +1 -1
  21. package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js +9 -6
  22. package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js.map +1 -1
  23. package/lib/components/{Lakehouse/LakehouseHeader.d.ts → Header/MarketplaceLakehouseHeader.d.ts} +2 -2
  24. package/lib/components/Header/MarketplaceLakehouseHeader.d.ts.map +1 -0
  25. package/lib/components/{Lakehouse/LakehouseHeader.js → Header/MarketplaceLakehouseHeader.js} +8 -4
  26. package/lib/components/Header/MarketplaceLakehouseHeader.js.map +1 -0
  27. package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts +25 -0
  28. package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts.map +1 -0
  29. package/lib/components/MarketplaceCard/LegendMarketplaceCard.js +32 -0
  30. package/lib/components/MarketplaceCard/LegendMarketplaceCard.js.map +1 -0
  31. package/lib/components/ProviderCard/LegendMarketplaceProviderCard.d.ts.map +1 -1
  32. package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js +6 -3
  33. package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js.map +1 -1
  34. package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts.map +1 -1
  35. package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js +3 -6
  36. package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js.map +1 -1
  37. package/lib/index.css +2 -2
  38. package/lib/index.css.map +1 -1
  39. package/lib/package.json +2 -1
  40. package/lib/pages/Home/LegendMarketplaceHome.d.ts.map +1 -1
  41. package/lib/pages/Home/LegendMarketplaceHome.js +4 -4
  42. package/lib/pages/Home/LegendMarketplaceHome.js.map +1 -1
  43. package/lib/pages/Lakehouse/DataProductDataAccess.d.ts.map +1 -0
  44. package/lib/{components → pages}/Lakehouse/DataProductDataAccess.js +41 -9
  45. package/lib/pages/Lakehouse/DataProductDataAccess.js.map +1 -0
  46. package/lib/pages/Lakehouse/DataProductHolder.d.ts.map +1 -0
  47. package/lib/pages/Lakehouse/DataProductHolder.js.map +1 -0
  48. package/lib/pages/Lakehouse/DataProductViewer.d.ts.map +1 -0
  49. package/lib/pages/Lakehouse/DataProductViewer.js.map +1 -0
  50. package/lib/pages/Lakehouse/DataProductViewerActivityBar.d.ts.map +1 -0
  51. package/lib/pages/Lakehouse/DataProductViewerActivityBar.js.map +1 -0
  52. package/lib/pages/Lakehouse/DataProductWiki.d.ts.map +1 -0
  53. package/lib/pages/Lakehouse/DataProductWiki.js.map +1 -0
  54. package/lib/pages/Lakehouse/LakehouseDataProduct.d.ts.map +1 -0
  55. package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.js +3 -3
  56. package/lib/pages/Lakehouse/LakehouseDataProduct.js.map +1 -0
  57. package/lib/{components/Lakehouse/LakehouseMarketplace.d.ts → pages/Lakehouse/MarketplaceLakehouseHome.d.ts} +2 -2
  58. package/lib/pages/Lakehouse/MarketplaceLakehouseHome.d.ts.map +1 -0
  59. package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js +54 -0
  60. package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js.map +1 -0
  61. package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.d.ts → pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts} +1 -1
  62. package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts.map +1 -0
  63. package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.js → pages/Lakehouse/MarketplaceLakehouseStoreProvider.js} +1 -1
  64. package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.js.map +1 -0
  65. package/lib/{components/Lakehouse/entitlements/LakehouseEntitlements.d.ts → pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts} +6 -5
  66. package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts.map +1 -0
  67. package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js +194 -0
  68. package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js.map +1 -0
  69. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts +24 -0
  70. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts.map +1 -0
  71. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js +38 -0
  72. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js.map +1 -0
  73. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts +22 -0
  74. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts.map +1 -0
  75. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js +23 -0
  76. package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js.map +1 -0
  77. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts +21 -0
  78. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts.map +1 -0
  79. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js +32 -0
  80. package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js.map +1 -0
  81. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts +17 -0
  82. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +1 -0
  83. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js +55 -0
  84. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js.map +1 -0
  85. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +1 -0
  86. package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +1 -0
  87. package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts +21 -0
  88. package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts.map +1 -0
  89. package/lib/pages/Lakehouse/shared/GridItemViewer.js +46 -0
  90. package/lib/pages/Lakehouse/shared/GridItemViewer.js.map +1 -0
  91. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts +29 -0
  92. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts.map +1 -0
  93. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js +152 -0
  94. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js.map +1 -0
  95. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts +22 -0
  96. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts.map +1 -0
  97. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js +34 -0
  98. package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js.map +1 -0
  99. package/lib/pages/LegendMarketplacePage.d.ts +23 -0
  100. package/lib/pages/LegendMarketplacePage.d.ts.map +1 -0
  101. package/lib/pages/LegendMarketplacePage.js +23 -0
  102. package/lib/pages/LegendMarketplacePage.js.map +1 -0
  103. package/lib/pages/SearchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
  104. package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js +13 -13
  105. package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js.map +1 -1
  106. package/lib/pages/VendorData/LegendMarketplaceVendorData.d.ts.map +1 -1
  107. package/lib/pages/VendorData/LegendMarketplaceVendorData.js +6 -6
  108. package/lib/pages/VendorData/LegendMarketplaceVendorData.js.map +1 -1
  109. package/lib/stores/LakehouseContractServerClient.d.ts +11 -4
  110. package/lib/stores/LakehouseContractServerClient.d.ts.map +1 -1
  111. package/lib/stores/LakehouseContractServerClient.js +21 -3
  112. package/lib/stores/LakehouseContractServerClient.js.map +1 -1
  113. package/lib/stores/LegendMarketplaceBaseStore.d.ts +3 -0
  114. package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
  115. package/lib/stores/LegendMarketplaceBaseStore.js +8 -1
  116. package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
  117. package/lib/stores/lakehouse/DataProductDataAccessState.d.ts +6 -7
  118. package/lib/stores/lakehouse/DataProductDataAccessState.d.ts.map +1 -1
  119. package/lib/stores/lakehouse/DataProductDataAccessState.js +47 -48
  120. package/lib/stores/lakehouse/DataProductDataAccessState.js.map +1 -1
  121. package/lib/stores/lakehouse/DataProductViewerState.d.ts +7 -3
  122. package/lib/stores/lakehouse/DataProductViewerState.d.ts.map +1 -1
  123. package/lib/stores/lakehouse/DataProductViewerState.js +51 -22
  124. package/lib/stores/lakehouse/DataProductViewerState.js.map +1 -1
  125. package/lib/stores/lakehouse/LakehouseUtils.d.ts +50 -0
  126. package/lib/stores/lakehouse/LakehouseUtils.d.ts.map +1 -0
  127. package/lib/stores/lakehouse/LakehouseUtils.js +267 -0
  128. package/lib/stores/lakehouse/LakehouseUtils.js.map +1 -0
  129. package/lib/stores/lakehouse/MarketplaceLakehouseStore.d.ts.map +1 -1
  130. package/lib/stores/lakehouse/MarketplaceLakehouseStore.js +9 -4
  131. package/lib/stores/lakehouse/MarketplaceLakehouseStore.js.map +1 -1
  132. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +31 -0
  133. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -0
  134. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +110 -0
  135. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -0
  136. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts +30 -0
  137. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts.map +1 -0
  138. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js +65 -0
  139. package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js.map +1 -0
  140. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts +41 -0
  141. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts.map +1 -0
  142. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js +146 -0
  143. package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js.map +1 -0
  144. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts +10 -32
  145. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts.map +1 -1
  146. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js +49 -163
  147. package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js.map +1 -1
  148. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.d.ts +23 -0
  149. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.d.ts.map +1 -0
  150. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.js +24 -0
  151. package/lib/stores/lakehouse/entitlements/LakehouseViewerState.js.map +1 -0
  152. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.d.ts +30 -0
  153. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.d.ts.map +1 -0
  154. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.js +63 -0
  155. package/lib/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.js.map +1 -0
  156. package/package.json +5 -4
  157. package/src/__lib__/LegendMarketplaceNavigation.ts +16 -1
  158. package/src/application/LegendMarketplaceApplicationConfig.ts +25 -0
  159. package/src/application/LegendMarketplaceFrameworkProvider.tsx +2 -0
  160. package/src/application/LegendMarketplaceWebApplication.tsx +50 -12
  161. package/src/components/DataProductCard/LegendMarketplaceDataProductSearchCard.tsx +41 -33
  162. package/src/components/DataProductCard/LegendMarketplaceLightDataProductCard.tsx +33 -36
  163. package/src/components/{Lakehouse/LakehouseHeader.tsx → Header/MarketplaceLakehouseHeader.tsx} +7 -3
  164. package/src/components/MarketplaceCard/LegendMarketplaceCard.tsx +98 -0
  165. package/src/components/ProviderCard/LegendMarketplaceProviderCard.tsx +47 -39
  166. package/src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx +2 -14
  167. package/src/pages/Home/LegendMarketplaceHome.tsx +42 -51
  168. package/src/{components → pages}/Lakehouse/DataProductDataAccess.tsx +91 -12
  169. package/src/{components → pages}/Lakehouse/LakehouseDataProduct.tsx +14 -23
  170. package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +167 -0
  171. package/src/pages/Lakehouse/entitlements/EntitlementsDashboard.tsx +390 -0
  172. package/src/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.tsx +99 -0
  173. package/src/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.tsx +33 -0
  174. package/src/pages/Lakehouse/entitlements/EntitlementsTaskViewer.tsx +73 -0
  175. package/src/pages/Lakehouse/entitlements/LakehouseEntitlements.tsx +82 -0
  176. package/src/pages/Lakehouse/shared/GridItemViewer.tsx +105 -0
  177. package/src/pages/Lakehouse/subscriptions/LakehouseSubscriptions.tsx +358 -0
  178. package/src/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.tsx +65 -0
  179. package/src/pages/LegendMarketplacePage.tsx +26 -0
  180. package/src/pages/SearchResults/LegendMarketplaceSearchResults.tsx +58 -65
  181. package/src/pages/VendorData/LegendMarketplaceVendorData.tsx +44 -42
  182. package/src/stores/LakehouseContractServerClient.ts +78 -10
  183. package/src/stores/LegendMarketplaceBaseStore.ts +16 -1
  184. package/src/stores/lakehouse/DataProductDataAccessState.ts +67 -63
  185. package/src/stores/lakehouse/DataProductViewerState.ts +86 -29
  186. package/src/stores/lakehouse/LakehouseUtils.ts +345 -0
  187. package/src/stores/lakehouse/MarketplaceLakehouseStore.ts +10 -6
  188. package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +167 -0
  189. package/src/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.ts +101 -0
  190. package/src/stores/lakehouse/entitlements/EntitlementsTaskViewerState.ts +227 -0
  191. package/src/stores/lakehouse/entitlements/LakehouseEntitlementsStore.ts +69 -231
  192. package/src/stores/lakehouse/entitlements/LakehouseViewerState.ts +27 -0
  193. package/src/stores/lakehouse/subscriptions/LakehouseSubscriptionsStore.ts +100 -0
  194. package/tsconfig.json +26 -13
  195. package/lib/components/Lakehouse/DataProductDataAccess.d.ts.map +0 -1
  196. package/lib/components/Lakehouse/DataProductDataAccess.js.map +0 -1
  197. package/lib/components/Lakehouse/DataProductHolder.d.ts.map +0 -1
  198. package/lib/components/Lakehouse/DataProductHolder.js.map +0 -1
  199. package/lib/components/Lakehouse/DataProductViewer.d.ts.map +0 -1
  200. package/lib/components/Lakehouse/DataProductViewer.js.map +0 -1
  201. package/lib/components/Lakehouse/DataProductViewerActivityBar.d.ts.map +0 -1
  202. package/lib/components/Lakehouse/DataProductViewerActivityBar.js.map +0 -1
  203. package/lib/components/Lakehouse/DataProductWiki.d.ts.map +0 -1
  204. package/lib/components/Lakehouse/DataProductWiki.js.map +0 -1
  205. package/lib/components/Lakehouse/LakehouseDataProduct.d.ts.map +0 -1
  206. package/lib/components/Lakehouse/LakehouseDataProduct.js.map +0 -1
  207. package/lib/components/Lakehouse/LakehouseHeader.d.ts.map +0 -1
  208. package/lib/components/Lakehouse/LakehouseHeader.js.map +0 -1
  209. package/lib/components/Lakehouse/LakehouseMarketplace.d.ts.map +0 -1
  210. package/lib/components/Lakehouse/LakehouseMarketplace.js +0 -57
  211. package/lib/components/Lakehouse/LakehouseMarketplace.js.map +0 -1
  212. package/lib/components/Lakehouse/MarketLakehouseStoreProvider.d.ts.map +0 -1
  213. package/lib/components/Lakehouse/MarketLakehouseStoreProvider.js.map +0 -1
  214. package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +0 -1
  215. package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js +0 -147
  216. package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js.map +0 -1
  217. package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +0 -1
  218. package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +0 -1
  219. package/lib/stores/MarketplaceLakehouseServerClient.d.ts +0 -25
  220. package/lib/stores/MarketplaceLakehouseServerClient.d.ts.map +0 -1
  221. package/lib/stores/MarketplaceLakehouseServerClient.js +0 -27
  222. package/lib/stores/MarketplaceLakehouseServerClient.js.map +0 -1
  223. package/lib/stores/lakehouse/entitlements/DataContractState.d.ts +0 -27
  224. package/lib/stores/lakehouse/entitlements/DataContractState.d.ts.map +0 -1
  225. package/lib/stores/lakehouse/entitlements/DataContractState.js +0 -115
  226. package/lib/stores/lakehouse/entitlements/DataContractState.js.map +0 -1
  227. package/src/components/Lakehouse/LakehouseMarketplace.tsx +0 -193
  228. package/src/components/Lakehouse/entitlements/LakehouseEntitlements.tsx +0 -332
  229. package/src/stores/MarketplaceLakehouseServerClient.ts +0 -40
  230. package/src/stores/lakehouse/entitlements/DataContractState.ts +0 -131
  231. /package/lib/{components → pages}/Lakehouse/DataProductDataAccess.d.ts +0 -0
  232. /package/lib/{components → pages}/Lakehouse/DataProductHolder.d.ts +0 -0
  233. /package/lib/{components → pages}/Lakehouse/DataProductHolder.js +0 -0
  234. /package/lib/{components → pages}/Lakehouse/DataProductViewer.d.ts +0 -0
  235. /package/lib/{components → pages}/Lakehouse/DataProductViewer.js +0 -0
  236. /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.d.ts +0 -0
  237. /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.js +0 -0
  238. /package/lib/{components → pages}/Lakehouse/DataProductWiki.d.ts +0 -0
  239. /package/lib/{components → pages}/Lakehouse/DataProductWiki.js +0 -0
  240. /package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.d.ts +0 -0
  241. /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts +0 -0
  242. /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js +0 -0
  243. /package/src/{components → pages}/Lakehouse/DataProductHolder.tsx +0 -0
  244. /package/src/{components → pages}/Lakehouse/DataProductViewer.tsx +0 -0
  245. /package/src/{components → pages}/Lakehouse/DataProductViewerActivityBar.tsx +0 -0
  246. /package/src/{components → pages}/Lakehouse/DataProductWiki.tsx +0 -0
  247. /package/src/{components/Lakehouse/MarketLakehouseStoreProvider.tsx → pages/Lakehouse/MarketplaceLakehouseStoreProvider.tsx} +0 -0
  248. /package/src/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.tsx +0 -0
@@ -19,7 +19,6 @@ import {
19
19
  type GenericLegendApplicationStore,
20
20
  type NavigationZone,
21
21
  } from '@finos/legend-application';
22
-
23
22
  import {
24
23
  type DataProductArtifactGeneration,
25
24
  type V1_DataContract,
@@ -28,10 +27,15 @@ import {
28
27
  V1_AppDirLevel,
29
28
  V1_AppDirNode,
30
29
  V1_AppDirNodeModelSchema,
31
- V1_DataContractsRecordModelSchema,
32
30
  type GraphData,
33
31
  type GraphManagerState,
34
32
  type V1_DataProduct,
33
+ type V1_AccessPointGroup,
34
+ V1_User,
35
+ V1_UserType,
36
+ V1_AdhocTeam,
37
+ V1_AdhocTeamModelSchema,
38
+ V1_DataContractsRecordModelSchemaToContracts,
35
39
  } from '@finos/legend-graph';
36
40
  import type { VersionedProjectData } from '@finos/legend-server-depot';
37
41
  import { action, computed, flow, makeObservable, observable } from 'mobx';
@@ -45,13 +49,25 @@ import {
45
49
  } from './DataProductViewerNavigation.js';
46
50
  import { DataProductDataAccessState } from './DataProductDataAccessState.js';
47
51
  import {
52
+ ActionState,
48
53
  assertErrorThrown,
49
54
  guaranteeNonEmptyString,
55
+ guaranteeNonNullable,
50
56
  type GeneratorFn,
51
57
  type PlainObject,
52
58
  } from '@finos/legend-shared';
53
59
  import type { LakehouseContractServerClient } from '../LakehouseContractServerClient.js';
54
- import { deserialize, serialize } from 'serializr';
60
+ import { serialize } from 'serializr';
61
+ import { dataContractContainsDataProduct } from './LakehouseUtils.js';
62
+
63
+ const buildAdhocUser = (user: string): V1_AdhocTeam => {
64
+ const _user = new V1_User();
65
+ _user.name = user;
66
+ _user.userType = V1_UserType.WORKFORCE_USER;
67
+ const _adhocTeam = new V1_AdhocTeam();
68
+ _adhocTeam.users = [_user];
69
+ return _adhocTeam;
70
+ };
55
71
 
56
72
  export class DataProductViewerState {
57
73
  readonly applicationStore: GenericLegendApplicationStore;
@@ -72,6 +88,10 @@ export class DataProductViewerState {
72
88
  accessState: DataProductDataAccessState;
73
89
  generation: DataProductArtifactGeneration | undefined;
74
90
  associatedContracts: V1_DataContract[] | undefined;
91
+ dataContractAccessPointGroup: V1_AccessPointGroup | undefined;
92
+ // actions
93
+
94
+ creatingContractState = ActionState.create();
75
95
 
76
96
  constructor(
77
97
  applicationStore: GenericLegendApplicationStore,
@@ -91,9 +111,13 @@ export class DataProductViewerState {
91
111
  setCurrentActivity: action,
92
112
  isVerified: computed,
93
113
  accessState: observable,
94
- init: flow,
114
+ fetchContracts: flow,
95
115
  associatedContracts: observable,
116
+ dataContractAccessPointGroup: observable,
117
+ setDataContractAccessPointGroup: action,
96
118
  setAssociatedContracts: action,
119
+ create: flow,
120
+ creatingContractState: observable,
97
121
  });
98
122
 
99
123
  this.applicationStore = applicationStore;
@@ -114,49 +138,82 @@ export class DataProductViewerState {
114
138
  this.associatedContracts = val;
115
139
  }
116
140
 
117
- *init(token: string | undefined): GeneratorFn<void> {
141
+ setDataContractAccessPointGroup(val: V1_AccessPointGroup | undefined) {
142
+ this.dataContractAccessPointGroup = val;
143
+ }
144
+
145
+ *fetchContracts(token: string | undefined): GeneratorFn<void> {
118
146
  try {
119
147
  const did = guaranteeNonEmptyString(
120
148
  this.generation?.dataProduct.deploymentId,
121
149
  'did required to get contracts',
122
150
  );
123
-
124
151
  const didNode = new V1_AppDirNode();
125
152
  didNode.appDirId = Number(did);
126
153
  didNode.level = V1_AppDirLevel.DEPLOYMENT;
127
154
  const _contracts = (yield this.lakeServerClient.getDataContractsFromDID(
128
- serialize(V1_AppDirNodeModelSchema, didNode),
155
+ [serialize(V1_AppDirNodeModelSchema, didNode)],
129
156
  token,
130
157
  )) as PlainObject<V1_DataContractsRecord>;
131
-
132
- const dataProductContracts = deserialize(
133
- V1_DataContractsRecordModelSchema,
158
+ const dataProductContracts = V1_DataContractsRecordModelSchemaToContracts(
134
159
  _contracts,
135
- )
136
- .dataContracts.map((e) => e.dataContract)
137
- .filter((_contract) => {
138
- const _resource = _contract.resource;
139
- if (
140
- _resource instanceof V1_AccessPointGroupReference &&
141
- this.deploymentId
142
- ) {
143
- const isDID =
144
- Number(this.deploymentId) ===
145
- _resource.dataProduct.owner.appDirId;
146
- const isName = _resource.dataProduct.name === this.product.name;
147
- const hasGroup = this.product.accessPointGroups
148
- .map((e) => e.id)
149
- .includes(_resource.accessPointGroup);
150
- return isDID && isName && hasGroup;
151
- }
152
- return false;
153
- });
160
+ ).filter((_contract) =>
161
+ dataContractContainsDataProduct(
162
+ this.product,
163
+ this.deploymentId,
164
+ _contract,
165
+ ),
166
+ );
154
167
  this.setAssociatedContracts(dataProductContracts);
168
+ this.accessState.accessGroupStates.forEach((e) =>
169
+ e.handleDataProductContracts(dataProductContracts),
170
+ );
171
+ } catch (error) {
172
+ assertErrorThrown(error);
173
+ this.accessState.viewerState.applicationStore.notificationService.notifyError(
174
+ `${error.message}`,
175
+ );
176
+ }
177
+ }
178
+
179
+ *create(
180
+ description: string,
181
+ group: V1_AccessPointGroup,
182
+ token: string | undefined,
183
+ ): GeneratorFn<void> {
184
+ try {
185
+ this.creatingContractState.inProgress();
186
+ const request: PlainObject<V1_DataContractsRecord> = {
187
+ description,
188
+ product: guaranteeNonNullable(this.generation?.content),
189
+ accessPointGroup: group.id,
190
+ consumer: serialize(
191
+ V1_AdhocTeamModelSchema,
192
+ buildAdhocUser(this.applicationStore.identityService.currentUser),
193
+ ),
194
+ };
195
+ const contracts = V1_DataContractsRecordModelSchemaToContracts(
196
+ (yield this.lakeServerClient.createContract(
197
+ request,
198
+ token,
199
+ )) as unknown as PlainObject<V1_DataContractsRecord>,
200
+ );
201
+ const associatedContracts = contracts[0];
202
+ const findGroup = this.accessState.accessGroupStates.find(
203
+ (e) => e.group === group,
204
+ );
205
+ findGroup?.setAssociatedContract(associatedContracts);
206
+ this.setDataContractAccessPointGroup(undefined);
207
+ this.applicationStore.notificationService.notifySuccess(
208
+ `Contract created, please go to contract view for pending tasks`,
209
+ );
155
210
  } catch (error) {
156
211
  assertErrorThrown(error);
157
212
  this.accessState.viewerState.applicationStore.notificationService.notifyError(
158
213
  `${error.message}`,
159
214
  );
215
+ } finally {
216
+ this.creatingContractState.complete();
160
217
  }
161
218
  }
162
219
 
@@ -0,0 +1,345 @@
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
+
17
+ import {
18
+ type V1_AccessPointGroup,
19
+ V1_AccessPointGroupReference,
20
+ V1_AdhocTeam,
21
+ V1_AppDirOrganizationalScope,
22
+ V1_ContractState,
23
+ type V1_ContractUserEventRecord,
24
+ type V1_DataContract,
25
+ type V1_DataProduct,
26
+ V1_UserApprovalStatus,
27
+ } from '@finos/legend-graph';
28
+ import { prettyCONSTName } from '@finos/legend-shared';
29
+
30
+ export enum GridTiemStatus {
31
+ SUCCESS = 'success',
32
+ ERROR = 'error',
33
+ INFO = 'info',
34
+ }
35
+
36
+ export type GridItemDetail = {
37
+ name: string;
38
+ value: string | number;
39
+ onClick?: (() => void) | undefined;
40
+ status?: GridTiemStatus | undefined;
41
+ };
42
+ const inValidContractState = [
43
+ V1_ContractState.DRAFT,
44
+ V1_ContractState.REJECTED,
45
+ V1_ContractState.CLOSED,
46
+ ];
47
+
48
+ const inProgressContractState = [
49
+ V1_ContractState.PENDING_DATA_OWNER_APPROVAL,
50
+ V1_ContractState.OPEN_FOR_PRIVILEGE_MANAGER_APPROVAL,
51
+ ];
52
+
53
+ const idxLabel = (idx: number): string => {
54
+ return ` (${idx + 1})`;
55
+ };
56
+
57
+ export const convertMutilGridItemDetail = (
58
+ details: GridItemDetail[][],
59
+ ): GridItemDetail[] => {
60
+ if (details.length > 1) {
61
+ details.forEach((gridItems, idx) => {
62
+ gridItems.forEach((item) => {
63
+ item.name = `${item.name}${idxLabel(idx)}`;
64
+ });
65
+ });
66
+ }
67
+ return details.flat();
68
+ };
69
+
70
+ export const dataContractContainsDataProduct = (
71
+ dataProduct: V1_DataProduct,
72
+ dataProdcutDeploymentID: string | undefined,
73
+ dataContract: V1_DataContract,
74
+ ): boolean => {
75
+ if (inValidContractState.includes(dataContract.state)) {
76
+ return false;
77
+ }
78
+ const contractResource = dataContract.resource;
79
+ if (
80
+ contractResource instanceof V1_AccessPointGroupReference &&
81
+ dataProdcutDeploymentID
82
+ ) {
83
+ const sameDID =
84
+ Number(dataProdcutDeploymentID) ===
85
+ contractResource.dataProduct.owner.appDirId;
86
+ // revisit name
87
+ const isName = contractResource.dataProduct.name === dataProduct.name;
88
+ const hasGroup = dataProduct.accessPointGroups
89
+ .map((e) => e.id)
90
+ .includes(contractResource.accessPointGroup);
91
+ return sameDID && isName && hasGroup;
92
+ }
93
+
94
+ return false;
95
+ };
96
+
97
+ // Assume contract already part of data product
98
+ export const dataContractContainsAccessGroup = (
99
+ group: V1_AccessPointGroup,
100
+ dataContract: V1_DataContract,
101
+ ): boolean => {
102
+ const contractResource = dataContract.resource;
103
+ if (contractResource instanceof V1_AccessPointGroupReference) {
104
+ return contractResource.accessPointGroup === group.id;
105
+ }
106
+ return false;
107
+ };
108
+
109
+ export const isMemberOfContract = (
110
+ user: string,
111
+ contract: V1_DataContract,
112
+ ): boolean => {
113
+ const consumer = contract.consumer;
114
+ if (consumer instanceof V1_AdhocTeam) {
115
+ return consumer.users.some((e) => e.name === user);
116
+ }
117
+ return false;
118
+ };
119
+
120
+ export const isContractCompleted = (contract: V1_DataContract): boolean => {
121
+ return contract.state === V1_ContractState.COMPLETED;
122
+ };
123
+
124
+ export const isContractPending = (contract: V1_DataContract): boolean => {
125
+ return inProgressContractState.includes(contract.state);
126
+ };
127
+
128
+ type ContractDetailOptions = {
129
+ openApplicationIdHandler?: ((user: string) => void) | undefined;
130
+ openDirectoryHandler?: ((id: string) => void) | undefined;
131
+ externalReference?:
132
+ | {
133
+ openContractHandler: ((id: string) => void) | undefined;
134
+ }
135
+ | undefined;
136
+ };
137
+
138
+ const CONTRACT_GRID_NAME = Object.freeze({
139
+ CONTRACT_ID: 'Contract ID',
140
+ CONTRACT_DESCRIPTION: 'Contract Description',
141
+ CONTRACT_VERSION: 'Contract Version',
142
+ CONTRACT_STATE: 'Contract State',
143
+ CONTRACT_DATA_PRODUCT_ID: 'Contract Data Product ID',
144
+ CONTRACT_DATA_PRODUCT: 'Contract Data Product',
145
+ CONTRACT_DATA_PRODUCT_DID: 'Contract Data Product DID',
146
+ CONTRACT_ACCESS_GROUP: 'Contract Access Group',
147
+ CONTRACT_ACCESS_POINTS: 'Contract Access Points',
148
+ CONTRACT_CONSUMER_NAME: 'Contract Consumer Name',
149
+ CONTRACT_CONSUMER_LEVEL: 'Contract Consumer Level',
150
+ CONTRACT_MEMBER_ID: 'Contract Member ID',
151
+ CONTRACT_MEMBER_TYPE: 'Contract Member Type',
152
+ CONTRACT_MEMBER_STATUS: 'Contract Member Status',
153
+ CONTRACT_MEMBER_NAME: 'Contract Member Name',
154
+ CONTRACT_APP_DID: 'Contract App DID',
155
+ CONTRACT_APP_LEVEL: 'Contract App Level',
156
+ });
157
+
158
+ export const buildDataContractDetail = (
159
+ dataContract: V1_DataContract,
160
+ options?: ContractDetailOptions | undefined,
161
+ ): GridItemDetail[] => {
162
+ const applicationIdUrlCallBack = options?.openApplicationIdHandler;
163
+ const directoryUrl = options?.openDirectoryHandler;
164
+ const openContractHandler = options?.externalReference?.openContractHandler;
165
+ const contractDetails = [
166
+ {
167
+ name: CONTRACT_GRID_NAME.CONTRACT_ID,
168
+ value: dataContract.guid,
169
+ onClick: openContractHandler
170
+ ? () => openContractHandler(dataContract.guid)
171
+ : undefined,
172
+ },
173
+ {
174
+ name: CONTRACT_GRID_NAME.CONTRACT_DESCRIPTION,
175
+ value: dataContract.description,
176
+ },
177
+ {
178
+ name: CONTRACT_GRID_NAME.CONTRACT_VERSION,
179
+ value: dataContract.version,
180
+ },
181
+ {
182
+ name: CONTRACT_GRID_NAME.CONTRACT_STATE,
183
+ value: prettyCONSTName(dataContract.state),
184
+ },
185
+ ];
186
+ const accessPointGroupRef = dataContract.resource;
187
+ let dataProductDetails: GridItemDetail[] = [];
188
+ if (accessPointGroupRef instanceof V1_AccessPointGroupReference) {
189
+ dataProductDetails = [
190
+ {
191
+ name: CONTRACT_GRID_NAME.CONTRACT_DATA_PRODUCT_ID,
192
+ value: accessPointGroupRef.dataProduct.guid,
193
+ },
194
+ {
195
+ name: CONTRACT_GRID_NAME.CONTRACT_DATA_PRODUCT,
196
+ value: accessPointGroupRef.dataProduct.name,
197
+ },
198
+ {
199
+ name: CONTRACT_GRID_NAME.CONTRACT_DATA_PRODUCT_DID,
200
+ value: accessPointGroupRef.dataProduct.owner.appDirId,
201
+ onClick: applicationIdUrlCallBack
202
+ ? () =>
203
+ applicationIdUrlCallBack(
204
+ accessPointGroupRef.dataProduct.owner.appDirId.toString(),
205
+ )
206
+ : undefined,
207
+ },
208
+ {
209
+ name: CONTRACT_GRID_NAME.CONTRACT_ACCESS_GROUP,
210
+ value: accessPointGroupRef.accessPointGroup,
211
+ },
212
+ {
213
+ name: CONTRACT_GRID_NAME.CONTRACT_ACCESS_POINTS,
214
+ value: accessPointGroupRef.dataProduct.accessPoints
215
+ .map((ap) => ap.name)
216
+ .join(', '),
217
+ },
218
+ ];
219
+ }
220
+ const org = dataContract.consumer;
221
+ let orgDetails: GridItemDetail[] = [];
222
+ if (org instanceof V1_AppDirOrganizationalScope) {
223
+ orgDetails = convertMutilGridItemDetail(
224
+ org.appDirNode.map((value) => [
225
+ {
226
+ name: CONTRACT_GRID_NAME.CONTRACT_APP_DID,
227
+ value: value.appDirId.toString(),
228
+ },
229
+ {
230
+ name: CONTRACT_GRID_NAME.CONTRACT_APP_LEVEL,
231
+ value: value.level.toString(),
232
+ },
233
+ ]),
234
+ );
235
+ } else if (org instanceof V1_AdhocTeam) {
236
+ orgDetails = convertMutilGridItemDetail(
237
+ org.users.map((user) => {
238
+ return [
239
+ {
240
+ name: CONTRACT_GRID_NAME.CONTRACT_CONSUMER_NAME,
241
+ value: user.name,
242
+ onClick: directoryUrl ? () => directoryUrl(user.name) : undefined,
243
+ },
244
+ ];
245
+ }),
246
+ );
247
+ }
248
+ const contractMembers = convertMutilGridItemDetail(
249
+ dataContract.members.map((member) => [
250
+ {
251
+ name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_ID,
252
+ value: member.guid,
253
+ },
254
+ {
255
+ name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_NAME,
256
+ value: member.user.name,
257
+ },
258
+ {
259
+ name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_TYPE,
260
+ value: member.user.userType.toString(),
261
+ },
262
+ {
263
+ name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_STATUS,
264
+ value: member.status.toString(),
265
+ },
266
+ ]),
267
+ );
268
+ return [
269
+ ...contractDetails,
270
+ ...dataProductDetails,
271
+ ...orgDetails,
272
+ ...contractMembers,
273
+ ];
274
+ };
275
+
276
+ const getGridInfoFromTaskStatus = (
277
+ status: V1_UserApprovalStatus,
278
+ ): GridTiemStatus | undefined => {
279
+ switch (status) {
280
+ case V1_UserApprovalStatus.APPROVED:
281
+ return GridTiemStatus.SUCCESS;
282
+ case V1_UserApprovalStatus.DENIED:
283
+ return GridTiemStatus.ERROR;
284
+ case V1_UserApprovalStatus.PENDING:
285
+ return GridTiemStatus.INFO;
286
+ default:
287
+ return undefined;
288
+ }
289
+ };
290
+
291
+ export const TYPE_GRID_ITEM = Object.freeze({
292
+ TASK_ID: 'Task ID',
293
+ TASK_STATUS: 'Task Status',
294
+ TASK_CONSUMER: 'Task Consumer',
295
+ TASK_ASSIGNEE: 'Task Assignee',
296
+ });
297
+
298
+ export const buildTaskGridItemDetail = (
299
+ task: V1_ContractUserEventRecord,
300
+ assignees?: string[] | undefined,
301
+ contract?: V1_DataContract | undefined,
302
+ openContractHandler?: ((id: string) => void) | undefined,
303
+ openDirectoryHandler?: ((id: string) => void) | undefined,
304
+ openApplicationIdHandler?: ((user: string) => void) | undefined,
305
+ ): GridItemDetail[] => {
306
+ const taskAssignees = convertMutilGridItemDetail(
307
+ assignees?.map((name) => [
308
+ {
309
+ name: TYPE_GRID_ITEM.TASK_ASSIGNEE,
310
+ value: name,
311
+ onClick: openDirectoryHandler
312
+ ? () => openDirectoryHandler(name)
313
+ : undefined,
314
+ },
315
+ ]) ?? [],
316
+ );
317
+ return [
318
+ {
319
+ name: TYPE_GRID_ITEM.TASK_ID,
320
+ value: task.taskId,
321
+ },
322
+ {
323
+ name: TYPE_GRID_ITEM.TASK_STATUS,
324
+ value: task.status.toString(),
325
+ status: getGridInfoFromTaskStatus(task.status),
326
+ },
327
+ {
328
+ name: TYPE_GRID_ITEM.TASK_CONSUMER,
329
+ value: task.consumer,
330
+ onClick: openDirectoryHandler
331
+ ? () => openDirectoryHandler(task.consumer)
332
+ : undefined,
333
+ },
334
+ ...taskAssignees,
335
+ ...(contract && openContractHandler
336
+ ? buildDataContractDetail(contract, {
337
+ openDirectoryHandler,
338
+ openApplicationIdHandler,
339
+ externalReference: {
340
+ openContractHandler,
341
+ },
342
+ })
343
+ : []),
344
+ ];
345
+ };
@@ -272,13 +272,16 @@ export class MarketplaceLakehouseStore implements CommandRegistrar {
272
272
  resolveVersion(projectData.versionId),
273
273
  ARTIFACT_GENERATION_DAT_PRODUCT_KEY,
274
274
  )) as StoredFileGeneration[];
275
- const generation = files.filter((e) => e.path === v1DataProduct.path)[0]
275
+ const fileGen = files.filter((e) => e.path === v1DataProduct.path)[0]
276
276
  ?.file.content;
277
- const parsed = generation
278
- ? DataProductArtifactGeneration.serialization.fromJson(
279
- JSON.parse(generation),
280
- )
281
- : undefined;
277
+ let parsed: DataProductArtifactGeneration | undefined = undefined;
278
+ if (fileGen) {
279
+ const content: PlainObject = JSON.parse(fileGen) as PlainObject;
280
+ const gen =
281
+ DataProductArtifactGeneration.serialization.fromJson(content);
282
+ gen.content = content;
283
+ parsed = gen;
284
+ }
282
285
  const stateViewer = new DataProductViewerState(
283
286
  this.applicationStore,
284
287
  new GraphManagerState(
@@ -325,6 +328,7 @@ export class MarketplaceLakehouseStore implements CommandRegistrar {
325
328
  },
326
329
  );
327
330
  this.setDataProductViewerState(stateViewer);
331
+ stateViewer.fetchContracts(auth.user?.access_token);
328
332
  this.loadingProductsState.complete();
329
333
  } catch (error) {
330
334
  assertErrorThrown(error);