From 27f05a4588c21fb53646d78476102f6740d11f6b Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Wed, 13 Jan 2021 17:45:50 -0700 Subject: [PATCH] adds timestamps --- agent/src/Handler/Apps.hs | 1 + agent/src/Handler/Types/Apps.hs | 2 ++ agent/src/Lib/External/Registry.hs | 1 + agent/src/Lib/Types/ServerApp.hs | 1 + 4 files changed, 5 insertions(+) diff --git a/agent/src/Handler/Apps.hs b/agent/src/Handler/Apps.hs index 54357680d..1ee581fbb 100644 --- a/agent/src/Handler/Apps.hs +++ b/agent/src/Handler/Apps.hs @@ -740,6 +740,7 @@ storeAppToAvailablePreview s@StoreApp {..} installed = AppAvailablePreview (storeAppVersionInfoVersion $ extract storeAppVersions) storeAppDescriptionShort installed + storeAppTimestamp type AsInstalled :: Bool -> Type newtype AsInstalled a = AsInstalled { unAsInstalled :: SBool a } diff --git a/agent/src/Handler/Types/Apps.hs b/agent/src/Handler/Types/Apps.hs index cf01e1ae5..0529783b2 100644 --- a/agent/src/Handler/Types/Apps.hs +++ b/agent/src/Handler/Types/Apps.hs @@ -28,6 +28,7 @@ data AppAvailablePreview = AppAvailablePreview , appAvailablePreviewVersionLatest :: Version , appAvailablePreviewDescriptionShort :: Text , appAvailablePreviewInstallInfo :: Maybe (Version, AppStatus) + , appAvailablePreviewTimestamp :: UTCTime } deriving (Eq, Show) instance ToJSON AppAvailablePreview where @@ -36,6 +37,7 @@ instance ToJSON AppAvailablePreview where , "descriptionShort" .= appAvailablePreviewDescriptionShort , "versionInstalled" .= (fst <$> appAvailablePreviewInstallInfo) , "status" .= (snd <$> appAvailablePreviewInstallInfo) + , "latestVersionTimestamp" .= appAvailablePreviewTimestamp ] data AppInstalledPreview = AppInstalledPreview diff --git a/agent/src/Lib/External/Registry.hs b/agent/src/Lib/External/Registry.hs index c1225d04d..c8d423b35 100644 --- a/agent/src/Lib/External/Registry.hs +++ b/agent/src/Lib/External/Registry.hs @@ -135,6 +135,7 @@ parseAppData = do storeAppVersions <- ad .: "version-info" >>= \case [] -> fail "No Valid Version Info" (x : xs) -> pure $ x :| xs + storeAppTimestamp <- ad .: "timestamp" pure StoreApp { .. } getAppVersionForSpec :: (Has RegistryUrl sig m, Has (Error S9Error) sig m, MonadIO m) diff --git a/agent/src/Lib/Types/ServerApp.hs b/agent/src/Lib/Types/ServerApp.hs index 34892a01c..27bb19386 100644 --- a/agent/src/Lib/Types/ServerApp.hs +++ b/agent/src/Lib/Types/ServerApp.hs @@ -20,6 +20,7 @@ data StoreApp = StoreApp , storeAppDescriptionLong :: Text , storeAppIconUrl :: Text , storeAppVersions :: NonEmpty StoreAppVersionInfo + , storeAppTimestamp :: UTCTime } deriving (Eq, Show)