Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ApiRequest = ApiRequest {
- iAction :: Action
- iRange :: HashMap ByteString NonnegRange
- iTopLevelRange :: NonnegRange
- iTarget :: Target
- iAccepts :: [ContentType]
- iPayload :: Maybe PayloadJSON
- iPreferRepresentation :: PreferRepresentation
- iPreferParameters :: Maybe PreferParameters
- iPreferCount :: Maybe PreferCount
- iPreferResolution :: Maybe PreferResolution
- iFilters :: [(Text, Text)]
- iLogic :: [(Text, Text)]
- iSelect :: Maybe Text
- iOnConflict :: Maybe Text
- iColumns :: Maybe Text
- iOrder :: [(Text, Text)]
- iCanonicalQS :: ByteString
- iJWT :: Text
- iHeaders :: [(Text, Text)]
- iCookies :: [(Text, Text)]
- iPath :: ByteString
- iMethod :: ByteString
- iProfile :: Maybe Schema
- iSchema :: Schema
- data InvokeMethod
- data ContentType
- data Action
- data Target
- = TargetIdent QualifiedIdentifier
- | TargetProc { }
- | TargetDefaultSpec { }
- | TargetUnknown [Text]
- mutuallyAgreeable :: [ContentType] -> [ContentType] -> Maybe ContentType
- userApiRequest :: NonEmpty Schema -> Maybe Text -> Request -> RequestBody -> Either ApiRequestError ApiRequest
Documentation
data ApiRequest Source #
Describes what the user wants to do. This data type is a translation of the raw elements of an HTTP request into domain specific language. There is no guarantee that the intent is sensible, it is up to a later stage of processing to determine if it is an action we are able to perform.
ApiRequest | |
|
data InvokeMethod Source #
Instances
Eq InvokeMethod Source # | |
Defined in PostgREST.ApiRequest (==) :: InvokeMethod -> InvokeMethod -> Bool # (/=) :: InvokeMethod -> InvokeMethod -> Bool # |
data ContentType Source #
Enumeration of currently supported response content types
CTApplicationJSON | |
CTSingularJSON | |
CTTextCSV | |
CTTextPlain | |
CTOpenAPI | |
CTOctetStream | |
CTAny | |
CTOther ByteString |
Instances
Eq ContentType Source # | |
Defined in PostgREST.Types (==) :: ContentType -> ContentType -> Bool # (/=) :: ContentType -> ContentType -> Bool # | |
Show ContentType Source # | |
Defined in PostgREST.Types showsPrec :: Int -> ContentType -> ShowS # show :: ContentType -> String # showList :: [ContentType] -> ShowS # |
Types of things a user wants to do to tablesviewsprocs
The target db object of a user action
mutuallyAgreeable :: [ContentType] -> [ContentType] -> Maybe ContentType Source #
Find the best match from a list of content types accepted by the client in order of decreasing preference and a list of types producible by the server. If there is no match but the client accepts */* then return the top server pick.
userApiRequest :: NonEmpty Schema -> Maybe Text -> Request -> RequestBody -> Either ApiRequestError ApiRequest Source #
Examines HTTP request and translates it into user intent.