| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Avers.API
Synopsis
- type AversAPI = CreateObject :<|> (LookupObject :<|> (PatchObject :<|> (DeleteObject :<|> (LookupPatch :<|> (ObjectChanges :<|> (CreateRelease :<|> (LookupRelease :<|> (LookupLatestRelease :<|> (Feed :<|> (ChangeSecret :<|> (CreateSession :<|> (LookupSession :<|> (DeleteSession :<|> (UploadBlob :<|> (LookupBlob :<|> LookupBlobContent)))))))))))))))
- type CreateObject = "objects" :> (Credentials :> (ReqBody '[JSON] CreateObjectBody :> Post '[JSON] CreateObjectResponse))
- type LookupObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupObjectResponse))))
- type PatchObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> (ReqBody '[JSON] PatchObjectBody :> Patch '[JSON] PatchObjectResponse)))
- type DeleteObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> Delete '[JSON] ()))
- type LookupPatch = "objects" :> (Capture "objId" ObjId :> ("patches" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupPatchResponse))))))
- type ObjectChanges = "objects" :> (Capture "objId" ObjId :> ("changes" :> (Credentials :> Raw)))
- type CreateRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> (Credentials :> (ReqBody '[JSON] CreateReleaseBody :> Post '[JSON] CreateReleaseResponse))))
- type LookupRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupReleaseResponse))))))
- type LookupLatestRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> ("_latest" :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupLatestReleaseResponse))))))
- type Feed = "feed" :> (Credentials :> Raw)
- type ChangeSecret = "secret" :> (Credentials :> (ReqBody '[JSON] ChangeSecretBody :> Post '[JSON] ()))
- type CreateSession = "session" :> (ReqBody '[JSON] CreateSessionBody :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie] CreateSessionResponse))
- type LookupSession = "session" :> (SessionId :> Get '[JSON] (Headers '[Header "Set-Cookie" SetCookie] LookupSessionResponse))
- type DeleteSession = "session" :> (SessionId :> Delete '[JSON] (Headers '[Header "Set-Cookie" SetCookie] ()))
- type UploadBlob = "blobs" :> (Credentials :> (Header "Content-Type" Text :> (ReqBody '[OctetStream] BlobContent :> Post '[JSON] UploadBlobResponse)))
- type LookupBlob = "blobs" :> (Capture "blobId" BlobId :> (Credentials :> Get '[JSON] LookupBlobResponse))
- type LookupBlobContent = "blobs" :> (Capture "blobId" BlobId :> ("content" :> (Credentials :> Get '[OctetStream] (Headers '[Header "Content-Type" Text] BlobContent))))
- type CacheValidationToken = Header "If-None-Match" Text
- type Cacheable a = Headers '[Header "Cache-Control" Text, Header "ETag" Text] a
- data CreateObjectBody = CreateObjectBody {
- cobType :: !Text
- cobContent :: !Value
- data CreateObjectResponse = CreateObjectResponse {}
- data LookupObjectResponse = LookupObjectResponse {
- lorId :: !ObjId
- lorType :: !Text
- lorCreatedAt :: !UTCTime
- lorCreatedBy :: !ObjId
- lorRevisionId :: !RevId
- lorContent :: !Value
- data PatchObjectBody = PatchObjectBody {
- pobRevisionId :: !RevId
- pobOperations :: ![Operation]
- data PatchObjectResponse = PatchObjectResponse {
- porPreviousPatches :: ![Patch]
- porNumProcessedOperations :: !Int
- porResultingPatches :: ![Patch]
- data ObjectChangeNotification = PatchNotification !Patch
- type LookupPatchResponse = Patch
- data CreateReleaseBody = CreateReleaseBody {
- data CreateReleaseResponse = CreateReleaseResponse {
- data LookupReleaseResponse = LookupReleaseResponse {
- data LookupLatestReleaseResponse = LookupLatestReleaseResponse {
- data CreateSessionBody = CreateSessionBody {}
- data CreateSessionResponse = CreateSessionResponse {}
- data LookupSessionResponse = LookupSessionResponse {}
- data ChangeFeedSubscription = IncludeObjectChanges ObjId
- data ChangeSecretBody = ChangeSecretBody {
- csbNewSecret :: !Text
- newtype BlobContent = BlobContent ByteString
- data UploadBlobResponse = UploadBlobResponse {}
- data LookupBlobResponse = LookupBlobResponse {}
- data Credentials
Documentation
type AversAPI = CreateObject :<|> (LookupObject :<|> (PatchObject :<|> (DeleteObject :<|> (LookupPatch :<|> (ObjectChanges :<|> (CreateRelease :<|> (LookupRelease :<|> (LookupLatestRelease :<|> (Feed :<|> (ChangeSecret :<|> (CreateSession :<|> (LookupSession :<|> (DeleteSession :<|> (UploadBlob :<|> (LookupBlob :<|> LookupBlobContent))))))))))))))) #
The complete Avers API as a data type.
type CreateObject = "objects" :> (Credentials :> (ReqBody '[JSON] CreateObjectBody :> Post '[JSON] CreateObjectResponse)) #
The complete Avers API
type LookupObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupObjectResponse)))) #
type PatchObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> (ReqBody '[JSON] PatchObjectBody :> Patch '[JSON] PatchObjectResponse))) #
type DeleteObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> Delete '[JSON] ())) #
type LookupPatch = "objects" :> (Capture "objId" ObjId :> ("patches" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupPatchResponse)))))) #
type ObjectChanges = "objects" :> (Capture "objId" ObjId :> ("changes" :> (Credentials :> Raw))) #
type CreateRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> (Credentials :> (ReqBody '[JSON] CreateReleaseBody :> Post '[JSON] CreateReleaseResponse)))) #
type LookupRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupReleaseResponse)))))) #
type LookupLatestRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> ("_latest" :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupLatestReleaseResponse)))))) #
type ChangeSecret = "secret" :> (Credentials :> (ReqBody '[JSON] ChangeSecretBody :> Post '[JSON] ())) #
type CreateSession = "session" :> (ReqBody '[JSON] CreateSessionBody :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie] CreateSessionResponse)) #
type LookupSession = "session" :> (SessionId :> Get '[JSON] (Headers '[Header "Set-Cookie" SetCookie] LookupSessionResponse)) #
type DeleteSession = "session" :> (SessionId :> Delete '[JSON] (Headers '[Header "Set-Cookie" SetCookie] ())) #
type UploadBlob = "blobs" :> (Credentials :> (Header "Content-Type" Text :> (ReqBody '[OctetStream] BlobContent :> Post '[JSON] UploadBlobResponse))) #
type LookupBlob = "blobs" :> (Capture "blobId" BlobId :> (Credentials :> Get '[JSON] LookupBlobResponse)) #
type LookupBlobContent = "blobs" :> (Capture "blobId" BlobId :> ("content" :> (Credentials :> Get '[OctetStream] (Headers '[Header "Content-Type" Text] BlobContent)))) #
type CacheValidationToken = Header "If-None-Match" Text #
The cache validator token when passed in the request. The server will use it to determine if the cached response on the client can be reused or not.
type Cacheable a = Headers '[Header "Cache-Control" Text, Header "ETag" Text] a #
Includes Cache-Control and ETag headers in the response to mark
it as cacheable by the client.
data CreateObjectBody #
Constructors
| CreateObjectBody | |
Fields
| |
Instances
| Generic CreateObjectBody # | |
Defined in Avers.API.Types Associated Types type Rep CreateObjectBody :: Type -> Type # Methods from :: CreateObjectBody -> Rep CreateObjectBody x # to :: Rep CreateObjectBody x -> CreateObjectBody # | |
| FromJSON CreateObjectBody # | |
Defined in Avers.API.Types Methods parseJSON :: Value -> Parser CreateObjectBody # parseJSONList :: Value -> Parser [CreateObjectBody] # | |
| type Rep CreateObjectBody # | |
Defined in Avers.API.Types type Rep CreateObjectBody = D1 (MetaData "CreateObjectBody" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "CreateObjectBody" PrefixI True) (S1 (MetaSel (Just "cobType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "cobContent") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Value))) | |
data CreateObjectResponse #
Constructors
| CreateObjectResponse | |
Instances
data LookupObjectResponse #
Constructors
| LookupObjectResponse | |
Fields
| |
Instances
data PatchObjectBody #
Constructors
| PatchObjectBody | |
Fields
| |
Instances
| Generic PatchObjectBody # | |
Defined in Avers.API.Types Associated Types type Rep PatchObjectBody :: Type -> Type # Methods from :: PatchObjectBody -> Rep PatchObjectBody x # to :: Rep PatchObjectBody x -> PatchObjectBody # | |
| FromJSON PatchObjectBody # | |
Defined in Avers.API.Types Methods parseJSON :: Value -> Parser PatchObjectBody # parseJSONList :: Value -> Parser [PatchObjectBody] # | |
| type Rep PatchObjectBody # | |
Defined in Avers.API.Types type Rep PatchObjectBody = D1 (MetaData "PatchObjectBody" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "PatchObjectBody" PrefixI True) (S1 (MetaSel (Just "pobRevisionId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 RevId) :*: S1 (MetaSel (Just "pobOperations") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Operation]))) | |
data PatchObjectResponse #
Constructors
| PatchObjectResponse | |
Fields
| |
Instances
data ObjectChangeNotification #
Constructors
| PatchNotification !Patch | A new patch was created. |
Instances
| Generic ObjectChangeNotification # | |
Defined in Avers.API.Types Associated Types type Rep ObjectChangeNotification :: Type -> Type # Methods from :: ObjectChangeNotification -> Rep ObjectChangeNotification x # to :: Rep ObjectChangeNotification x -> ObjectChangeNotification # | |
| ToJSON ObjectChangeNotification # | |
Defined in Avers.API.Types Methods toJSON :: ObjectChangeNotification -> Value # toEncoding :: ObjectChangeNotification -> Encoding # toJSONList :: [ObjectChangeNotification] -> Value # | |
| type Rep ObjectChangeNotification # | |
Defined in Avers.API.Types type Rep ObjectChangeNotification = D1 (MetaData "ObjectChangeNotification" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "PatchNotification" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Patch))) | |
type LookupPatchResponse = Patch #
data CreateReleaseBody #
Constructors
| CreateReleaseBody | |
Instances
| Generic CreateReleaseBody # | |
Defined in Avers.API.Types Associated Types type Rep CreateReleaseBody :: Type -> Type # Methods from :: CreateReleaseBody -> Rep CreateReleaseBody x # to :: Rep CreateReleaseBody x -> CreateReleaseBody # | |
| FromJSON CreateReleaseBody # | |
Defined in Avers.API.Types Methods parseJSON :: Value -> Parser CreateReleaseBody # parseJSONList :: Value -> Parser [CreateReleaseBody] # | |
| type Rep CreateReleaseBody # | |
data CreateReleaseResponse #
Constructors
| CreateReleaseResponse | |
Instances
| Generic CreateReleaseResponse # | |
Defined in Avers.API.Types Associated Types type Rep CreateReleaseResponse :: Type -> Type # Methods from :: CreateReleaseResponse -> Rep CreateReleaseResponse x # to :: Rep CreateReleaseResponse x -> CreateReleaseResponse # | |
| ToJSON CreateReleaseResponse # | |
Defined in Avers.API.Types Methods toJSON :: CreateReleaseResponse -> Value # toEncoding :: CreateReleaseResponse -> Encoding # toJSONList :: [CreateReleaseResponse] -> Value # toEncodingList :: [CreateReleaseResponse] -> Encoding # | |
| type Rep CreateReleaseResponse # | |
data LookupReleaseResponse #
Constructors
| LookupReleaseResponse | |
Instances
| Generic LookupReleaseResponse # | |
Defined in Avers.API.Types Associated Types type Rep LookupReleaseResponse :: Type -> Type # Methods from :: LookupReleaseResponse -> Rep LookupReleaseResponse x # to :: Rep LookupReleaseResponse x -> LookupReleaseResponse # | |
| ToJSON LookupReleaseResponse # | |
Defined in Avers.API.Types Methods toJSON :: LookupReleaseResponse -> Value # toEncoding :: LookupReleaseResponse -> Encoding # toJSONList :: [LookupReleaseResponse] -> Value # toEncodingList :: [LookupReleaseResponse] -> Encoding # | |
| type Rep LookupReleaseResponse # | |
data LookupLatestReleaseResponse #
Constructors
| LookupLatestReleaseResponse | |
Instances
| Generic LookupLatestReleaseResponse # | |
Defined in Avers.API.Types Associated Types type Rep LookupLatestReleaseResponse :: Type -> Type # Methods from :: LookupLatestReleaseResponse -> Rep LookupLatestReleaseResponse x # to :: Rep LookupLatestReleaseResponse x -> LookupLatestReleaseResponse # | |
| ToJSON LookupLatestReleaseResponse # | |
Defined in Avers.API.Types Methods toJSON :: LookupLatestReleaseResponse -> Value # toEncoding :: LookupLatestReleaseResponse -> Encoding # toJSONList :: [LookupLatestReleaseResponse] -> Value # toEncodingList :: [LookupLatestReleaseResponse] -> Encoding # | |
| type Rep LookupLatestReleaseResponse # | |
data CreateSessionBody #
Constructors
| CreateSessionBody | |
Instances
| Generic CreateSessionBody # | |
Defined in Avers.API.Types Associated Types type Rep CreateSessionBody :: Type -> Type # Methods from :: CreateSessionBody -> Rep CreateSessionBody x # to :: Rep CreateSessionBody x -> CreateSessionBody # | |
| FromJSON CreateSessionBody # | |
Defined in Avers.API.Types Methods parseJSON :: Value -> Parser CreateSessionBody # parseJSONList :: Value -> Parser [CreateSessionBody] # | |
| type Rep CreateSessionBody # | |
Defined in Avers.API.Types type Rep CreateSessionBody = D1 (MetaData "CreateSessionBody" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "CreateSessionBody" PrefixI True) (S1 (MetaSel (Just "csbLogin") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 SecretId) :*: S1 (MetaSel (Just "csbSecret") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) | |
data CreateSessionResponse #
Constructors
| CreateSessionResponse | |
Fields
| |
Instances
| Generic CreateSessionResponse # | |
Defined in Avers.API.Types Associated Types type Rep CreateSessionResponse :: Type -> Type # Methods from :: CreateSessionResponse -> Rep CreateSessionResponse x # to :: Rep CreateSessionResponse x -> CreateSessionResponse # | |
| ToJSON CreateSessionResponse # | |
Defined in Avers.API.Types Methods toJSON :: CreateSessionResponse -> Value # toEncoding :: CreateSessionResponse -> Encoding # toJSONList :: [CreateSessionResponse] -> Value # toEncodingList :: [CreateSessionResponse] -> Encoding # | |
| type Rep CreateSessionResponse # | |
Defined in Avers.API.Types type Rep CreateSessionResponse = D1 (MetaData "CreateSessionResponse" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "CreateSessionResponse" PrefixI True) (S1 (MetaSel (Just "csrSessionId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 SessionId) :*: S1 (MetaSel (Just "csrSessionObjId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ObjId))) | |
data LookupSessionResponse #
Constructors
| LookupSessionResponse | |
Fields
| |
Instances
| Generic LookupSessionResponse # | |
Defined in Avers.API.Types Associated Types type Rep LookupSessionResponse :: Type -> Type # Methods from :: LookupSessionResponse -> Rep LookupSessionResponse x # to :: Rep LookupSessionResponse x -> LookupSessionResponse # | |
| ToJSON LookupSessionResponse # | |
Defined in Avers.API.Types Methods toJSON :: LookupSessionResponse -> Value # toEncoding :: LookupSessionResponse -> Encoding # toJSONList :: [LookupSessionResponse] -> Value # toEncodingList :: [LookupSessionResponse] -> Encoding # | |
| type Rep LookupSessionResponse # | |
Defined in Avers.API.Types type Rep LookupSessionResponse = D1 (MetaData "LookupSessionResponse" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "LookupSessionResponse" PrefixI True) (S1 (MetaSel (Just "lsrSessionId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 SessionId) :*: S1 (MetaSel (Just "lsrSessionObjId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ObjId))) | |
data ChangeFeedSubscription #
Constructors
| IncludeObjectChanges ObjId |
Instances
| FromJSON ChangeFeedSubscription # | |
Defined in Avers.API.Types Methods parseJSON :: Value -> Parser ChangeFeedSubscription # parseJSONList :: Value -> Parser [ChangeFeedSubscription] # | |
data ChangeSecretBody #
Constructors
| ChangeSecretBody | |
Fields
| |
Instances
| Generic ChangeSecretBody # | |
Defined in Avers.API.Types Associated Types type Rep ChangeSecretBody :: Type -> Type # Methods from :: ChangeSecretBody -> Rep ChangeSecretBody x # to :: Rep ChangeSecretBody x -> ChangeSecretBody # | |
| FromJSON ChangeSecretBody # | |
Defined in Avers.API.Types Methods parseJSON :: Value -> Parser ChangeSecretBody # parseJSONList :: Value -> Parser [ChangeSecretBody] # | |
| type Rep ChangeSecretBody # | |
Defined in Avers.API.Types type Rep ChangeSecretBody = D1 (MetaData "ChangeSecretBody" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "ChangeSecretBody" PrefixI True) (S1 (MetaSel (Just "csbNewSecret") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) | |
newtype BlobContent #
Constructors
| BlobContent ByteString |
Instances
| MimeRender OctetStream BlobContent # | |
Defined in Avers.API.Types Methods mimeRender :: Proxy OctetStream -> BlobContent -> ByteString # | |
| MimeUnrender OctetStream BlobContent # | |
Defined in Avers.API.Types Methods mimeUnrender :: Proxy OctetStream -> ByteString -> Either String BlobContent # mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String BlobContent # | |
data UploadBlobResponse #
Constructors
| UploadBlobResponse | |
Instances
data LookupBlobResponse #
Constructors
| LookupBlobResponse | |
Instances
data Credentials #
Credentials are used to authenticate the client. It can be a SessionId
(extracted from the session cookie).
Later we may add support for token based authentication. Then we extend this into a sumtype covering all the possible ways how credentials can be passed along with the request.
Constructors
| CredAnonymous | |
| CredSessionId !SessionId |