Safe Haskell | None |
---|---|
Language | Haskell2010 |
- runApi :: HttpConfig -> ActionState -> IO ()
- serveApi :: HttpConfig -> ActionState -> Application
- type Api = (ThentosAssertHeaders :> (ThentosAuth :> ThentosBasic)) :<|> ("js" :> Api)
- api :: ActionState -> Server Api
- type ThentosBasic = ("user" :> ThentosUser) :<|> (("service" :> ThentosService) :<|> (("thentos_session" :> ThentosThentosSession) :<|> ("service_session" :> ThentosServiceSession)))
- thentosBasic :: ServerT ThentosBasic (Action Void ())
- type ThentosUser = (ReqBody `[JSON]` UserFormData :> Post `[JSON]` UserId) :<|> (("login" :> (ReqBody `[JSON]` LoginFormData :> Post `[JSON]` ThentosSessionToken)) :<|> ((Capture "uid" UserId :> Delete `[JSON]` ()) :<|> ((Capture "uid" UserId :> ("name" :> Get `[JSON]` UserName)) :<|> (Capture "uid" UserId :> ("email" :> Get `[JSON]` UserEmail)))))
- thentosUser :: ServerT ThentosUser (Action Void ())
- type ThentosService = (ReqBody `[JSON]` (UserId, ServiceName, ServiceDescription) :> Post `[JSON]` (ServiceId, ServiceKey)) :<|> ((Capture "sid" ServiceId :> Delete `[JSON]` ()) :<|> Get `[JSON]` [ServiceId])
- thentosService :: ServerT ThentosService (Action Void ())
- type ThentosThentosSession = (ReqBody `[JSON]` ByUserOrServiceId :> Post `[JSON]` ThentosSessionToken) :<|> ((ReqBody `[JSON]` ThentosSessionToken :> Get `[JSON]` Bool) :<|> (ReqBody `[JSON]` ThentosSessionToken :> Delete `[JSON]` ()))
- thentosThentosSession :: ServerT ThentosThentosSession (Action Void ())
- type ThentosServiceSession = (ReqBody `[JSON]` ServiceSessionToken :> Get `[JSON]` Bool) :<|> ((ReqBody `[JSON]` ServiceSessionToken :> ("meta" :> Get `[JSON]` ServiceSessionMetadata)) :<|> (ReqBody `[JSON]` ServiceSessionToken :> Delete `[JSON]` ()))
- thentosServiceSession :: ServerT ThentosServiceSession (Action Void ())
main
runApi :: HttpConfig -> ActionState -> IO ()
serveApi :: HttpConfig -> ActionState -> Application
type Api = (ThentosAssertHeaders :> (ThentosAuth :> ThentosBasic)) :<|> ("js" :> Api)
api :: ActionState -> Server Api
combinators
type ThentosBasic = ("user" :> ThentosUser) :<|> (("service" :> ThentosService) :<|> (("thentos_session" :> ThentosThentosSession) :<|> ("service_session" :> ThentosServiceSession)))
thentosBasic :: ServerT ThentosBasic (Action Void ())
user
type ThentosUser = (ReqBody `[JSON]` UserFormData :> Post `[JSON]` UserId) :<|> (("login" :> (ReqBody `[JSON]` LoginFormData :> Post `[JSON]` ThentosSessionToken)) :<|> ((Capture "uid" UserId :> Delete `[JSON]` ()) :<|> ((Capture "uid" UserId :> ("name" :> Get `[JSON]` UserName)) :<|> (Capture "uid" UserId :> ("email" :> Get `[JSON]` UserEmail)))))
thentosUser :: ServerT ThentosUser (Action Void ())
service
type ThentosService = (ReqBody `[JSON]` (UserId, ServiceName, ServiceDescription) :> Post `[JSON]` (ServiceId, ServiceKey)) :<|> ((Capture "sid" ServiceId :> Delete `[JSON]` ()) :<|> Get `[JSON]` [ServiceId])
thentosService :: ServerT ThentosService (Action Void ())
session
type ThentosThentosSession = (ReqBody `[JSON]` ByUserOrServiceId :> Post `[JSON]` ThentosSessionToken) :<|> ((ReqBody `[JSON]` ThentosSessionToken :> Get `[JSON]` Bool) :<|> (ReqBody `[JSON]` ThentosSessionToken :> Delete `[JSON]` ()))
thentosThentosSession :: ServerT ThentosThentosSession (Action Void ())
service session
type ThentosServiceSession = (ReqBody `[JSON]` ServiceSessionToken :> Get `[JSON]` Bool) :<|> ((ReqBody `[JSON]` ServiceSessionToken :> ("meta" :> Get `[JSON]` ServiceSessionMetadata)) :<|> (ReqBody `[JSON]` ServiceSessionToken :> Delete `[JSON]` ()))
thentosServiceSession :: ServerT ThentosServiceSession (Action Void ())