-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | BDCS API Server
--   
--   This module provides an API server and library component that works
--   with the BDCS project. It provides a web interface for clients to
--   create, edit, and delete blueprints; to list the contents of the
--   content store; to request composes from existing blueprints; and to
--   fetch the results of composes.
@package bdcs-api
@version 0.1.3

module BDCS.API.ComposeConfig

-- | Information about the compose configuration not available in other
--   results files
data ComposeConfig
ComposeConfig :: Text -> ExportType -> ComposeConfig

-- | Commit hash for Blueprint
[ccCommit] :: ComposeConfig -> Text

-- | Export type
[ccExportType] :: ComposeConfig -> ExportType

-- | Parse a TOML formatted compose config string and return a
--   ComposeConfig
--   
--   If there is an error the details will be returned in the Left
parseComposeConfig :: Text -> Either String ComposeConfig

-- | Return a TOML string from a ComposeConfig record
composeConfigTOML :: ComposeConfig -> Text
instance GHC.Classes.Eq BDCS.API.ComposeConfig.ComposeConfig
instance GHC.Show.Show BDCS.API.ComposeConfig.ComposeConfig
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.ComposeConfig.ComposeConfig
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.ComposeConfig.ComposeConfig


-- | Customizations applies to the content of an export
module BDCS.API.Customization

-- | Recipe customization commands
data RecipeCustomization
RecipeCustomization :: Maybe String -> [RecipeSshKey] -> RecipeCustomization

-- | System hostname
[rcHostName] :: RecipeCustomization -> Maybe String

-- | Ssh keys to install
[rcSshKeys] :: RecipeCustomization -> [RecipeSshKey]

-- | A sshkey customization
data RecipeSshKey
RecipeSshKey :: String -> String -> RecipeSshKey

-- | User to which to apply the key
[rcSshUser] :: RecipeSshKey -> String

-- | Key to install
[rcSshKey] :: RecipeSshKey -> String
emptyCustomization :: RecipeCustomization

-- | Convert a <a>RecipeCustomization</a> block into a list of bdcs
--   <a>Customization</a> directives
processCustomization :: MonadIO m => RecipeCustomization -> m [Customization]
instance GHC.Show.Show BDCS.API.Customization.RecipeCustomization
instance GHC.Classes.Eq BDCS.API.Customization.RecipeCustomization
instance GHC.Show.Show BDCS.API.Customization.RecipeSshKey
instance GHC.Classes.Eq BDCS.API.Customization.RecipeSshKey
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Customization.RecipeCustomization
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Customization.RecipeCustomization
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Customization.RecipeSshKey
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Customization.RecipeSshKey


-- | Error functions for use with <a>BDCS.API</a>
module BDCS.API.Error

-- | Create a <a>ServantErr</a> with an error id and a message
--   
--   <ul>
--   <li><i><tt>base</tt></i> The default <a>ServantErr</a> response</li>
--   <li><i><tt>status</tt></i> The response status</li>
--   <li><i><tt>messages</tt></i> A list of human readable messages to
--   include with the error</li>
--   </ul>
createAPIError :: ServantErr -> Bool -> [String] -> ServantErr

-- | Convert IO Exceptions into an ExceptT.
tryIO :: IO a -> ExceptT String IO a

-- | API Status response with possible error messages used to report errors
--   with API requests
--   
--   This is converted to a JSON error response that is used in the API
--   responses
--   
--   <pre>
--   {
--       "status": false,
--       "errors": ["compose: Unsupported output type"]
--       }
--   }
--   </pre>
data APIResponse
APIResponse :: Bool -> [String] -> APIResponse
[arjStatus] :: APIResponse -> Bool
[arjErrors] :: APIResponse -> [String]
instance GHC.Classes.Eq BDCS.API.Error.APIResponse
instance GHC.Show.Show BDCS.API.Error.APIResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Error.APIResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Error.APIResponse

module BDCS.API.QueueStatus

-- | What is the state of a compose in the queue?
data QueueStatus

-- | The compose has not yet started.
QWaiting :: QueueStatus

-- | The compose is in progress.
QRunning :: QueueStatus

-- | The compose finished successfully.
QFinished :: QueueStatus

-- | The compose finished unsuccessfully.
QFailed :: QueueStatus
queueStatusEnded :: QueueStatus -> Bool
queueStatusFromText :: Text -> Maybe QueueStatus
queueStatusInProgress :: QueueStatus -> Bool
queueStatusText :: QueueStatus -> Text
instance GHC.Show.Show BDCS.API.QueueStatus.QueueStatus
instance GHC.Classes.Eq BDCS.API.QueueStatus.QueueStatus
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.QueueStatus.QueueStatus
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.QueueStatus.QueueStatus


-- | Implement a ContentType for <a>TOML</a> so that POSTing text/x-toml
--   with Servant will parse it. Add [TOML] to the Servant API to enable
--   handling of it. See <a>BDCS.API.V0</a> for an example.
module BDCS.API.TOMLMediaType

-- | Used in the Servant ReqBody
data TOML

-- | toTOML needs to be implemented for the type being converted. See
--   <a>BDCS.API.Recipe</a> for an example.
class ToTOML a
toTOML :: ToTOML a => a -> ByteString

-- | parseTOML needs to be implemented for the type being converted. See
--   <a>BDCS.API.Recipe</a> for an example.
class FromTOML a
parseTOML :: FromTOML a => ByteString -> Either String a
instance BDCS.API.TOMLMediaType.FromTOML a => Servant.API.ContentTypes.MimeUnrender BDCS.API.TOMLMediaType.TOML a
instance BDCS.API.TOMLMediaType.ToTOML a => Servant.API.ContentTypes.MimeRender BDCS.API.TOMLMediaType.TOML a
instance Servant.API.ContentTypes.Accept BDCS.API.TOMLMediaType.TOML


-- | Utility functions for <a>BDCS.API</a>
module BDCS.API.Utils

-- | Apply limit and offset to a list.
applyLimits :: Int -> Int -> [a] -> [a]

-- | Take a list of possiby comma, or comma-space, separated options and
--   turn it into a list of options
argify :: Foldable t => t String -> [String]

-- | Compare 2 strings case-insensitively
--   
--   Takes into account unicode
caseInsensitive :: String -> String -> Ordering

-- | Compare 2 T.Text's case-insensitively
--   
--   Takes into account unicode
caseInsensitiveT :: Text -> Text -> Ordering

-- | Git Repository and its RWLock
--   
--   This is used to control access to the Git repository. Users should
--   take the lock like this:
--   
--   <pre>
--   RWL.withRead (gitRepoLock repoLock)
--   </pre>
data GitLock
GitLock :: RWLock -> Repository -> GitLock
[gitRepoLock] :: GitLock -> RWLock
[gitRepo] :: GitLock -> Repository

-- | Turn exceptions from an action into <a>Nothing</a>
maybeIO :: IO a -> IO (Maybe a)

-- | Throw an IO error when a <a>Maybe</a> is <a>Nothing</a>
maybeThrow :: Exception e => e -> Maybe a -> IO a


-- | Recipe is used to store information about what packages are included
--   in a composition.
--   
--   It can be converted to and from TOML and JSON when needed.
module BDCS.API.Recipe

-- | <a>semver</a> recipe version number bump
--   
--   <ul>
--   <li><i><tt>prev_ver</tt></i> Previous version</li>
--   <li><i><tt>new_ver</tt></i> New version</li>
--   </ul>
--   
--   <ul>
--   <li>If neither have a version 0.0.1 is returned</li>
--   <li>If there is no previous version the new version is checked and
--   returned</li>
--   <li>If there is no new version, but there is a previous one, bump its
--   patch level</li>
--   <li>If the previous and new versions are the same, bump the patch
--   level</li>
--   <li>If they are different, check and return the new version</li>
--   </ul>
--   
--   Errors will be returned in the Left
bumpVersion :: Maybe String -> Maybe String -> Either String String

-- | Return a sorted list of the unique module+packages in a recipe
getAllRecipeProjects :: Recipe -> [String]

-- | Parse a TOML formatted recipe string and return a Recipe
--   
--   If there is an error the details will be returned in the Left
parseRecipe :: Text -> Either String Recipe

-- | Convert a Recipe to a TOML string
recipeTOML :: Recipe -> Text

-- | Convert a recipe name to a toml filename
--   
--   <ul>
--   <li><i><tt>name</tt></i> The recipe name (not filename)</li>
--   </ul>
--   
--   Replaces spaces with - and append .toml
recipeTomlFilename :: String -> Text

-- | Bump or replace a Recipe Version with a new one
--   
--   <ul>
--   <li><i><tt>recipe</tt></i> The Recipe to bump</li>
--   <li><i><tt>prev_version</tt></i> Previous version of the recipe</li>
--   </ul>
--   
--   Pass the new recipe and the version from the previous recipe Returns a
--   new recipe with the correct version
--   
--   Errors will be returned in the Left
recipeBumpVersion :: Recipe -> Maybe String -> Either String Recipe

-- | Recipe data structure
--   
--   Note that at this time there is no real distinction between package
--   and modules.
data Recipe
Recipe :: String -> Maybe String -> String -> [RecipeModule] -> [RecipeModule] -> RecipeCustomization -> Recipe

-- | Human readable recipe name
[rName] :: Recipe -> String

-- | Version, following <a>semver</a> rules.
[rVersion] :: Recipe -> Maybe String

-- | Human readable description of the Recipe
[rDescription] :: Recipe -> String

-- | List of Packages in the Recipe
[rPackages] :: Recipe -> [RecipeModule]

-- | List of Modules in the Recipe
[rModules] :: Recipe -> [RecipeModule]

-- | Post-export customization block
[rCustomization] :: Recipe -> RecipeCustomization

-- | Name and Version glob of a package or module
data RecipeModule
RecipeModule :: String -> String -> RecipeModule

-- | Name of the package/module
[rmName] :: RecipeModule -> String

-- | Version glob describing the package
[rmVersion] :: RecipeModule -> String
instance GHC.Show.Show BDCS.API.Recipe.Recipe
instance GHC.Classes.Eq BDCS.API.Recipe.Recipe
instance GHC.Show.Show BDCS.API.Recipe.RecipeModule
instance GHC.Classes.Eq BDCS.API.Recipe.RecipeModule
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Recipe.Recipe
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Recipe.Recipe
instance BDCS.API.TOMLMediaType.ToTOML BDCS.API.Recipe.Recipe
instance BDCS.API.TOMLMediaType.FromTOML BDCS.API.Recipe.Recipe
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Recipe.RecipeModule
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Recipe.RecipeModule

module BDCS.API.Depsolve

-- | Package build details
data PackageNEVRA
PackageNEVRA :: Text -> Maybe Int -> Text -> Text -> Text -> PackageNEVRA
[pnName] :: PackageNEVRA -> Text
[pnEpoch] :: PackageNEVRA -> Maybe Int
[pnVersion] :: PackageNEVRA -> Text
[pnRelease] :: PackageNEVRA -> Text
[pnArch] :: PackageNEVRA -> Text
mkPackageNEVRA :: (Text, Maybe Text, Text, Text, Text) -> PackageNEVRA

-- | Depsolve a list of project names, returning a list of PackageNEVRA If
--   there is an error it returns an empty list
depsolveProjects :: (MonadBaseControl IO m, MonadIO m) => ConnectionPool -> [Text] -> m (Either String [PackageNEVRA])
depsolveRecipe :: (MonadBaseControl IO m, MonadIO m) => ConnectionPool -> Recipe -> m (Either Text ([PackageNEVRA], [PackageNEVRA]))
instance GHC.Classes.Eq BDCS.API.Depsolve.PackageNEVRA
instance GHC.Show.Show BDCS.API.Depsolve.PackageNEVRA
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Depsolve.PackageNEVRA
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Depsolve.PackageNEVRA


-- | BDCS API Compose-related types and functions
module BDCS.API.Compose
data ComposeInfo
ComposeInfo :: FilePath -> Text -> Recipe -> FilePath -> [Customization] -> ExportType -> ComposeInfo

-- | Path to the compose artifact
[ciDest] :: ComposeInfo -> FilePath

-- | Build UUID
[ciId] :: ComposeInfo -> Text

-- | The recipe being built
[ciRecipe] :: ComposeInfo -> Recipe

-- | Directory containing the compose and other files
[ciResultsDir] :: ComposeInfo -> FilePath

-- | Customizations to perform on the items in the compose
[ciCustom] :: ComposeInfo -> [Customization]

-- | Build type (tar, etc.)
[ciType] :: ComposeInfo -> ExportType
data ComposeMsgAsk
AskBuildsWaiting :: ComposeMsgAsk
AskBuildsInProgress :: ComposeMsgAsk
AskCancelBuild :: Text -> ComposeMsgAsk
AskCompose :: ComposeInfo -> ComposeMsgAsk
AskDequeueBuild :: Text -> ComposeMsgAsk
data ComposeMsgResp
RespBuildCancelled :: Bool -> ComposeMsgResp
RespBuildDequeued :: Bool -> ComposeMsgResp
RespBuildsWaiting :: [Text] -> ComposeMsgResp
RespBuildsInProgress :: [Text] -> ComposeMsgResp
data ComposeStatus
ComposeStatus :: Text -> Text -> QueueStatus -> UTCTime -> Text -> ComposeStatus
[csBuildId] :: ComposeStatus -> Text
[csName] :: ComposeStatus -> Text
[csQueueStatus] :: ComposeStatus -> QueueStatus
[csTimestamp] :: ComposeStatus -> UTCTime
[csVersion] :: ComposeStatus -> Text
data UuidStatus
UuidStatus :: Bool -> Text -> UuidStatus
[usStatus] :: UuidStatus -> Bool
[usUuid] :: UuidStatus -> Text
compose :: (MonadBaseControl IO m, MonadLoggerIO m, MonadThrow m) => FilePath -> ConnectionPool -> ComposeInfo -> m ()
deleteCompose :: FilePath -> Text -> IO (Either String UuidStatus)
getComposesWithStatus :: FilePath -> QueueStatus -> IO [ComposeStatus]
mkComposeStatus :: FilePath -> Text -> ExceptT String IO ComposeStatus
instance GHC.Classes.Eq BDCS.API.Compose.UuidStatus
instance GHC.Show.Show BDCS.API.Compose.UuidStatus
instance GHC.Classes.Eq BDCS.API.Compose.ComposeStatus
instance GHC.Show.Show BDCS.API.Compose.ComposeStatus
instance GHC.Show.Show BDCS.API.Compose.ComposeInfo
instance GHC.Classes.Eq BDCS.API.Compose.ComposeInfo
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Compose.UuidStatus
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Compose.UuidStatus
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Compose.ComposeStatus
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Compose.ComposeStatus


-- | BDCS API Server Configuration
module BDCS.API.Config
type AskTuple = (ComposeMsgAsk, Maybe (TMVar ComposeMsgResp))
data ServerConfig
ServerConfig :: GitLock -> TChan AskTuple -> ConnectionPool -> FilePath -> FilePath -> ServerConfig

-- | Lock required for accessing recipe repo
[cfgRepoLock] :: ServerConfig -> GitLock

-- | Channel for the API server to ask things of the compose server. The
--   tuple is the message that needs a response and a location for where
--   the response should be written to.
[cfgChan] :: ServerConfig -> TChan AskTuple

-- | SQL connection pool for accessing MDDB
[cfgPool] :: ServerConfig -> ConnectionPool

-- | Location of the content store
[cfgBdcs] :: ServerConfig -> FilePath

-- | Base location for writing results
[cfgResultsDir] :: ServerConfig -> FilePath

module BDCS.API.Results
guardReturnResults :: ServerConfig -> String -> Handler ComposeStatus
returnImage :: ServerConfig -> String -> Handler (FilePath, ByteString)
returnImageLocation :: ServerConfig -> String -> Handler (Maybe FilePath)
returnResults :: KnownSymbol h => ServerConfig -> String -> Maybe FilePath -> [FilePath] -> Handler (Headers '[Header h String] ByteString)


-- | Workspace functions - The workspace is a temporary storage location
--   for Recipes.
--   
--   The workspace files are stored under the
--   .<i>git</i>workspace/&lt;branch&gt; directory using the recipe's toml
--   filename as created by <a>recipeTomlFilename</a>.
--   
--   Recipes written to the workspace are not committed to git, and are
--   overwritten on the next call to <a>workspaceWrite</a>
module BDCS.API.Workspace

-- | Read a <a>Recipe</a> from the branch's workspace
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> The name, not the filename, of the
--   recipe to read</li>
--   </ul>
--   
--   Can throw <a>WorkspaceError</a>
workspaceRead :: Repository -> Text -> Text -> IO (Maybe Recipe)

-- | Write a <a>Recipe</a> to the branch's workspace
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe</tt></i> The <a>Recipe</a> to write to the
--   workspace</li>
--   </ul>
workspaceWrite :: Repository -> Text -> Recipe -> IO ()

-- | Delete the recipe from the branch's workspace
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> The name, not the filename, of the
--   recipe to read</li>
--   </ul>
--   
--   Can throw a WorkspaceError
workspaceDelete :: Repository -> Text -> Text -> IO ()

-- | Create the branch's workspace path
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   </ul>
workspaceDir :: Repository -> Text -> IO FilePath

-- | Workspace Errors
data WorkspaceError

-- | There was a problem getting the path to the repository
RepoLocationError :: WorkspaceError

-- | There was an error parsing the recipe, details will be included
ParseRecipeError :: String -> WorkspaceError
instance GHC.Show.Show BDCS.API.Workspace.WorkspaceError
instance GHC.Classes.Eq BDCS.API.Workspace.WorkspaceError
instance GHC.Exception.Exception BDCS.API.Workspace.WorkspaceError


-- | Git Recipe storage functions
--   
--   Recipes are stored in a bare git repository. The repository is created
--   with <a>openOrCreateRepo</a> which returns the Repository which is
--   passed to all of the other functions.
module BDCS.API.Recipes

-- | Open a Git repository, or create the initial repository if one doesn't
--   exist
--   
--   <ul>
--   <li><i><tt>path</tt></i> Path to the git repository</li>
--   </ul>
--   
--   The bare git repository is created in ./git underneath path If the
--   directory doesn't look like an existing git repo (no .<i>git</i>HEAD
--   file) then a new bare repository is created.
--   
--   Can throw <a>OpenRepoError</a>, <a>CreateRepoError</a>,
--   <a>NewSignatureError</a>, <a>GetIndexError</a>, <a>WriteTreeError</a>,
--   <a>LookupTreeError</a>, or <a>CreateCommitError</a>
openOrCreateRepo :: FilePath -> IO Repository

-- | Lookup the Branch name or create a new branch and return a Git.Branch
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   </ul>
--   
--   Can throw <a>GetHeadError</a>, <a>RefLookupError</a>, or
--   <a>CreateBranchError</a>
findOrCreateBranch :: Repository -> Text -> IO Branch

-- | Convert a Branch object to an OId
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   </ul>
--   
--   Can throw <a>BranchNameError</a>, <a>LookupReferenceError</a>, or
--   <a>GetTargetError</a>
getBranchOIdFromObject :: Repository -> Branch -> IO OId

-- | Make a new commit to a repository's branch
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> Filename of the commit</li>
--   <li><i><tt>message</tt></i> Commit message</li>
--   <li><i><tt>content</tt></i> Data to be written to the commit</li>
--   </ul>
--   
--   Returns the OId of the new commit.
--   
--   Can throw <a>CreateBlobError</a>, <a>GetTreeError</a>,
--   <a>TreeBuilderError</a>, <a>BuilderInsertError</a>, or
--   <a>CreateCommitError</a>
writeCommit :: Repository -> Text -> Text -> Text -> ByteString -> IO OId

-- | Read a commit and return a ByteString of the content
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> Filename of the commit</li>
--   <li><i><tt>commit</tt></i> Commit hash to read, or Nothing to read the
--   HEAD</li>
--   </ul>
--   
--   TODO Return the commit message too
readCommit :: Repository -> Text -> Text -> Maybe Text -> IO (Text, ByteString)

-- | Read a commit using a revspec, return the ByteString content
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>spec</tt></i> revspec to read.</li>
--   </ul>
--   
--   eg. &lt;commit&gt;:&lt;filename&gt; or &lt;branch&gt;:&lt;filename&gt;
--   
--   Can throw <a>RevparseError</a>, <a>GetIdError</a>,
--   <a>LookupBlobError</a>, or <a>GetRawBlobError</a>
readCommitSpec :: Repository -> Text -> IO ByteString

-- | List the files on a branch
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   </ul>
listBranchFiles :: Repository -> Text -> IO [Text]

-- | List the files in a commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>commit</tt></i> The commit to get the files from</li>
--   </ul>
--   
--   Can throw <a>GetTreeIdError</a>, or <a>LookupTreeError</a>
listCommitFiles :: Repository -> Commit -> IO [Text]

-- | Delete a file from a branch
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> The recipe filename to delete</li>
--   </ul>
--   
--   Can throw <a>GetTreeError</a>, <a>TreeBuilderError</a>, or
--   <a>CreateCommitError</a>
deleteFile :: Repository -> Text -> Text -> IO OId

-- | Delete a recipe from a branch
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> The recipe name to delete (not the
--   filename)</li>
--   </ul>
deleteRecipe :: Repository -> Text -> Text -> IO OId

-- | Revert a recipe file to a previous commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> The recipe filename to revert</li>
--   <li><i><tt>commit</tt></i> The commit hash string to revert to</li>
--   </ul>
--   
--   Can throw <a>NewOIdError</a>
revertFile :: Repository -> Text -> Text -> Text -> IO OId

-- | Revert a recipe file to a previous commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> The recipe filename to revert</li>
--   <li><i><tt>commit</tt></i> The commit object to revert to</li>
--   </ul>
--   
--   Can throw <a>LookupCommitError</a>, <a>GetTreeError</a>,
--   <a>GetByNameError</a>, <a>GetEntryIdError</a>, <a>GetTreeError</a>,
--   '', <a>OIdError</a>, <a>CreateCommitError</a>
revertFileCommit :: Repository -> Text -> Text -> OId -> IO OId

-- | Revert a recipe to a previous commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> The recipe name to revert (not the
--   filename)</li>
--   <li><i><tt>commit</tt></i> The commit hash string to revert to</li>
--   </ul>
revertRecipe :: Repository -> Text -> Text -> Text -> IO OId

-- | List the commits for a recipe
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> Recipe name (not filename)</li>
--   </ul>
--   
--   Returns a list of <a>CommitDetails</a>
listRecipeCommits :: Repository -> Text -> Text -> IO [CommitDetails]

-- | List the commits for a filename
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> Recipe filename</li>
--   </ul>
--   
--   Returns a list of <a>CommitDetails</a>
--   
--   Can throw <a>NewWalkerError</a>
listCommits :: Repository -> Text -> Text -> IO [CommitDetails]

-- | Find the revision tag pointing to a specific commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> Recipe filename</li>
--   <li><i><tt>commit_id</tt></i> The commit OId</li>
--   </ul>
--   
--   The Tag is of the form
--   refs<i>tags</i>&lt;branch&gt;<i>&lt;filename&gt;</i>r&lt;revision&gt;
--   There should only be one result.
findCommitTag :: Repository -> Text -> Text -> OId -> IO (Maybe Text)

-- | Get the revision number from a git tag
--   
--   <ul>
--   <li><i><tt>mtag</tt></i> The tag string to extract the revision
--   from</li>
--   </ul>
--   
--   The Tag is of the form
--   refs<i>tags</i>&lt;branch&gt;<i>&lt;filename&gt;</i>r&lt;revision&gt;
--   
--   Returns the revision from the tag, or Nothing
getRevisionFromTag :: Maybe Text -> Maybe Int

-- | Tag a file's most recent commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> Recipe filename</li>
--   </ul>
--   
--   This uses git tags, of the form
--   refs<i>tags</i>&lt;branch&gt;<i>&lt;filename&gt;</i>r&lt;revision&gt;
--   Only the most recent recipe commit can be tagged to prevent out of
--   order tagging. Revisions start at 1 and increment for each new commit
--   that is tagged. If the commit has already been tagged it will return
--   False.
--   
--   Can throw <a>NewSignatureError</a>, <a>NewOIdError</a>,
--   <a>LookupError</a>
tagFileCommit :: Repository -> Text -> Text -> IO Bool

-- | Tag a recipe's most recent commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> Recipe name (not filename)</li>
--   </ul>
--   
--   Returns True if it is successful
tagRecipeCommit :: Repository -> Text -> Text -> IO Bool

-- | Commit a Recipe TOML file
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>filename</tt></i> Recipe filename</li>
--   </ul>
--   
--   Returns the OId of the new commit
commitRecipeFile :: Repository -> Text -> FilePath -> IO OId

-- | Commit a Recipe record to a branch
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe</tt></i> Recipe record</li>
--   </ul>
--   
--   If there is already an existing recipe this will bump or replace the
--   version number depending on what the new recipe contains. See the
--   rules in <a>bumpVersion</a>
commitRecipe :: Repository -> Text -> Recipe -> IO OId

-- | Commit recipes from a directory, if they don't already exist
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>directory</tt></i> Directory to read the recipes from</li>
--   </ul>
--   
--   This reads all files ending in .toml from the directory, skipping
--   recipes that are already in the branch.
commitRecipeDirectory :: Repository -> Text -> FilePath -> IO [OId]

-- | Read a Recipe from a commit
--   
--   <ul>
--   <li><i><tt>repo</tt></i> Open git repository</li>
--   <li><i><tt>branch</tt></i> Branch name</li>
--   <li><i><tt>recipe_name</tt></i> Recipe name (not filename)</li>
--   <li><i><tt>commit</tt></i> The commit hash string to read</li>
--   </ul>
--   
--   If the recipe isn't found it returns a Left
readRecipeCommit :: Repository -> Text -> Text -> Maybe Text -> IO (Either String (Text, Recipe))

-- | Find the differences between two recipes
--   
--   <ul>
--   <li><i><tt>oldRecipe</tt></i> The old version of the Recipe</li>
--   <li><i><tt>newRecipe</tt></i> The new version of the Recipe</li>
--   </ul>
--   
--   This calculates the differences between the recipes, returning a list
--   of <a>RecipeDiffEntry</a>. The order is always the same, Name,
--   Description, Version, removed Modules, added Modules, removed
--   Packages, added Packages, and then packages with different versions.
recipeDiff :: Recipe -> Recipe -> [RecipeDiffEntry]

-- | Run the Git repository tests with a temporary directory
runGitRepoTests :: IO Bool

-- | Run the Workspace tests with a temporary directory
runWorkspaceTests :: IO Bool

-- | File commit details
data CommitDetails
CommitDetails :: Text -> Text -> Text -> Maybe Int -> CommitDetails

-- | Hash string
[cdCommit] :: CommitDetails -> Text

-- | Timestamp in ISO 8601 format
[cdTime] :: CommitDetails -> Text

-- | Commit message, separated by n
[cdMessage] :: CommitDetails -> Text

-- | Recipe revision number
[cdRevision] :: CommitDetails -> Maybe Int

-- | A difference entry
--   
--   This uses RecipeDiffType to indicate the type of difference between
--   recipe fields.
--   
--   If old is set and new is None it means the entry was removed If old is
--   None and new is set it means the entry was added If both are set then
--   old the the old content and new is the new content
data RecipeDiffEntry
RecipeDiffEntry :: RecipeDiffType -> RecipeDiffType -> RecipeDiffEntry
[rdeOld] :: RecipeDiffEntry -> RecipeDiffType
[rdeNew] :: RecipeDiffEntry -> RecipeDiffType

-- | Type of Diff Entry
--   
--   Used by RecipeDiffEntry's old and new fields
data RecipeDiffType

-- | Name changed
Name :: String -> RecipeDiffType
[rdtName] :: RecipeDiffType -> String

-- | Description changed
Description :: String -> RecipeDiffType
[rdtDescription] :: RecipeDiffType -> String

-- | Version changed
Version :: Maybe String -> RecipeDiffType
[rdtVersion] :: RecipeDiffType -> Maybe String

-- | Module version changed, added, or removed
Module :: RecipeModule -> RecipeDiffType
[rdtModule] :: RecipeDiffType -> RecipeModule

-- | Package version changed, added, or removed
Package :: RecipeModule -> RecipeDiffType
[rdtPackage] :: RecipeDiffType -> RecipeModule

-- | Used for added and removed
None :: RecipeDiffType

-- | Errors that can be thrown by the BDCS.API.Recipes functions.
data GitError

-- | Repo open error
OpenRepoError :: GitError

-- | Problem creating a new repo
CreateRepoError :: GitError

-- | New Blob error
CreateBlobError :: GitError

-- | Error creating a commit
CreateCommitError :: GitError

-- | New Branch error
CreateBranchError :: GitError

-- | Branch name error, eg. doesn't exist
BranchNameError :: GitError

-- | Tree writing error
WriteTreeError :: GitError

-- | Error getting the repository error
GetIndexError :: GitError

-- | Error getting the repository head
GetHeadError :: GitError

-- | Error looking up a ref. eg. doesn't exist
RefLookupError :: GitError

-- | Problem creating a Tree Builder for a Tree.
TreeBuilderError :: GitError

-- | Problem getting a Tree by name
GetByNameError :: GitError

-- | Problem getting a Tree Entry by name
GetNameError :: GitError

-- | Error getting ref. target
GetTargetError :: GitError

-- | Problem getting the time from the Signature
GetTimeError :: GitError

-- | Problem getting the timezone from the Signature
GetTimeZoneError :: GitError

-- | Error getting Commit Tree
GetTreeError :: GitError

-- | Error getting commit Tree Id
GetTreeIdError :: GitError

-- | Error getting the committer's Signature
GetCommitterError :: GitError

-- | Error getting commit message
GetMessageError :: GitError

-- | Problem getting commit's parents
GetParentsError :: GitError

-- | Error looking up a commit
LookupError :: GitError

-- | Error looking up a Blob OId
LookupBlobError :: GitError

-- | Branch error, eg. doesn't exist
LookupBranchError :: GitError

-- | Commit error, eg. commit doesn't exist
LookupCommitError :: GitError

-- | Error looking up a Tag. eg. doesn't exist
LookupTagError :: GitError

-- | Tree Lookup error. eg. tree id doesn't exist
LookupTreeError :: GitError

-- | Problem looking up a reference
LookupReferenceError :: GitError

-- | Problem parsing a revision spec
RevparseError :: GitError

-- | Tree Builder write error
BuilderWriteError :: GitError

-- | Tree Builder insert error
BuilderInsertError :: GitError

-- | Error getting a tree entry id
GetEntryIdError :: GitError

-- | Problem getting object's id
GetIdError :: GitError

-- | Error getting the raw Blob content
GetRawBlobError :: GitError

-- | Error getting Tag Id from a tag object
GetTargetIdError :: GitError

-- | Problem creating a new OId from a string
NewOIdError :: GitError

-- | Error creating a new Options object
NewOptionsError :: GitError

-- | Error creating a new TimeVal object
NewTimeValError :: GitError

-- | Problem creating a new diff Tree
NewTreeError :: GitError

-- | Error creating a new Signature
NewSignatureError :: GitError

-- | Error creating a new revision Walker object
NewWalkerError :: GitError

-- | Error creating a String from an OId
OIdError :: GitError

-- | print the OId
--   
--   <ul>
--   <li><i><tt>oid</tt></i> The OId to print</li>
--   </ul>
--   
--   Used for debugging
printOId :: OId -> IO ()
instance GHC.Show.Show BDCS.API.Recipes.TestError
instance GHC.Classes.Eq BDCS.API.Recipes.TestError
instance GHC.Show.Show BDCS.API.Recipes.RecipeDiffEntry
instance GHC.Classes.Eq BDCS.API.Recipes.RecipeDiffEntry
instance GHC.Show.Show BDCS.API.Recipes.RecipeDiffType
instance GHC.Classes.Eq BDCS.API.Recipes.RecipeDiffType
instance GHC.Classes.Eq BDCS.API.Recipes.CommitDetails
instance GHC.Show.Show BDCS.API.Recipes.CommitDetails
instance GHC.Show.Show BDCS.API.Recipes.GitError
instance GHC.Classes.Eq BDCS.API.Recipes.GitError
instance GHC.Exception.Exception BDCS.API.Recipes.TestError
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Recipes.RecipeDiffEntry
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Recipes.RecipeDiffEntry
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Recipes.RecipeDiffType
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Recipes.RecipeDiffType
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Recipes.CommitDetails
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Recipes.CommitDetails
instance GHC.Exception.Exception BDCS.API.Recipes.GitError


-- | API v0 routes
module BDCS.API.V0

-- | Connect the V0API type to all of the handlers
v0ApiServer :: ServerConfig -> Server V0API

-- | The JSON response for <i>blueprints</i>list
data RecipesListResponse
RecipesListResponse :: [Text] -> Int -> Int -> Int -> RecipesListResponse

-- | List of blueprint names
[$sel:rlrRecipes:RecipesListResponse] :: RecipesListResponse -> [Text]

-- | Pagination offset into results
[$sel:rlrOffset:RecipesListResponse] :: RecipesListResponse -> Int

-- | Pagination limit of results
[$sel:rlrLimit:RecipesListResponse] :: RecipesListResponse -> Int

-- | Total number of blueprint names
[$sel:rlrTotal:RecipesListResponse] :: RecipesListResponse -> Int

-- | <i>api</i>v0<i>blueprints</i>list List the names of the available
--   blueprints
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   </ul>
--   
--   <pre>
--   {
--       "blueprints": [
--           "development",
--           "glusterfs",
--           "http-server",
--           "jboss",
--           "kubernetes",
--           "octave",
--       ],
--       "offset": 0,
--       "limit": 20,
--       "total": 6
--   }
--   </pre>
recipesList :: ServerConfig -> Maybe String -> Maybe Int -> Maybe Int -> Handler RecipesListResponse

-- | Status of a blueprint's workspace
data WorkspaceChanges
WorkspaceChanges :: Text -> Bool -> WorkspaceChanges

-- | Blueprint name
[$sel:wcName:WorkspaceChanges] :: WorkspaceChanges -> Text

-- | True when it is newer than the last commit
[$sel:wcChanged:WorkspaceChanges] :: WorkspaceChanges -> Bool

-- | The JSON response for <i>blueprints</i>info
data RecipesInfoResponse
RecipesInfoResponse :: [WorkspaceChanges] -> [Recipe] -> [String] -> RecipesInfoResponse

-- | Workspace status for each blueprint
[$sel:rirChanges:RecipesInfoResponse] :: RecipesInfoResponse -> [WorkspaceChanges]

-- | The Recipe record
[$sel:rirRecipes:RecipesInfoResponse] :: RecipesInfoResponse -> [Recipe]

-- | Errors reading the blueprint
[$sel:rirErrors:RecipesInfoResponse] :: RecipesInfoResponse -> [String]

-- | <i>api</i>v0<i>blueprints</i>info/&lt;recipes&gt; Return the contents
--   of the blueprint, or a list of recipes
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipes_names</tt></i> A comma separated list of blueprint
--   names</li>
--   </ul>
--   
--   The errors list may be empty, or may include blueprint-specific errors
--   if there was a problem retrieving it.
--   
--   <pre>
--   {
--       "changes": [
--           {
--               "name": "blueprint-test",
--               "changed": true
--           },
--       ],
--       "blueprints": [
--           {
--               "name": "http-server",
--               "description": "An example http server with PHP and MySQL support.",
--               "version": "0.0.1",
--               "modules": [
--                   {
--                       "name": "httpd",
--                       "version": "2.4.*"
--                   },
--                   {
--                       "name": "mod_auth_kerb",
--                       "version": "5.4"
--                   },
--                   {
--                       "name": "mod_ssl",
--                       "version": "2.4.*"
--                   },
--                   {
--                       "name": "php",
--                       "version": "5.4.*"
--                   },
--                   {
--                       "name": "php-mysql",
--                       "version": "5.4.*"
--                   }
--               ],
--               "packages": [
--                   {
--                       "name": "tmux",
--                       "version": "2.2"
--                   },
--                   {
--                       "name": "openssh-server",
--                       "version": "6.6.*"
--                   },
--                   {
--                       "name": "rsync",
--                       "version": "3.0.*"
--                   }
--               ]
--           },
--       "errors": ["a-missing-blueprint: Error retrieving a-missing-blueprint.toml"]
--   }
--   </pre>
recipesInfo :: ServerConfig -> Maybe String -> String -> Handler RecipesInfoResponse

-- | Get the recipe from the workspace or from git If there is neither
--   workspace or git recipes then an error is returned.
getRecipeInfo :: GitLock -> Text -> Text -> IO (Either String (Bool, Recipe))

-- | Details about commits to a blueprint
data RecipeChanges
RecipeChanges :: Text -> [CommitDetails] -> Int -> RecipeChanges

-- | Blueprint name
[$sel:rcName:RecipeChanges] :: RecipeChanges -> Text

-- | Details of the commit
[$sel:rcChange:RecipeChanges] :: RecipeChanges -> [CommitDetails]

-- | Total number of commits
[$sel:rcTotal:RecipeChanges] :: RecipeChanges -> Int

-- | <i>api</i>v0<i>blueprints</i>changes/&lt;recipes&gt; Return the commit
--   history of the blueprints
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipes_name</tt></i> The blueprint name</li>
--   <li><i><tt>moffset</tt></i> The offset from the start of the results.
--   Defaults to 0</li>
--   <li><i><tt>mlimit</tt></i> Limit to the number of results to be
--   returned. Defaults to 20</li>
--   </ul>
--   
--   The changes for each listed blueprint will have offset and limit
--   applied to them. This means that there will be cases where changes
--   will be empty, when offset &gt; total for the blueprint.
--   
--   If a blueprint commit has been tagged as a new revision the changes
--   will include a <tt>revision</tt> field set to the revision number. If
--   the commit has not been tagged it will not have this field included.
--   
--   <pre>
--   {
--       "blueprints": [
--           {
--               "name": "nfs-server",
--               "changes": [
--                   {
--                       "commit": "97d483e8dd0b178efca9a805e5fd8e722c48ac8e",
--                       "time": "Wed,  1 Mar 2017 13:29:37 -0800",
--                       "summary": "Recipe nfs-server saved"
--                   },
--                   {
--                       "commit": "857e1740f983bf033345c3242204af0ed7b81f37",
--                       "time": "Wed,  1 Mar 2017 09:28:53 -0800",
--                       "summary": "Recipe nfs-server saved",
--                       "revision" : 1
--                   }
--               ],
--               "total": 2
--           },
--           {
--               "name": "ruby",
--               "changes": [
--                   {
--                       "commit": "4b84f072befc3f4debbe1348d6f4b166f7c83d78",
--                       "time": "Wed,  1 Mar 2017 13:32:09 -0800",
--                       "summary": "Recipe ruby saved"
--                   },
--                   {
--                       "commit": "85999253c1790367a860a344ea622971b7e0a050",
--                       "time": "Wed,  1 Mar 2017 13:31:19 -0800",
--                       "summary": "Recipe ruby saved"
--                   }
--               ],
--               "total": 2
--           }
--       ],
--       "errors": ["a-missing-recipe: Error retrieving a-missing-blueprint.toml"]
--       "offset": 0,
--       "limit": 20
--   }
--   </pre>
recipesChanges :: ServerConfig -> Maybe String -> String -> Maybe Int -> Maybe Int -> Handler RecipesChangesResponse

-- | POST <i>api</i>v0<i>blueprints</i>new Create or update a blueprint.
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe</tt></i> The blueprint record</li>
--   </ul>
--   
--   The body of the post is a JSON or TOML representation of the
--   blueprint. If Conten-Type is application/json it uses the same format
--   received from <i>api</i>v0<i>blueprints</i>info<i>&lt;blueprints&gt;,
--   and if it is text</i>x-toml it uses the blueprint's TOML format for
--   the body.
--   
--   The response for a successful POST is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
recipesNew :: ServerConfig -> Maybe String -> Recipe -> Handler APIResponse

-- | DELETE <i>api</i>v0<i>blueprints</i>delete/&lt;recipe&gt; Delete the
--   named blueprint from the repository branch
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe_name</tt></i> The blueprint name</li>
--   </ul>
--   
--   The response for a successful DELETE is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
recipesDelete :: ServerConfig -> Maybe String -> String -> Handler APIResponse

-- | POST
--   <i>api</i>v0<i>blueprints</i>undo<i>&lt;recipe&gt;</i>&lt;commit&gt;
--   Revert a blueprint to a previous commit
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe_name</tt></i> The blueprint name</li>
--   <li><i><tt>commit</tt></i> The commit to revert to</li>
--   </ul>
--   
--   The response for a successful POST is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
recipesUndo :: ServerConfig -> Maybe String -> String -> String -> Handler APIResponse

-- | POST <i>api</i>v0<i>blueprints</i>workspace Update the temporary
--   blueprint workspace
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe</tt></i> The blueprint record</li>
--   </ul>
--   
--   The body of the post is the same as <i>blueprints</i>new/. For more
--   details on the workspace see <a>BDCS.API.Workspace</a>
--   
--   The response for a successful POST is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
recipesWorkspace :: ServerConfig -> Maybe String -> Recipe -> Handler APIResponse

-- | DELETE <i>api</i>v0<i>blueprints</i>workspace/&lt;recipe&gt; Delete
--   the named blueprint from the workspace
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe_name</tt></i> The blueprint name</li>
--   </ul>
--   
--   The response for a successful DELETE is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
recipesWorkspaceDelete :: ServerConfig -> Maybe String -> String -> Handler APIResponse

-- | POST <i>api</i>v0<i>blueprints</i>tag/<a>blueprint</a> Tag the most
--   recent blueprint commit as the next revision
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe_name</tt></i> The blueprint name</li>
--   </ul>
--   
--   If the commit is already tagged it will return False.
--   
--   The response for a successful POST is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
recipesTag :: ServerConfig -> Maybe String -> String -> Handler APIResponse

-- | JSON response for <i>blueprints</i>diff
data RecipesDiffResponse
RecipesDiffResponse :: [RecipeDiffEntry] -> RecipesDiffResponse
[$sel:rdrDiff:RecipesDiffResponse] :: RecipesDiffResponse -> [RecipeDiffEntry]

-- | 
--   <i>api</i>v0<i>blueprints</i>diff<i><a>blueprint</a></i><a>from_commit</a>/<a>to_commit</a>
--   Return the diff between the two blueprint commits.
--   
--   <ul>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe_name</tt></i> The blueprint name</li>
--   <li><i><tt>from_commit</tt></i> The older commit to caclulate the
--   difference from, can also be NEWEST</li>
--   <li><i><tt>to_commit</tt></i> The newer commit to calculate the diff.
--   to, can also be NEWEST or WORKSPACE</li>
--   </ul>
--   
--   If there is an error retrieving a commit (eg. it cannot find the
--   hash), it will use HEAD instead and log an error.
--   
--   In addition to the commit hashes listed by a call to
--   <i>blueprints</i>changes/&lt;blueprint-name&gt; you can use NEWEST to
--   compare the latest commit, and WORKSPACE to compare it with the
--   current temporary workspace version of the blueprint. eg. to see what
--   the differences are between the current workspace and most recent
--   commit of http-server you would call:
--   
--   <pre>
--   /blueprints/diff/http-server/NEWEST/WORKSPACE
--   </pre>
--   
--   Each entry in the response's diff object contains the old blueprint
--   value and the new one. If old is null and new is set, then it was
--   added. If new is null and old is set, then it was removed. If both are
--   set, then it was changed.
--   
--   The old/new entries will have the name of the blueprint field that was
--   changed. This can be one of: Name, Description, Version, Module, or
--   Package. The contents for these will be the old/new values for them.
--   
--   In the example below the description and version were changed. The php
--   module's version was changed, the rsync package was removed, and the
--   vim-enhanced package was added.
--   
--   # Examples
--   
--   <pre>
--   {
--       "diff": [
--           {
--               "old": {
--                   "Description": "An example http server with PHP and MySQL support."
--               },
--               "new": {
--                   "Description": "Apache HTTP Server"
--               }
--           },
--           {
--               "old": {
--                   "Version": "0.0.1"
--               },
--               "new": {
--                   "Version": "0.1.1"
--               }
--           },
--           {
--               "old": {
--                   "Module": {
--                       "name": "php",
--                       "version": "5.4.*"
--                   }
--               },
--               "new": {
--                   "Module": {
--                       "name": "php",
--                       "version": "5.6.*"
--                   }
--               }
--           },
--           {
--               "old": null,
--               "new": {
--                   "Package": {
--                       "name": "vim-enhanced",
--                       "version": "8.0.*"
--                   }
--               }
--           },
--           {
--               "old": {
--                   "Package": {
--                       "name": "rsync",
--                       "version": "3.0.*"
--                   }
--               },
--               "new": null
--           }
--       ]
--   }
--   </pre>
recipesDiff :: ServerConfig -> Maybe String -> String -> String -> String -> Handler RecipesDiffResponse

-- | The blueprint's dependency details
data RecipeDependencies
RecipeDependencies :: Recipe -> [PackageNEVRA] -> [PackageNEVRA] -> RecipeDependencies
[$sel:rdRecipe:RecipeDependencies] :: RecipeDependencies -> Recipe
[$sel:rdDependencies:RecipeDependencies] :: RecipeDependencies -> [PackageNEVRA]
[$sel:rdModules:RecipeDependencies] :: RecipeDependencies -> [PackageNEVRA]

-- | The JSON response for <i>blueprints</i>depsolve/<a>blueprints</a>
data RecipesDepsolveResponse
RecipesDepsolveResponse :: [RecipeDependencies] -> [String] -> RecipesDepsolveResponse

-- | List of blueprints and their dependencies
[$sel:rdrRecipes:RecipesDepsolveResponse] :: RecipesDepsolveResponse -> [RecipeDependencies]

-- | Errors reading the blueprint
[$sel:rdrErrors:RecipesDepsolveResponse] :: RecipesDepsolveResponse -> [String]

-- | <i>api</i>v0<i>blueprints</i>depsolve/<a>blueprints</a> Return the
--   blueprint and summary information about all of its modules and
--   packages.
--   
--   <ul>
--   <li><i><tt>pool</tt></i> The sqlite connection pool object</li>
--   <li><i><tt>repoLock</tt></i> The git repositories
--   <tt>ReadWriteLock</tt> and Repository object</li>
--   <li><i><tt>mbranch</tt></i> The branch name</li>
--   <li><i><tt>recipe_names</tt></i> The blueprint names to depsolve,
--   comma-separated if there is more than one</li>
--   </ul>
--   
--   If a workspace version of the blueprint is found it will be used for
--   the depsolve. If there are any errors reading the blueprint, or
--   depsolving it, they will be returned in the <tt>errors</tt> object.
--   
--   # Error example
--   
--   <pre>
--   {
--       "errors": ["nfs-server.toml is not present on branch master"],
--       "blueprints": []
--   }
--   </pre>
--   
--   A successful result will include 3 items. <tt>dependencies</tt> will
--   be the NEVRAs of all of the projects needed to satisfy the blueprint's
--   dependencies. <tt>modules</tt> will be the project NEVRAs for the
--   modules and packages explicitly listed in the blueprint, and
--   <tt>blueprint</tt> will be a copy of the blueprint that was depsolved.
--   
--   # Abbreviated successful example
--   
--   <pre>
--   {
--       "errors": [],
--       "blueprints": [
--           {
--               "dependencies": [
--                   {
--                       "arch": "x86_64",
--                       "epoch": 0,
--                       "name": "apr",
--                       "release": "3.el7",
--                       "version": "1.4.8"
--                   },
--                   {
--                       "arch": "x86_64",
--                       "epoch": 0,
--                       "name": "apr-util",
--                       "release": "6.el7",
--                       "version": "1.5.2"
--                   },
--                   ...
--               ],
--               "modules": [
--                   {
--                       "arch": "x86_64",
--                       "epoch": 0,
--                       "name": "httpd",
--                       "release": "67.el7",
--                       "version": "2.4.6"
--                   },
--                   {
--                       "arch": "x86_64",
--                       "epoch": 0,
--                       "name": "mod_auth_kerb",
--                       "release": "28.el7",
--                       "version": "5.4"
--                   },
--                   ...
--               ],
--              "blueprint": {
--                   "description": "An example http server with PHP and MySQL support.",
--                   "modules": [
--                       {
--                           "name": "httpd",
--                           "version": "2.4.*"
--                       },
--                       {
--                           "name": "mod_auth_kerb",
--                           "version": "5.4"
--                       },
--                       {
--                           "name": "mod_ssl",
--                           "version": "2.4.*"
--                       },
--                       {
--                           "name": "php",
--                           "version": "5.4.*"
--                       },
--                       {
--                           "name": "php-mysql",
--                           "version": "5.4.*"
--                       }
--                   ],
--                   "name": "http-server",
--                   "packages": [
--                       {
--                           "name": "tmux",
--                           "version": "2.2"
--                       },
--                       {
--                           "name": "openssh-server",
--                           "version": "6.6.*"
--                       },
--                       {
--                           "name": "rsync",
--                           "version": "3.0.*"
--                       }
--                   ],
--                   "version": "0.2.0"
--               }
--           }
--       ]
--   }
--   </pre>
recipesDepsolve :: ServerConfig -> Maybe String -> String -> Handler RecipesDepsolveResponse

-- | The JSON response for <i>blueprints</i>freeze/<a>blueprints</a>
data RecipesFreezeResponse
RecipesFreezeResponse :: [Recipe] -> [String] -> RecipesFreezeResponse

-- | Recipes with exact versions
[$sel:rfrRecipes:RecipesFreezeResponse] :: RecipesFreezeResponse -> [Recipe]

-- | Errors reading the blueprint
[$sel:rfrErrors:RecipesFreezeResponse] :: RecipesFreezeResponse -> [String]

-- | <i>api</i>v0<i>blueprints</i>freeze/<a>blueprints</a> Return the
--   contents of the blueprint with frozen dependencies instead of
--   expressions.
--   
--   This depsolves the blueprint, and then replaces the modules and
--   packages versions with the EVR found by the depsolve, returning a
--   frozen blueprint.
--   
--   # Examples
--   
--   <pre>
--   {
--       "errors": [],
--       "blueprints": [
--           {
--               "description": "An example http server with PHP and MySQL support.",
--               "modules": [
--                   {
--                       "name": "httpd",
--                       "version": "2.4.6-67.el7"
--                   },
--                   {
--                       "name": "mod_auth_kerb",
--                       "version": "5.4-28.el7"
--                   },
--                   {
--                       "name": "mod_ssl",
--                       "version": "1:2.4.6-67.el7"
--                   },
--                   {
--                       "name": "php",
--                       "version": "5.4.16-42.el7"
--                   },
--                   {
--                       "name": "php-mysql",
--                       "version": "5.4.16-42.el7"
--                   }
--               ],
--               "name": "http-server",
--               "packages": [
--                   {
--                       "name": "tmux",
--                       "version": "1.8-4.el7"
--                   },
--                   {
--                       "name": "openssh-server",
--                       "version": "7.4p1-11.el7"
--                   },
--                   {
--                       "name": "rsync",
--                       "version": "3.0.9-18.el7"
--                   }
--               ],
--               "version": "0.2.0"
--           }
--       ]
--   }
--   </pre>
recipesFreeze :: ServerConfig -> Maybe String -> String -> Handler RecipesFreezeResponse

-- | The JSON response for <i>projects</i>list
data ProjectsListResponse
ProjectsListResponse :: [Projects] -> Int -> Int -> Int -> ProjectsListResponse

-- | List of project names
[$sel:plpProjects:ProjectsListResponse] :: ProjectsListResponse -> [Projects]

-- | Pagination offset into results
[$sel:plpOffset:ProjectsListResponse] :: ProjectsListResponse -> Int

-- | Pagination limit of results
[$sel:plpLimit:ProjectsListResponse] :: ProjectsListResponse -> Int

-- | Total number of project names
[$sel:plpTotal:ProjectsListResponse] :: ProjectsListResponse -> Int

-- | <i>api</i>v0<i>projects</i>list Return the list of available projects
--   
--   # Example
--   
--   <pre>
--   {
--       "limit": 20,
--       "offset": 0,
--       "projects": [
--           {
--               "description": "389 Directory Server is an LDAPv3 compliant server. ...",
--               "homepage": "https://www.port389.org/",
--               "name": "389-ds-base",
--               "summary": "389 Directory Server (base)",
--               "upstream_vcs": "UPSTREAM_VCS"
--           },
--           }
--       ],
--       "total": 2117
--   }
--   </pre>
projectsList :: ServerConfig -> Maybe Int -> Maybe Int -> Handler ProjectsListResponse

-- | The JSON response for <i>projects</i>info
data Metadata
Metadata :: Text -> Text -> Metadata
[$sel:mdKey:Metadata] :: Metadata -> Text
[$sel:mdVal:Metadata] :: Metadata -> Text

-- | <i>api</i>v0<i>projects</i>info/<a>projects</a> Return information
--   about the comma-separated list of projects
--   
--   # Example
--   
--   <pre>
--   {
--     "projects": [
--       {
--         "builds": [
--           {
--             "arch": "x86_64",
--             "build_config_ref": "BUILD_CONFIG_REF",
--             "build_env_ref": "BUILD_ENV_REF",
--             "build_time": "2017-03-01T08:39:23",
--             "changelog": "- restore incremental backups correctly, files ...",
--             "epoch": "2",
--             "metadata": {},
--             "release": "32.el7",
--             "source": {
--               "license": "GPLv3+",
--               "metadata": {},
--               "source_ref": "SOURCE_REF",
--               "version": "1.26"
--             }
--           }
--         ],
--         "description": "The GNU tar program saves many files ...",
--         "homepage": "http://www.gnu.org/software/tar/",
--         "name": "tar",
--         "summary": "A GNU file archiving program",
--         "upstream_vcs": "UPSTREAM_VCS"
--       }
--     ]
--   }
--   </pre>
projectsInfo :: ServerConfig -> String -> Handler ProjectsInfoResponse

-- | The JSON response for <i>projects</i>depsolve/<a>projects</a>
data ProjectsDepsolveResponse
ProjectsDepsolveResponse :: [PackageNEVRA] -> ProjectsDepsolveResponse

-- | List of dependencies
[$sel:pdrProjects:ProjectsDepsolveResponse] :: ProjectsDepsolveResponse -> [PackageNEVRA]

-- | <i>api</i>v0<i>projects</i>depsolve/<a>projects</a> Return the
--   dependencies of a comma separated list of projects
projectsDepsolve :: ServerConfig -> String -> Handler ProjectsDepsolveResponse

-- | Information about a module
data ModuleName
ModuleName :: Text -> Text -> ModuleName

-- | Module name
[$sel:mnName:ModuleName] :: ModuleName -> Text

-- | Group type (always "rpm" for now)
[$sel:mnGroupType:ModuleName] :: ModuleName -> Text

-- | Make a ModuleName from a string
mkModuleName :: Text -> ModuleName

-- | The JSON response for <i>modules</i>list
data ModulesListResponse
ModulesListResponse :: [ModuleName] -> Int -> Int -> Int -> ModulesListResponse

-- | List of modules
[$sel:mlrModules:ModulesListResponse] :: ModulesListResponse -> [ModuleName]

-- | Pagination offset into results
[$sel:mlrOffset:ModulesListResponse] :: ModulesListResponse -> Int

-- | Pagination limit of results
[$sel:mlrLimit:ModulesListResponse] :: ModulesListResponse -> Int

-- | Total number of module names
[$sel:mlrTotal:ModulesListResponse] :: ModulesListResponse -> Int

-- | Special case for listing all the modules Uses SQL offset, limit, and
--   case-insensitive sorting
--   
--   <i>api</i>v0<i>modules</i>list
--   <i>api</i>v0<i>modules</i>list/<a>module_names</a> Return a list of
--   all of the available modules, filtering by module_names (a
--   comma-separated list). This includes the name and the group_type,
--   which is currently always "rpm".
--   
--   <pre>
--   {
--       "modules": [
--         {
--           "group_type": "rpm",
--           "name": "0ad"
--         },
--         {
--           "group_type": "rpm",
--           "name": "0ad-data"
--         },
--         ....
--       ],
--       "offset": 0,
--       "limit": 20,
--       "total": 6
--   }
--   </pre>
modulesList :: ServerConfig -> Maybe Int -> Maybe Int -> String -> Handler ModulesListResponse

-- | <i>api</i>v0<i>modules</i>info/<a>module_names</a> Return the module's
--   dependencies, and the information about the module.
--   
--   <pre>
--   {
--     "modules": [
--       {
--         "dependencies": [
--           {
--             "arch": "noarch",
--             "epoch": "0",
--             "name": "basesystem",
--             "release": "7.el7",
--             "version": "10.0"
--           },
--           {
--             "arch": "x86_64",
--             "epoch": "0",
--             "name": "bash",
--             "release": "28.el7",
--             "version": "4.2.46"
--           },
--           ...
--         ],
--         "description": "The GNU tar program saves ...",
--         "homepage": "http://www.gnu.org/software/tar/",
--         "name": "tar",
--         "summary": "A GNU file archiving program",
--         "upstream_vcs": "UPSTREAM_VCS"
--       }
--     ]
--   }
--   </pre>
data ModuleInfo
ModuleInfo :: [PackageNEVRA] -> Text -> Maybe Text -> Text -> Text -> Maybe Text -> ModuleInfo
[$sel:miDependencies:ModuleInfo] :: ModuleInfo -> [PackageNEVRA]
[$sel:miDescription:ModuleInfo] :: ModuleInfo -> Text
[$sel:miHomepage:ModuleInfo] :: ModuleInfo -> Maybe Text
[$sel:miName:ModuleInfo] :: ModuleInfo -> Text
[$sel:miSummary:ModuleInfo] :: ModuleInfo -> Text
[$sel:miUpstream:ModuleInfo] :: ModuleInfo -> Maybe Text

-- | JSON status response
data ComposeResponse
ComposeResponse :: Bool -> Text -> ComposeResponse

-- | Success/Failure of the request
[$sel:crStatus:ComposeResponse] :: ComposeResponse -> Bool

-- | UUID of the in-progress build
[$sel:crBuildID:ComposeResponse] :: ComposeResponse -> Text

-- | POST <i>api</i>v0/compose Start a compose. TODO implement test support
compose :: ServerConfig -> ComposeBody -> Maybe Int -> Handler ComposeResponse

-- | The JSON response for <i>compose</i>types
data ComposeType
ComposeType :: Bool -> Text -> ComposeType

-- | Is this output type enabled?
[$sel:ctEnabled:ComposeType] :: ComposeType -> Bool

-- | The name of the output type
[$sel:ctName:ComposeType] :: ComposeType -> Text

-- | <i>api</i>v0<i>compose</i>types
--   
--   Returns the list of supported output types that are valid for use with
--   'POST <i>api</i>v0/compose'
--   
--   <pre>
--   {
--     "types": [
--       {
--         "enabled": true,
--         "name": "tar"
--       }
--     ]
--   }
--   </pre>
composeTypes :: Handler ComposeTypesResponse

-- | <i>api</i>v0<i>compose</i>queue
--   
--   Return the status of the build queue. It includes information about
--   the builds waiting, and the build that is running.
--   
--   <pre>
--   {
--     "new": [
--       {
--         "id": "45502a6d-06e8-48a5-a215-2b4174b3614b",
--         "recipe": "glusterfs",
--         "queue_status": "WAITING",
--         "timestamp": 1517362647.4570868,
--         "version": "0.0.6"
--       },
--       {
--         "id": "6d292bd0-bec7-4825-8d7d-41ef9c3e4b73",
--         "recipe": "kubernetes",
--         "queue_status": "WAITING",
--         "timestamp": 1517362659.0034983,
--         "version": "0.0.1"
--       }
--     ],
--     "run": [
--       {
--         "id": "745712b2-96db-44c0-8014-fe925c35e795",
--         "recipe": "glusterfs",
--         "queue_status": "RUNNING",
--         "timestamp": 1517362633.7965999,
--         "version": "0.0.6"
--       }
--     ]
--   }
--   </pre>
composeQueue :: ServerConfig -> Handler ComposeQueueResponse

-- | <i>api</i>v0<i>compose</i>finished
--   
--   Return the details on all of the finished composes on the system.
--   
--   <pre>
--   {
--     "finished": [
--       {
--         "id": "70b84195-9817-4b8a-af92-45e380f39894",
--         "recipe": "glusterfs",
--         "queue_status": "FINISHED",
--         "timestamp": 1517351003.8210032,
--         "version": "0.0.6"
--       },
--       {
--         "id": "e695affd-397f-4af9-9022-add2636e7459",
--         "recipe": "glusterfs",
--         "queue_status": "FINISHED",
--         "timestamp": 1517362289.7193348,
--         "version": "0.0.6"
--       }
--     ]
--   }
--   </pre>
composeQueueFinished :: ServerConfig -> Handler ComposeFinishedResponse

-- | <i>api</i>v0<i>compose</i>failed
--   
--   Return the details on all of the failed composes on the system.
--   
--   <pre>
--   {
--     "failed": [
--       {
--         "id": "8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a",
--         "recipe": "http-server",
--         "queue_status": "FAILED",
--         "timestamp": 1517523249.9301329,
--         "version": "0.0.2"
--       }
--     ]
--   }
--   </pre>
composeQueueFailed :: ServerConfig -> Handler ComposeFailedResponse

-- | <i>api</i>v0<i>compose</i>status/<a>uuids</a>
--   
--   Return the details for each of the comma-separated list of uuids.
--   
--   <pre>
--   {
--     "uuids": [
--       {
--         "id": "8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a",
--         "recipe": "http-server",
--         "queue_status": "FINISHED",
--         "timestamp": 1517523644.2384307,
--         "version": "0.0.2"
--       },
--       {
--         "id": "45502a6d-06e8-48a5-a215-2b4174b3614b",
--         "recipe": "glusterfs",
--         "queue_status": "FINISHED",
--         "timestamp": 1517363442.188399,
--         "version": "0.0.6"
--       }
--     ]
--   }
--   </pre>
composeStatus :: ServerConfig -> [Text] -> Handler ComposeStatusResponse

-- | <i>api</i>v0<i>compose</i>info/<a>uuid</a>
--   
--   Get detailed information about the compose. The returned JSON string
--   will contain the following information:
--   
--   <ul>
--   <li>id - The uuid of the comoposition</li>
--   <li>config - containing the configuration settings used to run
--   Anaconda</li>
--   <li>blueprint - The depsolved blueprint used to generate the
--   kickstart</li>
--   <li>commit - The (local) git commit hash for the blueprint used</li>
--   <li>deps - The NEVRA of all of the dependencies used in the
--   composition</li>
--   <li>compose_type - The type of output generated (tar, iso, etc.)</li>
--   <li>queue_status - The final status of the composition (FINISHED or
--   FAILED)</li>
--   </ul>
--   
--   Example::
--   
--   <pre>
--   {
--     "commit": "7078e521a54b12eae31c3fd028680da7a0815a4d",
--     "compose_type": "tar",
--     "id": "c30b7d80-523b-4a23-ad52-61b799739ce8",
--     "queue_status": "FINISHED",
--     "blueprint": {
--       "description": "An example kubernetes master",
--       ...
--     }
--   }
--   </pre>
composeInfo :: ServerConfig -> String -> Handler ComposeInfoResponse

-- | DELETE <i>api</i>v0<i>compose</i>cancel/<a>uuid</a>
--   
--   Cancel the build, if it is not finished, and delete the results. It
--   will return a status of True if it is successful.
--   
--   The response for a successful DELETE is:
--   
--   <pre>
--   {
--       "status": true,
--       "errors": []
--   }
--   </pre>
composeCancel :: ServerConfig -> String -> Handler APIResponse

-- | DELETE <i>api</i>v0<i>compose</i>delete/<a>uuids</a>
--   
--   Delete the list of comma-separated uuids from the compose results.
--   
--   <pre>
--   {
--     "errors": [],
--     "uuids": [
--       {
--         "status": true,
--         "uuid": "ae1bf7e3-7f16-4c9f-b36e-3726a1093fd0"
--       }
--     ]
--   }
--   </pre>
composeDelete :: ServerConfig -> [Text] -> Handler ComposeDeleteResponse

-- | <i>api</i>v0<i>compose</i>logs/<a>uuid</a>
--   
--   Returns a .tar of the compose logs. The tar is not compressed, but it
--   is not large.
--   
--   The mime type is set to 'application/x-tar' and the filename is set to
--   UUID-logs.tar
composeLogs :: KnownSymbol h => ServerConfig -> String -> Handler (Headers '[Header h String] ByteString)

-- | <i>api</i>v0<i>compose</i>image/<a>uuid</a>
--   
--   Returns the output image from the build. The filename is set to the
--   filename from the build with the UUID as a prefix. eg.
--   UUID-root.tar.xz or UUID-boot.iso.
composeImage :: KnownSymbol h => ServerConfig -> Text -> Handler (Headers '[Header h String] ByteString)

-- | <i>api</i>v0<i>compose</i>metadata/<a>uuid</a>
--   
--   Returns a .tar of the metadata used for the build. This includes all
--   the information needed to reproduce the build, including the final
--   blueprint populated with repository and package NEVRA.
--   
--   The mime type is set to 'application/x-tar' and the filename is set to
--   UUID-metadata.tar
--   
--   The .tar is uncompressed, but is not large.
composeMetadata :: KnownSymbol h => ServerConfig -> String -> Handler (Headers '[Header h String] ByteString)

-- | <i>api</i>v0<i>compose</i>results/<a>uuid</a>
--   
--   Returns a .tar of the metadata, logs, and output image of the build.
--   This includes all the information needed to reproduce the build,
--   including the final kickstart populated with repository and package
--   NEVRA. The output image is already in compressed form so the returned
--   tar is not compressed.
--   
--   The mime type is set to 'application/x-tar' and the filename is set to
--   UUID.tar
composeResults :: KnownSymbol h => ServerConfig -> String -> Handler (Headers '[Header h String] ByteString)
instance GHC.Classes.Eq BDCS.API.V0.ComposeDeleteResponse
instance GHC.Show.Show BDCS.API.V0.ComposeDeleteResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeInfoResponse
instance GHC.Show.Show BDCS.API.V0.ComposeInfoResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeStatusResponse
instance GHC.Show.Show BDCS.API.V0.ComposeStatusResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeFailedResponse
instance GHC.Show.Show BDCS.API.V0.ComposeFailedResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeFinishedResponse
instance GHC.Show.Show BDCS.API.V0.ComposeFinishedResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeQueueResponse
instance GHC.Show.Show BDCS.API.V0.ComposeQueueResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeTypesResponse
instance GHC.Show.Show BDCS.API.V0.ComposeTypesResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeType
instance GHC.Show.Show BDCS.API.V0.ComposeType
instance GHC.Classes.Eq BDCS.API.V0.ComposeResponse
instance GHC.Show.Show BDCS.API.V0.ComposeResponse
instance GHC.Classes.Eq BDCS.API.V0.ComposeBody
instance GHC.Show.Show BDCS.API.V0.ComposeBody
instance GHC.Classes.Eq BDCS.API.V0.ModulesInfoResponse
instance GHC.Show.Show BDCS.API.V0.ModulesInfoResponse
instance GHC.Classes.Eq BDCS.API.V0.ModuleInfo
instance GHC.Show.Show BDCS.API.V0.ModuleInfo
instance GHC.Classes.Eq BDCS.API.V0.ModulesListResponse
instance GHC.Show.Show BDCS.API.V0.ModulesListResponse
instance GHC.Classes.Eq BDCS.API.V0.ModuleName
instance GHC.Show.Show BDCS.API.V0.ModuleName
instance GHC.Classes.Eq BDCS.API.V0.ProjectsDepsolveResponse
instance GHC.Show.Show BDCS.API.V0.ProjectsDepsolveResponse
instance GHC.Classes.Eq BDCS.API.V0.ProjectsInfoResponse
instance GHC.Show.Show BDCS.API.V0.ProjectsInfoResponse
instance GHC.Classes.Eq BDCS.API.V0.ProjectInfo
instance GHC.Show.Show BDCS.API.V0.ProjectInfo
instance GHC.Classes.Eq BDCS.API.V0.BuildInfo
instance GHC.Show.Show BDCS.API.V0.BuildInfo
instance GHC.Classes.Eq BDCS.API.V0.SourceInfo
instance GHC.Show.Show BDCS.API.V0.SourceInfo
instance GHC.Classes.Eq BDCS.API.V0.Metadata
instance GHC.Show.Show BDCS.API.V0.Metadata
instance GHC.Classes.Eq BDCS.API.V0.ProjectsListResponse
instance GHC.Show.Show BDCS.API.V0.ProjectsListResponse
instance GHC.Classes.Eq BDCS.API.V0.RecipesFreezeResponse
instance GHC.Show.Show BDCS.API.V0.RecipesFreezeResponse
instance GHC.Classes.Eq BDCS.API.V0.RecipesDepsolveResponse
instance GHC.Show.Show BDCS.API.V0.RecipesDepsolveResponse
instance GHC.Classes.Eq BDCS.API.V0.RecipeDependencies
instance GHC.Show.Show BDCS.API.V0.RecipeDependencies
instance GHC.Show.Show BDCS.API.V0.RecipesDiffResponse
instance GHC.Classes.Eq BDCS.API.V0.RecipesDiffResponse
instance GHC.Classes.Eq BDCS.API.V0.RecipesChangesResponse
instance GHC.Show.Show BDCS.API.V0.RecipesChangesResponse
instance GHC.Classes.Eq BDCS.API.V0.RecipeChanges
instance GHC.Show.Show BDCS.API.V0.RecipeChanges
instance GHC.Classes.Eq BDCS.API.V0.RecipesInfoResponse
instance GHC.Show.Show BDCS.API.V0.RecipesInfoResponse
instance GHC.Classes.Eq BDCS.API.V0.WorkspaceChanges
instance GHC.Show.Show BDCS.API.V0.WorkspaceChanges
instance GHC.Classes.Eq BDCS.API.V0.RecipesListResponse
instance GHC.Show.Show BDCS.API.V0.RecipesListResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeDeleteResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeDeleteResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeInfoResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeInfoResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeStatusResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeStatusResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeFailedResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeFailedResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeFinishedResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeFinishedResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeQueueResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeQueueResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeTypesResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeTypesResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeType
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeType
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ComposeBody
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ComposeBody
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ModulesInfoResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ModulesInfoResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ModuleInfo
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ModuleInfo
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ModulesListResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ModulesListResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ModuleName
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ModuleName
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ProjectsDepsolveResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ProjectsDepsolveResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ProjectsInfoResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ProjectsInfoResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ProjectInfo
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ProjectInfo
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.BuildInfo
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.BuildInfo
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.SourceInfo
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.SourceInfo
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.Metadata
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.Metadata
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.ProjectsListResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.ProjectsListResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipesFreezeResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipesFreezeResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipesDepsolveResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipesDepsolveResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipeDependencies
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipeDependencies
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipesDiffResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipesDiffResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipesChangesResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipesChangesResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipeChanges
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipeChanges
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipesInfoResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipesInfoResponse
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.WorkspaceChanges
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.WorkspaceChanges
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.V0.RecipesListResponse
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.V0.RecipesListResponse

module BDCS.API.Version
buildVersion :: String


-- | BDCS API Server
--   
--   This starts a server and answers the API requests.
module BDCS.API.Server

-- | Create the server app
--   
--   Create a SQLite connection pool, open/create the Git repo, and return
--   the app
mkApp :: FilePath -> FilePath -> FilePath -> IO Application

-- | Servant <a>Proxy</a>
--   
--   This connects the API to everything else
proxyAPI :: Proxy CombinedAPI

-- | Run the API server
runServer :: FilePath -> String -> FilePath -> FilePath -> FilePath -> IO ()

-- | The status of the server, the database, and the API.
data ServerStatus
ServerStatus :: String -> String -> String -> String -> String -> Bool -> ServerStatus

-- | Supported API version
[srvApi] :: ServerStatus -> String

-- | Backend implementation (weldr, lorax-composer)
[srvBackend] :: ServerStatus -> String

-- | Server build version
[srvBuild] :: ServerStatus -> String

-- | Supported Database Schema version
[srvSchemaVersion] :: ServerStatus -> String

-- | Database version
[srvDbVersion] :: ServerStatus -> String

-- | True if the Database is supported by the Server
[srvDbSupported] :: ServerStatus -> Bool
data SocketException
BadFileDescriptor :: SocketException
BadGroup :: String -> SocketException
NoSocketError :: SocketException
instance GHC.Show.Show BDCS.API.Server.ServerStatus
instance GHC.Classes.Eq BDCS.API.Server.ServerStatus
instance GHC.Show.Show BDCS.API.Server.SocketException
instance Data.Aeson.Types.ToJSON.ToJSON BDCS.API.Server.ServerStatus
instance Data.Aeson.Types.FromJSON.FromJSON BDCS.API.Server.ServerStatus
instance GHC.Exception.Exception BDCS.API.Server.SocketException
