avers-api-0.1.0: Types describing the core and extended Avers APIs

Safe HaskellNone
LanguageHaskell2010

Avers.API

Synopsis

Documentation

type CreateObject = "objects" :> (Credentials :> (ReqBody '[JSON] CreateObjectBody :> Post '[JSON] CreateObjectResponse)) #

The complete Avers API

type DeleteObject = "objects" :> (Capture "objId" ObjId :> (Credentials :> Delete '[JSON] ())) #

type ObjectChanges = "objects" :> (Capture "objId" ObjId :> ("changes" :> (Credentials :> Raw))) #

type Feed = "feed" :> (Credentials :> Raw) #

type DeleteSession = "session" :> (SessionId :> Delete '[JSON] (Headers '[Header "Set-Cookie" SetCookie] ())) #

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 # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep CreateObjectBody :: Type -> Type #

FromJSON CreateObjectBody # 
Instance details

Defined in Avers.API.Types

type Rep CreateObjectBody # 
Instance details

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 LookupObjectResponse #

data PatchObjectBody #

Constructors

PatchObjectBody 

Fields

  • pobRevisionId :: !RevId

    The RevId against which the client created the operations. This may be a bit behind if some other client submitted patches in parallel.

  • pobOperations :: ![Operation]

    The operations which the client wants to store in the database.

Instances
Generic PatchObjectBody # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep PatchObjectBody :: Type -> Type #

FromJSON PatchObjectBody # 
Instance details

Defined in Avers.API.Types

type Rep PatchObjectBody # 
Instance details

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

  • porPreviousPatches :: ![Patch]

    Patches which were already in the database. The submitted ops were rebased on top of these.

  • porNumProcessedOperations :: !Int

    The number of operations which were processed. This may be smaller than the number of submitted ops if the processing failed somewhere in the middle. The client can then decide what to do with those which were not accepted.

  • porResultingPatches :: ![Patch]

    Out of the submitted operations, these are the patches which were actually applied and stored in the database. This list may be shorter if some operations were dropped (because redundant or conflicting).

Instances
Generic PatchObjectResponse # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep PatchObjectResponse :: Type -> Type #

ToJSON PatchObjectResponse # 
Instance details

Defined in Avers.API.Types

type Rep PatchObjectResponse # 
Instance details

Defined in Avers.API.Types

type Rep PatchObjectResponse = D1 (MetaData "PatchObjectResponse" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "PatchObjectResponse" PrefixI True) (S1 (MetaSel (Just "porPreviousPatches") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Patch]) :*: (S1 (MetaSel (Just "porNumProcessedOperations") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "porResultingPatches") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Patch]))))

data CreateReleaseBody #

Constructors

CreateReleaseBody 
Instances
Generic CreateReleaseBody # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep CreateReleaseBody :: Type -> Type #

FromJSON CreateReleaseBody # 
Instance details

Defined in Avers.API.Types

type Rep CreateReleaseBody # 
Instance details

Defined in Avers.API.Types

type Rep CreateReleaseBody = D1 (MetaData "CreateReleaseBody" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "CreateReleaseBody" PrefixI False) (U1 :: Type -> Type))

data CreateReleaseResponse #

Constructors

CreateReleaseResponse 
Instances
Generic CreateReleaseResponse # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep CreateReleaseResponse :: Type -> Type #

ToJSON CreateReleaseResponse # 
Instance details

Defined in Avers.API.Types

type Rep CreateReleaseResponse # 
Instance details

Defined in Avers.API.Types

type Rep CreateReleaseResponse = D1 (MetaData "CreateReleaseResponse" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "CreateReleaseResponse" PrefixI False) (U1 :: Type -> Type))

data LookupReleaseResponse #

Constructors

LookupReleaseResponse 
Instances
Generic LookupReleaseResponse # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep LookupReleaseResponse :: Type -> Type #

ToJSON LookupReleaseResponse # 
Instance details

Defined in Avers.API.Types

type Rep LookupReleaseResponse # 
Instance details

Defined in Avers.API.Types

type Rep LookupReleaseResponse = D1 (MetaData "LookupReleaseResponse" "Avers.API.Types" "avers-api-0.1.0-dY1Titi6yu6O8MG4uEAw5" False) (C1 (MetaCons "LookupReleaseResponse" PrefixI False) (U1 :: Type -> Type))

data CreateSessionBody #

Constructors

CreateSessionBody 

Fields

Instances
Generic CreateSessionBody # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep CreateSessionBody :: Type -> Type #

FromJSON CreateSessionBody # 
Instance details

Defined in Avers.API.Types

type Rep CreateSessionBody # 
Instance details

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 ChangeSecretBody #

Constructors

ChangeSecretBody 

Fields

Instances
Generic ChangeSecretBody # 
Instance details

Defined in Avers.API.Types

Associated Types

type Rep ChangeSecretBody :: Type -> Type #

FromJSON ChangeSecretBody # 
Instance details

Defined in Avers.API.Types

type Rep ChangeSecretBody # 
Instance details

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)))

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.