| Copyright | (c) simplex.chat |
|---|---|
| License | AGPL-3 |
| Maintainer | chat@simplex.chat |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- type VersionSMPA = Version SMPAgentVersion
- type VersionRangeSMPA = VersionRange SMPAgentVersion
- pattern VersionSMPA :: Word16 -> VersionSMPA
- duplexHandshakeSMPAgentVersion :: VersionSMPA
- ratchetSyncSMPAgentVersion :: VersionSMPA
- deliveryRcptsSMPAgentVersion :: VersionSMPA
- pqdrSMPAgentVersion :: VersionSMPA
- sndAuthKeySMPAgentVersion :: VersionSMPA
- ratchetOnConfSMPAgentVersion :: VersionSMPA
- currentSMPAgentVersion :: VersionSMPA
- supportedSMPAgentVRange :: VersionRangeSMPA
- e2eEncConnInfoLength :: VersionSMPA -> PQSupport -> Int
- e2eEncAgentMsgLength :: VersionSMPA -> PQSupport -> Int
- type ConnInfo = ByteString
- type SndQueueSecured = Bool
- type AEntityId = ByteString
- data ACommand
- = NEW Bool AConnectionMode InitialKeys SubscriptionMode
- | LSET (UserConnLinkData 'CMContact) (Maybe CRClientData)
- | LGET (ConnShortLink 'CMContact)
- | JOIN Bool AConnectionRequestUri PQSupport SubscriptionMode ConnInfo
- | LET ConfirmationId ConnInfo
- | ACK AgentMsgId (Maybe MsgReceiptInfo)
- | SWCH
- | DEL
- data AEvent (e :: AEntity) where
- 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
- data AEvt = AEntityI e => AEvt (SAEntity e) (AEvent e)
- data ACommandTag
- data AEventTag (e :: AEntity) where
- INV_ :: AEventTag 'AEConn
- LINK_ :: AEventTag 'AEConn
- LDATA_ :: AEventTag 'AEConn
- CONF_ :: AEventTag 'AEConn
- REQ_ :: AEventTag 'AEConn
- INFO_ :: AEventTag 'AEConn
- CON_ :: AEventTag 'AEConn
- END_ :: AEventTag 'AEConn
- DELD_ :: AEventTag 'AEConn
- CONNECT_ :: AEventTag 'AENone
- DISCONNECT_ :: AEventTag 'AENone
- DOWN_ :: AEventTag 'AENone
- UP_ :: AEventTag 'AENone
- SWITCH_ :: AEventTag 'AEConn
- RSYNC_ :: AEventTag 'AEConn
- SENT_ :: AEventTag 'AEConn
- MWARN_ :: AEventTag 'AEConn
- MERR_ :: AEventTag 'AEConn
- MERRS_ :: AEventTag 'AEConn
- MSG_ :: AEventTag 'AEConn
- MSGNTF_ :: AEventTag 'AEConn
- RCVD_ :: AEventTag 'AEConn
- QCONT_ :: AEventTag 'AEConn
- DEL_RCVQS_ :: AEventTag 'AEConn
- DEL_CONNS_ :: AEventTag 'AEConn
- DEL_USER_ :: AEventTag 'AENone
- STAT_ :: AEventTag 'AEConn
- OK_ :: AEventTag 'AEConn
- JOINED_ :: AEventTag 'AEConn
- ERR_ :: AEventTag 'AEConn
- ERRS_ :: AEventTag 'AENone
- SUSPENDED_ :: AEventTag 'AENone
- RFDONE_ :: AEventTag 'AERcvFile
- RFPROG_ :: AEventTag 'AERcvFile
- RFERR_ :: AEventTag 'AERcvFile
- RFWARN_ :: AEventTag 'AERcvFile
- SFPROG_ :: AEventTag 'AESndFile
- SFDONE_ :: AEventTag 'AESndFile
- SFERR_ :: AEventTag 'AESndFile
- SFWARN_ :: AEventTag 'AESndFile
- data AEvtTag = AEntityI e => AEvtTag (SAEntity e) (AEventTag e)
- aCommandTag :: ACommand -> ACommandTag
- aEventTag :: forall (e :: AEntity). AEvent e -> AEventTag e
- data AEntity
- data SAEntity (a :: AEntity) where
- class AEntityI (e :: AEntity) where
- type MsgHash = ByteString
- data MsgMeta = MsgMeta {
- integrity :: MsgIntegrity
- recipient :: (AgentMsgId, UTCTime)
- broker :: (MsgId, UTCTime)
- sndMsgId :: AgentMsgId
- pqEncryption :: PQEncryption
- data RcvQueueInfo = RcvQueueInfo {
- rcvServer :: SMPServer
- status :: QueueStatus
- rcvSwitchStatus :: Maybe RcvSwitchStatus
- canAbortSwitch :: Bool
- subStatus :: SubscriptionStatus
- data SndQueueInfo = SndQueueInfo {
- sndServer :: SMPServer
- status :: QueueStatus
- sndSwitchStatus :: Maybe SndSwitchStatus
- data SubscriptionStatus
- data ConnectionStats = ConnectionStats {}
- data SwitchPhase
- data RcvSwitchStatus
- data SndSwitchStatus
- data QueueDirection
- data RatchetSyncState
- = RSOk
- | RSAllowed
- | RSRequired
- | RSStarted
- | RSAgreed
- data SMPConfirmation = SMPConfirmation {}
- data AgentMsgEnvelope
- = AgentConfirmation {
- agentVersion :: VersionSMPA
- e2eEncryption_ :: Maybe (SndE2ERatchetParams 'X448)
- encConnInfo :: ByteString
- | AgentMsgEnvelope {
- agentVersion :: VersionSMPA
- encAgentMessage :: ByteString
- | AgentInvitation {
- agentVersion :: VersionSMPA
- connReq :: ConnectionRequestUri 'CMInvitation
- connInfo :: ByteString
- | AgentRatchetKey {
- agentVersion :: VersionSMPA
- e2eEncryption :: RcvE2ERatchetParams 'X448
- info :: ByteString
- = AgentConfirmation {
- data AgentMessage
- = AgentConnInfo ConnInfo
- | AgentConnInfoReply (NonEmpty SMPQueueInfo) ConnInfo
- | AgentRatchetInfo ByteString
- | AgentMessage APrivHeader AMessage
- data AgentMessageType
- data APrivHeader = APrivHeader {}
- data AMessage
- = HELLO
- | A_MSG MsgBody
- | A_RCVD (NonEmpty AMessageReceipt)
- | A_QCONT SndQAddr
- | QADD (NonEmpty (SMPQueueUri, Maybe SndQAddr))
- | QKEY (NonEmpty (SMPQueueInfo, SndPublicAuthKey))
- | QUSE (NonEmpty (SndQAddr, Bool))
- | QTEST (NonEmpty SndQAddr)
- | EREADY AgentMsgId
- data AMessageReceipt = AMessageReceipt {}
- data MsgReceipt = MsgReceipt {}
- type MsgReceiptInfo = ByteString
- data MsgReceiptStatus
- = MROk
- | MRBadMsgHash
- type SndQAddr = (SMPServer, SenderId)
- type SMPServer = ProtocolServer 'PSMP
- pattern SMPServer :: NonEmpty TransportHost -> ServiceName -> KeyHash -> ProtocolServer 'PSMP
- pattern ProtoServerWithAuth :: ProtocolServer p -> Maybe BasicAuth -> ProtoServerWithAuth p
- type SMPServerWithAuth = ProtoServerWithAuth 'PSMP
- data SrvLoc = SrvLoc HostName ServiceName
- class SMPQueue q where
- qAddress :: SMPQueue q => q -> (SMPServer, QueueId)
- sameQueue :: SMPQueue q => (SMPServer, QueueId) -> q -> Bool
- sameQAddress :: (SMPServer, QueueId) -> (SMPServer, QueueId) -> Bool
- noAuthSrv :: forall (p :: ProtocolType). ProtocolServer p -> ProtoServerWithAuth p
- data SMPQueueUri = SMPQueueUri {}
- data SMPQueueInfo = SMPQueueInfo {}
- data SMPQueueAddress = SMPQueueAddress {
- smpServer :: SMPServer
- senderId :: SenderId
- dhPublicKey :: PublicKeyX25519
- queueMode :: Maybe QueueMode
- data ConnectionMode
- data SConnectionMode (m :: ConnectionMode) where
- data AConnectionMode = ConnectionModeI m => ACM (SConnectionMode m)
- class ConnectionModeI (m :: ConnectionMode) where
- data ConnectionRequestUri (m :: ConnectionMode) where
- data AConnectionRequestUri = ConnectionModeI m => ACR (SConnectionMode m) (ConnectionRequestUri m)
- data ShortLinkCreds = ShortLinkCreds {}
- data ConnReqUriData = ConnReqUriData {
- crScheme :: ServiceScheme
- crAgentVRange :: VersionRangeSMPA
- crSmpQueues :: NonEmpty SMPQueueUri
- crClientData :: Maybe CRClientData
- type CRClientData = Text
- data ServiceScheme
- data FixedLinkData (c :: ConnectionMode) = FixedLinkData {
- agentVRange :: VersionRangeSMPA
- rootKey :: PublicKeyEd25519
- linkConnReq :: ConnectionRequestUri c
- linkEntityId :: Maybe ByteString
- data AConnLinkData = ConnectionModeI m => ACLD (SConnectionMode m) (ConnLinkData m)
- data ConnLinkData (c :: ConnectionMode) where
- data AUserConnLinkData = ConnectionModeI m => AULD (SConnectionMode m) (UserConnLinkData m)
- data UserConnLinkData (c :: ConnectionMode) where
- data UserContactData = UserContactData {
- direct :: Bool
- owners :: [OwnerAuth]
- relays :: [ConnShortLink 'CMContact]
- userData :: UserLinkData
- newtype UserLinkData = UserLinkData ByteString
- data OwnerAuth = OwnerAuth {}
- type OwnerId = ByteString
- data ConnectionLink (m :: ConnectionMode)
- = CLFull (ConnectionRequestUri m)
- | CLShort (ConnShortLink m)
- data AConnectionLink = ConnectionModeI m => ACL (SConnectionMode m) (ConnectionLink m)
- data ConnShortLink (m :: ConnectionMode) where
- CSLInvitation :: ShortLinkScheme -> SMPServer -> LinkId -> LinkKey -> ConnShortLink 'CMInvitation
- CSLContact :: ShortLinkScheme -> ContactConnType -> SMPServer -> LinkKey -> ConnShortLink 'CMContact
- data AConnShortLink = ConnectionModeI m => ACSL (SConnectionMode m) (ConnShortLink m)
- data CreatedConnLink (m :: ConnectionMode) = CCLink {
- connFullLink :: ConnectionRequestUri m
- connShortLink :: Maybe (ConnShortLink m)
- data ACreatedConnLink = ConnectionModeI m => ACCL (SConnectionMode m) (CreatedConnLink m)
- data ContactConnType
- data ShortLinkScheme
- newtype LinkKey = LinkKey ByteString
- data PreparedLinkParams = PreparedLinkParams {}
- data StoredClientService (s :: DBStored) = ClientService {
- dbServiceId :: DBEntityId' s
- serviceId :: ServiceId
- type ClientService = StoredClientService 'DBStored
- type ClientServiceId = DBEntityId
- validateOwners :: Maybe ShortLinkCreds -> UserContactData -> Either String ()
- validateLinkOwners :: PublicKeyEd25519 -> [OwnerAuth] -> Either String ()
- sameConnReqContact :: ConnectionRequestUri 'CMContact -> ConnectionRequestUri 'CMContact -> Bool
- sameShortLinkContact :: ConnShortLink 'CMContact -> ConnShortLink 'CMContact -> Bool
- simplexChat :: ServiceScheme
- connReqUriP' :: forall (m :: ConnectionMode). ConnectionModeI m => Maybe ServiceScheme -> Parser (ConnectionRequestUri m)
- simplexConnReqUri :: forall (m :: ConnectionMode). ConnectionRequestUri m -> ConnectionRequestUri m
- simplexShortLink :: forall (m :: ConnectionMode). ConnShortLink m -> ConnShortLink m
- data AgentErrorType
- = CMD {
- cmdErr :: CommandErrorType
- errContext :: String
- | CONN {
- connErr :: ConnectionErrorType
- errContext :: String
- | NO_USER
- | SMP {
- serverAddress :: String
- smpErr :: ErrorType
- | NTF {
- serverAddress :: String
- ntfErr :: ErrorType
- | XFTP {
- serverAddress :: String
- xftpErr :: XFTPErrorType
- | FILE { }
- | PROXY {
- proxyServer :: String
- relayServer :: String
- proxyErr :: ProxyClientError
- | RCP { }
- | BROKER {
- brokerAddress :: String
- brokerErr :: BrokerErrorType
- | AGENT { }
- | NOTICE { }
- | INTERNAL {
- internalErr :: String
- | CRITICAL {
- offerRestart :: Bool
- criticalErr :: String
- | INACTIVE
- = CMD {
- data CommandErrorType
- = PROHIBITED
- | SYNTAX
- | NO_CONN
- | SIZE
- | LARGE
- data ConnectionErrorType
- data BrokerErrorType
- = RESPONSE {
- respErr :: String
- | UNEXPECTED {
- respErr :: String
- | NETWORK { }
- | HOST
- | NO_SERVICE
- | TRANSPORT { }
- | TIMEOUT
- = RESPONSE {
- data SMPAgentError
- = A_MESSAGE
- | A_PROHIBITED {
- prohibitedErr :: String
- | A_VERSION
- | A_LINK {
- linkErr :: String
- | A_CRYPTO { }
- | A_DUPLICATE {
- droppedMsg_ :: Maybe DroppedMsg
- | A_QUEUE {
- queueErr :: String
- data DroppedMsg = DroppedMsg {}
- data AgentCryptoError
- = DECRYPT_AES
- | DECRYPT_CB
- | RATCHET_HEADER
- | RATCHET_EARLIER Word32
- | RATCHET_SKIPPED Word32
- | RATCHET_SYNC
- cryptoErrToSyncState :: AgentCryptoError -> RatchetSyncState
- type ATransmission = (ACorrId, AEntityId, AEvt)
- type ConnId = ByteString
- type ConfirmationId = ByteString
- type InvitationId = ByteString
- data MsgIntegrity
- data MsgErrorType
- = MsgSkipped { }
- | MsgBadId {
- msgId :: AgentMsgId
- | MsgBadHash
- | MsgDuplicate
- data QueueStatus
- type UserId = Int64
- type ACorrId = ByteString
- type AgentMsgId = Int64
- data NotificationsMode
- data NotificationInfo = NotificationInfo {
- ntfConnId :: ConnId
- ntfDbQueueId :: Int64
- ntfTs :: SystemTime
- ntfMsgMeta :: Maybe NMsgMeta
- data ConnMsgReq = ConnMsgReq {
- msgConnId :: ConnId
- msgDbQueueId :: Int64
- msgTs :: Maybe UTCTime
- serializeCommand :: ACommand -> ByteString
- connMode :: forall (m :: ConnectionMode). SConnectionMode m -> ConnectionMode
- connMode' :: ConnectionMode -> AConnectionMode
- dbCommandP :: Parser ACommand
- connModeT :: Text -> Maybe ConnectionMode
- serializeQueueStatus :: QueueStatus -> Text
- queueStatusT :: Text -> Maybe QueueStatus
- agentMessageType :: AgentMessage -> AgentMessageType
- aMessageType :: AMessage -> AgentMessageType
- extraSMPServerHosts :: Map TransportHost TransportHost
- updateSMPServerHosts :: SMPServer -> SMPServer
- shortenShortLink :: forall (m :: ConnectionMode). NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m
- restoreShortLink :: forall (m :: ConnectionMode). NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m
- isPresetServer :: Foldable t => SMPServer -> t SMPServer -> Bool
- linkUserData :: forall (c :: ConnectionMode). ConnLinkData c -> UserLinkData
- linkUserData' :: forall (c :: ConnectionMode). ConnLinkData c -> ByteString
Protocol parameters
type VersionSMPA = Version SMPAgentVersion Source #
type VersionRangeSMPA = VersionRange SMPAgentVersion Source #
pattern VersionSMPA :: Word16 -> VersionSMPA Source #
e2eEncConnInfoLength :: VersionSMPA -> PQSupport -> Int Source #
e2eEncAgentMsgLength :: VersionSMPA -> PQSupport -> Int Source #
SMP agent protocol types
type SndQueueSecured = Bool Source #
Constructors
data AEvent (e :: AEntity) where Source #
Parameterized type for SMP agent events
Constructors
data ACommandTag Source #
Instances
| Show ACommandTag Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ACommandTag -> ShowS show :: ACommandTag -> String showList :: [ACommandTag] -> ShowS | |
| StrEncoding ACommandTag Source # | |
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 #
Constructors
aCommandTag :: ACommand -> ACommandTag Source #
data SAEntity (a :: AEntity) where Source #
Constructors
| SAEConn :: SAEntity 'AEConn | |
| SAERcvFile :: SAEntity 'AERcvFile | |
| SAESndFile :: SAEntity 'AESndFile | |
| SAENone :: SAEntity 'AENone |
Agent message metadata sent to the client
Constructors
| MsgMeta | |
Fields
| |
data RcvQueueInfo Source #
Constructors
| RcvQueueInfo | |
Fields
| |
Instances
| FromJSON RcvQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser RcvQueueInfo parseJSONList :: Value -> Parser [RcvQueueInfo] omittedField :: Maybe RcvQueueInfo | |
| ToJSON RcvQueueInfo Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> RcvQueueInfo -> ShowS show :: RcvQueueInfo -> String showList :: [RcvQueueInfo] -> ShowS | |
| Eq RcvQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data SndQueueInfo Source #
Constructors
| SndQueueInfo | |
Fields
| |
Instances
| FromJSON SndQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser SndQueueInfo parseJSONList :: Value -> Parser [SndQueueInfo] omittedField :: Maybe SndQueueInfo | |
| ToJSON SndQueueInfo Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SndQueueInfo -> ShowS show :: SndQueueInfo -> String showList :: [SndQueueInfo] -> ShowS | |
| Eq SndQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data SubscriptionStatus Source #
Instances
data ConnectionStats Source #
Constructors
| ConnectionStats | |
Fields
| |
Instances
| FromJSON ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser ConnectionStats parseJSONList :: Value -> Parser [ConnectionStats] omittedField :: Maybe ConnectionStats | |
| ToJSON ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ConnectionStats -> Value toEncoding :: ConnectionStats -> Encoding toJSONList :: [ConnectionStats] -> Value toEncodingList :: [ConnectionStats] -> Encoding omitField :: ConnectionStats -> Bool | |
| Show ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnectionStats -> ShowS show :: ConnectionStats -> String showList :: [ConnectionStats] -> ShowS | |
| Eq ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnectionStats -> ConnectionStats -> Bool (/=) :: ConnectionStats -> ConnectionStats -> Bool | |
data SwitchPhase Source #
Constructors
| SPStarted | |
| SPConfirmed | |
| SPSecured | |
| SPCompleted |
Instances
| FromJSON SwitchPhase Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser SwitchPhase parseJSONList :: Value -> Parser [SwitchPhase] omittedField :: Maybe SwitchPhase | |
| ToJSON SwitchPhase Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SwitchPhase -> ShowS show :: SwitchPhase -> String showList :: [SwitchPhase] -> ShowS | |
| Eq SwitchPhase Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data RcvSwitchStatus Source #
Constructors
| RSSwitchStarted | |
| RSSendingQADD | |
| RSSendingQUSE | |
| RSReceivedMessage |
Instances
data SndSwitchStatus Source #
Constructors
| SSSendingQKEY | |
| SSSendingQTEST |
Instances
data QueueDirection Source #
Instances
| FromJSON QueueDirection Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser QueueDirection parseJSONList :: Value -> Parser [QueueDirection] omittedField :: Maybe QueueDirection | |
| ToJSON QueueDirection Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> QueueDirection -> ShowS show :: QueueDirection -> String showList :: [QueueDirection] -> ShowS | |
| Eq QueueDirection Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: QueueDirection -> QueueDirection -> Bool (/=) :: QueueDirection -> QueueDirection -> Bool | |
data RatchetSyncState Source #
Constructors
| RSOk | |
| RSAllowed | |
| RSRequired | |
| RSStarted | |
| RSAgreed |
Instances
data SMPConfirmation Source #
Constructors
| SMPConfirmation | |
Fields
| |
Instances
| Show SMPConfirmation Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPConfirmation -> ShowS show :: SMPConfirmation -> String showList :: [SMPConfirmation] -> ShowS | |
data AgentMsgEnvelope Source #
Constructors
| AgentConfirmation | |
Fields
| |
| AgentMsgEnvelope | |
Fields
| |
| AgentInvitation | |
Fields
| |
| AgentRatchetKey | |
Fields
| |
Instances
| Show AgentMsgEnvelope Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentMsgEnvelope -> ShowS show :: AgentMsgEnvelope -> String showList :: [AgentMsgEnvelope] -> ShowS | |
| Encoding AgentMsgEnvelope Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AgentMsgEnvelope -> ByteString Source # smpDecode :: ByteString -> Either String AgentMsgEnvelope Source # smpP :: Parser AgentMsgEnvelope Source # | |
data AgentMessage Source #
Constructors
| AgentConnInfo ConnInfo | |
| AgentConnInfoReply (NonEmpty SMPQueueInfo) ConnInfo | |
| AgentRatchetInfo ByteString | |
| AgentMessage APrivHeader AMessage |
Instances
| Show AgentMessage Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentMessage -> ShowS show :: AgentMessage -> String showList :: [AgentMessage] -> ShowS | |
| Encoding AgentMessage Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AgentMessage -> ByteString Source # smpDecode :: ByteString -> Either String AgentMessage Source # smpP :: Parser AgentMessage Source # | |
data AgentMessageType Source #
Constructors
| AM_CONN_INFO | |
| AM_CONN_INFO_REPLY | |
| AM_RATCHET_INFO | |
| AM_HELLO_ | |
| AM_A_MSG_ | |
| AM_A_RCVD_ | |
| AM_QCONT_ | |
| AM_QADD_ | |
| AM_QKEY_ | |
| AM_QUSE_ | |
| AM_QTEST_ | |
| AM_EREADY_ |
Instances
| Show AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentMessageType -> ShowS show :: AgentMessageType -> String showList :: [AgentMessageType] -> ShowS | |
| Eq AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AgentMessageType -> AgentMessageType -> Bool (/=) :: AgentMessageType -> AgentMessageType -> Bool | |
| Encoding AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AgentMessageType -> ByteString Source # smpDecode :: ByteString -> Either String AgentMessageType Source # smpP :: Parser AgentMessageType Source # | |
| FromField AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser AgentMessageType # | |
| ToField AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: AgentMessageType -> SQLData # | |
data APrivHeader Source #
Constructors
| APrivHeader | |
Fields
| |
Instances
| Show APrivHeader Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> APrivHeader -> ShowS show :: APrivHeader -> String showList :: [APrivHeader] -> ShowS | |
| Encoding APrivHeader Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: APrivHeader -> ByteString Source # smpDecode :: ByteString -> Either String APrivHeader Source # smpP :: Parser APrivHeader Source # | |
Messages sent between SMP agents once SMP queue is secured.
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 |
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
Constructors
| AMessageReceipt | |
Fields
| |
Instances
| Show AMessageReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AMessageReceipt -> ShowS show :: AMessageReceipt -> String showList :: [AMessageReceipt] -> ShowS | |
| Encoding AMessageReceipt Source # | |
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
Constructors
| MsgReceipt | |
Fields | |
Instances
| Show MsgReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> MsgReceipt -> ShowS show :: MsgReceipt -> String showList :: [MsgReceipt] -> ShowS | |
| Eq MsgReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
type MsgReceiptInfo = ByteString Source #
data MsgReceiptStatus Source #
Constructors
| MROk | |
| MRBadMsgHash |
Instances
type SMPServer = ProtocolServer 'PSMP Source #
pattern SMPServer :: NonEmpty TransportHost -> ServiceName -> KeyHash -> ProtocolServer 'PSMP Source #
pattern ProtoServerWithAuth :: ProtocolServer p -> Maybe BasicAuth -> ProtoServerWithAuth p Source #
type SMPServerWithAuth = ProtoServerWithAuth 'PSMP Source #
Constructors
| SrvLoc HostName ServiceName |
class SMPQueue q where Source #
Instances
| SMPQueue SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods qServer :: SMPQueueAddress -> SMPServer Source # queueId :: SMPQueueAddress -> QueueId Source # | |
| SMPQueue SMPQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| SMPQueue SMPQueueUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| SMPQueue NewRcvQueue Source # | |
Defined in Simplex.Messaging.Agent.Store | |
| SMPQueue RcvQueue Source # | |
| SMPQueue RcvQueueSub Source # | |
Defined in Simplex.Messaging.Agent.Store | |
| SMPQueue SndQueue Source # | |
noAuthSrv :: forall (p :: ProtocolType). ProtocolServer p -> ProtoServerWithAuth p Source #
data SMPQueueUri Source #
SMP queue information sent out-of-band.
Constructors
| SMPQueueUri | |
Fields | |
Instances
data SMPQueueInfo Source #
Constructors
| SMPQueueInfo | |
Fields | |
Instances
| Show SMPQueueInfo Source # | |||||
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPQueueInfo -> ShowS show :: SMPQueueInfo -> String showList :: [SMPQueueInfo] -> ShowS | |||||
| Eq SMPQueueInfo Source # | |||||
Defined in Simplex.Messaging.Agent.Protocol | |||||
| SMPQueue SMPQueueInfo Source # | |||||
Defined in Simplex.Messaging.Agent.Protocol | |||||
| Encoding SMPQueueInfo Source # | |||||
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 # | |||||
Defined in Simplex.Messaging.Agent.Protocol Associated Types
| |||||
| FromField [SMPQueueInfo] Source # | |||||
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser [SMPQueueInfo] # | |||||
| ToField [SMPQueueInfo] Source # | |||||
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: [SMPQueueInfo] -> SQLData # | |||||
| type VersionRangeT SMPClientVersion SMPQueueInfo Source # | |||||
Defined in Simplex.Messaging.Agent.Protocol | |||||
data SMPQueueAddress Source #
Constructors
| SMPQueueAddress | |
Fields
| |
Instances
| Show SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPQueueAddress -> ShowS show :: SMPQueueAddress -> String showList :: [SMPQueueAddress] -> ShowS | |
| Eq SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: SMPQueueAddress -> SMPQueueAddress -> Bool (/=) :: SMPQueueAddress -> SMPQueueAddress -> Bool | |
| SMPQueue SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods qServer :: SMPQueueAddress -> SMPServer Source # queueId :: SMPQueueAddress -> QueueId Source # | |
data ConnectionMode Source #
Constructors
| CMInvitation | |
| CMContact |
Instances
| FromJSON ConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser ConnectionMode parseJSONList :: Value -> Parser [ConnectionMode] omittedField :: Maybe ConnectionMode | |
| ToJSON ConnectionMode Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnectionMode -> ShowS show :: ConnectionMode -> String showList :: [ConnectionMode] -> ShowS | |
| Eq ConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnectionMode -> ConnectionMode -> Bool (/=) :: ConnectionMode -> ConnectionMode -> Bool | |
| Encoding ConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: ConnectionMode -> ByteString Source # smpDecode :: ByteString -> Either String ConnectionMode Source # smpP :: Parser ConnectionMode Source # | |
| StrEncoding ConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: ConnectionMode -> ByteString Source # strDecode :: ByteString -> Either String ConnectionMode Source # strP :: Parser ConnectionMode Source # | |
| FromField ConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser ConnectionMode # | |
| ToField ConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: ConnectionMode -> SQLData # | |
| TestEquality SConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods testEquality :: forall (a :: ConnectionMode) (b :: ConnectionMode). SConnectionMode a -> SConnectionMode b -> Maybe (a :~: b) | |
data SConnectionMode (m :: ConnectionMode) where Source #
Constructors
| SCMInvitation :: SConnectionMode 'CMInvitation | |
| SCMContact :: SConnectionMode 'CMContact |
Instances
| TestEquality SConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods testEquality :: forall (a :: ConnectionMode) (b :: ConnectionMode). SConnectionMode a -> SConnectionMode b -> Maybe (a :~: b) | |
| Show (SConnectionMode m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SConnectionMode m -> ShowS show :: SConnectionMode m -> String showList :: [SConnectionMode m] -> ShowS | |
| Eq (SConnectionMode m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: SConnectionMode m -> SConnectionMode m -> Bool (/=) :: SConnectionMode m -> SConnectionMode m -> Bool | |
| ToField (SConnectionMode c) Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: SConnectionMode c -> SQLData # | |
data AConnectionMode Source #
Constructors
| ConnectionModeI m => ACM (SConnectionMode m) |
Instances
| Show AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AConnectionMode -> ShowS show :: AConnectionMode -> String showList :: [AConnectionMode] -> ShowS | |
| Eq AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AConnectionMode -> AConnectionMode -> Bool (/=) :: AConnectionMode -> AConnectionMode -> Bool | |
| StrEncoding AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: AConnectionMode -> ByteString Source # strDecode :: ByteString -> Either String AConnectionMode Source # strP :: Parser AConnectionMode Source # | |
| FromField AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser AConnectionMode # | |
class ConnectionModeI (m :: ConnectionMode) where Source #
Methods
Instances
| ConnectionModeI 'CMContact Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods | |
| ConnectionModeI 'CMInvitation Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods | |
data ConnectionRequestUri (m :: ConnectionMode) where Source #
Constructors
| CRInvitationUri :: ConnReqUriData -> RcvE2ERatchetParamsUri 'X448 -> ConnectionRequestUri 'CMInvitation | |
| CRContactUri :: ConnReqUriData -> ConnectionRequestUri 'CMContact |
Instances
| ConnectionModeI m => FromJSON (ConnectionRequestUri m) Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ConnectionRequestUri m -> Value toEncoding :: ConnectionRequestUri m -> Encoding toJSONList :: [ConnectionRequestUri m] -> Value toEncodingList :: [ConnectionRequestUri m] -> Encoding omitField :: ConnectionRequestUri m -> Bool | |
| Show (ConnectionRequestUri m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnectionRequestUri m -> ShowS show :: ConnectionRequestUri m -> String showList :: [ConnectionRequestUri m] -> ShowS | |
| Eq (ConnectionRequestUri m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnectionRequestUri m -> ConnectionRequestUri m -> Bool (/=) :: ConnectionRequestUri m -> ConnectionRequestUri m -> Bool | |
| ConnectionModeI m => Encoding (ConnectionRequestUri m) Source # | |
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 # | |
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 # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser (ConnectionRequestUri c) # | |
| ConnectionModeI c => ToField (ConnectionRequestUri c) Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: ConnectionRequestUri c -> SQLData # | |
data AConnectionRequestUri Source #
Constructors
| ConnectionModeI m => ACR (SConnectionMode m) (ConnectionRequestUri m) |
Instances
| FromJSON AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser AConnectionRequestUri parseJSONList :: Value -> Parser [AConnectionRequestUri] omittedField :: Maybe AConnectionRequestUri | |
| ToJSON AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: AConnectionRequestUri -> Value toEncoding :: AConnectionRequestUri -> Encoding toJSONList :: [AConnectionRequestUri] -> Value toEncodingList :: [AConnectionRequestUri] -> Encoding omitField :: AConnectionRequestUri -> Bool | |
| Show AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AConnectionRequestUri -> ShowS show :: AConnectionRequestUri -> String showList :: [AConnectionRequestUri] -> ShowS | |
| Eq AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AConnectionRequestUri -> AConnectionRequestUri -> Bool (/=) :: AConnectionRequestUri -> AConnectionRequestUri -> Bool | |
| Encoding AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AConnectionRequestUri -> ByteString Source # smpDecode :: ByteString -> Either String AConnectionRequestUri Source # smpP :: Parser AConnectionRequestUri Source # | |
| StrEncoding AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: AConnectionRequestUri -> ByteString Source # strDecode :: ByteString -> Either String AConnectionRequestUri Source # strP :: Parser AConnectionRequestUri Source # | |
| FromField AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser AConnectionRequestUri # | |
| ToField AConnectionRequestUri Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: AConnectionRequestUri -> SQLData # | |
data ShortLinkCreds Source #
Constructors
| ShortLinkCreds | |
Fields | |
Instances
| Show ShortLinkCreds Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ShortLinkCreds -> ShowS show :: ShortLinkCreds -> String showList :: [ShortLinkCreds] -> ShowS | |
data ConnReqUriData Source #
Constructors
| ConnReqUriData | |
Fields
| |
Instances
| Show ConnReqUriData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnReqUriData -> ShowS show :: ConnReqUriData -> String showList :: [ConnReqUriData] -> ShowS | |
| Eq ConnReqUriData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnReqUriData -> ConnReqUriData -> Bool (/=) :: ConnReqUriData -> ConnReqUriData -> Bool | |
| Encoding ConnReqUriData Source # | |
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
| Show ServiceScheme Source # | |
Defined in Simplex.Messaging.ServiceScheme Methods showsPrec :: Int -> ServiceScheme -> ShowS show :: ServiceScheme -> String showList :: [ServiceScheme] -> ShowS | |
| Eq ServiceScheme Source # | |
Defined in Simplex.Messaging.ServiceScheme | |
| StrEncoding ServiceScheme Source # | |
Defined in Simplex.Messaging.ServiceScheme Methods strEncode :: ServiceScheme -> ByteString Source # strDecode :: ByteString -> Either String ServiceScheme Source # strP :: Parser ServiceScheme Source # | |
data FixedLinkData (c :: ConnectionMode) Source #
Constructors
| FixedLinkData | |
Fields
| |
Instances
| Show (FixedLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> FixedLinkData c -> ShowS show :: FixedLinkData c -> String showList :: [FixedLinkData c] -> ShowS | |
| Eq (FixedLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: FixedLinkData c -> FixedLinkData c -> Bool (/=) :: FixedLinkData c -> FixedLinkData c -> Bool | |
| ConnectionModeI c => Encoding (FixedLinkData c) Source # | |
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
| ConnectionModeI m => ACLD (SConnectionMode m) (ConnLinkData m) |
Instances
| Encoding AConnLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AConnLinkData -> ByteString Source # smpDecode :: ByteString -> Either String AConnLinkData Source # smpP :: Parser AConnLinkData Source # | |
data ConnLinkData (c :: ConnectionMode) where Source #
Constructors
| InvitationLinkData :: VersionRangeSMPA -> UserLinkData -> ConnLinkData 'CMInvitation | |
| ContactLinkData :: VersionRangeSMPA -> UserContactData -> ConnLinkData 'CMContact |
Instances
| Show (ConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnLinkData c -> ShowS show :: ConnLinkData c -> String showList :: [ConnLinkData c] -> ShowS | |
| Eq (ConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnLinkData c -> ConnLinkData c -> Bool (/=) :: ConnLinkData c -> ConnLinkData c -> Bool | |
| ConnectionModeI c => Encoding (ConnLinkData c) Source # | |
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
| ConnectionModeI m => AULD (SConnectionMode m) (UserConnLinkData m) |
Instances
| Encoding AUserConnLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AUserConnLinkData -> ByteString Source # smpDecode :: ByteString -> Either String AUserConnLinkData Source # smpP :: Parser AUserConnLinkData Source # | |
data UserConnLinkData (c :: ConnectionMode) where Source #
Constructors
| UserInvLinkData :: UserLinkData -> UserConnLinkData 'CMInvitation | |
| UserContactLinkData :: UserContactData -> UserConnLinkData 'CMContact |
Instances
| Show (UserConnLinkData m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> UserConnLinkData m -> ShowS show :: UserConnLinkData m -> String showList :: [UserConnLinkData m] -> ShowS | |
| Eq (UserConnLinkData m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: UserConnLinkData m -> UserConnLinkData m -> Bool (/=) :: UserConnLinkData m -> UserConnLinkData m -> Bool | |
| ConnectionModeI c => Encoding (UserConnLinkData c) Source # | |
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 # | |
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 #
Constructors
| UserContactData | |
Fields
| |
Instances
| Show UserContactData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> UserContactData -> ShowS show :: UserContactData -> String showList :: [UserContactData] -> ShowS | |
| Eq UserContactData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: UserContactData -> UserContactData -> Bool (/=) :: UserContactData -> UserContactData -> Bool | |
| Encoding UserContactData Source # | |
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
| Show UserLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> UserLinkData -> ShowS show :: UserLinkData -> String showList :: [UserLinkData] -> ShowS | |
| Eq UserLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| Encoding UserLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: UserLinkData -> ByteString Source # smpDecode :: ByteString -> Either String UserLinkData Source # smpP :: Parser UserLinkData Source # | |
Constructors
| OwnerAuth | |
Fields | |
data ConnectionLink (m :: ConnectionMode) Source #
Constructors
| CLFull (ConnectionRequestUri m) | |
| CLShort (ConnShortLink m) |
Instances
| ConnectionModeI m => FromJSON (ConnectionLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser (ConnectionLink m) parseJSONList :: Value -> Parser [ConnectionLink m] omittedField :: Maybe (ConnectionLink m) | |
| ConnectionModeI m => ToJSON (ConnectionLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ConnectionLink m -> Value toEncoding :: ConnectionLink m -> Encoding toJSONList :: [ConnectionLink m] -> Value toEncodingList :: [ConnectionLink m] -> Encoding omitField :: ConnectionLink m -> Bool | |
| Show (ConnectionLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnectionLink m -> ShowS show :: ConnectionLink m -> String showList :: [ConnectionLink m] -> ShowS | |
| Eq (ConnectionLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnectionLink m -> ConnectionLink m -> Bool (/=) :: ConnectionLink m -> ConnectionLink m -> Bool | |
| ConnectionModeI m => StrEncoding (ConnectionLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: ConnectionLink m -> ByteString Source # strDecode :: ByteString -> Either String (ConnectionLink m) Source # strP :: Parser (ConnectionLink m) Source # | |
| (Typeable c, ConnectionModeI c) => FromField (ConnectionLink c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods fromField :: FieldParser (ConnectionLink c) # | |
| ConnectionModeI c => ToField (ConnectionLink c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toField :: ConnectionLink c -> SQLData # | |
data AConnectionLink Source #
Constructors
| ConnectionModeI m => ACL (SConnectionMode m) (ConnectionLink m) |
Instances
| FromJSON AConnectionLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser AConnectionLink parseJSONList :: Value -> Parser [AConnectionLink] omittedField :: Maybe AConnectionLink | |
| ToJSON AConnectionLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: AConnectionLink -> Value toEncoding :: AConnectionLink -> Encoding toJSONList :: [AConnectionLink] -> Value toEncodingList :: [AConnectionLink] -> Encoding omitField :: AConnectionLink -> Bool | |
| Show AConnectionLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AConnectionLink -> ShowS show :: AConnectionLink -> String showList :: [AConnectionLink] -> ShowS | |
| Eq AConnectionLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AConnectionLink -> AConnectionLink -> Bool (/=) :: AConnectionLink -> AConnectionLink -> Bool | |
| StrEncoding AConnectionLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: AConnectionLink -> ByteString Source # strDecode :: ByteString -> Either String AConnectionLink Source # strP :: Parser AConnectionLink Source # | |
data ConnShortLink (m :: ConnectionMode) where Source #
Constructors
| CSLInvitation :: ShortLinkScheme -> SMPServer -> LinkId -> LinkKey -> ConnShortLink 'CMInvitation | |
| CSLContact :: ShortLinkScheme -> ContactConnType -> SMPServer -> LinkKey -> ConnShortLink 'CMContact |
Instances
| ConnectionModeI m => FromJSON (ConnShortLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser (ConnShortLink m) parseJSONList :: Value -> Parser [ConnShortLink m] omittedField :: Maybe (ConnShortLink m) | |
| ConnectionModeI m => ToJSON (ConnShortLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ConnShortLink m -> Value toEncoding :: ConnShortLink m -> Encoding toJSONList :: [ConnShortLink m] -> Value toEncodingList :: [ConnShortLink m] -> Encoding omitField :: ConnShortLink m -> Bool | |
| Show (ConnShortLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnShortLink m -> ShowS show :: ConnShortLink m -> String showList :: [ConnShortLink m] -> ShowS | |
| Eq (ConnShortLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnShortLink m -> ConnShortLink m -> Bool (/=) :: ConnShortLink m -> ConnShortLink m -> Bool | |
| ConnectionModeI m => Encoding (ConnShortLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: ConnShortLink m -> ByteString Source # smpDecode :: ByteString -> Either String (ConnShortLink m) Source # smpP :: Parser (ConnShortLink m) Source # | |
| ConnectionModeI m => StrEncoding (ConnShortLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: ConnShortLink m -> ByteString Source # strDecode :: ByteString -> Either String (ConnShortLink m) Source # strP :: Parser (ConnShortLink m) Source # | |
| (Typeable c, ConnectionModeI c) => FromField (ConnShortLink c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods fromField :: FieldParser (ConnShortLink c) # | |
| ConnectionModeI c => ToField (ConnShortLink c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toField :: ConnShortLink c -> SQLData # | |
data AConnShortLink Source #
Constructors
| ConnectionModeI m => ACSL (SConnectionMode m) (ConnShortLink m) |
Instances
| FromJSON AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser AConnShortLink parseJSONList :: Value -> Parser [AConnShortLink] omittedField :: Maybe AConnShortLink | |
| ToJSON AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: AConnShortLink -> Value toEncoding :: AConnShortLink -> Encoding toJSONList :: [AConnShortLink] -> Value toEncodingList :: [AConnShortLink] -> Encoding omitField :: AConnShortLink -> Bool | |
| Show AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AConnShortLink -> ShowS show :: AConnShortLink -> String showList :: [AConnShortLink] -> ShowS | |
| Eq AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AConnShortLink -> AConnShortLink -> Bool (/=) :: AConnShortLink -> AConnShortLink -> Bool | |
| Encoding AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AConnShortLink -> ByteString Source # smpDecode :: ByteString -> Either String AConnShortLink Source # smpP :: Parser AConnShortLink Source # | |
| StrEncoding AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: AConnShortLink -> ByteString Source # strDecode :: ByteString -> Either String AConnShortLink Source # strP :: Parser AConnShortLink Source # | |
| FromField AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods fromField :: FieldParser AConnShortLink # | |
| ToField AConnShortLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toField :: AConnShortLink -> SQLData # | |
data CreatedConnLink (m :: ConnectionMode) Source #
Constructors
| CCLink | |
Fields
| |
Instances
| ConnectionModeI m => FromJSON (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser (CreatedConnLink m) parseJSONList :: Value -> Parser [CreatedConnLink m] omittedField :: Maybe (CreatedConnLink m) | |
| ConnectionModeI m => ToJSON (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: CreatedConnLink m -> Value toEncoding :: CreatedConnLink m -> Encoding toJSONList :: [CreatedConnLink m] -> Value toEncodingList :: [CreatedConnLink m] -> Encoding omitField :: CreatedConnLink m -> Bool | |
| Show (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> CreatedConnLink m -> ShowS show :: CreatedConnLink m -> String showList :: [CreatedConnLink m] -> ShowS | |
| Eq (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: CreatedConnLink m -> CreatedConnLink m -> Bool (/=) :: CreatedConnLink m -> CreatedConnLink m -> Bool | |
data ACreatedConnLink Source #
Constructors
| ConnectionModeI m => ACCL (SConnectionMode m) (CreatedConnLink m) |
Instances
| FromJSON ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser ACreatedConnLink parseJSONList :: Value -> Parser [ACreatedConnLink] omittedField :: Maybe ACreatedConnLink | |
| ToJSON ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ACreatedConnLink -> Value toEncoding :: ACreatedConnLink -> Encoding toJSONList :: [ACreatedConnLink] -> Value toEncodingList :: [ACreatedConnLink] -> Encoding omitField :: ACreatedConnLink -> Bool | |
| Show ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ACreatedConnLink -> ShowS show :: ACreatedConnLink -> String showList :: [ACreatedConnLink] -> ShowS | |
| Eq ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ACreatedConnLink -> ACreatedConnLink -> Bool (/=) :: ACreatedConnLink -> ACreatedConnLink -> Bool | |
data ContactConnType Source #
Constructors
| CCTContact | |
| CCTChannel | |
| CCTGroup | |
| CCTRelay |
Instances
| Show ContactConnType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ContactConnType -> ShowS show :: ContactConnType -> String showList :: [ContactConnType] -> ShowS | |
| Eq ContactConnType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ContactConnType -> ContactConnType -> Bool (/=) :: ContactConnType -> ContactConnType -> Bool | |
data ShortLinkScheme Source #
Constructors
| SLSSimplex | |
| SLSServer |
Instances
| Show ShortLinkScheme Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ShortLinkScheme -> ShowS show :: ShortLinkScheme -> String showList :: [ShortLinkScheme] -> ShowS | |
| Eq ShortLinkScheme Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ShortLinkScheme -> ShortLinkScheme -> Bool (/=) :: ShortLinkScheme -> ShortLinkScheme -> Bool | |
Constructors
| LinkKey ByteString |
data PreparedLinkParams Source #
Parameters for creating a connection with a prepared link.
Constructors
| PreparedLinkParams | |
Fields
| |
Instances
| Show PreparedLinkParams Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> PreparedLinkParams -> ShowS show :: PreparedLinkParams -> String showList :: [PreparedLinkParams] -> ShowS | |
data StoredClientService (s :: DBStored) Source #
Constructors
| ClientService | |
Fields
| |
Instances
| Show (StoredClientService s) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> StoredClientService s -> ShowS show :: StoredClientService s -> String showList :: [StoredClientService s] -> ShowS | |
| Eq (StoredClientService s) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: StoredClientService s -> StoredClientService s -> Bool (/=) :: StoredClientService s -> StoredClientService s -> Bool | |
type ClientService = StoredClientService 'DBStored Source #
type ClientServiceId = DBEntityId Source #
validateOwners :: Maybe ShortLinkCreds -> UserContactData -> Either String () Source #
validateLinkOwners :: PublicKeyEd25519 -> [OwnerAuth] -> Either String () Source #
sameConnReqContact :: ConnectionRequestUri 'CMContact -> ConnectionRequestUri 'CMContact -> Bool Source #
sameShortLinkContact :: ConnShortLink 'CMContact -> ConnShortLink 'CMContact -> Bool Source #
connReqUriP' :: forall (m :: ConnectionMode). ConnectionModeI m => Maybe ServiceScheme -> Parser (ConnectionRequestUri m) Source #
simplexConnReqUri :: forall (m :: ConnectionMode). ConnectionRequestUri m -> ConnectionRequestUri m Source #
simplexShortLink :: forall (m :: ConnectionMode). ConnShortLink m -> ConnShortLink m 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 |
Fields | |
| PROXY | SMP proxy errors |
Fields
| |
| RCP | XRCP protocol errors forwarded to agent clients |
Fields | |
| BROKER | SMP server errors |
Fields
| |
| AGENT | errors of other agents |
Fields | |
| NOTICE | client notice |
| 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
| FromJSON AgentErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser AgentErrorType parseJSONList :: Value -> Parser [AgentErrorType] omittedField :: Maybe AgentErrorType | |
| ToJSON AgentErrorType Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toException :: AgentErrorType -> SomeException fromException :: SomeException -> Maybe AgentErrorType displayException :: AgentErrorType -> String | |
| Show AgentErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentErrorType -> ShowS show :: AgentErrorType -> String showList :: [AgentErrorType] -> ShowS | |
| Eq AgentErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AgentErrorType -> AgentErrorType -> Bool (/=) :: AgentErrorType -> AgentErrorType -> Bool | |
| AnyError AgentErrorType Source # | |
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
| FromJSON CommandErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser CommandErrorType parseJSONList :: Value -> Parser [CommandErrorType] omittedField :: Maybe CommandErrorType | |
| ToJSON CommandErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: CommandErrorType -> Value toEncoding :: CommandErrorType -> Encoding toJSONList :: [CommandErrorType] -> Value toEncodingList :: [CommandErrorType] -> Encoding omitField :: CommandErrorType -> Bool | |
| Exception CommandErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toException :: CommandErrorType -> SomeException fromException :: SomeException -> Maybe CommandErrorType displayException :: CommandErrorType -> String | |
| Read CommandErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods readsPrec :: Int -> ReadS CommandErrorType readList :: ReadS [CommandErrorType] readPrec :: ReadPrec CommandErrorType readListPrec :: ReadPrec [CommandErrorType] | |
| Show CommandErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> CommandErrorType -> ShowS show :: CommandErrorType -> String showList :: [CommandErrorType] -> ShowS | |
| Eq CommandErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: CommandErrorType -> CommandErrorType -> Bool (/=) :: CommandErrorType -> CommandErrorType -> Bool | |
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
| FromJSON ConnectionErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser ConnectionErrorType parseJSONList :: Value -> Parser [ConnectionErrorType] omittedField :: Maybe ConnectionErrorType | |
| ToJSON ConnectionErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ConnectionErrorType -> Value toEncoding :: ConnectionErrorType -> Encoding toJSONList :: [ConnectionErrorType] -> Value toEncodingList :: [ConnectionErrorType] -> Encoding omitField :: ConnectionErrorType -> Bool | |
| Exception ConnectionErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toException :: ConnectionErrorType -> SomeException fromException :: SomeException -> Maybe ConnectionErrorType displayException :: ConnectionErrorType -> String | |
| Read ConnectionErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods readsPrec :: Int -> ReadS ConnectionErrorType readList :: ReadS [ConnectionErrorType] readPrec :: ReadPrec ConnectionErrorType readListPrec :: ReadPrec [ConnectionErrorType] | |
| Show ConnectionErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnectionErrorType -> ShowS show :: ConnectionErrorType -> String showList :: [ConnectionErrorType] -> ShowS | |
| Eq ConnectionErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnectionErrorType -> ConnectionErrorType -> Bool (/=) :: ConnectionErrorType -> ConnectionErrorType -> Bool | |
data BrokerErrorType Source #
SMP server errors.
Constructors
| RESPONSE | invalid server response (failed to parse) |
Fields
| |
| UNEXPECTED | unexpected response |
Fields
| |
| NETWORK | network error |
Fields | |
| 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 |
Fields | |
| TIMEOUT | command response timeout |
Instances
| FromJSON BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods parseJSON :: Value -> Parser BrokerErrorType parseJSONList :: Value -> Parser [BrokerErrorType] omittedField :: Maybe BrokerErrorType | |
| ToJSON BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods toJSON :: BrokerErrorType -> Value toEncoding :: BrokerErrorType -> Encoding toJSONList :: [BrokerErrorType] -> Value toEncodingList :: [BrokerErrorType] -> Encoding omitField :: BrokerErrorType -> Bool | |
| Exception BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods toException :: BrokerErrorType -> SomeException fromException :: SomeException -> Maybe BrokerErrorType displayException :: BrokerErrorType -> String | |
| Read BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods readsPrec :: Int -> ReadS BrokerErrorType readList :: ReadS [BrokerErrorType] readPrec :: ReadPrec BrokerErrorType readListPrec :: ReadPrec [BrokerErrorType] | |
| Show BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods showsPrec :: Int -> BrokerErrorType -> ShowS show :: BrokerErrorType -> String showList :: [BrokerErrorType] -> ShowS | |
| Eq BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods (==) :: BrokerErrorType -> BrokerErrorType -> Bool (/=) :: BrokerErrorType -> BrokerErrorType -> Bool | |
| Encoding BrokerErrorType Source # | |
Defined in Simplex.Messaging.Protocol Methods smpEncode :: BrokerErrorType -> ByteString Source # smpDecode :: ByteString -> Either String BrokerErrorType Source # smpP :: Parser BrokerErrorType Source # | |
| StrEncoding BrokerErrorType Source # | |
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 |
Fields | |
| 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
| FromJSON SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser SMPAgentError parseJSONList :: Value -> Parser [SMPAgentError] omittedField :: Maybe SMPAgentError | |
| ToJSON SMPAgentError Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toException :: SMPAgentError -> SomeException fromException :: SomeException -> Maybe SMPAgentError displayException :: SMPAgentError -> String | |
| Show SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPAgentError -> ShowS show :: SMPAgentError -> String showList :: [SMPAgentError] -> ShowS | |
| Eq SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data DroppedMsg Source #
Constructors
| DroppedMsg | |
Instances
| FromJSON DroppedMsg Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser DroppedMsg parseJSONList :: Value -> Parser [DroppedMsg] omittedField :: Maybe DroppedMsg | |
| ToJSON DroppedMsg Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> DroppedMsg -> ShowS show :: DroppedMsg -> String showList :: [DroppedMsg] -> ShowS | |
| Eq DroppedMsg Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
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
| FromJSON AgentCryptoError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser AgentCryptoError parseJSONList :: Value -> Parser [AgentCryptoError] omittedField :: Maybe AgentCryptoError | |
| ToJSON AgentCryptoError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: AgentCryptoError -> Value toEncoding :: AgentCryptoError -> Encoding toJSONList :: [AgentCryptoError] -> Value toEncodingList :: [AgentCryptoError] -> Encoding omitField :: AgentCryptoError -> Bool | |
| Exception AgentCryptoError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toException :: AgentCryptoError -> SomeException fromException :: SomeException -> Maybe AgentCryptoError displayException :: AgentCryptoError -> String | |
| Read AgentCryptoError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods readsPrec :: Int -> ReadS AgentCryptoError readList :: ReadS [AgentCryptoError] readPrec :: ReadPrec AgentCryptoError readListPrec :: ReadPrec [AgentCryptoError] | |
| Show AgentCryptoError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentCryptoError -> ShowS show :: AgentCryptoError -> String showList :: [AgentCryptoError] -> ShowS | |
| Eq AgentCryptoError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AgentCryptoError -> AgentCryptoError -> Bool (/=) :: AgentCryptoError -> AgentCryptoError -> Bool | |
type ConfirmationId = ByteString Source #
type InvitationId = ByteString Source #
data MsgIntegrity Source #
Result of received message integrity validation.
Instances
| FromJSON MsgIntegrity Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser MsgIntegrity parseJSONList :: Value -> Parser [MsgIntegrity] omittedField :: Maybe MsgIntegrity | |
| ToJSON MsgIntegrity Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> MsgIntegrity -> ShowS show :: MsgIntegrity -> String showList :: [MsgIntegrity] -> ShowS | |
| Eq MsgIntegrity Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| StrEncoding MsgIntegrity Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: MsgIntegrity -> ByteString Source # strDecode :: ByteString -> Either String MsgIntegrity Source # strP :: Parser MsgIntegrity Source # | |
| FromField MsgIntegrity Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser MsgIntegrity # | |
| ToField MsgIntegrity Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: MsgIntegrity -> SQLData # | |
data MsgErrorType Source #
Error of message integrity validation.
Constructors
| MsgSkipped | |
Fields
| |
| MsgBadId | |
Fields
| |
| MsgBadHash | |
| MsgDuplicate | |
Instances
| FromJSON MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser MsgErrorType parseJSONList :: Value -> Parser [MsgErrorType] omittedField :: Maybe MsgErrorType | |
| ToJSON MsgErrorType Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> MsgErrorType -> ShowS show :: MsgErrorType -> String showList :: [MsgErrorType] -> ShowS | |
| Eq MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| StrEncoding MsgErrorType Source # | |
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
| FromJSON QueueStatus Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser QueueStatus parseJSONList :: Value -> Parser [QueueStatus] omittedField :: Maybe QueueStatus | |
| ToJSON QueueStatus Source # | |
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 # | |
Defined in Simplex.Messaging.Agent.Protocol Methods readsPrec :: Int -> ReadS QueueStatus readList :: ReadS [QueueStatus] readPrec :: ReadPrec QueueStatus readListPrec :: ReadPrec [QueueStatus] | |
| Show QueueStatus Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> QueueStatus -> ShowS show :: QueueStatus -> String showList :: [QueueStatus] -> ShowS | |
| Eq QueueStatus Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| FromField QueueStatus Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser QueueStatus # | |
| ToField QueueStatus Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: QueueStatus -> SQLData # | |
type AgentMsgId = Int64 Source #
data NotificationsMode Source #
Constructors
| NMPeriodic | |
| NMInstant |
Instances
| FromJSON NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser NotificationsMode parseJSONList :: Value -> Parser [NotificationsMode] omittedField :: Maybe NotificationsMode | |
| ToJSON NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: NotificationsMode -> Value toEncoding :: NotificationsMode -> Encoding toJSONList :: [NotificationsMode] -> Value toEncodingList :: [NotificationsMode] -> Encoding omitField :: NotificationsMode -> Bool | |
| Show NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> NotificationsMode -> ShowS show :: NotificationsMode -> String showList :: [NotificationsMode] -> ShowS | |
| Eq NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: NotificationsMode -> NotificationsMode -> Bool (/=) :: NotificationsMode -> NotificationsMode -> Bool | |
| StrEncoding NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: NotificationsMode -> ByteString Source # strDecode :: ByteString -> Either String NotificationsMode Source # strP :: Parser NotificationsMode Source # | |
| FromField NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods fromField :: FieldParser NotificationsMode # | |
| ToField NotificationsMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toField :: NotificationsMode -> SQLData # | |
data NotificationInfo Source #
Constructors
| NotificationInfo | |
Fields
| |
Instances
| Show NotificationInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> NotificationInfo -> ShowS show :: NotificationInfo -> String showList :: [NotificationInfo] -> ShowS | |
data ConnMsgReq Source #
Constructors
| ConnMsgReq | |
Fields
| |
Instances
| Show ConnMsgReq Source # | |
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.
connMode :: forall (m :: ConnectionMode). SConnectionMode m -> ConnectionMode Source #
dbCommandP :: Parser ACommand Source #
SMP agent command and response parser for commands stored in db (fully parses binary bodies)
connModeT :: Text -> Maybe ConnectionMode Source #
serializeQueueStatus :: QueueStatus -> Text Source #
queueStatusT :: Text -> Maybe QueueStatus Source #
shortenShortLink :: forall (m :: ConnectionMode). NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m Source #
restoreShortLink :: forall (m :: ConnectionMode). NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m Source #
isPresetServer :: Foldable t => SMPServer -> t SMPServer -> Bool Source #
linkUserData :: forall (c :: ConnectionMode). ConnLinkData c -> UserLinkData Source #
linkUserData' :: forall (c :: ConnectionMode). ConnLinkData c -> ByteString Source #