simplexmq-6.5.0.16: SimpleXMQ message broker
Copyright(c) simplex.chat
LicenseAGPL-3
Maintainerchat@simplex.chat
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simplex.Messaging.Agent.Protocol

Description

Types, parsers, serializers and functions to send and receive SMP agent protocol commands and responses.

See https://github.com/simplex-chat/simplexmq/blob/master/protocol/agent-protocol.md

Synopsis

Protocol parameters

type VersionSMPA = Version SMPAgentVersion Source #

type VersionRangeSMPA = VersionRange SMPAgentVersion Source #

pattern VersionSMPA :: Word16 -> VersionSMPA Source #

SMP agent protocol types

type ConnInfo = ByteString Source #

type AEntityId = ByteString Source #

data AEvent (e :: AEntity) where Source #

Parameterized type for SMP agent events

Constructors

INV :: AConnectionRequestUri -> Maybe ClientServiceId -> AEvent AEConn 
LINK :: ConnShortLink 'CMContact -> UserConnLinkData 'CMContact -> AEvent AEConn 
LDATA :: FixedLinkData 'CMContact -> ConnLinkData 'CMContact -> AEvent AEConn 
CONF :: ConfirmationId -> PQSupport -> [SMPServer] -> ConnInfo -> AEvent AEConn 
REQ :: InvitationId -> PQSupport -> NonEmpty SMPServer -> ConnInfo -> AEvent AEConn 
INFO :: PQSupport -> ConnInfo -> AEvent AEConn 
CON :: PQEncryption -> AEvent AEConn 
END :: AEvent AEConn 
DELD :: AEvent AEConn 
CONNECT :: AProtocolType -> TransportHost -> AEvent AENone 
DISCONNECT :: AProtocolType -> TransportHost -> AEvent AENone 
DOWN :: SMPServer -> [ConnId] -> AEvent AENone 
UP :: SMPServer -> [ConnId] -> AEvent AENone 
SWITCH :: QueueDirection -> SwitchPhase -> ConnectionStats -> AEvent AEConn 
RSYNC :: RatchetSyncState -> Maybe AgentCryptoError -> ConnectionStats -> AEvent AEConn 
SENT :: AgentMsgId -> Maybe SMPServer -> AEvent AEConn 
MWARN :: AgentMsgId -> AgentErrorType -> AEvent AEConn 
MERR :: AgentMsgId -> AgentErrorType -> AEvent AEConn 
MERRS :: NonEmpty AgentMsgId -> AgentErrorType -> AEvent AEConn 
MSG :: MsgMeta -> MsgFlags -> MsgBody -> AEvent AEConn 
MSGNTF :: MsgId -> Maybe UTCTime -> AEvent AEConn 
RCVD :: MsgMeta -> NonEmpty MsgReceipt -> AEvent AEConn 
QCONT :: AEvent AEConn 
DEL_RCVQS :: NonEmpty (ConnId, SMPServer, RecipientId, Maybe AgentErrorType) -> AEvent AEConn 
DEL_CONNS :: NonEmpty ConnId -> AEvent AEConn 
DEL_USER :: Int64 -> AEvent AENone 
STAT :: ConnectionStats -> AEvent AEConn 
OK :: AEvent AEConn 
JOINED :: SndQueueSecured -> Maybe ClientServiceId -> AEvent AEConn 
ERR :: AgentErrorType -> AEvent AEConn 
ERRS :: NonEmpty (ConnId, AgentErrorType) -> AEvent AENone 
SUSPENDED :: AEvent AENone 
RFPROG :: Int64 -> Int64 -> AEvent AERcvFile 
RFDONE :: FilePath -> AEvent AERcvFile 
RFERR :: AgentErrorType -> AEvent AERcvFile 
RFWARN :: AgentErrorType -> AEvent AERcvFile 
SFPROG :: Int64 -> Int64 -> AEvent AESndFile 
SFDONE :: ValidFileDescription 'FSender -> [ValidFileDescription 'FRecipient] -> AEvent AESndFile 
SFERR :: AgentErrorType -> AEvent AESndFile 
SFWARN :: AgentErrorType -> AEvent AESndFile 

Instances

Instances details
Show (AEvent e) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AEvent e -> ShowS

show :: AEvent e -> String

showList :: [AEvent e] -> ShowS

Eq (AEvent e) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: AEvent e -> AEvent e -> Bool

(/=) :: AEvent e -> AEvent e -> Bool

data AEvt Source #

Constructors

forall e.AEntityI e => AEvt (SAEntity e) (AEvent e) 

Instances

Instances details
Show AEvt Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AEvt -> ShowS

show :: AEvt -> String

showList :: [AEvt] -> ShowS

Eq AEvt Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: AEvt -> AEvt -> Bool

(/=) :: AEvt -> AEvt -> Bool

data ACommandTag Source #

Constructors

NEW_ 
LSET_ 
LGET_ 
JOIN_ 
LET_ 
ACK_ 
SWCH_ 
DEL_ 

Instances

Instances details
Show ACommandTag Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ACommandTag -> ShowS

show :: ACommandTag -> String

showList :: [ACommandTag] -> ShowS

StrEncoding ACommandTag Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: ACommandTag -> ByteString Source #

strDecode :: ByteString -> Either String ACommandTag Source #

strP :: Parser ACommandTag Source #

data AEventTag (e :: AEntity) where Source #

Instances

Instances details
Show (AEventTag e) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AEventTag e -> ShowS

show :: AEventTag e -> String

showList :: [AEventTag e] -> ShowS

Eq (AEventTag e) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: AEventTag e -> AEventTag e -> Bool

(/=) :: AEventTag e -> AEventTag e -> Bool

data AEvtTag Source #

Constructors

forall e.AEntityI e => AEvtTag (SAEntity e) (AEventTag e) 

Instances

Instances details
Show AEvtTag Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AEvtTag -> ShowS

show :: AEvtTag -> String

showList :: [AEvtTag] -> ShowS

Eq AEvtTag Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: AEvtTag -> AEvtTag -> Bool

(/=) :: AEvtTag -> AEvtTag -> Bool

data AEntity Source #

Constructors

AEConn 
AERcvFile 
AESndFile 
AENone 

Instances

Instances details
Show AEntity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AEntity -> ShowS

show :: AEntity -> String

showList :: [AEntity] -> ShowS

Eq AEntity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: AEntity -> AEntity -> Bool

(/=) :: AEntity -> AEntity -> Bool

TestEquality SAEntity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

testEquality :: forall (a :: k) (b :: k). SAEntity a -> SAEntity b -> Maybe (a :~: b)

data SAEntity :: AEntity -> Type where Source #

Instances

Instances details
TestEquality SAEntity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

testEquality :: forall (a :: k) (b :: k). SAEntity a -> SAEntity b -> Maybe (a :~: b)

Show (SAEntity e) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SAEntity e -> ShowS

show :: SAEntity e -> String

showList :: [SAEntity e] -> ShowS

class AEntityI (e :: AEntity) where Source #

type MsgHash = ByteString Source #

data MsgMeta Source #

Agent message metadata sent to the client

Constructors

MsgMeta 

Instances

Instances details
Show MsgMeta Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> MsgMeta -> ShowS

show :: MsgMeta -> String

showList :: [MsgMeta] -> ShowS

Eq MsgMeta Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: MsgMeta -> MsgMeta -> Bool

(/=) :: MsgMeta -> MsgMeta -> Bool

data RcvQueueInfo Source #

Instances

Instances details
FromJSON RcvQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser RcvQueueInfo

parseJSONList :: Value -> Parser [RcvQueueInfo]

omittedField :: Maybe RcvQueueInfo

ToJSON RcvQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: RcvQueueInfo -> Value

toEncoding :: RcvQueueInfo -> Encoding

toJSONList :: [RcvQueueInfo] -> Value

toEncodingList :: [RcvQueueInfo] -> Encoding

omitField :: RcvQueueInfo -> Bool

Show RcvQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> RcvQueueInfo -> ShowS

show :: RcvQueueInfo -> String

showList :: [RcvQueueInfo] -> ShowS

Eq RcvQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: RcvQueueInfo -> RcvQueueInfo -> Bool

(/=) :: RcvQueueInfo -> RcvQueueInfo -> Bool

data SndQueueInfo Source #

Instances

Instances details
FromJSON SndQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser SndQueueInfo

parseJSONList :: Value -> Parser [SndQueueInfo]

omittedField :: Maybe SndQueueInfo

ToJSON SndQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: SndQueueInfo -> Value

toEncoding :: SndQueueInfo -> Encoding

toJSONList :: [SndQueueInfo] -> Value

toEncodingList :: [SndQueueInfo] -> Encoding

omitField :: SndQueueInfo -> Bool

Show SndQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SndQueueInfo -> ShowS

show :: SndQueueInfo -> String

showList :: [SndQueueInfo] -> ShowS

Eq SndQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: SndQueueInfo -> SndQueueInfo -> Bool

(/=) :: SndQueueInfo -> SndQueueInfo -> Bool

data SubscriptionStatus Source #

Constructors

SSActive 
SSPending 
SSRemoved 

Fields

SSNoSub 

Instances

Instances details
FromJSON SubscriptionStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser SubscriptionStatus

parseJSONList :: Value -> Parser [SubscriptionStatus]

omittedField :: Maybe SubscriptionStatus

ToJSON SubscriptionStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show SubscriptionStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SubscriptionStatus -> ShowS

show :: SubscriptionStatus -> String

showList :: [SubscriptionStatus] -> ShowS

Eq SubscriptionStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Ord SubscriptionStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data SwitchPhase Source #

Instances

Instances details
FromJSON SwitchPhase Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser SwitchPhase

parseJSONList :: Value -> Parser [SwitchPhase]

omittedField :: Maybe SwitchPhase

ToJSON SwitchPhase Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: SwitchPhase -> Value

toEncoding :: SwitchPhase -> Encoding

toJSONList :: [SwitchPhase] -> Value

toEncodingList :: [SwitchPhase] -> Encoding

omitField :: SwitchPhase -> Bool

Show SwitchPhase Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SwitchPhase -> ShowS

show :: SwitchPhase -> String

showList :: [SwitchPhase] -> ShowS

Eq SwitchPhase Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: SwitchPhase -> SwitchPhase -> Bool

(/=) :: SwitchPhase -> SwitchPhase -> Bool

data RcvSwitchStatus Source #

Instances

Instances details
FromJSON RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser RcvSwitchStatus

parseJSONList :: Value -> Parser [RcvSwitchStatus]

omittedField :: Maybe RcvSwitchStatus

ToJSON RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> RcvSwitchStatus -> ShowS

show :: RcvSwitchStatus -> String

showList :: [RcvSwitchStatus] -> ShowS

Eq RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

StrEncoding RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: RcvSwitchStatus -> ByteString Source #

strDecode :: ByteString -> Either String RcvSwitchStatus Source #

strP :: Parser RcvSwitchStatus Source #

FromField RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromField :: FieldParser RcvSwitchStatus #

ToField RcvSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toField :: RcvSwitchStatus -> SQLData #

data SndSwitchStatus Source #

Instances

Instances details
FromJSON SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser SndSwitchStatus

parseJSONList :: Value -> Parser [SndSwitchStatus]

omittedField :: Maybe SndSwitchStatus

ToJSON SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SndSwitchStatus -> ShowS

show :: SndSwitchStatus -> String

showList :: [SndSwitchStatus] -> ShowS

Eq SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

StrEncoding SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: SndSwitchStatus -> ByteString Source #

strDecode :: ByteString -> Either String SndSwitchStatus Source #

strP :: Parser SndSwitchStatus Source #

FromField SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromField :: FieldParser SndSwitchStatus #

ToField SndSwitchStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toField :: SndSwitchStatus -> SQLData #

data QueueDirection Source #

Constructors

QDRcv 
QDSnd 

Instances

Instances details
FromJSON QueueDirection Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser QueueDirection

parseJSONList :: Value -> Parser [QueueDirection]

omittedField :: Maybe QueueDirection

ToJSON QueueDirection Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: QueueDirection -> Value

toEncoding :: QueueDirection -> Encoding

toJSONList :: [QueueDirection] -> Value

toEncodingList :: [QueueDirection] -> Encoding

omitField :: QueueDirection -> Bool

Show QueueDirection Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> QueueDirection -> ShowS

show :: QueueDirection -> String

showList :: [QueueDirection] -> ShowS

Eq QueueDirection Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data RatchetSyncState Source #

Instances

Instances details
FromJSON RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser RatchetSyncState

parseJSONList :: Value -> Parser [RatchetSyncState]

omittedField :: Maybe RatchetSyncState

ToJSON RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> RatchetSyncState -> ShowS

show :: RatchetSyncState -> String

showList :: [RatchetSyncState] -> ShowS

Eq RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

StrEncoding RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: RatchetSyncState -> ByteString Source #

strDecode :: ByteString -> Either String RatchetSyncState Source #

strP :: Parser RatchetSyncState Source #

FromField RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromField :: FieldParser RatchetSyncState #

ToField RatchetSyncState Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toField :: RatchetSyncState -> SQLData #

data SMPConfirmation Source #

Constructors

SMPConfirmation 

Fields

Instances

Instances details
Show SMPConfirmation Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SMPConfirmation -> ShowS

show :: SMPConfirmation -> String

showList :: [SMPConfirmation] -> ShowS

data AgentMessage Source #

Instances

Instances details
Show AgentMessage Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AgentMessage -> ShowS

show :: AgentMessage -> String

showList :: [AgentMessage] -> ShowS

Encoding AgentMessage Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: AgentMessage -> ByteString Source #

smpDecode :: ByteString -> Either String AgentMessage Source #

smpP :: Parser AgentMessage Source #

data APrivHeader Source #

Constructors

APrivHeader 

Fields

Instances

Instances details
Show APrivHeader Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> APrivHeader -> ShowS

show :: APrivHeader -> String

showList :: [APrivHeader] -> ShowS

Encoding APrivHeader Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: APrivHeader -> ByteString Source #

smpDecode :: ByteString -> Either String APrivHeader Source #

smpP :: Parser APrivHeader Source #

data AMessage Source #

Constructors

HELLO

the first message in the queue to validate it is secured

A_MSG MsgBody

agent envelope for the client message

A_RCVD (NonEmpty AMessageReceipt)

agent envelope for delivery receipt

A_QCONT SndQAddr

the message instructing the client to continue sending messages (after ERR QUOTA)

QADD (NonEmpty (SMPQueueUri, Maybe SndQAddr)) 
QKEY (NonEmpty (SMPQueueInfo, SndPublicAuthKey)) 
QUSE (NonEmpty (SndQAddr, Bool)) 
QTEST (NonEmpty SndQAddr) 
EREADY AgentMsgId 

Instances

Instances details
Show AMessage Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AMessage -> ShowS

show :: AMessage -> String

showList :: [AMessage] -> ShowS

Encoding AMessage Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: AMessage -> ByteString Source #

smpDecode :: ByteString -> Either String AMessage Source #

smpP :: Parser AMessage Source #

FromField AMessage Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromField :: FieldParser AMessage #

ToField AMessage Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toField :: AMessage -> SQLData #

data AMessageReceipt Source #

this type is used to send as part of the protocol between different clients TODO possibly, rename fields and types referring to external and internal IDs to make them different

Instances

Instances details
Show AMessageReceipt Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AMessageReceipt -> ShowS

show :: AMessageReceipt -> String

showList :: [AMessageReceipt] -> ShowS

Encoding AMessageReceipt Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: AMessageReceipt -> ByteString Source #

smpDecode :: ByteString -> Either String AMessageReceipt Source #

smpP :: Parser AMessageReceipt Source #

data MsgReceipt Source #

this type is used as part of agent protocol to communicate with the user application

Instances

Instances details
Show MsgReceipt Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> MsgReceipt -> ShowS

show :: MsgReceipt -> String

showList :: [MsgReceipt] -> ShowS

Eq MsgReceipt Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: MsgReceipt -> MsgReceipt -> Bool

(/=) :: MsgReceipt -> MsgReceipt -> Bool

type MsgReceiptInfo = ByteString Source #

data MsgReceiptStatus Source #

Constructors

MROk 
MRBadMsgHash 

Instances

Instances details
FromJSON MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser MsgReceiptStatus

parseJSONList :: Value -> Parser [MsgReceiptStatus]

omittedField :: Maybe MsgReceiptStatus

ToJSON MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> MsgReceiptStatus -> ShowS

show :: MsgReceiptStatus -> String

showList :: [MsgReceiptStatus] -> ShowS

Eq MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

StrEncoding MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: MsgReceiptStatus -> ByteString Source #

strDecode :: ByteString -> Either String MsgReceiptStatus Source #

strP :: Parser MsgReceiptStatus Source #

FromField MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser MsgReceiptStatus #

ToField MsgReceiptStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: MsgReceiptStatus -> SQLData #

pattern SMPServer :: NonEmpty TransportHost -> ServiceName -> KeyHash -> ProtocolServer 'PSMP Source #

data SrvLoc Source #

Constructors

SrvLoc HostName ServiceName 

Instances

Instances details
Show SrvLoc Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

Methods

showsPrec :: Int -> SrvLoc -> ShowS

show :: SrvLoc -> String

showList :: [SrvLoc] -> ShowS

Eq SrvLoc Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

Methods

(==) :: SrvLoc -> SrvLoc -> Bool

(/=) :: SrvLoc -> SrvLoc -> Bool

Ord SrvLoc Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

Methods

compare :: SrvLoc -> SrvLoc -> Ordering

(<) :: SrvLoc -> SrvLoc -> Bool

(<=) :: SrvLoc -> SrvLoc -> Bool

(>) :: SrvLoc -> SrvLoc -> Bool

(>=) :: SrvLoc -> SrvLoc -> Bool

max :: SrvLoc -> SrvLoc -> SrvLoc

min :: SrvLoc -> SrvLoc -> SrvLoc

StrEncoding SrvLoc Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

Methods

strEncode :: SrvLoc -> ByteString Source #

strDecode :: ByteString -> Either String SrvLoc Source #

strP :: Parser SrvLoc Source #

sameQueue :: SMPQueue q => (SMPServer, QueueId) -> q -> Bool Source #

data SMPQueueUri Source #

Instances

Instances details
Show SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SMPQueueUri -> ShowS

show :: SMPQueueUri -> String

showList :: [SMPQueueUri] -> ShowS

Eq SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: SMPQueueUri -> SMPQueueUri -> Bool

(/=) :: SMPQueueUri -> SMPQueueUri -> Bool

SMPQueue SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Encoding SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: SMPQueueUri -> ByteString Source #

smpDecode :: ByteString -> Either String SMPQueueUri Source #

smpP :: Parser SMPQueueUri Source #

StrEncoding SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: SMPQueueUri -> ByteString Source #

strDecode :: ByteString -> Either String SMPQueueUri Source #

strP :: Parser SMPQueueUri Source #

FromField SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser SMPQueueUri #

ToField SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: SMPQueueUri -> SQLData #

VersionRangeI SMPClientVersion SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

type VersionT SMPClientVersion SMPQueueUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data SMPQueueInfo Source #

Instances

Instances details
Show SMPQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SMPQueueInfo -> ShowS

show :: SMPQueueInfo -> String

showList :: [SMPQueueInfo] -> ShowS

Eq SMPQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: SMPQueueInfo -> SMPQueueInfo -> Bool

(/=) :: SMPQueueInfo -> SMPQueueInfo -> Bool

SMPQueue SMPQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Encoding SMPQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: SMPQueueInfo -> ByteString Source #

smpDecode :: ByteString -> Either String SMPQueueInfo Source #

smpP :: Parser SMPQueueInfo Source #

VersionI SMPClientVersion SMPQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

FromField [SMPQueueInfo] Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser [SMPQueueInfo] #

ToField [SMPQueueInfo] Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: [SMPQueueInfo] -> SQLData #

type VersionRangeT SMPClientVersion SMPQueueInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data ConnectionMode Source #

Constructors

CMInvitation 
CMContact 

Instances

Instances details
FromJSON ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser ConnectionMode

parseJSONList :: Value -> Parser [ConnectionMode]

omittedField :: Maybe ConnectionMode

ToJSON ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: ConnectionMode -> Value

toEncoding :: ConnectionMode -> Encoding

toJSONList :: [ConnectionMode] -> Value

toEncodingList :: [ConnectionMode] -> Encoding

omitField :: ConnectionMode -> Bool

Show ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ConnectionMode -> ShowS

show :: ConnectionMode -> String

showList :: [ConnectionMode] -> ShowS

Eq ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Encoding ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: ConnectionMode -> ByteString Source #

smpDecode :: ByteString -> Either String ConnectionMode Source #

smpP :: Parser ConnectionMode Source #

StrEncoding ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: ConnectionMode -> ByteString Source #

strDecode :: ByteString -> Either String ConnectionMode Source #

strP :: Parser ConnectionMode Source #

FromField ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser ConnectionMode #

ToField ConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: ConnectionMode -> SQLData #

TestEquality SConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

testEquality :: forall (a :: k) (b :: k). SConnectionMode a -> SConnectionMode b -> Maybe (a :~: b)

data SConnectionMode (m :: ConnectionMode) where Source #

Instances

Instances details
TestEquality SConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

testEquality :: forall (a :: k) (b :: k). SConnectionMode a -> SConnectionMode b -> Maybe (a :~: b)

Show (SConnectionMode m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SConnectionMode m -> ShowS

show :: SConnectionMode m -> String

showList :: [SConnectionMode m] -> ShowS

Eq (SConnectionMode m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: SConnectionMode m -> SConnectionMode m -> Bool

(/=) :: SConnectionMode m -> SConnectionMode m -> Bool

ToField (SConnectionMode c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: SConnectionMode c -> SQLData #

data AConnectionMode Source #

Constructors

forall m.ConnectionModeI m => ACM (SConnectionMode m) 

Instances

Instances details
Show AConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AConnectionMode -> ShowS

show :: AConnectionMode -> String

showList :: [AConnectionMode] -> ShowS

Eq AConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

StrEncoding AConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: AConnectionMode -> ByteString Source #

strDecode :: ByteString -> Either String AConnectionMode Source #

strP :: Parser AConnectionMode Source #

FromField AConnectionMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser AConnectionMode #

data ConnectionRequestUri (m :: ConnectionMode) where Source #

Instances

Instances details
ConnectionModeI m => FromJSON (ConnectionRequestUri m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser (ConnectionRequestUri m)

parseJSONList :: Value -> Parser [ConnectionRequestUri m]

omittedField :: Maybe (ConnectionRequestUri m)

ConnectionModeI m => ToJSON (ConnectionRequestUri m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show (ConnectionRequestUri m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ConnectionRequestUri m -> ShowS

show :: ConnectionRequestUri m -> String

showList :: [ConnectionRequestUri m] -> ShowS

Eq (ConnectionRequestUri m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

ConnectionModeI m => Encoding (ConnectionRequestUri m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: ConnectionRequestUri m -> ByteString Source #

smpDecode :: ByteString -> Either String (ConnectionRequestUri m) Source #

smpP :: Parser (ConnectionRequestUri m) Source #

ConnectionModeI m => StrEncoding (ConnectionRequestUri m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: ConnectionRequestUri m -> ByteString Source #

strDecode :: ByteString -> Either String (ConnectionRequestUri m) Source #

strP :: Parser (ConnectionRequestUri m) Source #

(Typeable c, ConnectionModeI c) => FromField (ConnectionRequestUri c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser (ConnectionRequestUri c) #

ConnectionModeI c => ToField (ConnectionRequestUri c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: ConnectionRequestUri c -> SQLData #

data AConnectionRequestUri Source #

Constructors

forall m.ConnectionModeI m => ACR (SConnectionMode m) (ConnectionRequestUri m) 

Instances

Instances details
FromJSON AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

ToJSON AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AConnectionRequestUri -> ShowS

show :: AConnectionRequestUri -> String

showList :: [AConnectionRequestUri] -> ShowS

Eq AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Encoding AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: AConnectionRequestUri -> ByteString Source #

smpDecode :: ByteString -> Either String AConnectionRequestUri Source #

smpP :: Parser AConnectionRequestUri Source #

StrEncoding AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: AConnectionRequestUri -> ByteString Source #

strDecode :: ByteString -> Either String AConnectionRequestUri Source #

strP :: Parser AConnectionRequestUri Source #

FromField AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser AConnectionRequestUri #

ToField AConnectionRequestUri Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: AConnectionRequestUri -> SQLData #

data ConnReqUriData Source #

Instances

Instances details
Show ConnReqUriData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ConnReqUriData -> ShowS

show :: ConnReqUriData -> String

showList :: [ConnReqUriData] -> ShowS

Eq ConnReqUriData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Encoding ConnReqUriData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: ConnReqUriData -> ByteString Source #

smpDecode :: ByteString -> Either String ConnReqUriData Source #

smpP :: Parser ConnReqUriData Source #

type CRClientData = Text Source #

data ServiceScheme Source #

Instances

Instances details
Show ServiceScheme Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

Methods

showsPrec :: Int -> ServiceScheme -> ShowS

show :: ServiceScheme -> String

showList :: [ServiceScheme] -> ShowS

Eq ServiceScheme Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

StrEncoding ServiceScheme Source # 
Instance details

Defined in Simplex.Messaging.ServiceScheme

Methods

strEncode :: ServiceScheme -> ByteString Source #

strDecode :: ByteString -> Either String ServiceScheme Source #

strP :: Parser ServiceScheme Source #

data FixedLinkData c Source #

Instances

Instances details
Show (FixedLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> FixedLinkData c -> ShowS

show :: FixedLinkData c -> String

showList :: [FixedLinkData c] -> ShowS

Eq (FixedLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: FixedLinkData c -> FixedLinkData c -> Bool

(/=) :: FixedLinkData c -> FixedLinkData c -> Bool

ConnectionModeI c => Encoding (FixedLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: FixedLinkData c -> ByteString Source #

smpDecode :: ByteString -> Either String (FixedLinkData c) Source #

smpP :: Parser (FixedLinkData c) Source #

data AConnLinkData Source #

Constructors

forall m.ConnectionModeI m => ACLD (SConnectionMode m) (ConnLinkData m) 

Instances

Instances details
Encoding AConnLinkData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: AConnLinkData -> ByteString Source #

smpDecode :: ByteString -> Either String AConnLinkData Source #

smpP :: Parser AConnLinkData Source #

data ConnLinkData c where Source #

Instances

Instances details
Show (ConnLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ConnLinkData c -> ShowS

show :: ConnLinkData c -> String

showList :: [ConnLinkData c] -> ShowS

Eq (ConnLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: ConnLinkData c -> ConnLinkData c -> Bool

(/=) :: ConnLinkData c -> ConnLinkData c -> Bool

ConnectionModeI c => Encoding (ConnLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: ConnLinkData c -> ByteString Source #

smpDecode :: ByteString -> Either String (ConnLinkData c) Source #

smpP :: Parser (ConnLinkData c) Source #

data AUserConnLinkData Source #

Constructors

forall m.ConnectionModeI m => AULD (SConnectionMode m) (UserConnLinkData m) 

Instances

Instances details
Encoding AUserConnLinkData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: AUserConnLinkData -> ByteString Source #

smpDecode :: ByteString -> Either String AUserConnLinkData Source #

smpP :: Parser AUserConnLinkData Source #

data UserConnLinkData c where Source #

Instances

Instances details
Show (UserConnLinkData m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> UserConnLinkData m -> ShowS

show :: UserConnLinkData m -> String

showList :: [UserConnLinkData m] -> ShowS

Eq (UserConnLinkData m) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

ConnectionModeI c => Encoding (UserConnLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: UserConnLinkData c -> ByteString Source #

smpDecode :: ByteString -> Either String (UserConnLinkData c) Source #

smpP :: Parser (UserConnLinkData c) Source #

ConnectionModeI c => StrEncoding (UserConnLinkData c) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: UserConnLinkData c -> ByteString Source #

strDecode :: ByteString -> Either String (UserConnLinkData c) Source #

strP :: Parser (UserConnLinkData c) Source #

data UserContactData Source #

Instances

Instances details
Show UserContactData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> UserContactData -> ShowS

show :: UserContactData -> String

showList :: [UserContactData] -> ShowS

Eq UserContactData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Encoding UserContactData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: UserContactData -> ByteString Source #

smpDecode :: ByteString -> Either String UserContactData Source #

smpP :: Parser UserContactData Source #

newtype UserLinkData Source #

Constructors

UserLinkData ByteString 

Instances

Instances details
Show UserLinkData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> UserLinkData -> ShowS

show :: UserLinkData -> String

showList :: [UserLinkData] -> ShowS

Eq UserLinkData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: UserLinkData -> UserLinkData -> Bool

(/=) :: UserLinkData -> UserLinkData -> Bool

Encoding UserLinkData Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: UserLinkData -> ByteString Source #

smpDecode :: ByteString -> Either String UserLinkData Source #

smpP :: Parser UserLinkData Source #

data OwnerAuth Source #

Instances

Instances details
Show OwnerAuth Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> OwnerAuth -> ShowS

show :: OwnerAuth -> String

showList :: [OwnerAuth] -> ShowS

Eq OwnerAuth Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: OwnerAuth -> OwnerAuth -> Bool

(/=) :: OwnerAuth -> OwnerAuth -> Bool

Encoding OwnerAuth Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

smpEncode :: OwnerAuth -> ByteString Source #

smpDecode :: ByteString -> Either String OwnerAuth Source #

smpP :: Parser OwnerAuth Source #

type OwnerId = ByteString Source #

data ConnectionLink m Source #

Instances

data AConnectionLink Source #

Constructors

forall m.ConnectionModeI m => ACL (SConnectionMode m) (ConnectionLink m) 

Instances

data ConnShortLink (m :: ConnectionMode) where Source #

Instances

data AConnShortLink Source #

Constructors

forall m.ConnectionModeI m => ACSL (SConnectionMode m) (ConnShortLink m) 

Instances

data CreatedConnLink m Source #

Constructors

CCLink 

Instances

data ACreatedConnLink Source #

Constructors

forall m.ConnectionModeI m => ACCL (SConnectionMode m) (CreatedConnLink m) 

Instances

data ContactConnType Source #

Instances

Instances details
Show ContactConnType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ContactConnType -> ShowS

show :: ContactConnType -> String

showList :: [ContactConnType] -> ShowS

Eq ContactConnType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data ShortLinkScheme Source #

Constructors

SLSSimplex 
SLSServer 

Instances

Instances details
Show ShortLinkScheme Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ShortLinkScheme -> ShowS

show :: ShortLinkScheme -> String

showList :: [ShortLinkScheme] -> ShowS

Eq ShortLinkScheme Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

newtype LinkKey Source #

Constructors

LinkKey ByteString 

Instances

Instances details
Show LinkKey Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> LinkKey -> ShowS

show :: LinkKey -> String

showList :: [LinkKey] -> ShowS

Eq LinkKey Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: LinkKey -> LinkKey -> Bool

(/=) :: LinkKey -> LinkKey -> Bool

StrEncoding LinkKey Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: LinkKey -> ByteString Source #

strDecode :: ByteString -> Either String LinkKey Source #

strP :: Parser LinkKey Source #

FromField LinkKey Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromField :: FieldParser LinkKey #

ToField LinkKey Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toField :: LinkKey -> SQLData #

data PreparedLinkParams Source #

Parameters for creating a connection with a prepared link.

Constructors

PreparedLinkParams 

Fields

Instances

Instances details
Show PreparedLinkParams Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> PreparedLinkParams -> ShowS

show :: PreparedLinkParams -> String

showList :: [PreparedLinkParams] -> ShowS

data StoredClientService (s :: DBStored) Source #

Instances

Instances details
Show (StoredClientService s) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> StoredClientService s -> ShowS

show :: StoredClientService s -> String

showList :: [StoredClientService s] -> ShowS

Eq (StoredClientService s) Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

validateOwners :: Maybe ShortLinkCreds -> UserContactData -> Either String () Source #

data AgentErrorType Source #

Error type used in errors sent to agent clients.

Constructors

CMD

command or response error

Fields

CONN

connection errors

Fields

NO_USER

user not found in database

SMP

SMP protocol errors forwarded to agent clients

Fields

NTF

NTF protocol errors forwarded to agent clients

Fields

XFTP

XFTP protocol errors forwarded to agent clients

Fields

FILE

XFTP agent errors

PROXY

SMP proxy errors

Fields

RCP

XRCP protocol errors forwarded to agent clients

Fields

BROKER

SMP server errors

AGENT

errors of other agents

NOTICE

client notice

Fields

INTERNAL

agent implementation or dependency errors

Fields

CRITICAL

critical agent errors that should be shown to the user, optionally with restart button

Fields

INACTIVE

agent inactive

Instances

Instances details
FromJSON AgentErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser AgentErrorType

parseJSONList :: Value -> Parser [AgentErrorType]

omittedField :: Maybe AgentErrorType

ToJSON AgentErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: AgentErrorType -> Value

toEncoding :: AgentErrorType -> Encoding

toJSONList :: [AgentErrorType] -> Value

toEncodingList :: [AgentErrorType] -> Encoding

omitField :: AgentErrorType -> Bool

Exception AgentErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toException :: AgentErrorType -> SomeException

fromException :: SomeException -> Maybe AgentErrorType

displayException :: AgentErrorType -> String

Show AgentErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AgentErrorType -> ShowS

show :: AgentErrorType -> String

showList :: [AgentErrorType] -> ShowS

Eq AgentErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

AnyError AgentErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromSomeException :: SomeException -> AgentErrorType Source #

data CommandErrorType Source #

SMP agent protocol command or response error.

Constructors

PROHIBITED

command is prohibited in this context

SYNTAX

command syntax is invalid

NO_CONN

entity ID is required with this command

SIZE

message size is not correct (no terminating space)

LARGE

message does not fit in SMP block

Instances

Instances details
FromJSON CommandErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser CommandErrorType

parseJSONList :: Value -> Parser [CommandErrorType]

omittedField :: Maybe CommandErrorType

ToJSON CommandErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Exception CommandErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toException :: CommandErrorType -> SomeException

fromException :: SomeException -> Maybe CommandErrorType

displayException :: CommandErrorType -> String

Read CommandErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show CommandErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> CommandErrorType -> ShowS

show :: CommandErrorType -> String

showList :: [CommandErrorType] -> ShowS

Eq CommandErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data ConnectionErrorType Source #

Connection error.

Constructors

NOT_FOUND

connection is not in the database

DUPLICATE

connection already exists

SIMPLEX

connection is simplex, but operation requires another queue

NOT_ACCEPTED

connection not accepted on join HELLO after timeout

NOT_AVAILABLE

connection not available on reply confirmation/HELLO after timeout

Instances

Instances details
FromJSON ConnectionErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

ToJSON ConnectionErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Exception ConnectionErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toException :: ConnectionErrorType -> SomeException

fromException :: SomeException -> Maybe ConnectionErrorType

displayException :: ConnectionErrorType -> String

Read ConnectionErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show ConnectionErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ConnectionErrorType -> ShowS

show :: ConnectionErrorType -> String

showList :: [ConnectionErrorType] -> ShowS

Eq ConnectionErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data BrokerErrorType Source #

SMP server errors.

Constructors

RESPONSE

invalid server response (failed to parse)

Fields

UNEXPECTED

unexpected response

Fields

NETWORK

network error

HOST

no compatible server host (e.g. onion when public is required, or vice versa)

NO_SERVICE

service unavailable client-side - used in agent errors

TRANSPORT

handshake or other transport error

TIMEOUT

command response timeout

Instances

Instances details
FromJSON BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Methods

parseJSON :: Value -> Parser BrokerErrorType

parseJSONList :: Value -> Parser [BrokerErrorType]

omittedField :: Maybe BrokerErrorType

ToJSON BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Exception BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Methods

toException :: BrokerErrorType -> SomeException

fromException :: SomeException -> Maybe BrokerErrorType

displayException :: BrokerErrorType -> String

Read BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Show BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Methods

showsPrec :: Int -> BrokerErrorType -> ShowS

show :: BrokerErrorType -> String

showList :: [BrokerErrorType] -> ShowS

Eq BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Encoding BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Methods

smpEncode :: BrokerErrorType -> ByteString Source #

smpDecode :: ByteString -> Either String BrokerErrorType Source #

smpP :: Parser BrokerErrorType Source #

StrEncoding BrokerErrorType Source # 
Instance details

Defined in Simplex.Messaging.Protocol

Methods

strEncode :: BrokerErrorType -> ByteString Source #

strDecode :: ByteString -> Either String BrokerErrorType Source #

strP :: Parser BrokerErrorType Source #

data SMPAgentError Source #

Errors of another SMP agent.

Constructors

A_MESSAGE

client or agent message that failed to parse

A_PROHIBITED

prohibited SMP/agent message

Fields

A_VERSION

incompatible version of SMP client, agent or encryption protocols

A_LINK

failed signature, hash or senderId verification of retrieved link data

Fields

A_CRYPTO

cannot decrypt message

A_DUPLICATE

duplicate message - this error is detected by ratchet decryption - this message will be ignored and not shown. it may also indicate a loss of ratchet synchronization (when only one message is sent via copied ratchet). when message is dropped after too many reception attempts, DroppedMsg is included.

Fields

A_QUEUE

error in the message to adddeleteetc queue in connection

Fields

Instances

Instances details
FromJSON SMPAgentError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser SMPAgentError

parseJSONList :: Value -> Parser [SMPAgentError]

omittedField :: Maybe SMPAgentError

ToJSON SMPAgentError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: SMPAgentError -> Value

toEncoding :: SMPAgentError -> Encoding

toJSONList :: [SMPAgentError] -> Value

toEncodingList :: [SMPAgentError] -> Encoding

omitField :: SMPAgentError -> Bool

Exception SMPAgentError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toException :: SMPAgentError -> SomeException

fromException :: SomeException -> Maybe SMPAgentError

displayException :: SMPAgentError -> String

Show SMPAgentError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> SMPAgentError -> ShowS

show :: SMPAgentError -> String

showList :: [SMPAgentError] -> ShowS

Eq SMPAgentError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

data DroppedMsg Source #

Constructors

DroppedMsg 

Fields

Instances

Instances details
FromJSON DroppedMsg Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser DroppedMsg

parseJSONList :: Value -> Parser [DroppedMsg]

omittedField :: Maybe DroppedMsg

ToJSON DroppedMsg Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: DroppedMsg -> Value

toEncoding :: DroppedMsg -> Encoding

toJSONList :: [DroppedMsg] -> Value

toEncodingList :: [DroppedMsg] -> Encoding

omitField :: DroppedMsg -> Bool

Show DroppedMsg Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> DroppedMsg -> ShowS

show :: DroppedMsg -> String

showList :: [DroppedMsg] -> ShowS

Eq DroppedMsg Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: DroppedMsg -> DroppedMsg -> Bool

(/=) :: DroppedMsg -> DroppedMsg -> Bool

data AgentCryptoError Source #

Constructors

DECRYPT_AES

AES decryption error

DECRYPT_CB 
RATCHET_HEADER

can't decrypt ratchet header, possibly ratchet out of sync due to device change

RATCHET_EARLIER Word32

earlier message number (or, possibly, skipped message that failed to decrypt?)

RATCHET_SKIPPED Word32

too many skipped messages

RATCHET_SYNC

ratchet synchronization error

Instances

Instances details
FromJSON AgentCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser AgentCryptoError

parseJSONList :: Value -> Parser [AgentCryptoError]

omittedField :: Maybe AgentCryptoError

ToJSON AgentCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Exception AgentCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toException :: AgentCryptoError -> SomeException

fromException :: SomeException -> Maybe AgentCryptoError

displayException :: AgentCryptoError -> String

Read AgentCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show AgentCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> AgentCryptoError -> ShowS

show :: AgentCryptoError -> String

showList :: [AgentCryptoError] -> ShowS

Eq AgentCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

type ATransmission = (ACorrId, AEntityId, AEvt) Source #

SMP agent event

type ConnId = ByteString Source #

SMP agent connection ID.

type ConfirmationId = ByteString Source #

type InvitationId = ByteString Source #

data MsgIntegrity Source #

Result of received message integrity validation.

Constructors

MsgOk 
MsgError 

Instances

Instances details
FromJSON MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser MsgIntegrity

parseJSONList :: Value -> Parser [MsgIntegrity]

omittedField :: Maybe MsgIntegrity

ToJSON MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: MsgIntegrity -> Value

toEncoding :: MsgIntegrity -> Encoding

toJSONList :: [MsgIntegrity] -> Value

toEncodingList :: [MsgIntegrity] -> Encoding

omitField :: MsgIntegrity -> Bool

Show MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> MsgIntegrity -> ShowS

show :: MsgIntegrity -> String

showList :: [MsgIntegrity] -> ShowS

Eq MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: MsgIntegrity -> MsgIntegrity -> Bool

(/=) :: MsgIntegrity -> MsgIntegrity -> Bool

StrEncoding MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: MsgIntegrity -> ByteString Source #

strDecode :: ByteString -> Either String MsgIntegrity Source #

strP :: Parser MsgIntegrity Source #

FromField MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser MsgIntegrity #

ToField MsgIntegrity Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: MsgIntegrity -> SQLData #

data MsgErrorType Source #

Error of message integrity validation.

Instances

Instances details
FromJSON MsgErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser MsgErrorType

parseJSONList :: Value -> Parser [MsgErrorType]

omittedField :: Maybe MsgErrorType

ToJSON MsgErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: MsgErrorType -> Value

toEncoding :: MsgErrorType -> Encoding

toJSONList :: [MsgErrorType] -> Value

toEncodingList :: [MsgErrorType] -> Encoding

omitField :: MsgErrorType -> Bool

Show MsgErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> MsgErrorType -> ShowS

show :: MsgErrorType -> String

showList :: [MsgErrorType] -> ShowS

Eq MsgErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: MsgErrorType -> MsgErrorType -> Bool

(/=) :: MsgErrorType -> MsgErrorType -> Bool

StrEncoding MsgErrorType Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: MsgErrorType -> ByteString Source #

strDecode :: ByteString -> Either String MsgErrorType Source #

strP :: Parser MsgErrorType Source #

data QueueStatus Source #

SMP queue status.

Constructors

New

queue is created

Confirmed

queue is confirmed by the sender

Secured

queue is secured with sender key (only used by the queue recipient)

Active

queue is active

Disabled

queue is disabled (only used by the queue recipient)

Instances

Instances details
FromJSON QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser QueueStatus

parseJSONList :: Value -> Parser [QueueStatus]

omittedField :: Maybe QueueStatus

ToJSON QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toJSON :: QueueStatus -> Value

toEncoding :: QueueStatus -> Encoding

toJSONList :: [QueueStatus] -> Value

toEncodingList :: [QueueStatus] -> Encoding

omitField :: QueueStatus -> Bool

Read QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

readsPrec :: Int -> ReadS QueueStatus

readList :: ReadS [QueueStatus]

readPrec :: ReadPrec QueueStatus

readListPrec :: ReadPrec [QueueStatus]

Show QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> QueueStatus -> ShowS

show :: QueueStatus -> String

showList :: [QueueStatus] -> ShowS

Eq QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

(==) :: QueueStatus -> QueueStatus -> Bool

(/=) :: QueueStatus -> QueueStatus -> Bool

FromField QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

fromField :: FieldParser QueueStatus #

ToField QueueStatus Source # 
Instance details

Defined in Simplex.Messaging.Agent.Store.AgentStore

Methods

toField :: QueueStatus -> SQLData #

type UserId = Int64 Source #

type ACorrId = ByteString Source #

type AgentMsgId = Int64 Source #

data NotificationsMode Source #

Constructors

NMPeriodic 
NMInstant 

Instances

Instances details
FromJSON NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

parseJSON :: Value -> Parser NotificationsMode

parseJSONList :: Value -> Parser [NotificationsMode]

omittedField :: Maybe NotificationsMode

ToJSON NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Show NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> NotificationsMode -> ShowS

show :: NotificationsMode -> String

showList :: [NotificationsMode] -> ShowS

Eq NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

StrEncoding NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

strEncode :: NotificationsMode -> ByteString Source #

strDecode :: ByteString -> Either String NotificationsMode Source #

strP :: Parser NotificationsMode Source #

FromField NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

fromField :: FieldParser NotificationsMode #

ToField NotificationsMode Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

toField :: NotificationsMode -> SQLData #

data NotificationInfo Source #

Constructors

NotificationInfo 

Fields

Instances

Instances details
Show NotificationInfo Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> NotificationInfo -> ShowS

show :: NotificationInfo -> String

showList :: [NotificationInfo] -> ShowS

data ConnMsgReq Source #

Constructors

ConnMsgReq 

Fields

Instances

Instances details
Show ConnMsgReq Source # 
Instance details

Defined in Simplex.Messaging.Agent.Protocol

Methods

showsPrec :: Int -> ConnMsgReq -> ShowS

show :: ConnMsgReq -> String

showList :: [ConnMsgReq] -> ShowS

Encode/decode

serializeCommand :: ACommand -> ByteString Source #

Serialize SMP agent command.

dbCommandP :: Parser ACommand Source #

SMP agent command and response parser for commands stored in db (fully parses binary bodies)

connModeT :: Text -> Maybe ConnectionMode Source #

queueStatusT :: Text -> Maybe QueueStatus Source #

isPresetServer :: Foldable t => SMPServer -> t SMPServer -> Bool Source #

linkUserData' :: ConnLinkData c -> ByteString Source #