| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Simplex.Messaging.Agent.Store.AgentStore
Synopsis
- createUserRecord :: Connection -> IO UserId
- getUserIds :: Connection -> IO [UserId]
- deleteUserRecord :: Connection -> UserId -> IO (Either StoreError ())
- setUserDeleted :: Connection -> UserId -> IO (Either StoreError [ConnId])
- deleteUserWithoutConns :: Connection -> UserId -> IO Bool
- deleteUsersWithoutConns :: Connection -> IO [Int64]
- checkUser :: Connection -> UserId -> IO (Either StoreError ())
- createServer :: Connection -> SMPServer -> IO (Maybe KeyHash)
- createNewConn :: Connection -> TVar ChaChaDRG -> ConnData -> SConnectionMode c -> IO (Either StoreError ConnId)
- updateNewConnRcv :: Connection -> ConnId -> NewRcvQueue -> SubscriptionMode -> IO (Either StoreError RcvQueue)
- updateNewConnSnd :: Connection -> ConnId -> NewSndQueue -> IO (Either StoreError SndQueue)
- createSndConn :: Connection -> TVar ChaChaDRG -> ConnData -> NewSndQueue -> IO (Either StoreError (ConnId, SndQueue))
- getClientNotices :: Connection -> [SMPServer] -> IO (Map (Maybe SMPServer) (Maybe SystemSeconds))
- updateClientNotices :: Connection -> SMPTransportSession -> SystemSeconds -> [(RcvQueueSub, Maybe ClientNotice)] -> IO [(RecipientId, Maybe NoticeId)]
- getSubscriptionServers :: Connection -> Bool -> IO [(UserId, SMPServer)]
- getUserServerRcvQueueSubs :: Connection -> UserId -> SMPServer -> Bool -> Int -> Maybe RecipientId -> IO [RcvQueueSub]
- unsetQueuesToSubscribe :: Connection -> IO ()
- getConnIds :: Connection -> IO [ConnId]
- getConn :: Connection -> ConnId -> IO (Either StoreError SomeConn)
- getDeletedConn :: Connection -> ConnId -> IO (Either StoreError SomeConn)
- getConns :: Connection -> [ConnId] -> IO [Either StoreError SomeConn]
- getConnSubs :: Connection -> [ConnId] -> IO [Either StoreError SomeConnSub]
- getDeletedConns :: Connection -> [ConnId] -> IO [Either StoreError SomeConn]
- getConnsData :: Connection -> [ConnId] -> IO [Either StoreError (Maybe (ConnData, ConnectionMode))]
- lockConnForUpdate :: Connection -> ConnId -> IO ()
- setConnDeleted :: Connection -> Bool -> ConnId -> IO ()
- setConnUserId :: Connection -> UserId -> ConnId -> UserId -> IO ()
- setConnAgentVersion :: Connection -> ConnId -> VersionSMPA -> IO ()
- setConnPQSupport :: Connection -> ConnId -> PQSupport -> IO ()
- updateNewConnJoin :: Connection -> ConnId -> VersionSMPA -> PQSupport -> Bool -> IO ()
- getDeletedConnIds :: Connection -> IO [ConnId]
- getDeletedWaitingDeliveryConnIds :: Connection -> IO [ConnId]
- setConnRatchetSync :: Connection -> ConnId -> RatchetSyncState -> IO ()
- addProcessedRatchetKeyHash :: Connection -> ConnId -> ByteString -> IO ()
- checkRatchetKeyHashExists :: Connection -> ConnId -> ByteString -> IO Bool
- deleteRatchetKeyHashesExpired :: Connection -> NominalDiffTime -> Int -> IO ()
- getRcvConn :: Connection -> SMPServer -> RecipientId -> IO (Either StoreError (RcvQueue, SomeConn))
- getRcvQueueById :: Connection -> ConnId -> Int64 -> IO (Either StoreError RcvQueue)
- getSndQueueById :: Connection -> ConnId -> Int64 -> IO (Either StoreError SndQueue)
- deleteConn :: Connection -> Maybe NominalDiffTime -> ConnId -> IO (Maybe ConnId)
- deleteConnRecord :: Connection -> ConnId -> IO ()
- upgradeRcvConnToDuplex :: Connection -> ConnId -> NewSndQueue -> IO (Either StoreError SndQueue)
- upgradeSndConnToDuplex :: Connection -> ConnId -> NewRcvQueue -> SubscriptionMode -> IO (Either StoreError RcvQueue)
- addConnRcvQueue :: Connection -> ConnId -> NewRcvQueue -> SubscriptionMode -> IO (Either StoreError RcvQueue)
- addConnSndQueue :: Connection -> ConnId -> NewSndQueue -> IO (Either StoreError SndQueue)
- setRcvQueueStatus :: Connection -> RcvQueue -> QueueStatus -> IO ()
- setRcvSwitchStatus :: Connection -> RcvQueue -> Maybe RcvSwitchStatus -> IO RcvQueue
- setRcvQueueDeleted :: Connection -> RcvQueue -> IO ()
- setRcvQueueConfirmedE2E :: Connection -> RcvQueue -> DhSecretX25519 -> VersionSMPC -> IO ()
- setSndQueueStatus :: Connection -> SndQueue -> QueueStatus -> IO ()
- setSndSwitchStatus :: Connection -> SndQueue -> Maybe SndSwitchStatus -> IO SndQueue
- setRcvQueuePrimary :: Connection -> ConnId -> RcvQueue -> IO ()
- setSndQueuePrimary :: Connection -> ConnId -> SndQueue -> IO ()
- deleteConnRcvQueue :: Connection -> RcvQueue -> IO ()
- incRcvDeleteErrors :: Connection -> RcvQueue -> IO ()
- deleteConnSndQueue :: Connection -> ConnId -> SndQueue -> IO ()
- getPrimaryRcvQueue :: Connection -> ConnId -> IO (Either StoreError RcvQueue)
- getRcvQueue :: Connection -> ConnId -> SMPServer -> RecipientId -> IO (Either StoreError RcvQueue)
- getDeletedRcvQueue :: Connection -> ConnId -> SMPServer -> RecipientId -> IO (Either StoreError RcvQueue)
- setRcvQueueNtfCreds :: Connection -> ConnId -> Maybe ClientNtfCreds -> IO ()
- createConfirmation :: Connection -> TVar ChaChaDRG -> NewConfirmation -> IO (Either StoreError ConfirmationId)
- acceptConfirmation :: Connection -> ConfirmationId -> ConnInfo -> IO (Either StoreError AcceptedConfirmation)
- getAcceptedConfirmation :: Connection -> ConnId -> IO (Either StoreError AcceptedConfirmation)
- removeConfirmations :: Connection -> ConnId -> IO ()
- createInvitation :: Connection -> TVar ChaChaDRG -> NewInvitation -> IO (Either StoreError InvitationId)
- getInvitation :: Connection -> String -> InvitationId -> IO (Either StoreError Invitation)
- acceptInvitation :: Connection -> InvitationId -> ConnInfo -> IO ()
- unacceptInvitation :: Connection -> InvitationId -> IO ()
- deleteInvitation :: Connection -> InvitationId -> IO ()
- getInvShortLink :: Connection -> SMPServer -> LinkId -> IO (Maybe InvShortLink)
- getInvShortLinkKeys :: Connection -> SMPServer -> SenderId -> IO (Maybe (LinkId, APrivateAuthKey))
- deleteInvShortLink :: Connection -> SMPServer -> LinkId -> IO ()
- createInvShortLink :: Connection -> InvShortLink -> IO ()
- setInvShortLinkSndId :: Connection -> InvShortLink -> SenderId -> IO ()
- updateShortLinkCreds :: Connection -> RcvQueue -> ShortLinkCreds -> IO ()
- updateRcvIds :: Connection -> ConnId -> IO (InternalId, InternalRcvId, PrevExternalSndId, PrevRcvMsgHash)
- createRcvMsg :: Connection -> ConnId -> RcvQueue -> RcvMsgData -> IO ()
- setLastBrokerTs :: Connection -> ConnId -> DBEntityId -> UTCTime -> IO ()
- updateRcvMsgHash :: Connection -> ConnId -> AgentMsgId -> InternalRcvId -> MsgHash -> IO ()
- createSndMsgBody :: Connection -> AMessage -> IO Int64
- updateSndIds :: Connection -> ConnId -> IO (Either StoreError (InternalId, InternalSndId, PrevSndMsgHash))
- createSndMsg :: Connection -> ConnId -> SndMsgData -> IO ()
- updateSndMsgHash :: Connection -> ConnId -> InternalSndId -> MsgHash -> IO ()
- createSndMsgDelivery :: Connection -> SndQueue -> InternalId -> IO ()
- getSndMsgViaRcpt :: Connection -> ConnId -> InternalSndId -> IO (Either StoreError SndMsg)
- updateSndMsgRcpt :: Connection -> ConnId -> InternalSndId -> MsgReceipt -> IO ()
- getPendingQueueMsg :: Connection -> ConnId -> SndQueue -> IO (Either StoreError (Maybe (Maybe RcvQueue, PendingMsgData)))
- getConnectionsForDelivery :: Connection -> IO [ConnId]
- getAllSndQueuesForDelivery :: Connection -> IO [SndQueue]
- updatePendingMsgRIState :: Connection -> ConnId -> InternalId -> RI2State -> IO ()
- deletePendingMsgs :: Connection -> ConnId -> SndQueue -> IO ()
- getExpiredSndMessages :: Connection -> ConnId -> SndQueue -> UTCTime -> IO [InternalId]
- setMsgUserAck :: Connection -> ConnId -> InternalId -> IO (Either StoreError (RcvQueue, MsgId))
- getRcvMsg :: Connection -> ConnId -> InternalId -> IO (Either StoreError RcvMsg)
- getLastMsg :: Connection -> ConnId -> MsgId -> IO (Maybe RcvMsg)
- incMsgRcvAttempts :: Connection -> ConnId -> InternalId -> IO Int
- checkRcvMsgHashExists :: Connection -> ConnId -> ByteString -> IO Bool
- getRcvMsgBrokerTs :: Connection -> ConnId -> MsgId -> IO (Either StoreError BrokerTs)
- deleteMsg :: Connection -> ConnId -> InternalId -> IO ()
- deleteDeliveredSndMsg :: Connection -> ConnId -> InternalId -> IO ()
- deleteSndMsgDelivery :: Connection -> ConnId -> SndQueue -> InternalId -> Bool -> IO ()
- deleteRcvMsgHashesExpired :: Connection -> NominalDiffTime -> Int -> IO ()
- deleteSndMsgsExpired :: Connection -> NominalDiffTime -> Int -> IO ()
- createRatchetX3dhKeys :: Connection -> ConnId -> PrivateKeyX448 -> PrivateKeyX448 -> Maybe RcvPrivRKEMParams -> IO ()
- getRatchetX3dhKeys :: Connection -> ConnId -> IO (Either StoreError (PrivateKeyX448, PrivateKeyX448, Maybe RcvPrivRKEMParams))
- setRatchetX3dhKeys :: Connection -> ConnId -> PrivateKeyX448 -> PrivateKeyX448 -> Maybe RcvPrivRKEMParams -> IO ()
- createSndRatchet :: Connection -> ConnId -> RatchetX448 -> AE2ERatchetParams 'X448 -> IO ()
- getSndRatchet :: Connection -> ConnId -> VersionE2E -> IO (Either StoreError (RatchetX448, AE2ERatchetParams 'X448))
- createRatchet :: Connection -> ConnId -> RatchetX448 -> IO ()
- deleteRatchet :: Connection -> ConnId -> IO ()
- getRatchet :: Connection -> ConnId -> IO (Either StoreError RatchetX448)
- getRatchetForUpdate :: Connection -> ConnId -> IO (Either StoreError RatchetX448)
- getSkippedMsgKeys :: Connection -> ConnId -> IO SkippedMsgKeys
- updateRatchet :: Connection -> ConnId -> RatchetX448 -> SkippedMsgDiff -> IO ()
- createCommand :: Connection -> ACorrId -> ConnId -> Maybe SMPServer -> AgentCommand -> IO (Either StoreError ())
- getPendingCommandServers :: Connection -> [ConnId] -> IO [(ConnId, NonEmpty (Maybe SMPServer))]
- getAllPendingCommandConns :: Connection -> IO [(ConnId, Maybe SMPServer)]
- getPendingServerCommand :: Connection -> ConnId -> Maybe SMPServer -> IO (Either StoreError (Maybe PendingCommand))
- updateCommandServer :: Connection -> AsyncCmdId -> SMPServer -> IO (Either StoreError ())
- deleteCommand :: Connection -> AsyncCmdId -> IO ()
- createNtfToken :: Connection -> NtfToken -> IO ()
- getSavedNtfToken :: Connection -> IO (Maybe NtfToken)
- updateNtfTokenRegistration :: Connection -> NtfToken -> NtfTokenId -> DhSecretX25519 -> IO ()
- updateDeviceToken :: Connection -> NtfToken -> DeviceToken -> IO ()
- updateNtfMode :: Connection -> NtfToken -> NotificationsMode -> IO ()
- updateNtfToken :: Connection -> NtfToken -> NtfTknStatus -> Maybe NtfTknAction -> IO ()
- removeNtfToken :: Connection -> NtfToken -> IO ()
- addNtfTokenToDelete :: Connection -> NtfServer -> APrivateAuthKey -> NtfTokenId -> IO ()
- deleteExpiredNtfTokensToDelete :: Connection -> NominalDiffTime -> IO ()
- type NtfTokenToDelete = (Int64, APrivateAuthKey, NtfTokenId)
- getNextNtfTokenToDelete :: Connection -> NtfServer -> IO (Either StoreError (Maybe NtfTokenToDelete))
- markNtfTokenToDeleteFailed_ :: Connection -> Int64 -> IO ()
- getPendingDelTknServers :: Connection -> IO [NtfServer]
- deleteNtfTokenToDelete :: Connection -> Int64 -> IO ()
- type NtfSupervisorSub = (NtfSubscription, Maybe (NtfSubAction, NtfActionTs))
- getNtfSubscription :: Connection -> ConnId -> IO (Maybe NtfSupervisorSub)
- createNtfSubscription :: Connection -> NtfSubscription -> NtfSubAction -> IO (Either StoreError ())
- supervisorUpdateNtfSub :: Connection -> NtfSubscription -> NtfSubAction -> IO ()
- supervisorUpdateNtfAction :: Connection -> ConnId -> NtfSubAction -> IO ()
- updateNtfSubscription :: Connection -> NtfSubscription -> NtfSubAction -> NtfActionTs -> IO ()
- setNullNtfSubscriptionAction :: Connection -> ConnId -> IO ()
- deleteNtfSubscription :: Connection -> ConnId -> IO ()
- deleteNtfSubscription' :: Connection -> ConnId -> IO ()
- getNextNtfSubNTFActions :: Connection -> NtfServer -> Int -> IO (Either StoreError [Either StoreError (NtfSubNTFAction, NtfSubscription, NtfActionTs)])
- markNtfSubActionNtfFailed_ :: Connection -> ConnId -> IO ()
- getNextNtfSubSMPActions :: Connection -> SMPServer -> Int -> IO (Either StoreError [Either StoreError (NtfSubSMPAction, NtfSubscription)])
- markNtfSubActionSMPFailed_ :: Connection -> ConnId -> IO ()
- getActiveNtfToken :: Connection -> IO (Maybe NtfToken)
- getNtfRcvQueue :: Connection -> SMPQueueNtf -> IO (Either StoreError (ConnId, Int64, RcvNtfDhSecret, Maybe UTCTime))
- setConnectionNtfs :: Connection -> ConnId -> Bool -> IO ()
- createRcvFile :: Connection -> TVar ChaChaDRG -> UserId -> FileDescription 'FRecipient -> FilePath -> FilePath -> CryptoFile -> Bool -> IO (Either StoreError RcvFileId)
- createRcvFileRedirect :: Connection -> TVar ChaChaDRG -> UserId -> FileDescription 'FRecipient -> FilePath -> FilePath -> CryptoFile -> FilePath -> CryptoFile -> Bool -> IO (Either StoreError RcvFileId)
- lockRcvFileForUpdate :: Connection -> DBRcvFileId -> IO ()
- getRcvFile :: Connection -> DBRcvFileId -> IO (Either StoreError RcvFile)
- getRcvFileByEntityId :: Connection -> RcvFileId -> IO (Either StoreError RcvFile)
- getRcvFileRedirects :: Connection -> DBRcvFileId -> IO [RcvFile]
- updateRcvChunkReplicaDelay :: Connection -> Int64 -> Int64 -> IO ()
- updateRcvFileChunkReceived :: Connection -> Int64 -> Int64 -> FilePath -> IO ()
- updateRcvFileStatus :: Connection -> DBRcvFileId -> RcvFileStatus -> IO ()
- updateRcvFileError :: Connection -> DBRcvFileId -> String -> IO ()
- updateRcvFileComplete :: Connection -> DBRcvFileId -> IO ()
- updateRcvFileRedirect :: Connection -> DBRcvFileId -> FileDescription 'FRecipient -> IO (Either StoreError ())
- updateRcvFileNoTmpPath :: Connection -> DBRcvFileId -> IO ()
- updateRcvFileDeleted :: Connection -> DBRcvFileId -> IO ()
- deleteRcvFile' :: Connection -> DBRcvFileId -> IO ()
- getNextRcvChunkToDownload :: Connection -> XFTPServer -> NominalDiffTime -> IO (Either StoreError (Maybe (RcvFileChunk, Bool, Maybe RcvFileId)))
- getNextRcvFileToDecrypt :: Connection -> NominalDiffTime -> IO (Either StoreError (Maybe RcvFile))
- getPendingRcvFilesServers :: Connection -> NominalDiffTime -> IO [XFTPServer]
- getCleanupRcvFilesTmpPaths :: Connection -> IO [(DBRcvFileId, RcvFileId, FilePath)]
- getCleanupRcvFilesDeleted :: Connection -> IO [(DBRcvFileId, RcvFileId, FilePath)]
- getRcvFilesExpired :: Connection -> NominalDiffTime -> IO [(DBRcvFileId, RcvFileId, FilePath)]
- createSndFile :: Connection -> TVar ChaChaDRG -> UserId -> CryptoFile -> Int -> FilePath -> SbKey -> CbNonce -> Maybe RedirectFileInfo -> IO (Either StoreError SndFileId)
- lockSndFileForUpdate :: Connection -> DBSndFileId -> IO ()
- getSndFile :: Connection -> DBSndFileId -> IO (Either StoreError SndFile)
- getSndFileByEntityId :: Connection -> SndFileId -> IO (Either StoreError SndFile)
- getNextSndFileToPrepare :: Connection -> NominalDiffTime -> IO (Either StoreError (Maybe SndFile))
- updateSndFileError :: Connection -> DBSndFileId -> String -> IO ()
- updateSndFileStatus :: Connection -> DBSndFileId -> SndFileStatus -> IO ()
- updateSndFileEncrypted :: Connection -> DBSndFileId -> FileDigest -> [(XFTPChunkSpec, FileDigest)] -> IO ()
- updateSndFileComplete :: Connection -> DBSndFileId -> IO ()
- updateSndFileNoPrefixPath :: Connection -> DBSndFileId -> IO ()
- updateSndFileDeleted :: Connection -> DBSndFileId -> IO ()
- deleteSndFile' :: Connection -> DBSndFileId -> IO ()
- getSndFileDeleted :: Connection -> DBSndFileId -> IO Bool
- createSndFileReplica :: Connection -> SndFileChunk -> NewSndChunkReplica -> IO ()
- createSndFileReplica_ :: Connection -> Int64 -> NewSndChunkReplica -> IO ()
- getNextSndChunkToUpload :: Connection -> XFTPServer -> NominalDiffTime -> IO (Either StoreError (Maybe SndFileChunk))
- updateSndChunkReplicaDelay :: Connection -> Int64 -> Int64 -> IO ()
- addSndChunkReplicaRecipients :: Connection -> SndFileChunkReplica -> [(ChunkReplicaId, APrivateAuthKey)] -> IO SndFileChunkReplica
- updateSndChunkReplicaStatus :: Connection -> Int64 -> SndFileReplicaStatus -> IO ()
- getPendingSndFilesServers :: Connection -> NominalDiffTime -> IO [XFTPServer]
- getCleanupSndFilesPrefixPaths :: Connection -> IO [(DBSndFileId, SndFileId, FilePath)]
- getCleanupSndFilesDeleted :: Connection -> IO [(DBSndFileId, SndFileId, Maybe FilePath)]
- getSndFilesExpired :: Connection -> NominalDiffTime -> IO [(DBSndFileId, SndFileId, Maybe FilePath)]
- createDeletedSndChunkReplica :: Connection -> UserId -> FileChunkReplica -> FileDigest -> IO ()
- getNextDeletedSndChunkReplica :: Connection -> XFTPServer -> NominalDiffTime -> IO (Either StoreError (Maybe DeletedSndChunkReplica))
- updateDeletedSndChunkReplicaDelay :: Connection -> Int64 -> Int64 -> IO ()
- deleteDeletedSndChunkReplica :: Connection -> Int64 -> IO ()
- getPendingDelFilesServers :: Connection -> NominalDiffTime -> IO [XFTPServer]
- deleteDeletedSndChunkReplicasExpired :: Connection -> NominalDiffTime -> IO ()
- updateServersStats :: Connection -> AgentPersistedServerStats -> IO ()
- getServersStats :: Connection -> IO (Either StoreError (UTCTime, Maybe AgentPersistedServerStats))
- resetServersStats :: Connection -> UTCTime -> IO ()
- withConnection :: DBStore -> (Connection -> IO a) -> IO a
- withTransaction :: DBStore -> (Connection -> IO a) -> IO a
- withTransactionPriority :: DBStore -> Bool -> (Connection -> IO a) -> IO a
- firstRow :: (a -> b) -> e -> IO [a] -> IO (Either e b)
- firstRow' :: (a -> Either e b) -> e -> IO [a] -> IO (Either e b)
- maybeFirstRow :: Functor f => (a -> b) -> f [a] -> f (Maybe b)
- fromOnlyBI :: Only BoolInt -> Bool
- getWorkItem :: (Show i, AnyStoreError e) => String -> IO (Maybe i) -> (i -> IO (Either e a)) -> (i -> IO ()) -> IO (Either e (Maybe a))
- getWorkItems :: (Show i, AnyStoreError e) => String -> IO [i] -> (i -> IO (Either e a)) -> (i -> IO ()) -> IO (Either e [Either e a])
Users
createUserRecord :: Connection -> IO UserId Source #
getUserIds :: Connection -> IO [UserId] Source #
deleteUserRecord :: Connection -> UserId -> IO (Either StoreError ()) Source #
setUserDeleted :: Connection -> UserId -> IO (Either StoreError [ConnId]) Source #
deleteUserWithoutConns :: Connection -> UserId -> IO Bool Source #
deleteUsersWithoutConns :: Connection -> IO [Int64] Source #
checkUser :: Connection -> UserId -> IO (Either StoreError ()) Source #
Queues and connections
createServer :: Connection -> SMPServer -> IO (Maybe KeyHash) Source #
Creates a new server, if it doesn't exist, and returns the passed key hash if it is different from stored.
createNewConn :: Connection -> TVar ChaChaDRG -> ConnData -> SConnectionMode c -> IO (Either StoreError ConnId) Source #
updateNewConnRcv :: Connection -> ConnId -> NewRcvQueue -> SubscriptionMode -> IO (Either StoreError RcvQueue) Source #
updateNewConnSnd :: Connection -> ConnId -> NewSndQueue -> IO (Either StoreError SndQueue) Source #
createSndConn :: Connection -> TVar ChaChaDRG -> ConnData -> NewSndQueue -> IO (Either StoreError (ConnId, SndQueue)) Source #
getClientNotices :: Connection -> [SMPServer] -> IO (Map (Maybe SMPServer) (Maybe SystemSeconds)) Source #
updateClientNotices :: Connection -> SMPTransportSession -> SystemSeconds -> [(RcvQueueSub, Maybe ClientNotice)] -> IO [(RecipientId, Maybe NoticeId)] Source #
getSubscriptionServers :: Connection -> Bool -> IO [(UserId, SMPServer)] Source #
getUserServerRcvQueueSubs :: Connection -> UserId -> SMPServer -> Bool -> Int -> Maybe RecipientId -> IO [RcvQueueSub] Source #
unsetQueuesToSubscribe :: Connection -> IO () Source #
getConnIds :: Connection -> IO [ConnId] Source #
getConn :: Connection -> ConnId -> IO (Either StoreError SomeConn) Source #
getDeletedConn :: Connection -> ConnId -> IO (Either StoreError SomeConn) Source #
getConns :: Connection -> [ConnId] -> IO [Either StoreError SomeConn] Source #
getConnSubs :: Connection -> [ConnId] -> IO [Either StoreError SomeConnSub] Source #
getDeletedConns :: Connection -> [ConnId] -> IO [Either StoreError SomeConn] Source #
getConnsData :: Connection -> [ConnId] -> IO [Either StoreError (Maybe (ConnData, ConnectionMode))] Source #
lockConnForUpdate :: Connection -> ConnId -> IO () Source #
setConnDeleted :: Connection -> Bool -> ConnId -> IO () Source #
setConnUserId :: Connection -> UserId -> ConnId -> UserId -> IO () Source #
setConnAgentVersion :: Connection -> ConnId -> VersionSMPA -> IO () Source #
setConnPQSupport :: Connection -> ConnId -> PQSupport -> IO () Source #
updateNewConnJoin :: Connection -> ConnId -> VersionSMPA -> PQSupport -> Bool -> IO () Source #
getDeletedConnIds :: Connection -> IO [ConnId] Source #
getDeletedWaitingDeliveryConnIds :: Connection -> IO [ConnId] Source #
setConnRatchetSync :: Connection -> ConnId -> RatchetSyncState -> IO () Source #
addProcessedRatchetKeyHash :: Connection -> ConnId -> ByteString -> IO () Source #
checkRatchetKeyHashExists :: Connection -> ConnId -> ByteString -> IO Bool Source #
deleteRatchetKeyHashesExpired :: Connection -> NominalDiffTime -> Int -> IO () Source #
getRcvConn :: Connection -> SMPServer -> RecipientId -> IO (Either StoreError (RcvQueue, SomeConn)) Source #
getRcvQueueById :: Connection -> ConnId -> Int64 -> IO (Either StoreError RcvQueue) Source #
getSndQueueById :: Connection -> ConnId -> Int64 -> IO (Either StoreError SndQueue) Source #
deleteConn :: Connection -> Maybe NominalDiffTime -> ConnId -> IO (Maybe ConnId) Source #
Deletes connection, optionally checking for pending snd message deliveries; returns connection id if it was deleted
deleteConnRecord :: Connection -> ConnId -> IO () Source #
upgradeRcvConnToDuplex :: Connection -> ConnId -> NewSndQueue -> IO (Either StoreError SndQueue) Source #
upgradeSndConnToDuplex :: Connection -> ConnId -> NewRcvQueue -> SubscriptionMode -> IO (Either StoreError RcvQueue) Source #
addConnRcvQueue :: Connection -> ConnId -> NewRcvQueue -> SubscriptionMode -> IO (Either StoreError RcvQueue) Source #
addConnSndQueue :: Connection -> ConnId -> NewSndQueue -> IO (Either StoreError SndQueue) Source #
setRcvQueueStatus :: Connection -> RcvQueue -> QueueStatus -> IO () Source #
setRcvSwitchStatus :: Connection -> RcvQueue -> Maybe RcvSwitchStatus -> IO RcvQueue Source #
setRcvQueueDeleted :: Connection -> RcvQueue -> IO () Source #
setRcvQueueConfirmedE2E :: Connection -> RcvQueue -> DhSecretX25519 -> VersionSMPC -> IO () Source #
setSndQueueStatus :: Connection -> SndQueue -> QueueStatus -> IO () Source #
setSndSwitchStatus :: Connection -> SndQueue -> Maybe SndSwitchStatus -> IO SndQueue Source #
setRcvQueuePrimary :: Connection -> ConnId -> RcvQueue -> IO () Source #
setSndQueuePrimary :: Connection -> ConnId -> SndQueue -> IO () Source #
deleteConnRcvQueue :: Connection -> RcvQueue -> IO () Source #
incRcvDeleteErrors :: Connection -> RcvQueue -> IO () Source #
deleteConnSndQueue :: Connection -> ConnId -> SndQueue -> IO () Source #
getPrimaryRcvQueue :: Connection -> ConnId -> IO (Either StoreError RcvQueue) Source #
getRcvQueue :: Connection -> ConnId -> SMPServer -> RecipientId -> IO (Either StoreError RcvQueue) Source #
getDeletedRcvQueue :: Connection -> ConnId -> SMPServer -> RecipientId -> IO (Either StoreError RcvQueue) Source #
setRcvQueueNtfCreds :: Connection -> ConnId -> Maybe ClientNtfCreds -> IO () Source #
createConfirmation :: Connection -> TVar ChaChaDRG -> NewConfirmation -> IO (Either StoreError ConfirmationId) Source #
acceptConfirmation :: Connection -> ConfirmationId -> ConnInfo -> IO (Either StoreError AcceptedConfirmation) Source #
getAcceptedConfirmation :: Connection -> ConnId -> IO (Either StoreError AcceptedConfirmation) Source #
removeConfirmations :: Connection -> ConnId -> IO () Source #
createInvitation :: Connection -> TVar ChaChaDRG -> NewInvitation -> IO (Either StoreError InvitationId) Source #
getInvitation :: Connection -> String -> InvitationId -> IO (Either StoreError Invitation) Source #
acceptInvitation :: Connection -> InvitationId -> ConnInfo -> IO () Source #
unacceptInvitation :: Connection -> InvitationId -> IO () Source #
deleteInvitation :: Connection -> InvitationId -> IO () Source #
getInvShortLink :: Connection -> SMPServer -> LinkId -> IO (Maybe InvShortLink) Source #
getInvShortLinkKeys :: Connection -> SMPServer -> SenderId -> IO (Maybe (LinkId, APrivateAuthKey)) Source #
deleteInvShortLink :: Connection -> SMPServer -> LinkId -> IO () Source #
createInvShortLink :: Connection -> InvShortLink -> IO () Source #
setInvShortLinkSndId :: Connection -> InvShortLink -> SenderId -> IO () Source #
updateShortLinkCreds :: Connection -> RcvQueue -> ShortLinkCreds -> IO () Source #
updateRcvIds :: Connection -> ConnId -> IO (InternalId, InternalRcvId, PrevExternalSndId, PrevRcvMsgHash) Source #
createRcvMsg :: Connection -> ConnId -> RcvQueue -> RcvMsgData -> IO () Source #
setLastBrokerTs :: Connection -> ConnId -> DBEntityId -> UTCTime -> IO () Source #
updateRcvMsgHash :: Connection -> ConnId -> AgentMsgId -> InternalRcvId -> MsgHash -> IO () Source #
createSndMsgBody :: Connection -> AMessage -> IO Int64 Source #
updateSndIds :: Connection -> ConnId -> IO (Either StoreError (InternalId, InternalSndId, PrevSndMsgHash)) Source #
createSndMsg :: Connection -> ConnId -> SndMsgData -> IO () Source #
updateSndMsgHash :: Connection -> ConnId -> InternalSndId -> MsgHash -> IO () Source #
createSndMsgDelivery :: Connection -> SndQueue -> InternalId -> IO () Source #
getSndMsgViaRcpt :: Connection -> ConnId -> InternalSndId -> IO (Either StoreError SndMsg) Source #
updateSndMsgRcpt :: Connection -> ConnId -> InternalSndId -> MsgReceipt -> IO () Source #
getPendingQueueMsg :: Connection -> ConnId -> SndQueue -> IO (Either StoreError (Maybe (Maybe RcvQueue, PendingMsgData))) Source #
getConnectionsForDelivery :: Connection -> IO [ConnId] Source #
getAllSndQueuesForDelivery :: Connection -> IO [SndQueue] Source #
updatePendingMsgRIState :: Connection -> ConnId -> InternalId -> RI2State -> IO () Source #
deletePendingMsgs :: Connection -> ConnId -> SndQueue -> IO () Source #
getExpiredSndMessages :: Connection -> ConnId -> SndQueue -> UTCTime -> IO [InternalId] Source #
setMsgUserAck :: Connection -> ConnId -> InternalId -> IO (Either StoreError (RcvQueue, MsgId)) Source #
getRcvMsg :: Connection -> ConnId -> InternalId -> IO (Either StoreError RcvMsg) Source #
getLastMsg :: Connection -> ConnId -> MsgId -> IO (Maybe RcvMsg) Source #
incMsgRcvAttempts :: Connection -> ConnId -> InternalId -> IO Int Source #
checkRcvMsgHashExists :: Connection -> ConnId -> ByteString -> IO Bool Source #
getRcvMsgBrokerTs :: Connection -> ConnId -> MsgId -> IO (Either StoreError BrokerTs) Source #
deleteMsg :: Connection -> ConnId -> InternalId -> IO () Source #
deleteDeliveredSndMsg :: Connection -> ConnId -> InternalId -> IO () Source #
deleteSndMsgDelivery :: Connection -> ConnId -> SndQueue -> InternalId -> Bool -> IO () Source #
deleteRcvMsgHashesExpired :: Connection -> NominalDiffTime -> Int -> IO () Source #
deleteSndMsgsExpired :: Connection -> NominalDiffTime -> Int -> IO () Source #
createRatchetX3dhKeys :: Connection -> ConnId -> PrivateKeyX448 -> PrivateKeyX448 -> Maybe RcvPrivRKEMParams -> IO () Source #
getRatchetX3dhKeys :: Connection -> ConnId -> IO (Either StoreError (PrivateKeyX448, PrivateKeyX448, Maybe RcvPrivRKEMParams)) Source #
setRatchetX3dhKeys :: Connection -> ConnId -> PrivateKeyX448 -> PrivateKeyX448 -> Maybe RcvPrivRKEMParams -> IO () Source #
createSndRatchet :: Connection -> ConnId -> RatchetX448 -> AE2ERatchetParams 'X448 -> IO () Source #
getSndRatchet :: Connection -> ConnId -> VersionE2E -> IO (Either StoreError (RatchetX448, AE2ERatchetParams 'X448)) Source #
createRatchet :: Connection -> ConnId -> RatchetX448 -> IO () Source #
deleteRatchet :: Connection -> ConnId -> IO () Source #
getRatchet :: Connection -> ConnId -> IO (Either StoreError RatchetX448) Source #
getRatchetForUpdate :: Connection -> ConnId -> IO (Either StoreError RatchetX448) Source #
getSkippedMsgKeys :: Connection -> ConnId -> IO SkippedMsgKeys Source #
updateRatchet :: Connection -> ConnId -> RatchetX448 -> SkippedMsgDiff -> IO () Source #
createCommand :: Connection -> ACorrId -> ConnId -> Maybe SMPServer -> AgentCommand -> IO (Either StoreError ()) Source #
getPendingCommandServers :: Connection -> [ConnId] -> IO [(ConnId, NonEmpty (Maybe SMPServer))] Source #
getAllPendingCommandConns :: Connection -> IO [(ConnId, Maybe SMPServer)] Source #
getPendingServerCommand :: Connection -> ConnId -> Maybe SMPServer -> IO (Either StoreError (Maybe PendingCommand)) Source #
updateCommandServer :: Connection -> AsyncCmdId -> SMPServer -> IO (Either StoreError ()) Source #
deleteCommand :: Connection -> AsyncCmdId -> IO () Source #
createNtfToken :: Connection -> NtfToken -> IO () Source #
getSavedNtfToken :: Connection -> IO (Maybe NtfToken) Source #
updateNtfTokenRegistration :: Connection -> NtfToken -> NtfTokenId -> DhSecretX25519 -> IO () Source #
updateDeviceToken :: Connection -> NtfToken -> DeviceToken -> IO () Source #
updateNtfMode :: Connection -> NtfToken -> NotificationsMode -> IO () Source #
updateNtfToken :: Connection -> NtfToken -> NtfTknStatus -> Maybe NtfTknAction -> IO () Source #
removeNtfToken :: Connection -> NtfToken -> IO () Source #
addNtfTokenToDelete :: Connection -> NtfServer -> APrivateAuthKey -> NtfTokenId -> IO () Source #
deleteExpiredNtfTokensToDelete :: Connection -> NominalDiffTime -> IO () Source #
type NtfTokenToDelete = (Int64, APrivateAuthKey, NtfTokenId) Source #
getNextNtfTokenToDelete :: Connection -> NtfServer -> IO (Either StoreError (Maybe NtfTokenToDelete)) Source #
markNtfTokenToDeleteFailed_ :: Connection -> Int64 -> IO () Source #
getPendingDelTknServers :: Connection -> IO [NtfServer] Source #
deleteNtfTokenToDelete :: Connection -> Int64 -> IO () Source #
type NtfSupervisorSub = (NtfSubscription, Maybe (NtfSubAction, NtfActionTs)) Source #
getNtfSubscription :: Connection -> ConnId -> IO (Maybe NtfSupervisorSub) Source #
createNtfSubscription :: Connection -> NtfSubscription -> NtfSubAction -> IO (Either StoreError ()) Source #
supervisorUpdateNtfSub :: Connection -> NtfSubscription -> NtfSubAction -> IO () Source #
supervisorUpdateNtfAction :: Connection -> ConnId -> NtfSubAction -> IO () Source #
updateNtfSubscription :: Connection -> NtfSubscription -> NtfSubAction -> NtfActionTs -> IO () Source #
setNullNtfSubscriptionAction :: Connection -> ConnId -> IO () Source #
deleteNtfSubscription :: Connection -> ConnId -> IO () Source #
deleteNtfSubscription' :: Connection -> ConnId -> IO () Source #
getNextNtfSubNTFActions :: Connection -> NtfServer -> Int -> IO (Either StoreError [Either StoreError (NtfSubNTFAction, NtfSubscription, NtfActionTs)]) Source #
markNtfSubActionNtfFailed_ :: Connection -> ConnId -> IO () Source #
getNextNtfSubSMPActions :: Connection -> SMPServer -> Int -> IO (Either StoreError [Either StoreError (NtfSubSMPAction, NtfSubscription)]) Source #
markNtfSubActionSMPFailed_ :: Connection -> ConnId -> IO () Source #
getActiveNtfToken :: Connection -> IO (Maybe NtfToken) Source #
getNtfRcvQueue :: Connection -> SMPQueueNtf -> IO (Either StoreError (ConnId, Int64, RcvNtfDhSecret, Maybe UTCTime)) Source #
setConnectionNtfs :: Connection -> ConnId -> Bool -> IO () Source #
File transfer
createRcvFile :: Connection -> TVar ChaChaDRG -> UserId -> FileDescription 'FRecipient -> FilePath -> FilePath -> CryptoFile -> Bool -> IO (Either StoreError RcvFileId) Source #
createRcvFileRedirect :: Connection -> TVar ChaChaDRG -> UserId -> FileDescription 'FRecipient -> FilePath -> FilePath -> CryptoFile -> FilePath -> CryptoFile -> Bool -> IO (Either StoreError RcvFileId) Source #
lockRcvFileForUpdate :: Connection -> DBRcvFileId -> IO () Source #
getRcvFile :: Connection -> DBRcvFileId -> IO (Either StoreError RcvFile) Source #
getRcvFileByEntityId :: Connection -> RcvFileId -> IO (Either StoreError RcvFile) Source #
getRcvFileRedirects :: Connection -> DBRcvFileId -> IO [RcvFile] Source #
updateRcvChunkReplicaDelay :: Connection -> Int64 -> Int64 -> IO () Source #
updateRcvFileChunkReceived :: Connection -> Int64 -> Int64 -> FilePath -> IO () Source #
updateRcvFileStatus :: Connection -> DBRcvFileId -> RcvFileStatus -> IO () Source #
updateRcvFileError :: Connection -> DBRcvFileId -> String -> IO () Source #
updateRcvFileComplete :: Connection -> DBRcvFileId -> IO () Source #
updateRcvFileRedirect :: Connection -> DBRcvFileId -> FileDescription 'FRecipient -> IO (Either StoreError ()) Source #
updateRcvFileNoTmpPath :: Connection -> DBRcvFileId -> IO () Source #
updateRcvFileDeleted :: Connection -> DBRcvFileId -> IO () Source #
deleteRcvFile' :: Connection -> DBRcvFileId -> IO () Source #
getNextRcvChunkToDownload :: Connection -> XFTPServer -> NominalDiffTime -> IO (Either StoreError (Maybe (RcvFileChunk, Bool, Maybe RcvFileId))) Source #
getNextRcvFileToDecrypt :: Connection -> NominalDiffTime -> IO (Either StoreError (Maybe RcvFile)) Source #
getPendingRcvFilesServers :: Connection -> NominalDiffTime -> IO [XFTPServer] Source #
getCleanupRcvFilesTmpPaths :: Connection -> IO [(DBRcvFileId, RcvFileId, FilePath)] Source #
getCleanupRcvFilesDeleted :: Connection -> IO [(DBRcvFileId, RcvFileId, FilePath)] Source #
getRcvFilesExpired :: Connection -> NominalDiffTime -> IO [(DBRcvFileId, RcvFileId, FilePath)] Source #
createSndFile :: Connection -> TVar ChaChaDRG -> UserId -> CryptoFile -> Int -> FilePath -> SbKey -> CbNonce -> Maybe RedirectFileInfo -> IO (Either StoreError SndFileId) Source #
lockSndFileForUpdate :: Connection -> DBSndFileId -> IO () Source #
getSndFile :: Connection -> DBSndFileId -> IO (Either StoreError SndFile) Source #
getSndFileByEntityId :: Connection -> SndFileId -> IO (Either StoreError SndFile) Source #
getNextSndFileToPrepare :: Connection -> NominalDiffTime -> IO (Either StoreError (Maybe SndFile)) Source #
updateSndFileError :: Connection -> DBSndFileId -> String -> IO () Source #
updateSndFileStatus :: Connection -> DBSndFileId -> SndFileStatus -> IO () Source #
updateSndFileEncrypted :: Connection -> DBSndFileId -> FileDigest -> [(XFTPChunkSpec, FileDigest)] -> IO () Source #
updateSndFileComplete :: Connection -> DBSndFileId -> IO () Source #
updateSndFileNoPrefixPath :: Connection -> DBSndFileId -> IO () Source #
updateSndFileDeleted :: Connection -> DBSndFileId -> IO () Source #
deleteSndFile' :: Connection -> DBSndFileId -> IO () Source #
getSndFileDeleted :: Connection -> DBSndFileId -> IO Bool Source #
createSndFileReplica :: Connection -> SndFileChunk -> NewSndChunkReplica -> IO () Source #
createSndFileReplica_ :: Connection -> Int64 -> NewSndChunkReplica -> IO () Source #
getNextSndChunkToUpload :: Connection -> XFTPServer -> NominalDiffTime -> IO (Either StoreError (Maybe SndFileChunk)) Source #
updateSndChunkReplicaDelay :: Connection -> Int64 -> Int64 -> IO () Source #
addSndChunkReplicaRecipients :: Connection -> SndFileChunkReplica -> [(ChunkReplicaId, APrivateAuthKey)] -> IO SndFileChunkReplica Source #
updateSndChunkReplicaStatus :: Connection -> Int64 -> SndFileReplicaStatus -> IO () Source #
getPendingSndFilesServers :: Connection -> NominalDiffTime -> IO [XFTPServer] Source #
getCleanupSndFilesPrefixPaths :: Connection -> IO [(DBSndFileId, SndFileId, FilePath)] Source #
getCleanupSndFilesDeleted :: Connection -> IO [(DBSndFileId, SndFileId, Maybe FilePath)] Source #
getSndFilesExpired :: Connection -> NominalDiffTime -> IO [(DBSndFileId, SndFileId, Maybe FilePath)] Source #
createDeletedSndChunkReplica :: Connection -> UserId -> FileChunkReplica -> FileDigest -> IO () Source #
getNextDeletedSndChunkReplica :: Connection -> XFTPServer -> NominalDiffTime -> IO (Either StoreError (Maybe DeletedSndChunkReplica)) Source #
updateDeletedSndChunkReplicaDelay :: Connection -> Int64 -> Int64 -> IO () Source #
deleteDeletedSndChunkReplica :: Connection -> Int64 -> IO () Source #
getPendingDelFilesServers :: Connection -> NominalDiffTime -> IO [XFTPServer] Source #
deleteDeletedSndChunkReplicasExpired :: Connection -> NominalDiffTime -> IO () Source #
updateServersStats :: Connection -> AgentPersistedServerStats -> IO () Source #
getServersStats :: Connection -> IO (Either StoreError (UTCTime, Maybe AgentPersistedServerStats)) Source #
resetServersStats :: Connection -> UTCTime -> IO () Source #
utilities
withConnection :: DBStore -> (Connection -> IO a) -> IO a Source #
withTransaction :: DBStore -> (Connection -> IO a) -> IO a Source #
withTransactionPriority :: DBStore -> Bool -> (Connection -> IO a) -> IO a Source #
maybeFirstRow :: Functor f => (a -> b) -> f [a] -> f (Maybe b) Source #
fromOnlyBI :: Only BoolInt -> Bool Source #
getWorkItem :: (Show i, AnyStoreError e) => String -> IO (Maybe i) -> (i -> IO (Either e a)) -> (i -> IO ()) -> IO (Either e (Maybe a)) Source #
getWorkItems :: (Show i, AnyStoreError e) => String -> IO [i] -> (i -> IO (Either e a)) -> (i -> IO ()) -> IO (Either e [Either e a]) Source #