wire-subsystems-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Wire.UserStore

Synopsis

Documentation

data StoredUserUpdate Source #

Update of any "simple" attributes (ones that do not involve locking, like handle, or validation protocols, like email).

| see UserProfileUpdate.

Instances

Instances details
Arbitrary StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

Generic StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

Associated Types

type Rep StoredUserUpdate :: Type -> Type #

Show StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

Default StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

Eq StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

Ord StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

type Rep StoredUserUpdate Source # 
Instance details

Defined in Wire.UserStore

data StoredUserHandleUpdate Source #

Update user handle (this involves several http requests for locking the required handle). The old/previous handle (for deciding idempotency).

Constructors

MkStoredUserHandleUpdate 

Fields

Instances

Instances details
Arbitrary StoredUserHandleUpdate Source # 
Instance details

Defined in Wire.UserStore

Generic StoredUserHandleUpdate Source # 
Instance details

Defined in Wire.UserStore

Associated Types

type Rep StoredUserHandleUpdate :: Type -> Type #

Show StoredUserHandleUpdate Source # 
Instance details

Defined in Wire.UserStore

Eq StoredUserHandleUpdate Source # 
Instance details

Defined in Wire.UserStore

Ord StoredUserHandleUpdate Source # 
Instance details

Defined in Wire.UserStore

type Rep StoredUserHandleUpdate Source # 
Instance details

Defined in Wire.UserStore

type Rep StoredUserHandleUpdate = D1 ('MetaData "StoredUserHandleUpdate" "Wire.UserStore" "wire-subsystems-0.1.0-8kLXA8DL8T7Joz69IIRPwJ" 'False) (C1 ('MetaCons "MkStoredUserHandleUpdate" 'PrefixI 'True) (S1 ('MetaSel ('Just "old") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Handle)) :*: S1 ('MetaSel ('Just "new") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Handle)))

data UserStore m a where Source #

Effect containing database logic around StoredUser. (Example: claim handle lock is database logic; validate handle is application logic.)

Constructors

GetIndexUser :: UserId -> UserStore m (Maybe IndexUser) 
GetIndexUsersPaginated :: Int32 -> Maybe PagingState -> UserStore m (PageWithState IndexUser) 
GetUsers :: [UserId] -> UserStore m [StoredUser] 
UpdateUser :: UserId -> StoredUserUpdate -> UserStore m () 
UpdateUserHandleEither :: UserId -> StoredUserHandleUpdate -> UserStore m (Either StoredUserUpdateError ()) 
DeleteUser :: User -> UserStore m () 
LookupHandle :: Handle -> UserStore m (Maybe UserId)

This operation looks up a handle but is guaranteed to not give you stale locks. It is potentially slower and less resilient than GlimpseHandle.

GlimpseHandle :: Handle -> UserStore m (Maybe UserId)

The interpretation for LookupHandle and GlimpseHandle may differ in terms of how consistent they are. If that matters for the interpretation, this operation may give you stale locks, but is faster and more resilient.

LookupStatus :: UserId -> UserStore m (Maybe AccountStatus) 
IsActivated :: UserId -> UserStore m Bool

Whether the account has been activated by verifying an email address or phone number.

LookupLocale :: UserId -> UserStore m (Maybe (Maybe Language, Maybe Country)) 
UpdateUserTeam :: UserId -> TeamId -> UserStore m () 
GetActivityTimestamps :: UserId -> UserStore m [Maybe UTCTime] 
GetRichInfo :: UserId -> UserStore m (Maybe RichInfoAssocList) 
GetUserAuthenticationInfo :: UserId -> UserStore m (Maybe (Maybe Password, AccountStatus)) 

updateUserTeam :: forall r. Member UserStore r => UserId -> TeamId -> Sem r () Source #

isActivated :: forall r. Member UserStore r => UserId -> Sem r Bool Source #

Whether the account has been activated by verifying an email address or phone number.

glimpseHandle :: forall r. Member UserStore r => Handle -> Sem r (Maybe UserId) Source #

The interpretation for LookupHandle and GlimpseHandle may differ in terms of how consistent they are. If that matters for the interpretation, this operation may give you stale locks, but is faster and more resilient.

lookupHandle :: forall r. Member UserStore r => Handle -> Sem r (Maybe UserId) Source #

This operation looks up a handle but is guaranteed to not give you stale locks. It is potentially slower and less resilient than GlimpseHandle.

deleteUser :: forall r. Member UserStore r => User -> Sem r () Source #

getUsers :: forall r. Member UserStore r => [UserId] -> Sem r [StoredUser] Source #