Module
Payload.Server.Handleable
- Package
- purescript-payload
- Repository
- hoodunit/purescript-payload
#Handleable Source
class Handleable route handler (basePath :: Symbol) (baseParams :: Row Type) (baseGuards :: GuardList) (guardsSpec :: Row Type) guards | route -> handler where
Members
handle :: Proxy basePath -> Proxy (Record baseParams) -> Guards baseGuards -> GuardTypes (Record guardsSpec) -> route -> handler -> guards -> RequestUrl -> Request -> Response -> Result RawResponse
Instances
(TypeEquals (Record route) { body :: body, guards :: Guards guardNames, params :: Record params, query :: Record query, response :: res | r }, IsSymbol path, Append "POST " fullPath docRoute, ToSpecResponse docRoute handlerRes res, EncodeResponse res, Append basePath path fullPath, DecodeOptionalBody body, Union baseParams params fullUrlParams, DecodeUrl fullPath fullUrlParams, DecodeQuery fullPath query, ParseUrl fullPath urlParts, ToSegments urlParts, TypeEquals { body :: body, guards :: Record routeGuardSpec, params :: Record fullUrlParams, query :: Record query } (Record payloadWithEmpty), OmitEmpty payloadWithEmpty payload, Append baseGuards guardNames fullGuards, RunGuards fullGuards guardsSpec allGuards () routeGuardSpec) => Handleable (Route "POST" path (Record route)) (Record payload -> Aff handlerRes) basePath baseParams baseGuards guardsSpec (Record allGuards)
(TypeEquals (Record route) { guards :: Guards guardNames, params :: Record params, query :: Record query, response :: res | r }, IsSymbol path, Append "GET " fullPath docRoute, ToSpecResponse docRoute handlerRes res, EncodeResponse res, Append basePath path fullPath, Union baseParams params fullUrlParams, DecodeUrl fullPath fullUrlParams, DecodeQuery fullPath query, ParseUrl fullPath urlParts, ToSegments urlParts, TypeEquals { guards :: Record routeGuardSpec, params :: Record fullUrlParams, query :: Record query } (Record payloadWithEmpty), OmitEmpty payloadWithEmpty payload, Append baseGuards guardNames fullGuards, RunGuards fullGuards guardsSpec allGuards () routeGuardSpec) => Handleable (Route "GET" path (Record route)) (Record payload -> Aff handlerRes) basePath baseParams baseGuards guardsSpec (Record allGuards)
(TypeEquals (Record route) { guards :: Guards guardNames, params :: Record params, query :: Record query, response :: res | r }, IsSymbol path, Append basePath path fullPath, Append "HEAD " fullPath docRoute, ToSpecResponse docRoute handlerRes res, EncodeResponse res, Union baseParams params fullUrlParams, DecodeUrl fullPath fullUrlParams, DecodeQuery fullPath query, ParseUrl fullPath urlParts, ToSegments urlParts, TypeEquals { guards :: Record routeGuardSpec, params :: Record fullUrlParams, query :: Record query } (Record payloadWithEmpty), OmitEmpty payloadWithEmpty payload, Append baseGuards guardNames fullGuards, RunGuards fullGuards guardsSpec allGuards () routeGuardSpec) => Handleable (Route "HEAD" path (Record route)) (Record payload -> Aff handlerRes) basePath baseParams baseGuards guardsSpec (Record allGuards)
(TypeEquals (Record route) { body :: body, guards :: Guards guardNames, params :: Record params, query :: Record query, response :: res | r }, IsSymbol path, Append "PUT " fullPath docRoute, ToSpecResponse docRoute handlerRes res, EncodeResponse res, Append basePath path fullPath, DecodeOptionalBody body, Union baseParams params fullUrlParams, DecodeUrl fullPath fullUrlParams, DecodeQuery fullPath query, ParseUrl fullPath urlParts, ToSegments urlParts, TypeEquals { body :: body, guards :: Record routeGuardSpec, params :: Record fullUrlParams, query :: Record query } (Record payloadWithEmpty), OmitEmpty payloadWithEmpty payload, Append baseGuards guardNames fullGuards, RunGuards fullGuards guardsSpec allGuards () routeGuardSpec) => Handleable (Route "PUT" path (Record route)) (Record payload -> Aff handlerRes) basePath baseParams baseGuards guardsSpec (Record allGuards)
(TypeEquals (Record route) { body :: body, guards :: Guards guardNames, params :: Record params, query :: Record query, response :: res | r }, IsSymbol path, Append "DELETE " fullPath docRoute, ToSpecResponse docRoute handlerRes res, EncodeResponse res, Append basePath path fullPath, DecodeOptionalBody body, Union baseParams params fullUrlParams, DecodeUrl fullPath fullUrlParams, DecodeQuery fullPath query, ParseUrl fullPath urlParts, ToSegments urlParts, TypeEquals { body :: body, guards :: Record routeGuardSpec, params :: Record fullUrlParams, query :: Record query } (Record payloadWithEmpty), OmitEmpty payloadWithEmpty payload, Append baseGuards guardNames fullGuards, RunGuards fullGuards guardsSpec allGuards () routeGuardSpec) => Handleable (Route "DELETE" path (Record route)) (Record payload -> Aff handlerRes) basePath baseParams baseGuards guardsSpec (Record allGuards)
(TypeEquals (Record route) { guards :: Guards guardNames, params :: Record params, query :: Record query, response :: res | r }, IsSymbol path, Append "OPTIONS " fullPath docRoute, ToSpecResponse docRoute handlerRes res, EncodeResponse res, Append basePath path fullPath, Union baseParams params fullUrlParams, DecodeUrl fullPath fullUrlParams, DecodeQuery fullPath query, ParseUrl fullPath urlParts, ToSegments urlParts, TypeEquals { guards :: Record routeGuardSpec, params :: Record fullUrlParams, query :: Record query } (Record payloadWithEmpty), OmitEmpty payloadWithEmpty payload, Append baseGuards guardNames fullGuards, RunGuards fullGuards guardsSpec allGuards () routeGuardSpec) => Handleable (Route "OPTIONS" path (Record route)) (Record payload -> Aff handlerRes) basePath baseParams baseGuards guardsSpec (Record allGuards)
#MethodHandler Source
type MethodHandler = RequestUrl -> Request -> Response -> Result RawResponse
#DecodeOptionalBody Source
class DecodeOptionalBody (body :: Type) where
Members
decodeOptionalBody :: String -> Either String body
Instances
DecodeOptionalBody Undefined
(DecodeBody body) => DecodeOptionalBody body
- Modules
- Payload.
Client - Payload.
Client. ClientApi - Payload.
Client. DecodeResponse - Payload.
Client. EncodeBody - Payload.
Client. EncodeParam - Payload.
Client. Internal. EncodeUri - Payload.
Client. Internal. Query - Payload.
Client. Internal. Url - Payload.
Client. Options - Payload.
Client. QueryParams - Payload.
Client. Queryable - Payload.
Client. Response - Payload.
ContentType - Payload.
Debug - Payload.
Headers - Payload.
Internal. QueryParsing - Payload.
Internal. Route - Payload.
Internal. UrlParsing - Payload.
Internal. Utils - Payload.
ResponseTypes - Payload.
Server - Payload.
Server. Cookies - Payload.
Server. DecodeBody - Payload.
Server. Guards - Payload.
Server. Handleable - Payload.
Server. Handlers - Payload.
Server. Internal. GuardParsing - Payload.
Server. Internal. MimeTypes - Payload.
Server. Internal. OmitEmpty - Payload.
Server. Internal. Query - Payload.
Server. Internal. Querystring - Payload.
Server. Internal. Request - Payload.
Server. Internal. ServerResponse - Payload.
Server. Internal. Trie - Payload.
Server. Internal. Url - Payload.
Server. Internal. UrlString - Payload.
Server. Params - Payload.
Server. Path - Payload.
Server. QueryParams - Payload.
Server. Response - Payload.
Server. Routable - Payload.
Server. Status - Payload.
Spec - Payload.
TypeErrors