Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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))))))))))))))) Source #
The complete Avers API as a data type.
type CreateObject = "objects" :> (Credentials :> (ReqBody '[JSON] CreateObjectBody :> Post '[JSON] CreateObjectResponse)) Source #
The complete Avers API
type LookupObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupObjectResponse)))) Source #
type PatchObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> (ReqBody '[JSON] PatchObjectBody :> Patch '[JSON] PatchObjectResponse))) Source #
type DeleteObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> Delete '[JSON] ())) Source #
type LookupPatch = "objects" :> (Capture "objId" ObjId :> ("patches" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupPatchResponse)))))) Source #
type ObjectChanges = "objects" :> (Capture "objId" ObjId :> ("changes" :> (Credentials :> Raw))) Source #
type CreateRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> (Credentials :> (ReqBody '[JSON] CreateReleaseBody :> Post '[JSON] CreateReleaseResponse)))) Source #
type LookupRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupReleaseResponse)))))) Source #
type LookupLatestRelease = "objects" :> (Capture "objId" ObjId :> ("releases" :> ("_latest" :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupLatestReleaseResponse)))))) Source #
type ChangeSecret = "secret" :> (Credentials :> (ReqBody '[JSON] ChangeSecretBody :> Post '[JSON] ())) Source #
type CreateSession = "session" :> (ReqBody '[JSON] CreateSessionBody :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie] CreateSessionResponse)) Source #
type LookupSession = "session" :> (SessionId :> Get '[JSON] (Headers '[Header "Set-Cookie" SetCookie] LookupSessionResponse)) Source #
type DeleteSession = "session" :> (SessionId :> Delete '[JSON] (Headers '[Header "Set-Cookie" SetCookie] ())) Source #
type UploadBlob = "blobs" :> (Credentials :> (Header "Content-Type" Text :> (ReqBody '[OctetStream] BlobContent :> Post '[JSON] UploadBlobResponse))) Source #
type LookupBlob = "blobs" :> (Capture "blobId" BlobId :> (Credentials :> Get '[JSON] LookupBlobResponse)) Source #
type LookupBlobContent = "blobs" :> (Capture "blobId" BlobId :> ("content" :> (Credentials :> Get '[OctetStream] (Headers '[Header "Content-Type" Text] BlobContent)))) Source #
type CacheValidationToken = Header "If-None-Match" Text Source #
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 Source #
Includes Cache-Control
and ETag
headers in the response to mark
it as cacheable by the client.
data CreateObjectBody Source #
CreateObjectBody | |
|
data LookupObjectResponse Source #
LookupObjectResponse | |
|
data PatchObjectBody Source #
PatchObjectBody | |
|
data PatchObjectResponse Source #
PatchObjectResponse | |
|
data ObjectChangeNotification Source #
PatchNotification !Patch | A new patch was created. |
type LookupPatchResponse = Patch Source #
data CreateReleaseBody Source #
data CreateReleaseResponse Source #
data LookupReleaseResponse Source #
data CreateSessionResponse Source #
data LookupSessionResponse Source #
data ChangeSecretBody Source #
newtype BlobContent Source #
data Credentials Source #
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.