Module
Payload.Client.Queryable
- Package
- purescript-payload
- Repository
- hoodunit/purescript-payload
#ClientFnWithOptions Source
type ClientFnWithOptions payload body = RequestOptions -> ClientFn payload body
#ClientFn Source
type ClientFn payload body = payload -> Aff (ClientResponse body)
#Queryable Source
class Queryable route (basePath :: Symbol) (baseParams :: Row Type) payload res | route baseParams basePath -> payload, route -> res where
Members
request :: route -> Proxy basePath -> Proxy (Record baseParams) -> Options -> ClientFnWithOptions payload res
Instances
(Lacks "body" route, Union route DefaultRouteSpec mergedRoute, Nub mergedRoute routeWithDefaults, TypeEquals (Record routeWithDefaults) { params :: Record params, query :: query, response :: res | r }, Union baseParams params fullUrlParams, Append basePath path fullPath, RowToList fullUrlParams fullParamsList, EncodeUrlWithParams fullPath fullParamsList payload, EncodeOptionalQuery fullPath query payload, DecodeResponse res) => Queryable (Route "GET" path (Record route)) basePath baseParams (Record payload) res
(Union route DefaultRouteSpec mergedRoute, Nub mergedRoute routeWithDefaults, TypeEquals (Record routeWithDefaults) { body :: body, params :: Record params, query :: query, response :: res | r }, Union baseParams params fullUrlParams, Append basePath path fullPath, RowToList fullUrlParams fullParamsList, EncodeUrlWithParams fullPath fullParamsList payload, EncodeOptionalQuery fullPath query payload, EncodeOptionalBody body payload, HasContentType body, DecodeResponse res) => Queryable (Route "POST" path (Record route)) basePath baseParams (Record payload) res
(Lacks "body" route, Lacks "response" route, Union route DefaultRouteSpec mergedRoute, Nub mergedRoute routeWithDefaults, TypeEquals (Record routeWithDefaults) { params :: Record params, query :: query | r }, Append basePath path fullPath, Union baseParams params fullUrlParams, RowToList fullUrlParams fullParamsList, EncodeUrlWithParams fullPath fullParamsList payload, EncodeOptionalQuery fullPath query payload) => Queryable (Route "HEAD" path (Record route)) basePath baseParams (Record payload) String
(Union route DefaultRouteSpec mergedRoute, Nub mergedRoute routeWithDefaults, TypeEquals (Record routeWithDefaults) { body :: body, params :: Record params, query :: query, response :: res | r }, Union baseParams params fullUrlParams, Append basePath path fullPath, RowToList fullUrlParams fullParamsList, EncodeUrlWithParams fullPath fullParamsList payload, EncodeOptionalQuery fullPath query payload, EncodeOptionalBody body payload, HasContentType body, DecodeResponse res) => Queryable (Route "PUT" path (Record route)) basePath baseParams (Record payload) res
(Union route DefaultRouteSpec mergedRoute, Nub mergedRoute routeWithDefaults, TypeEquals (Record routeWithDefaults) { body :: body, params :: Record params, query :: query, response :: res | r }, Union baseParams params fullUrlParams, Append basePath path fullPath, DecodeResponse res, RowToList fullUrlParams fullParamsList, EncodeUrlWithParams fullPath fullParamsList payload, EncodeOptionalQuery fullPath query payload, EncodeOptionalBody body payload, HasContentType body) => Queryable (Route "DELETE" path (Record route)) basePath baseParams (Record payload) res
(Lacks "body" route, Union route DefaultRouteSpec mergedRoute, Nub mergedRoute routeWithDefaults, TypeEquals (Record routeWithDefaults) { params :: Record params, query :: query, response :: res | r }, Union baseParams params fullUrlParams, Append basePath path fullPath, RowToList fullUrlParams fullParamsList, EncodeUrlWithParams fullPath fullParamsList payload, EncodeOptionalQuery fullPath query payload, DecodeResponse res) => Queryable (Route "OPTIONS" path (Record route)) basePath baseParams (Record payload) res
#Request Source
type Request = { body :: Maybe RequestBody, headers :: Array RequestHeader, method :: Method, opts :: Options, reqOpts :: RequestOptions, url :: String }
#makeRequest Source
makeRequest :: forall body. DecodeResponse body => Request -> Aff (ClientResponse body)
#lookupHeader Source
lookupHeader :: String -> Array ResponseHeader -> Maybe String
#decodeAffjaxResponse Source
decodeAffjaxResponse :: forall body. DecodeResponse body => Either Error (Response String) -> ClientResponse body
#statusAndHeaders Source
statusAndHeaders :: forall a. Response a -> { headers :: Headers, status :: HttpStatus }
#EncodeOptionalBody Source
class EncodeOptionalBody (body :: Type) (payload :: Row Type) where
Members
encodeOptionalBody :: Proxy body -> Record payload -> Maybe RequestBody
Instances
EncodeOptionalBody Undefined payload
(TypeEquals (Record payload) { body :: body | rest }, EncodeBody body) => EncodeOptionalBody body payload
#EncodeOptionalQuery Source
class EncodeOptionalQuery (url :: Symbol) (query :: Type) (payload :: Row Type) where
Members
encodeOptionalQuery :: Proxy url -> Proxy query -> Record payload -> String
Instances
(EncodeQuery url ()) => EncodeOptionalQuery url Undefined payload
(TypeEquals (Record payload) { query :: Record query | rest }, EncodeQuery url query) => EncodeOptionalQuery url (Record query) payload
#EncodeUrlWithParams Source
class EncodeUrlWithParams (url :: Symbol) (params :: RowList Type) (payload :: Row Type) where
Members
Instances
(EncodeUrl url ()) => EncodeUrlWithParams url Nil payload
(TypeEquals (Record payload) { params :: Record params | rest }, ListToRow rl params, EncodeUrl url params) => EncodeUrlWithParams url rl payload
#stripTrailingSlash Source
stripTrailingSlash :: String -> String
- 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