integration-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

SetupHelpers

Synopsis

Documentation

deleteUser :: (HasCallStack, MakesValue user) => user -> App () Source #

createTeam :: (HasCallStack, MakesValue domain) => domain -> Int -> App (Value, String, [Value]) Source #

returns (owner, team id, members)

connectTwoUsers :: (HasCallStack, MakesValue alice, MakesValue bob) => alice -> bob -> App () Source #

connectUsers :: (HasCallStack, MakesValue usr) => [usr] -> App () Source #

assertConnection :: (HasCallStack, MakesValue alice, MakesValue bob) => alice -> bob -> String -> App () Source #

createUsers :: (HasCallStack, MakesValue domain) => [domain] -> App [Value] Source #

simpleMixedConversationSetup :: (HasCallStack, MakesValue domain) => domain -> App (Value, Value, Value) Source #

Setup a team user, another user, connect the two, create a proteus conversation, upgrade to mixed. Return the two users and the conversation.

createMLSOne2OnePartner :: (MakesValue user, MakesValue domain, MakesValue convDomain, HasCallStack) => domain -> user -> convDomain -> App Value Source #

Create a user on the given domain, such that the 1-1 conversation with other resides on convDomain. This connects the two users as a side-effect.

data TokenLength Source #

Constructors

GCM 
APNS 

createOne2OneConversation :: (HasCallStack, MakesValue domain1, MakesValue domain2) => domain1 -> domain2 -> App (Value, Value, Value) Source #

Create two users on different domains such that the one-to-one conversation, once finalised, will be hosted on the backend given by the first domain.

toConvType :: One2OneConvState -> Int Source #

Converts to an integer corresponding to the numeric representation of the ConvType type.

getOne2OneConversation :: HasCallStack => Value -> Value -> One2OneConvState -> App Value Source #

Fetch the one-to-one conversation between the two users that is in one of two possible states.

setupProvider :: (HasCallStack, MakesValue user) => user -> NewProvider -> App Value Source #

Create a provider, get an activation code, activate the provider and log it in. The return value is the created provider.

setUpLHDevice Source #

Arguments

:: (HasCallStack, MakesValue tid, MakesValue owner, MakesValue uid) 
=> tid 
-> owner 
-> uid 
-> (String, Int)

the host and port the LH service is running on

-> App () 

setup a legalhold device for uid, authorised by owner at the specified port

uploadProfilePicture :: (HasCallStack, MakesValue usr) => usr -> App (String, String, String) Source #

This adds one random asset to the $sel:assets:PutSelf field in the user record and returns an asset key. The asset carries a fresh UUIDv4 in text form (even though it is typed preview and image).

downloadProfilePicture :: (HasCallStack, MakesValue caller) => caller -> String -> String -> App (String, String) Source #

Take a calling user (any user will do) and an asset domain and key, and return a (temporarily valid) s3 url plus asset payload (if created with uploadProfilePicture, that's a UUIDv4).

uploadDownloadProfilePicture :: (HasCallStack, MakesValue usr) => usr -> App (String, String) Source #

Call uploadProfilePicture and downloadPicture, returning the return value of the latter.