mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
rename stuff
This commit is contained in:
committed by
Aiden McClelland
parent
71f2c88b8f
commit
718d556080
28
agent/src/Lib/External/AppManifest.hs
vendored
28
agent/src/Lib/External/AppManifest.hs
vendored
@@ -60,7 +60,7 @@ data AppManifest where
|
||||
, appManifestAssets :: [AssetMapping]
|
||||
, appManifestOnionVersion :: OnionVersion
|
||||
, appManifestDependencies :: HM.HashMap AppId VersionRange
|
||||
, appManifestUninstallWarning :: Maybe Text
|
||||
, appManifestUninstallAlert :: Maybe Text
|
||||
} -> AppManifest
|
||||
|
||||
uiAvailable :: AppManifest -> Bool
|
||||
@@ -68,19 +68,19 @@ uiAvailable AppManifest {..} = isJust $ HM.lookup 80 appManifestPortMapping
|
||||
|
||||
instance FromJSON AppManifest where
|
||||
parseJSON = withObject "App Manifest " $ \o -> do
|
||||
appManifestId <- o .: "id"
|
||||
appManifestVersion <- o .: "version"
|
||||
appManifestTitle <- o .: "title"
|
||||
appManifestDescShort <- o .: "description" >>= (.: "short")
|
||||
appManifestDescLong <- o .: "description" >>= (.: "long")
|
||||
appManifestReleaseNotes <- o .: "release-notes"
|
||||
appManifestPortMapping <- o .: "ports" >>= fmap HM.fromList . traverse parsePortMapping
|
||||
appManifestImageType <- o .: "image" >>= (.: "type")
|
||||
appManifestMount <- o .: "mount"
|
||||
appManifestAssets <- o .: "assets" >>= traverse parseJSON
|
||||
appManifestOnionVersion <- o .: "hidden-service-version"
|
||||
appManifestDependencies <- o .:? "dependencies" .!= HM.empty >>= traverse parseDepInfo
|
||||
appManifestUninstallWarning <- o .:? "uninstall-warning"
|
||||
appManifestId <- o .: "id"
|
||||
appManifestVersion <- o .: "version"
|
||||
appManifestTitle <- o .: "title"
|
||||
appManifestDescShort <- o .: "description" >>= (.: "short")
|
||||
appManifestDescLong <- o .: "description" >>= (.: "long")
|
||||
appManifestReleaseNotes <- o .: "release-notes"
|
||||
appManifestPortMapping <- o .: "ports" >>= fmap HM.fromList . traverse parsePortMapping
|
||||
appManifestImageType <- o .: "image" >>= (.: "type")
|
||||
appManifestMount <- o .: "mount"
|
||||
appManifestAssets <- o .: "assets" >>= traverse parseJSON
|
||||
appManifestOnionVersion <- o .: "hidden-service-version"
|
||||
appManifestDependencies <- o .:? "dependencies" .!= HM.empty >>= traverse parseDepInfo
|
||||
appManifestUninstallAlert <- o .:? "uninstall-alert"
|
||||
pure $ AppManifest { .. }
|
||||
where
|
||||
parsePortMapping = withObject "Port Mapping" $ \o -> liftA2 (,) (o .: "tor") (o .: "internal")
|
||||
|
||||
@@ -25,18 +25,18 @@ data StoreApp = StoreApp
|
||||
deriving (Eq, Show)
|
||||
|
||||
data StoreAppVersionInfo = StoreAppVersionInfo
|
||||
{ storeAppVersionInfoVersion :: Version
|
||||
, storeAppVersionInfoReleaseNotes :: Text
|
||||
, storeAppVersionInfoInstallWarning :: Maybe Text
|
||||
{ storeAppVersionInfoVersion :: Version
|
||||
, storeAppVersionInfoReleaseNotes :: Text
|
||||
, storeAppVersionInfoInstallAlert :: Maybe Text
|
||||
}
|
||||
deriving (Eq, Show)
|
||||
instance Ord StoreAppVersionInfo where
|
||||
compare = compare `on` storeAppVersionInfoVersion
|
||||
instance FromJSON StoreAppVersionInfo where
|
||||
parseJSON = withObject "Store App Version Info" $ \o -> do
|
||||
storeAppVersionInfoVersion <- o .: "version"
|
||||
storeAppVersionInfoReleaseNotes <- o .: "release-notes"
|
||||
storeAppVersionInfoInstallWarning <- o .: "install-warning"
|
||||
storeAppVersionInfoVersion <- o .: "version"
|
||||
storeAppVersionInfoReleaseNotes <- o .: "release-notes"
|
||||
storeAppVersionInfoInstallAlert <- o .: "install-alert"
|
||||
pure StoreAppVersionInfo { .. }
|
||||
instance ToJSON StoreAppVersionInfo where
|
||||
toJSON StoreAppVersionInfo {..} =
|
||||
|
||||
Reference in New Issue
Block a user