content: -- | Top-level router type for the application
  module Fission.Web.API.Types
    ( Routes   (..)
    , RoutesV3 (..)
    , RoutesV2 (..)
    , RoutesV_ (..)
    , V3       (..)
    , V2       (..)
    , Root
    ) where
  
  import           Servant.API.Generic
  
  import qualified Fission.Pong.Types              as Ping
  
  import           Fission.Web.API.Prelude
  
  import qualified Fission.Web.API.App.Types       as App
  import qualified Fission.Web.API.Append.Types    as Append
  import qualified Fission.Web.API.Auth.UCAN.Types as UCAN
  import qualified Fission.Web.API.DNS.Types       as DNS
  import           Fission.Web.API.Docs
  import qualified Fission.Web.API.Heroku.Types    as Heroku
  import qualified Fission.Web.API.IPFS.Types      as IPFS
  import qualified Fission.Web.API.User.Types      as User
  
  data Routes mode = Routes
    { v3          :: mode :- "v3" :> ToServantApi RoutesV3
    , v2          :: mode :- "v2" :> ToServantApi RoutesV2
    , heroku      :: mode :- "heroku" :> "resources" :> ToServantApi Heroku.Routes
    , latestDocs  :: mode :- Docs
    , unversioned :: mode :- ToServantApi RoutesV_
    , root        :: mode :- Root
    }
    deriving Generic
  
  type Root = Get '[JSON, OctetStream, PlainText] NoContent
  
  
  -- V3
  
  data RoutesV3 mode = RoutesV3
    { api  :: mode :- "api" :> ToServantApi V3
    , docs :: mode :- Docs
    }
    deriving Generic
  
  data V3 mode = V3
    { user :: mode :- "user" :> ToServantApi User.RoutesV3
    }
    deriving Generic
  
  
  -- V2
  
  data RoutesV2 mode = RoutesV2
    { api  :: mode :- "api" :> ToServantApi V2
    , docs :: mode :- Docs
    }
    deriving Generic
  
  data V2 mode = V2
    { ipfs   :: mode :- "ipfs"           :> ToServantApi IPFS.RoutesV2
    , app    :: mode :- "app"            :> ToServantApi App.RoutesV2
    , user   :: mode :- "user"           :> ToServantApi User.RoutesV2
    , auth   :: mode :- "auth" :> "ucan" :> ToServantApi UCAN.Routes
    , append :: mode :- "append"         :> ToServantApi Append.RoutesV2
    }
    deriving Generic
  
  
  -- DEPRECATED
  
  data RoutesV_ mode = RoutesV_
    { ipfs   :: mode :- "ipfs"           :> ToServantApi IPFS.RoutesV_
    , app    :: mode :- "app"            :> ToServantApi App.RoutesV_
    , user   :: mode :- "user"           :> ToServantApi User.RoutesV_
    , dns    :: mode :- "dns"            :> ToServantApi DNS.Routes
    , auth   :: mode :- "auth" :> "ucan" :> ToServantApi UCAN.Routes
  
    , ping ::
        mode
        :- Summary "Simple Ping"
        :> Description "DEPRECATED ⛔ A quick way to check for liveness"
        --
        :> "ping"
        :> Get '[JSON, PlainText] Ping.Pong
    }
    deriving Generic
  