Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type AversCoreAPI = ("objects" :> (Credentials :> (ReqBody '[JSON] CreateObjectBody :> Post '[JSON] CreateObjectResponse))) :<|> (("objects" :> (Capture "objId" ObjId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupObjectResponse))))) :<|> (("objects" :> (Capture "objId" ObjId :> (Credentials :> (ReqBody '[JSON] PatchObjectBody :> Patch '[JSON] PatchObjectResponse)))) :<|> (("objects" :> (Capture "objId" ObjId :> (Credentials :> Delete '[JSON] ()))) :<|> (("objects" :> (Capture "objId" ObjId :> ("patches" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupPatchResponse))))))) :<|> (("objects" :> (Capture "objId" ObjId :> ("changes" :> (Credentials :> Raw)))) :<|> (("objects" :> (Capture "objId" ObjId :> ("releases" :> (Credentials :> (ReqBody '[JSON] CreateReleaseBody :> Post '[JSON] CreateReleaseResponse))))) :<|> (("objects" :> (Capture "objId" ObjId :> ("releases" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupReleaseResponse))))))) :<|> (("objects" :> (Capture "objId" ObjId :> ("releases" :> ("_latest" :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupLatestReleaseResponse))))))) :<|> (("feed" :> (Credentials :> Raw)) :<|> ("secret" :> (Credentials :> (ReqBody '[JSON] ChangeSecretBody :> Post '[] ()))))))))))))
- type AversSessionAPI = ("session" :> (ReqBody '[JSON] CreateSessionBody :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie] CreateSessionResponse))) :<|> (("session" :> (SessionId :> Get '[JSON] (Headers '[Header "Set-Cookie" SetCookie] LookupSessionResponse))) :<|> ("session" :> (SessionId :> Delete '[JSON] (Headers '[Header "Set-Cookie" SetCookie] ()))))
- type AversBlobAPI = ("blobs" :> (Header "Content-Type" Text :> (ReqBody '[OctetStream] ByteString :> Post '[JSON] UploadBlobResponse))) :<|> (("blobs" :> (Capture "blobId" BlobId :> Get '[JSON] LookupBlobResponse)) :<|> ("blobs" :> (Capture "blobId" BlobId :> ("content" :> Get '[OctetStream] (Headers '[Header "Content-Type" Text] ByteString)))))
- type AversAccountAPI = "signup" :> (ReqBody '[JSON] SignupBody :> Post '[JSON] SignupResponse)
- 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
- data UploadBlobResponse = UploadBlobResponse {
- data LookupBlobResponse = LookupBlobResponse {
- data SignupBody = SignupBody {
- data SignupResponse = SignupResponse {
- data Credentials = SessionIdCredential !SessionId
Documentation
type AversCoreAPI = ("objects" :> (Credentials :> (ReqBody '[JSON] CreateObjectBody :> Post '[JSON] CreateObjectResponse))) :<|> (("objects" :> (Capture "objId" ObjId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupObjectResponse))))) :<|> (("objects" :> (Capture "objId" ObjId :> (Credentials :> (ReqBody '[JSON] PatchObjectBody :> Patch '[JSON] PatchObjectResponse)))) :<|> (("objects" :> (Capture "objId" ObjId :> (Credentials :> Delete '[JSON] ()))) :<|> (("objects" :> (Capture "objId" ObjId :> ("patches" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupPatchResponse))))))) :<|> (("objects" :> (Capture "objId" ObjId :> ("changes" :> (Credentials :> Raw)))) :<|> (("objects" :> (Capture "objId" ObjId :> ("releases" :> (Credentials :> (ReqBody '[JSON] CreateReleaseBody :> Post '[JSON] CreateReleaseResponse))))) :<|> (("objects" :> (Capture "objId" ObjId :> ("releases" :> (Capture "revId" RevId :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupReleaseResponse))))))) :<|> (("objects" :> (Capture "objId" ObjId :> ("releases" :> ("_latest" :> (Credentials :> (CacheValidationToken :> Get '[JSON] (Cacheable LookupLatestReleaseResponse))))))) :<|> (("feed" :> (Credentials :> Raw)) :<|> ("secret" :> (Credentials :> (ReqBody '[JSON] ChangeSecretBody :> Post '[] ())))))))))))) Source #
The Core API to manipulate objects, patches, releases etc.
type AversSessionAPI = ("session" :> (ReqBody '[JSON] CreateSessionBody :> Post '[JSON] (Headers '[Header "Set-Cookie" SetCookie] CreateSessionResponse))) :<|> (("session" :> (SessionId :> Get '[JSON] (Headers '[Header "Set-Cookie" SetCookie] LookupSessionResponse))) :<|> ("session" :> (SessionId :> Delete '[JSON] (Headers '[Header "Set-Cookie" SetCookie] ())))) Source #
API to create and maintain sessions. Also contains API to change the secret, which is part of the session code.
type AversBlobAPI = ("blobs" :> (Header "Content-Type" Text :> (ReqBody '[OctetStream] ByteString :> Post '[JSON] UploadBlobResponse))) :<|> (("blobs" :> (Capture "blobId" BlobId :> Get '[JSON] LookupBlobResponse)) :<|> ("blobs" :> (Capture "blobId" BlobId :> ("content" :> Get '[OctetStream] (Headers '[Header "Content-Type" Text] ByteString))))) Source #
API to manange blobs
type AversAccountAPI = "signup" :> (ReqBody '[JSON] SignupBody :> Post '[JSON] SignupResponse) Source #
API to manage accounts. These are optional and not really part of Avers, but many applications do have a concept of a user or account, some person which is using the API.
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 #
data UploadBlobResponse Source #
data LookupBlobResponse Source #
data SignupBody Source #
data SignupResponse 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.