-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Servant HTTP API specification for https://cachix.org
--
-- Servant HTTP API specification for https://cachix.org
@package cachix-api
@version 0.4.0
module Cachix.Api.Error
escalate :: (Exception exc, MonadThrow m) => Either exc a -> m a
-- | Examples: > escalate . maybeToEither err404
--
-- | Note that exceptions gets handled by warp and logged (user sees just
-- "Internal server")
escalateAs :: (Exception exc, MonadThrow m) => (l -> exc) -> Either l a -> m a
module Cachix.Api.Signing
fingerprint :: Text -> Text -> Integer -> [Text] -> ByteString
passthroughSizeSink :: MonadIO m => IORef Integer -> ConduitT ByteString ByteString m ()
passthroughHashSinkB16 :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m ()
passthroughHashSink :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m ()
module Cachix.Api.Types
data NixCacheInfo
NixCacheInfo :: Text -> Integer -> Integer -> NixCacheInfo
[storeDir] :: NixCacheInfo -> Text
[wantMassQuery] :: NixCacheInfo -> Integer
[priority] :: NixCacheInfo -> Integer
data NarInfo
NarInfo :: Text -> Text -> Text -> Text -> Integer -> Text -> Integer -> [Text] -> Text -> Text -> NarInfo
-- | absolute path of the derivation in nix store
[storePath] :: NarInfo -> Text
-- | relative url (to current domain) to download nar file
[url] :: NarInfo -> Text
-- | name of the compression algorithm, eg. xz
[compression] :: NarInfo -> Text
-- | sha256 hash of the compressed nar file NOTE: to compute use "nix-hash
-- --type sha256 --flat"
[fileHash] :: NarInfo -> Text
-- | file size of compressed nar file NOTE: du -b
[fileSize] :: NarInfo -> Integer
-- | sha256 hash of the decompressed nar file NOTE: to compute use
-- "nix-hash --type sha256 --flat --base32"
[narHash] :: NarInfo -> Text
-- | file size of decompressed nar file NOTE: du -b
[narSize] :: NarInfo -> Integer
-- | immediate dependencies of the storePath NOTE: nix-store -q
-- --references
[references] :: NarInfo -> [Text]
-- | relative store path (to nix store root) of the deriver NOTE: nix-store
-- -q --deriver
[deriver] :: NarInfo -> Text
-- | signature of fields: storePath, narHash, narSize, refs
[sig] :: NarInfo -> Text
data BinaryCache
BinaryCache :: Text -> Text -> Bool -> [Text] -> Text -> BinaryCache
[name] :: BinaryCache -> Text
[uri] :: BinaryCache -> Text
[isPublic] :: BinaryCache -> Bool
[publicSigningKeys] :: BinaryCache -> [Text]
[githubUsername] :: BinaryCache -> Text
newtype BinaryCacheError
BinaryCacheError :: Text -> BinaryCacheError
[error] :: BinaryCacheError -> Text
-- | Store path hash
newtype NarInfoC
NarInfoC :: Text -> NarInfoC
data User
User :: Maybe Text -> Text -> Maybe Text -> Bool -> SubscriptionType -> Maybe Text -> User
[fullname] :: User -> Maybe Text
[username] :: User -> Text
[email] :: User -> Maybe Text
[hasOrgsAcccess] :: User -> Bool
[activeSubscription] :: User -> SubscriptionType
[subscriptionAccountId] :: User -> Maybe Text
data SubscriptionType
Community :: SubscriptionType
Starter :: SubscriptionType
Basic :: SubscriptionType
Pro :: SubscriptionType
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Api.Types.User
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Api.Types.User
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Api.Types.User
instance GHC.Generics.Generic Cachix.Api.Types.User
instance GHC.Read.Read Cachix.Api.Types.SubscriptionType
instance GHC.Show.Show Cachix.Api.Types.SubscriptionType
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Api.Types.SubscriptionType
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Api.Types.SubscriptionType
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Api.Types.SubscriptionType
instance GHC.Generics.Generic Cachix.Api.Types.SubscriptionType
instance Data.Swagger.Internal.ParamSchema.ToParamSchema Cachix.Api.Types.NarInfoC
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Api.Types.NarInfoC
instance GHC.Generics.Generic Cachix.Api.Types.NarInfoC
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Api.Types.BinaryCacheError
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Api.Types.BinaryCacheError
instance GHC.Generics.Generic Cachix.Api.Types.BinaryCacheError
instance Control.DeepSeq.NFData Cachix.Api.Types.BinaryCache
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Api.Types.BinaryCache
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Api.Types.BinaryCache
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Api.Types.BinaryCache
instance GHC.Generics.Generic Cachix.Api.Types.BinaryCache
instance GHC.Show.Show Cachix.Api.Types.BinaryCache
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Api.Types.NarInfo
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Api.Types.NarInfo
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Api.Types.NarInfo
instance GHC.Show.Show Cachix.Api.Types.NarInfo
instance GHC.Generics.Generic Cachix.Api.Types.NarInfo
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Api.Types.NixCacheInfo
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Api.Types.NixCacheInfo
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Api.Types.NixCacheInfo
instance GHC.Show.Show Cachix.Api.Types.NixCacheInfo
instance GHC.Generics.Generic Cachix.Api.Types.NixCacheInfo
instance Web.Internal.HttpApiData.FromHttpApiData Cachix.Api.Types.NarInfoC
instance Web.Internal.HttpApiData.ToHttpApiData Cachix.Api.Types.NarInfoC
module Cachix.Types.BinaryCacheAuthenticated
-- | Binary Cache response content when user is authenticated
data BinaryCacheAuthenticated
BinaryCacheAuthenticated :: Text -> Text -> [Text] -> Bool -> Integer -> BinaryCacheAuthenticated
[name] :: BinaryCacheAuthenticated -> Text
[uri] :: BinaryCacheAuthenticated -> Text
[publicSigningKeys] :: BinaryCacheAuthenticated -> [Text]
[isPublic] :: BinaryCacheAuthenticated -> Bool
[totalFileSize] :: BinaryCacheAuthenticated -> Integer
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.BinaryCacheAuthenticated.BinaryCacheAuthenticated
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.BinaryCacheAuthenticated.BinaryCacheAuthenticated
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.BinaryCacheAuthenticated.BinaryCacheAuthenticated
instance GHC.Generics.Generic Cachix.Types.BinaryCacheAuthenticated.BinaryCacheAuthenticated
instance GHC.Show.Show Cachix.Types.BinaryCacheAuthenticated.BinaryCacheAuthenticated
module Cachix.Types.BinaryCacheCreate
data BinaryCacheCreate
BinaryCacheCreate :: Maybe Text -> Bool -> Maybe Text -> Maybe Int -> BinaryCacheCreate
[publicSigningKey] :: BinaryCacheCreate -> Maybe Text
[isPublic] :: BinaryCacheCreate -> Bool
[githubOrganization] :: BinaryCacheCreate -> Maybe Text
[githubTeamId] :: BinaryCacheCreate -> Maybe Int
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.BinaryCacheCreate.BinaryCacheCreate
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.BinaryCacheCreate.BinaryCacheCreate
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.BinaryCacheCreate.BinaryCacheCreate
instance GHC.Generics.Generic Cachix.Types.BinaryCacheCreate.BinaryCacheCreate
instance GHC.Show.Show Cachix.Types.BinaryCacheCreate.BinaryCacheCreate
module Cachix.Types.ContentTypes
data XNixNar
data XNixNarInfo
data XNixCacheInfo
instance Servant.API.ContentTypes.Accept Cachix.Types.ContentTypes.XNixCacheInfo
instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixCacheInfo Cachix.Api.Types.NixCacheInfo
instance Servant.API.ContentTypes.Accept Cachix.Types.ContentTypes.XNixNarInfo
instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixNarInfo Cachix.Api.Types.NarInfo
instance Servant.API.ContentTypes.Accept Cachix.Types.ContentTypes.XNixNar
instance Servant.API.ContentTypes.MimeRender Cachix.Types.ContentTypes.XNixNar Data.ByteString.Internal.ByteString
instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixNar Data.ByteString.Internal.ByteString
module Cachix.Types.CreateToken
data CreateToken
CreateToken :: Text -> CreateToken
[description] :: CreateToken -> Text
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.CreateToken.CreateToken
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.CreateToken.CreateToken
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.CreateToken.CreateToken
instance GHC.Generics.Generic Cachix.Types.CreateToken.CreateToken
instance GHC.Show.Show Cachix.Types.CreateToken.CreateToken
module Cachix.Types.GitHubTeam
data GitHubTeam
GitHubTeam :: Int -> Text -> GitHubTeam
[id] :: GitHubTeam -> Int
[name] :: GitHubTeam -> Text
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.GitHubTeam.GitHubTeam
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.GitHubTeam.GitHubTeam
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.GitHubTeam.GitHubTeam
instance GHC.Generics.Generic Cachix.Types.GitHubTeam.GitHubTeam
module Cachix.Types.NarFileName
-- | hash.nar.xz file
data NarFileName
NarFileName :: Text -> Text -> NarFileName
[contentHash] :: NarFileName -> Text
[extension] :: NarFileName -> Text
instance GHC.Generics.Generic Cachix.Types.NarFileName.NarFileName
instance Web.Internal.HttpApiData.FromHttpApiData Cachix.Types.NarFileName.NarFileName
instance Web.Internal.HttpApiData.ToHttpApiData Cachix.Types.NarFileName.NarFileName
module Cachix.Types.NarInfoCreate
-- | Client create type
data NarInfoCreate
NarInfoCreate :: Text -> Text -> Text -> Integer -> Text -> Integer -> [Text] -> Text -> Text -> NarInfoCreate
-- | $storePrefix / $storeHash - $storeSuffix
[cStoreHash] :: NarInfoCreate -> Text
-- | $storePrefix / $storeHash - $storeSuffix
[cStoreSuffix] :: NarInfoCreate -> Text
[cNarHash] :: NarInfoCreate -> Text
[cNarSize] :: NarInfoCreate -> Integer
[cFileHash] :: NarInfoCreate -> Text
[cFileSize] :: NarInfoCreate -> Integer
[cReferences] :: NarInfoCreate -> [Text]
[cDeriver] :: NarInfoCreate -> Text
[cSig] :: NarInfoCreate -> Text
data NarInfoInvalid
isNarInfoCreateValid :: NarInfoCreate -> Either NarInfoInvalid ()
instance GHC.Exception.Type.Exception Cachix.Types.NarInfoCreate.NarInfoInvalid
instance GHC.Show.Show Cachix.Types.NarInfoCreate.NarInfoInvalid
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.NarInfoCreate.NarInfoCreate
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.NarInfoCreate.NarInfoCreate
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.NarInfoCreate.NarInfoCreate
instance GHC.Show.Show Cachix.Types.NarInfoCreate.NarInfoCreate
instance GHC.Generics.Generic Cachix.Types.NarInfoCreate.NarInfoCreate
-- | Servant specific additions that could be upstreamed
module Cachix.Types.Servant
type Get302 (cts :: [*]) (hs :: [*]) = Verb 'GET 302 cts (Headers (Header "Location" Text : hs) NoContent)
type Post302 (cts :: [*]) (hs :: [*]) = Verb 'POST 302 cts (Headers (Header "Location" Text : hs) NoContent)
type Head = Verb 'HEAD 200 '[JSON] NoContent
-- | Auth representations
module Cachix.Types.Session
data Session
JWTSession :: ClaimsSet -> Session
instance GHC.Classes.Eq Cachix.Types.Session.Session
instance Servant.Auth.Server.Internal.JWT.ToJWT Cachix.Types.Session.Session
instance Servant.Auth.Server.Internal.JWT.FromJWT Cachix.Types.Session.Session
module Cachix.Types.SigningKeyCreate
-- | Conveys that a signing secret key was created, by sharing the public
-- key.
newtype SigningKeyCreate
SigningKeyCreate :: Text -> SigningKeyCreate
[publicKey] :: SigningKeyCreate -> Text
instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.SigningKeyCreate.SigningKeyCreate
instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.SigningKeyCreate.SigningKeyCreate
instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.SigningKeyCreate.SigningKeyCreate
instance GHC.Generics.Generic Cachix.Types.SigningKeyCreate.SigningKeyCreate
instance GHC.Show.Show Cachix.Types.SigningKeyCreate.SigningKeyCreate
module Cachix.Types.SwaggerOrphans
instance Data.Swagger.Internal.Schema.ToSchema i => Data.Swagger.Internal.Schema.ToSchema (Data.Conduit.Internal.Conduit.ConduitT i o m r)
module Cachix.Api
servantApi :: Proxy CachixServantAPI
swaggerDoc :: Swagger
data CachixAPI route
CachixAPI :: (route :- ("logout" :> (CachixAuth :> Post302 '[JSON] '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie]))) -> (route :- ("login" :> Get302 '[JSON] '[])) -> (route :- ("login" :> ("callback" :> (QueryParam "code" Text :> (QueryParam "state" Text :> Get302 '[JSON] '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie]))))) -> (route :- (CachixAuth :> ("user" :> Get '[JSON] User))) -> (route :- (CachixAuth :> ("token" :> (ReqBody '[JSON] CreateToken :> Post '[JSON] Text)))) -> (route :- (CachixAuth :> ("cache" :> Get '[JSON] [BinaryCacheAuthenticated]))) -> (route :- ("cache" :> (Capture "name" Text :> ToServantApi BinaryCacheAPI))) -> (route :- ("install" :> ToServantApi InstallAPI)) -> (route :- ("github" :> ToServantApi GitHubAPI)) -> CachixAPI route
[logout] :: CachixAPI route -> route :- ("logout" :> (CachixAuth :> Post302 '[JSON] '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie]))
[login] :: CachixAPI route -> route :- ("login" :> Get302 '[JSON] '[])
[loginCallback] :: CachixAPI route -> route :- ("login" :> ("callback" :> (QueryParam "code" Text :> (QueryParam "state" Text :> Get302 '[JSON] '[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie]))))
[user] :: CachixAPI route -> route :- (CachixAuth :> ("user" :> Get '[JSON] User))
[createToken] :: CachixAPI route -> route :- (CachixAuth :> ("token" :> (ReqBody '[JSON] CreateToken :> Post '[JSON] Text)))
[caches] :: CachixAPI route -> route :- (CachixAuth :> ("cache" :> Get '[JSON] [BinaryCacheAuthenticated]))
[cache] :: CachixAPI route -> route :- ("cache" :> (Capture "name" Text :> ToServantApi BinaryCacheAPI))
[install] :: CachixAPI route -> route :- ("install" :> ToServantApi InstallAPI)
[github] :: CachixAPI route -> route :- ("github" :> ToServantApi GitHubAPI)
type CachixServantAPI = "api" :> "v1" :> ToServantApi CachixAPI
type CachixAuth = Auth '[Cookie, JWT, BasicAuth] Session
data InstallAPI route
InstallAPI :: (route :- (Summary "Redirects to a tarball containing nix expression to build the latest version of cachix cli" :> Get302 '[JSON] '[])) -> (route :- (Summary "Redirects to a tarball containing nix expression to build given version of cachix cli" :> (Capture "version" Text :> Get302 '[JSON] '[]))) -> InstallAPI route
[installGetLatest] :: InstallAPI route -> route :- (Summary "Redirects to a tarball containing nix expression to build the latest version of cachix cli" :> Get302 '[JSON] '[])
[installGetVersion] :: InstallAPI route -> route :- (Summary "Redirects to a tarball containing nix expression to build given version of cachix cli" :> (Capture "version" Text :> Get302 '[JSON] '[]))
data GitHubAPI route
GitHubAPI :: (route :- (CachixAuth :> ("orgs" :> Get '[JSON] [Text]))) -> (route :- (CachixAuth :> ("orgs" :> (Capture "org" Text :> ("teams" :> Get '[JSON] [GitHubTeam]))))) -> GitHubAPI route
[githubOrganizations] :: GitHubAPI route -> route :- (CachixAuth :> ("orgs" :> Get '[JSON] [Text]))
[githubTeams] :: GitHubAPI route -> route :- (CachixAuth :> ("orgs" :> (Capture "org" Text :> ("teams" :> Get '[JSON] [GitHubTeam]))))
data BinaryCacheAPI route
BinaryCacheAPI :: (route :- (CachixAuth :> Get '[JSON] BinaryCache)) -> (route :- (CachixAuth :> (ReqBody '[JSON] BinaryCacheCreate :> Post '[JSON] NoContent))) -> (route :- (CachixAuth :> Delete '[JSON] NoContent)) -> (route :- (CachixAuth :> ("nix-cache-info" :> Get '[XNixCacheInfo, JSON] NixCacheInfo))) -> (route :- (CachixAuth :> (Capture "narinfo" NarInfoC :> Get '[XNixNarInfo, JSON] NarInfo))) -> (route :- (CachixAuth :> (Capture "narinfo" NarInfoC :> Head))) -> (route :- (CachixAuth :> ("narinfo" :> (Summary "Given a list of store hashes, return a list of those that are missing" :> (ReqBody '[JSON] [Text] :> Post '[JSON] [Text]))))) -> (route :- (Capture "narinfo" NarInfoC :> (ReqBody '[JSON] NarInfoCreate :> Post '[JSON] NoContent))) -> (route :- (CachixAuth :> ("key" :> (ReqBody '[JSON] SigningKeyCreate :> Post '[JSON] NoContent)))) -> BinaryCacheAPI route
[get] :: BinaryCacheAPI route -> route :- (CachixAuth :> Get '[JSON] BinaryCache)
[create] :: BinaryCacheAPI route -> route :- (CachixAuth :> (ReqBody '[JSON] BinaryCacheCreate :> Post '[JSON] NoContent))
[delete] :: BinaryCacheAPI route -> route :- (CachixAuth :> Delete '[JSON] NoContent)
[nixCacheInfo] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("nix-cache-info" :> Get '[XNixCacheInfo, JSON] NixCacheInfo))
[narinfo] :: BinaryCacheAPI route -> route :- (CachixAuth :> (Capture "narinfo" NarInfoC :> Get '[XNixNarInfo, JSON] NarInfo))
[narinfoHead] :: BinaryCacheAPI route -> route :- (CachixAuth :> (Capture "narinfo" NarInfoC :> Head))
[narinfoBulk] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("narinfo" :> (Summary "Given a list of store hashes, return a list of those that are missing" :> (ReqBody '[JSON] [Text] :> Post '[JSON] [Text]))))
[createNarinfo] :: BinaryCacheAPI route -> route :- (Capture "narinfo" NarInfoC :> (ReqBody '[JSON] NarInfoCreate :> Post '[JSON] NoContent))
[createKey] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("key" :> (ReqBody '[JSON] SigningKeyCreate :> Post '[JSON] NoContent)))
-- | Streaming endpoints
data BinaryCacheStreamingAPI route
BinaryCacheStreamingAPI :: (route :- (CachixAuth :> ("nar" :> (Capture "nar" NarFileName :> StreamGet NoFraming OctetStream (ConduitT () ByteString (ResourceT IO) ()))))) -> (route :- ("nar" :> (StreamBody NoFraming XNixNar (ConduitT () ByteString (ResourceT IO) ()) :> Post '[JSON] NoContent))) -> (route :- (CachixAuth :> ("serve" :> (Capture "storehash" Text :> (CaptureAll "filepath" Text :> (Summary "Serve a file from a given store path" :> Get '[OctetStream] (Headers '[Header "X-Content-Type-Options" Text] ByteString))))))) -> BinaryCacheStreamingAPI route
[nar] :: BinaryCacheStreamingAPI route -> route :- (CachixAuth :> ("nar" :> (Capture "nar" NarFileName :> StreamGet NoFraming OctetStream (ConduitT () ByteString (ResourceT IO) ()))))
[createNar] :: BinaryCacheStreamingAPI route -> route :- ("nar" :> (StreamBody NoFraming XNixNar (ConduitT () ByteString (ResourceT IO) ()) :> Post '[JSON] NoContent))
[serveNarContent] :: BinaryCacheStreamingAPI route -> route :- (CachixAuth :> ("serve" :> (Capture "storehash" Text :> (CaptureAll "filepath" Text :> (Summary "Serve a file from a given store path" :> Get '[OctetStream] (Headers '[Header "X-Content-Type-Options" Text] ByteString))))))
type BinaryCachStreamingServantAPI = "api" :> "v1" :> "cache" :> Capture "name" Text :> ToServantApi BinaryCacheStreamingAPI
-- | hash.nar.xz file
data NarFileName
NarFileName :: Text -> Text -> NarFileName
[contentHash] :: NarFileName -> Text
[extension] :: NarFileName -> Text
instance GHC.Generics.Generic (Cachix.Api.CachixAPI route)
instance GHC.Generics.Generic (Cachix.Api.GitHubAPI route)
instance GHC.Generics.Generic (Cachix.Api.InstallAPI route)
instance GHC.Generics.Generic (Cachix.Api.BinaryCacheStreamingAPI route)
instance GHC.Generics.Generic (Cachix.Api.BinaryCacheAPI route)