cachix-api 1.1 → 1.2
raw patch · 10 files changed
+140/−55 lines, 10 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Cachix.API: api :: Proxy API
- Cachix.API.Deploy: DeployAPI :: (route :- (CachixAuth :> ("deploy" :> ("activate" :> (ReqBody '[JSON] Deploy :> Post '[JSON] DeployResponse))))) -> DeployAPI route
- Cachix.API.Deploy: [activate] :: DeployAPI route -> route :- (CachixAuth :> ("deploy" :> ("activate" :> (ReqBody '[JSON] Deploy :> Post '[JSON] DeployResponse))))
- Cachix.API.Deploy: api :: Proxy API
- Cachix.API.Deploy: data DeployAPI route
- Cachix.API.Deploy: instance GHC.Generics.Generic (Cachix.API.Deploy.DeployAPI route)
- Cachix.API.Deploy: type API = "api" :> "v1" :> ToServantApi DeployAPI
- Cachix.Types.DeployResponse: DeployResponse :: HashMap Text Text -> DeployResponse
- Cachix.Types.DeployResponse: [agents] :: DeployResponse -> HashMap Text Text
- Cachix.Types.DeployResponse: instance Control.DeepSeq.NFData Cachix.Types.DeployResponse.DeployResponse
- Cachix.Types.DeployResponse: instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.DeployResponse.DeployResponse
- Cachix.Types.DeployResponse: instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.DeployResponse.DeployResponse
- Cachix.Types.DeployResponse: instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.DeployResponse.DeployResponse
- Cachix.Types.DeployResponse: instance GHC.Generics.Generic Cachix.Types.DeployResponse.DeployResponse
- Cachix.Types.DeployResponse: instance GHC.Show.Show Cachix.Types.DeployResponse.DeployResponse
- Cachix.Types.DeployResponse: newtype DeployResponse
+ Cachix.API.Deploy.V1: DeployAPI :: (route :- Activate) -> (route :- GetDeployment) -> DeployAPI route
+ Cachix.API.Deploy.V1: [activate] :: DeployAPI route -> route :- Activate
+ Cachix.API.Deploy.V1: [getDeployment] :: DeployAPI route -> route :- GetDeployment
+ Cachix.API.Deploy.V1: data DeployAPI route
+ Cachix.API.Deploy.V1: instance GHC.Generics.Generic (Cachix.API.Deploy.V1.DeployAPI route)
+ Cachix.API.Deploy.V1: type API = "api" :> "v1" :> ToServantApi DeployAPI
+ Cachix.API.Deploy.V1: type Activate = CachixAuth :> "deploy" :> "activate" :> ReqBody '[JSON] Deploy :> Post '[JSON] DeployResponse
+ Cachix.API.Deploy.V1: type GetDeployment = CachixAuth :> "deploy" :> "deployment" :> Capture "uuid" UUID :> Get '[JSON] Deployment
+ Cachix.API.Deploy.V2: DeployAPI :: (route :- Activate) -> DeployAPI route
+ Cachix.API.Deploy.V2: [activate] :: DeployAPI route -> route :- Activate
+ Cachix.API.Deploy.V2: data DeployAPI route
+ Cachix.API.Deploy.V2: instance GHC.Generics.Generic (Cachix.API.Deploy.V2.DeployAPI route)
+ Cachix.API.Deploy.V2: type API = "api" :> "v2" :> ToServantApi DeployAPI
+ Cachix.API.Deploy.V2: type Activate = CachixAuth :> "deploy" :> "activate" :> ReqBody '[JSON] Deploy :> Post '[JSON] DeployResponse
+ Cachix.Types.DeployResponse.V1: DeployResponse :: HashMap Text Text -> DeployResponse
+ Cachix.Types.DeployResponse.V1: [agents] :: DeployResponse -> HashMap Text Text
+ Cachix.Types.DeployResponse.V1: instance Control.DeepSeq.NFData Cachix.Types.DeployResponse.V1.DeployResponse
+ Cachix.Types.DeployResponse.V1: instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.DeployResponse.V1.DeployResponse
+ Cachix.Types.DeployResponse.V1: instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.DeployResponse.V1.DeployResponse
+ Cachix.Types.DeployResponse.V1: instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.DeployResponse.V1.DeployResponse
+ Cachix.Types.DeployResponse.V1: instance GHC.Generics.Generic Cachix.Types.DeployResponse.V1.DeployResponse
+ Cachix.Types.DeployResponse.V1: instance GHC.Show.Show Cachix.Types.DeployResponse.V1.DeployResponse
+ Cachix.Types.DeployResponse.V1: newtype DeployResponse
+ Cachix.Types.DeployResponse.V2: DeployResponse :: HashMap Text Details -> DeployResponse
+ Cachix.Types.DeployResponse.V2: Details :: UUID -> Text -> Details
+ Cachix.Types.DeployResponse.V2: [agents] :: DeployResponse -> HashMap Text Details
+ Cachix.Types.DeployResponse.V2: [id] :: Details -> UUID
+ Cachix.Types.DeployResponse.V2: [url] :: Details -> Text
+ Cachix.Types.DeployResponse.V2: data Details
+ Cachix.Types.DeployResponse.V2: instance Control.DeepSeq.NFData Cachix.Types.DeployResponse.V2.DeployResponse
+ Cachix.Types.DeployResponse.V2: instance Control.DeepSeq.NFData Cachix.Types.DeployResponse.V2.Details
+ Cachix.Types.DeployResponse.V2: instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.DeployResponse.V2.DeployResponse
+ Cachix.Types.DeployResponse.V2: instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.DeployResponse.V2.Details
+ Cachix.Types.DeployResponse.V2: instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.DeployResponse.V2.DeployResponse
+ Cachix.Types.DeployResponse.V2: instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.DeployResponse.V2.Details
+ Cachix.Types.DeployResponse.V2: instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.DeployResponse.V2.DeployResponse
+ Cachix.Types.DeployResponse.V2: instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.DeployResponse.V2.Details
+ Cachix.Types.DeployResponse.V2: instance GHC.Generics.Generic Cachix.Types.DeployResponse.V2.DeployResponse
+ Cachix.Types.DeployResponse.V2: instance GHC.Generics.Generic Cachix.Types.DeployResponse.V2.Details
+ Cachix.Types.DeployResponse.V2: instance GHC.Show.Show Cachix.Types.DeployResponse.V2.DeployResponse
+ Cachix.Types.DeployResponse.V2: instance GHC.Show.Show Cachix.Types.DeployResponse.V2.Details
+ Cachix.Types.DeployResponse.V2: newtype DeployResponse
+ Cachix.Types.Deployment: Cancelled :: Status
+ Cachix.Types.Deployment: Deployment :: UUID -> Int64 -> UTCTime -> Maybe UTCTime -> Text -> Maybe Int64 -> Status -> Deployment
+ Cachix.Types.Deployment: Failed :: Status
+ Cachix.Types.Deployment: InProgress :: Status
+ Cachix.Types.Deployment: Pending :: Status
+ Cachix.Types.Deployment: Succeeded :: Status
+ Cachix.Types.Deployment: [closureSize] :: Deployment -> Maybe Int64
+ Cachix.Types.Deployment: [createdOn] :: Deployment -> UTCTime
+ Cachix.Types.Deployment: [id] :: Deployment -> UUID
+ Cachix.Types.Deployment: [index] :: Deployment -> Int64
+ Cachix.Types.Deployment: [startedOn] :: Deployment -> Maybe UTCTime
+ Cachix.Types.Deployment: [status] :: Deployment -> Status
+ Cachix.Types.Deployment: [storePath] :: Deployment -> Text
+ Cachix.Types.Deployment: data Deployment
+ Cachix.Types.Deployment: data Status
+ Cachix.Types.Deployment: instance Control.DeepSeq.NFData Cachix.Types.Deployment.Deployment
+ Cachix.Types.Deployment: instance Control.DeepSeq.NFData Cachix.Types.Deployment.Status
+ Cachix.Types.Deployment: instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.Deployment.Deployment
+ Cachix.Types.Deployment: instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.Deployment.Status
+ Cachix.Types.Deployment: instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.Deployment.Deployment
+ Cachix.Types.Deployment: instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.Deployment.Status
+ Cachix.Types.Deployment: instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.Deployment.Deployment
+ Cachix.Types.Deployment: instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.Deployment.Status
+ Cachix.Types.Deployment: instance GHC.Classes.Eq Cachix.Types.Deployment.Status
+ Cachix.Types.Deployment: instance GHC.Generics.Generic Cachix.Types.Deployment.Deployment
+ Cachix.Types.Deployment: instance GHC.Generics.Generic Cachix.Types.Deployment.Status
+ Cachix.Types.Deployment: instance GHC.Show.Show Cachix.Types.Deployment.Deployment
+ Cachix.Types.Deployment: instance GHC.Show.Show Cachix.Types.Deployment.Status
Files
- cachix-api.cabal +6/−2
- src/Cachix/API.hs +1/−5
- src/Cachix/API/Deploy.hs +0/−28
- src/Cachix/API/Deploy/V1.hs +36/−0
- src/Cachix/API/Deploy/V2.hs +26/−0
- src/Cachix/Types/Deploy.hs +0/−5
- src/Cachix/Types/DeployResponse.hs +2/−15
- src/Cachix/Types/DeployResponse/V1.hs +15/−0
- src/Cachix/Types/DeployResponse/V2.hs +23/−0
- src/Cachix/Types/Deployment.hs +31/−0
cachix-api.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: cachix-api-version: 1.1+version: 1.2 synopsis: Servant HTTP API specification for https://cachix.org homepage: https://github.com/cachix/cachix#readme bug-reports: https://github.com/cachix/cachix/issues@@ -39,7 +39,8 @@ import: defaults exposed-modules: Cachix.API- Cachix.API.Deploy+ Cachix.API.Deploy.V1+ Cachix.API.Deploy.V2 Cachix.API.Error Cachix.API.Signing Cachix.API.WebSocketSubprotocol@@ -47,7 +48,10 @@ Cachix.Types.ByteStringStreaming Cachix.Types.ContentTypes Cachix.Types.Deploy+ Cachix.Types.Deployment Cachix.Types.DeployResponse+ Cachix.Types.DeployResponse.V1+ Cachix.Types.DeployResponse.V2 Cachix.Types.NarFileName Cachix.Types.NarInfo Cachix.Types.NarInfoCreate
src/Cachix/API.hs view
@@ -3,8 +3,7 @@ {-# LANGUAGE TypeOperators #-} module Cachix.API- ( api,- BinaryCacheAPI (..),+ ( BinaryCacheAPI (..), API, CachixAuth, )@@ -127,6 +126,3 @@ deriving (Generic) type API = "api" :> "v1" :> ToServantApi BinaryCacheAPI--api :: Proxy API-api = Proxy
− src/Cachix/API/Deploy.hs
@@ -1,28 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE TypeOperators #-}--module Cachix.API.Deploy where--import Cachix.API (CachixAuth)-import qualified Cachix.Types.Deploy as Deploy-import qualified Cachix.Types.DeployResponse as DeployResponse-import Protolude-import Servant.API-import Servant.API.Generic--data DeployAPI route = DeployAPI- { activate ::- route- :- CachixAuth- :> "deploy"- :> "activate"- :> ReqBody '[JSON] Deploy.Deploy- :> Post '[JSON] DeployResponse.DeployResponse- }- deriving (Generic)--type API = "api" :> "v1" :> ToServantApi DeployAPI--api :: Proxy API-api = Proxy
+ src/Cachix/API/Deploy/V1.hs view
@@ -0,0 +1,36 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE TypeOperators #-}++module Cachix.API.Deploy.V1 where++import Cachix.API (CachixAuth)+import qualified Cachix.Types.Deploy as Deploy+import qualified Cachix.Types.DeployResponse.V1 as DeployResponse.V1+import qualified Cachix.Types.Deployment as Deployment+import Data.UUID (UUID)+import Protolude+import Servant.API+import Servant.API.Generic++type API = "api" :> "v1" :> ToServantApi DeployAPI++data DeployAPI route = DeployAPI+ { activate :: route :- Activate,+ getDeployment :: route :- GetDeployment+ }+ deriving (Generic)++type Activate =+ CachixAuth+ :> "deploy"+ :> "activate"+ :> ReqBody '[JSON] Deploy.Deploy+ :> Post '[JSON] DeployResponse.V1.DeployResponse++type GetDeployment =+ CachixAuth+ :> "deploy"+ :> "deployment"+ :> Capture "uuid" UUID+ :> Get '[JSON] Deployment.Deployment
+ src/Cachix/API/Deploy/V2.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE TypeOperators #-}++module Cachix.API.Deploy.V2 where++import Cachix.API (CachixAuth)+import qualified Cachix.Types.Deploy as Deploy+import qualified Cachix.Types.DeployResponse.V2 as DeployResponse.V2+import Protolude+import Servant.API+import Servant.API.Generic++type API = "api" :> "v2" :> ToServantApi DeployAPI++data DeployAPI route = DeployAPI+ { activate :: route :- Activate+ }+ deriving (Generic)++type Activate =+ CachixAuth+ :> "deploy"+ :> "activate"+ :> ReqBody '[JSON] Deploy.Deploy+ :> Post '[JSON] DeployResponse.V2.DeployResponse
src/Cachix/Types/Deploy.hs view
@@ -1,12 +1,7 @@ {-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveAnyClass #-} module Cachix.Types.Deploy where -import Data.Aeson- ( FromJSON,- ToJSON,- ) import Data.HashMap.Strict import Data.Swagger (ToSchema) import Deriving.Aeson
src/Cachix/Types/DeployResponse.hs view
@@ -1,16 +1,3 @@-{-# LANGUAGE DeriveAnyClass #-}--module Cachix.Types.DeployResponse where--import Data.Aeson- ( FromJSON,- ToJSON,- )-import Data.HashMap.Strict-import Data.Swagger (ToSchema)-import Protolude+module Cachix.Types.DeployResponse (module V2) where -newtype DeployResponse = DeployResponse- { agents :: HashMap Text Text- }- deriving (Show, Generic, FromJSON, ToJSON, ToSchema, NFData)+import Cachix.Types.DeployResponse.V2 as V2
+ src/Cachix/Types/DeployResponse/V1.hs view
@@ -0,0 +1,15 @@+module Cachix.Types.DeployResponse.V1 where++import Data.Aeson+ ( FromJSON,+ ToJSON,+ )+import Data.HashMap.Strict+import Data.Swagger (ToSchema)+import Protolude++newtype DeployResponse = DeployResponse+ { agents :: HashMap Text Text+ }+ deriving stock (Show, Generic)+ deriving anyclass (FromJSON, ToJSON, ToSchema, NFData)
+ src/Cachix/Types/DeployResponse/V2.hs view
@@ -0,0 +1,23 @@+module Cachix.Types.DeployResponse.V2 where++import Data.Aeson+ ( FromJSON,+ ToJSON,+ )+import Data.HashMap.Strict+import Data.Swagger (ToSchema)+import Data.UUID (UUID)+import Protolude++data Details = Details+ { id :: UUID,+ url :: Text+ }+ deriving stock (Show, Generic)+ deriving anyclass (FromJSON, ToJSON, ToSchema, NFData)++newtype DeployResponse = DeployResponse+ { agents :: HashMap Text Details+ }+ deriving stock (Show, Generic)+ deriving anyclass (FromJSON, ToJSON, ToSchema, NFData)
+ src/Cachix/Types/Deployment.hs view
@@ -0,0 +1,31 @@+module Cachix.Types.Deployment where++import Data.Aeson+ ( FromJSON,+ ToJSON,+ )+import Data.Swagger (ToSchema)+import Data.Time.Clock (UTCTime)+import Data.UUID (UUID)+import Protolude++data Status+ = Pending+ | InProgress+ | Cancelled+ | Failed+ | Succeeded+ deriving stock (Eq, Generic, Show)+ deriving anyclass (FromJSON, ToJSON, ToSchema, NFData)++data Deployment = Deployment+ { id :: UUID,+ index :: Int64,+ createdOn :: UTCTime,+ startedOn :: Maybe UTCTime,+ storePath :: Text,+ closureSize :: Maybe Int64,+ status :: Status+ }+ deriving stock (Show, Generic)+ deriving anyclass (FromJSON, ToJSON, ToSchema, NFData)