mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-23 00:18:27 +00:00
Merge branch 'master' into names
This commit is contained in:
commit
0465fd649a
654 files changed
+24588
-119924
No files matched your search
@@ -127,6 +127,8 @@ chatCommandsDocsData =
|
||||
("APIRemoveMembers", [], "Remove members. Requires Admin role.", ["CRUserDeletedMembers", "CRChatCmdError"], ["CEGroupMemberNotFound"], Just UNBackground, "/_remove #" <> Param "groupId" <> " " <> Join ',' "groupMemberIds" <> OnOffParam "messages" "withMessages" (Just False)),
|
||||
("APILeaveGroup", [], "Leave group.", ["CRLeftMemberUser", "CRChatCmdError"], [], Just UNBackground, "/_leave #" <> Param "groupId"),
|
||||
("APIListMembers", [], "Get group members.", ["CRGroupMembers", "CRChatCmdError"], [], Nothing, "/_members #" <> Param "groupId"),
|
||||
("APICreateMemberContact", [], "Create a direct message contact with a group member.", ["CRNewMemberContact", "CRChatCmdError"], [TD "CEGroupMemberNotActive" "Member is not connected yet", TD "CEPeerChatVRangeIncompatible" "Member's client version is older than required"], Just UNInteractive, "/_create member contact #" <> Param "groupId" <> " " <> Param "groupMemberId"),
|
||||
("APISendMemberContactInvitation", [], "Send a direct message invitation to a group member contact.", ["CRNewMemberContactSentInv", "CRChatCmdError"], [TD "CEGroupMemberNotActive" "Member is not connected yet"], Just UNBackground, "/_invite member contact @" <> Param "contactId" <> Optional "" (" json " <> Json "$0") "msgContent_"),
|
||||
("APINewGroup", [], "Create group.", ["CRGroupCreated", "CRChatCmdError"], [], Nothing, "/_group " <> Param "userId" <> OnOffParam "incognito" "incognito" (Just False) <> " " <> Json "groupProfile"),
|
||||
("APINewPublicGroup", [], "Create public group.", ["CRPublicGroupCreated", "CRPublicGroupCreationFailed", "CRChatCmdError"], [], Just UNInteractive, "/_public group " <> Param "userId" <> OnOffParam "incognito" "incognito" (Just False) <> " " <> Join ',' "relayIds" <> " " <> Json "groupProfile"),
|
||||
("APIGetGroupRelays", [], "Get group relays.", ["CRGroupRelays", "CRChatCmdError"], [], Nothing, "/_get relays #" <> Param "groupId"),
|
||||
@@ -148,9 +150,14 @@ chatCommandsDocsData =
|
||||
"These commands may be used to create connections. Most bots do not need to use them - bot users will connect via bot address with auto-accept enabled.",
|
||||
[ ("APIAddContact", [], "Create 1-time invitation link.", ["CRInvitation", "CRChatCmdError"], [], Just UNInteractive, "/_connect " <> Param "userId" <> OnOffParam "incognito" "incognito" (Just False)),
|
||||
-- `Maybe` in `connectTarget :: Maybe ConnectTarget` is used to signal parse failure to the runtime (the handler returns CEInvalidConnReq on Nothing); it is NOT API-level optionality. The parameter is required from callers.
|
||||
("APIConnectPlan", [], "Determine SimpleX link type and if the bot is already connected via this link or name.", ["CRConnectionPlan", "CRChatCmdError"], [], Just UNInteractive, "/_connect plan " <> Param "userId" <> " " <> Param "connectTarget"),
|
||||
("APIConnectPlan", [], "Determine SimpleX link type and if the bot is already connected via this link or name.", ["CRConnectionPlan", "CRChatCmdError"], [], Just UNInteractive, "/_connect plan " <> Param "userId" <> " " <> Param "connectTarget" <> Param "resolveMode" <> Optional "" (" sig=" <> Json "$0") "linkOwnerSig"),
|
||||
("APIConnect", [], "Connect via prepared SimpleX link. The link can be 1-time invitation link, contact address or group link.", ["CRSentConfirmation", "CRContactAlreadyExists", "CRSentInvitation", "CRChatCmdError"], [], Just UNInteractive, "/_connect " <> Param "userId" <> OnOffParam "incognito" "incognito" (Just False) <> Optional "" (" " <> Param "$0") "preparedLink_"),
|
||||
("Connect", [], "Connect via SimpleX link or name as string in the active user profile.", ["CRSentConfirmation", "CRContactAlreadyExists", "CRSentInvitation", "CRConnectionPlan", "CRSentInvitationToContact", "CRStartedConnectionToContact", "CRStartedConnectionToGroup", "CRChatCmdError"], [], Just UNInteractive, "/connect" <> Optional "" (" " <> Param "$0") "connTarget_"),
|
||||
("APIPrepareContact", [], "Prepare contact chat from link data before connecting.", ["CRNewPreparedChat", "CRChatCmdError"], [], Nothing, "/_prepare contact " <> Param "userId" <> " " <> Param "connLink" <> Optional "" (" domain=" <> Param "$0") "verifiedDomain" <> " " <> Json "contactSLinkData"),
|
||||
("APIPrepareGroup", [], "Prepare group chat from link data before connecting.", ["CRNewPreparedChat", "CRChatCmdError"], [], Nothing, "/_prepare group " <> Param "userId" <> " " <> Param "connLinkContact" <> OnOffParam "direct" "direct" (Just True) <> Optional "" (" domain=" <> Param "$0") "verifiedDomain" <> " " <> Json "groupSLinkData"),
|
||||
("APIConnectPreparedContact", [], "Connect to prepared contact.", ["CRStartedConnectionToContact", "CRContactAlreadyExists", "CRChatCmdError"], [], Just UNInteractive, "/_connect contact @" <> Param "contactId" <> OnOffParam "incognito" "incognito" (Just False) <> Optional "" (" json " <> Json "$0") "msgContent_"),
|
||||
("APIConnectPreparedGroup", [], "Connect to prepared group.", ["CRStartedConnectionToGroup", "CRChatCmdError"], [], Just UNInteractive, "/_connect group #" <> Param "groupId" <> OnOffParam "incognito" "incognito" (Just False) <> Optional "" (" " <> Param "$0") "ownerContact" <> Optional "" (" json " <> Json "$0") "msgContent_"),
|
||||
("APIConnectContactViaAddress", [], "Connect to existing contact via address in its profile.", ["CRSentInvitationToContact", "CRChatCmdError"], [], Just UNInteractive, "/_connect contact " <> Param "userId" <> OnOffParam "incognito" "incognito" (Just False) <> " " <> Param "contactId"),
|
||||
("APIAcceptContact", ["incognito"], "Accept contact request.", ["CRAcceptingContactRequest", "CRChatCmdError"], [], Just UNInteractive, "/_accept " <> Param "contactReqId"),
|
||||
("APIRejectContact", [], "Reject contact request. The user who sent the request is **not notified**.", ["CRContactRequestRejected", "CRChatCmdError"], [], Nothing, "/_reject " <> Param "contactReqId")
|
||||
]
|
||||
@@ -160,17 +167,18 @@ chatCommandsDocsData =
|
||||
[ ("APIListContacts", [], "Get contacts.", ["CRContactsList", "CRChatCmdError"], [], Nothing, "/_contacts " <> Param "userId"),
|
||||
("APIListGroups", [], "Get groups.", ["CRGroupsList", "CRChatCmdError"], [], Nothing, "/_groups " <> Param "userId" <> Optional "" (" @" <> Param "$0") "contactId_" <> Optional "" (" " <> Param "$0") "search"),
|
||||
("APIGetChats", [], "Get chat previews. Supports time-based pagination — use this instead of APIListContacts / APIListGroups when scanning at scale (those load every record into memory and fail on large databases).", ["CRApiChats", "CRChatCmdError"], [], Nothing, "/_get chats " <> Param "userId" <> OnOffParam "pcc" "pendingConnections" (Just False) <> Optional "" (" " <> Param "$0") "pagination" <> " " <> Json "query"),
|
||||
("APIGetChat", [], "Get chat messages.", ["CRApiChat", "CRChatCmdError"], [], Nothing, "/_get chat " <> Param "chatRef" <> Optional "" (" content=" <> Param "$0") "contentTag" <> " " <> Param "chatPagination" <> Optional "" (" search=" <> Param "$0") "search"),
|
||||
("APIChatItemsRead", [], "Mark messages as read.", ["CRItemsReadForChat", "CRChatCmdError"], [], Nothing, "/_read chat items " <> Param "chatRef" <> " " <> Join ',' "chatItemIds"),
|
||||
("APIContactInfo", [], "Get contact information.", ["CRContactInfo", "CRChatCmdError"], [], Nothing, "/_info @" <> Param "contactId"),
|
||||
("APIGetChatItemInfo", [], "Get message information.", ["CRChatItemInfo", "CRChatCmdError"], [], Nothing, "/_get item info " <> Param "chatRef" <> " " <> Param "chatItemId"),
|
||||
("APIDeleteChat", [], "Delete chat.", ["CRContactDeleted", "CRContactConnectionDeleted", "CRGroupDeletedUser", "CRChatCmdError"], [], Just UNBackground, "/_delete " <> Param "chatRef" <> " " <> Param "chatDeleteMode"),
|
||||
("APISetGroupCustomData", [], "Set group custom data.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set custom #" <> Param "groupId" <> Optional "" (" " <> Json "$0") "customData"),
|
||||
("APISetContactCustomData", [], "Set contact custom data.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set custom @" <> Param "contactId" <> Optional "" (" " <> Json "$0") "customData"),
|
||||
("APISetUserAutoAcceptMemberContacts", [], "Set auto-accept member contacts.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set accept member contacts " <> Param "userId" <> " " <> OnOff "onOff"),
|
||||
("APISetUserAutoAcceptGroupInvitations", [], "Set auto-accept group invitations.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set accept group invitations " <> Param "userId" <> " " <> OnOff "onOff")
|
||||
-- ("APIChatItemsRead", [], "Mark items as read.", ["CRItemsReadForChat"], [], Nothing, ""),
|
||||
-- ("APIChatRead", [], "Mark chat as read.", ["CRCmdOk"], [], Nothing, ""),
|
||||
-- ("APIChatUnread", [], "Mark chat as unread.", ["CRCmdOk"], [], Nothing, ""),
|
||||
-- ("APIClearChat", [], "Clear chat.", ["CRChatCleared"], [], Nothing, ""),
|
||||
-- ("APIGetChat", [], "Get chat.", ["CRApiChat"], [], Nothing, ""),
|
||||
-- ("APIGetChatItemInfo", [], "Get message information.", ["CRChatItemInfo"], [], Nothing, ""),
|
||||
-- ("APIGetChatItems", [], "Get the most recent messages from all chats.", ["CRChatItems"], [], Nothing, ""),
|
||||
-- ("APIGetChats", [], "Get chats.", ["CRApiChats"], [], Nothing, ""),
|
||||
-- ("APISetChatSettings", [], "Set chat settings.", ["CRCmdOk"], [], Nothing, ""),
|
||||
@@ -209,7 +217,10 @@ chatCommandsDocsData =
|
||||
( "Chat management",
|
||||
"These commands should not be used with CLI-based bots",
|
||||
[ ("StartChat", [], "Start chat controller.", ["CRChatStarted", "CRChatRunning"], [], Nothing, "/_start" <> OnOffParam "main" "mainApp" Nothing <> OnOffParam "snd_files" "enableSndFiles" (Just True) <> OnOffParam "service_requests" "serviceRequests" (Just False)),
|
||||
("APIStopChat", [], "Stop chat controller.", ["CRChatStopped"], [], Nothing, "/_stop")
|
||||
("APIStopChat", [], "Stop chat controller.", ["CRChatStopped"], [], Nothing, "/_stop"),
|
||||
("APIGetNetworkConfig", [], "Get network configuration.", ["CRNetworkConfig", "CRChatCmdError"], [], Nothing, "/network"),
|
||||
("APISetNetworkConfig", [], "Set network configuration.", ["CRCmdOk", "CRChatCmdError"], [], Just UNBackground, "/_network " <> Json "networkConfig"),
|
||||
("APIGetUserServers", [], "Get user servers and chat relays, grouped by operator.", ["CRUserServers", "CRChatCmdError"], [], Nothing, "/_servers " <> Param "userId")
|
||||
]
|
||||
),
|
||||
( "Remote control commands",
|
||||
@@ -361,21 +372,14 @@ undocumentedCommands =
|
||||
"APIChangeConnectionUser",
|
||||
"APIChangePreparedContactUser",
|
||||
"APIChangePreparedGroupUser",
|
||||
"APIChatItemsRead",
|
||||
"APIChatRead",
|
||||
"APIChatUnread",
|
||||
"APICheckToken",
|
||||
"APIClearChat",
|
||||
"APIConnectContactViaAddress",
|
||||
"APIConnectPreparedContact",
|
||||
"APIConnectPreparedGroup",
|
||||
"APIContactInfo",
|
||||
"APIContactQueueInfo",
|
||||
"APICreateBadgeInvoice",
|
||||
"APICreateChatItems",
|
||||
"APICreateChatTag",
|
||||
"APICreateMemberContact",
|
||||
"APISendMemberContactInvitation",
|
||||
"APIAcceptMemberContact",
|
||||
"APICreateWallet",
|
||||
"APICreateWalletAccount",
|
||||
@@ -396,22 +400,18 @@ undocumentedCommands =
|
||||
"APIGetBadgeLedger",
|
||||
"APIGetBadgeState",
|
||||
"APIGetCallInvitations",
|
||||
"APIGetChat",
|
||||
"APIGetChatContentTypes",
|
||||
"APIGetChatItemInfo",
|
||||
"APIGetChatItems",
|
||||
"APIGetChatItemTTL",
|
||||
"APIGetChatTags",
|
||||
"APIGetConnNtfMessages",
|
||||
"APIGetContactCode",
|
||||
"APIGetGroupMemberCode",
|
||||
"APIGetNetworkConfig",
|
||||
"APIGetNtfConns",
|
||||
"APIGetNtfToken",
|
||||
"APIGetReactionMembers",
|
||||
"APIGetServerOperators",
|
||||
"APIGetUsageConditions",
|
||||
"APIGetUserServers",
|
||||
"APIGetWallet",
|
||||
"APIGroupInfo",
|
||||
"APIGetUpdatedGroupLinkData",
|
||||
@@ -421,8 +421,6 @@ undocumentedCommands =
|
||||
"APIImportArchive",
|
||||
"APIMuteUser",
|
||||
"APIPlanForwardChatItems",
|
||||
"APIPrepareContact",
|
||||
"APIPrepareGroup",
|
||||
"APIPurchaseBadge",
|
||||
"APIRedeemBadgeCode",
|
||||
"APIRegisterToken",
|
||||
@@ -451,7 +449,6 @@ undocumentedCommands =
|
||||
"APISetEncryptLocalFiles",
|
||||
"APISetGroupAlias",
|
||||
"APISetMemberSettings",
|
||||
"APISetNetworkConfig",
|
||||
"APISetNetworkInfo",
|
||||
"APISetPublicGroupAccess",
|
||||
"APISetServerOperators",
|
||||
|
||||
@@ -47,6 +47,8 @@ chatResponsesDocsData :: [(ConsName, String)]
|
||||
chatResponsesDocsData =
|
||||
[ ("CRAcceptingContactRequest", "Contact request accepted"),
|
||||
("CRActiveUser", "Active user profile"),
|
||||
("CRApiChat", "Chat and messages"),
|
||||
("CRChatItemInfo", "Message information"),
|
||||
("CRChatItemNotChanged", "Message not changed"),
|
||||
("CRChatItemReaction", "Message reaction"),
|
||||
("CRChatItemUpdated", "Message updated"),
|
||||
@@ -61,6 +63,7 @@ chatResponsesDocsData =
|
||||
("CRContactAlreadyExists", ""),
|
||||
("CRContactConnectionDeleted", "Connection deleted"),
|
||||
("CRContactDeleted", ""),
|
||||
("CRContactInfo", "Contact information"),
|
||||
("CRContactPrefsUpdated", "Contact preferences updated"),
|
||||
("CRContactRequestRejected", ""),
|
||||
("CRContactsList", "Contacts"),
|
||||
@@ -80,11 +83,16 @@ chatResponsesDocsData =
|
||||
("CRGroupsList", "Groups"),
|
||||
("CRGroupDomainVerified", ""),
|
||||
("CRInvitation", "One-time invitation"),
|
||||
("CRItemsReadForChat", "Messages marked as read"),
|
||||
("CRLeftMemberUser", "User left group"),
|
||||
("CRMemberAccepted", "Member accepted to group"),
|
||||
("CRMembersBlockedForAllUser", "Members blocked for all by admin"),
|
||||
("CRMembersRoleUser", "Members role changed by user"),
|
||||
("CRNetworkConfig", "Network configuration"),
|
||||
("CRNewChatItems", "New messages"),
|
||||
("CRNewMemberContact", "Member contact created"),
|
||||
("CRNewMemberContactSentInv", "Member contact invitation sent"),
|
||||
("CRNewPreparedChat", "Prepared chat"),
|
||||
("CRRcvFileAccepted", "File accepted to be received"),
|
||||
("CRRcvFileAcceptedSndCancelled", "File accepted, but no longer sent"),
|
||||
("CRRcvFileCancelled", "Cancelled receiving file"),
|
||||
@@ -107,18 +115,16 @@ chatResponsesDocsData =
|
||||
("CRUserDeletedMembers", "Members deleted"),
|
||||
("CRUserProfileUpdated", "User profile updated"),
|
||||
("CRUserProfileNoChange", "User profile was not changed"),
|
||||
("CRUserServers", "User servers and chat relays, grouped by operator"),
|
||||
("CRUsersList", "Users"),
|
||||
("CRApiChats", "Chat previews (paginated). Use this instead of CRContactsList / CRGroupsList when scanning at scale.")
|
||||
-- ("CRApiChat", "Chat and messages"),
|
||||
-- ("CRChatCleared", ""),
|
||||
-- ("CRChatItemInfo", "Message information"),
|
||||
-- ("CRChatItems", "The most recent messages"),
|
||||
-- ("CRConnectionAliasUpdated", ""),
|
||||
-- ("CRContactAliasUpdated", ""),
|
||||
-- ("CRContactRatchetSyncStarted", "Contact encryption synchronization started"),
|
||||
-- ("CRGroupAliasUpdated", ""),
|
||||
-- ("CRGroupMemberRatchetSyncStarted", "Member encryption synchronization started"),
|
||||
-- ("CRItemsReadForChat", "Messages marked as read"),
|
||||
-- ("CRReactionMembers", "Members who set reaction on the message"),
|
||||
]
|
||||
|
||||
@@ -131,7 +137,6 @@ undocumentedResponses =
|
||||
"CRAgentSubsTotal",
|
||||
"CRAgentWorkersDetails",
|
||||
"CRAgentWorkersSummary",
|
||||
"CRApiChat",
|
||||
"CRAppSettings",
|
||||
"CRArchiveExported",
|
||||
"CRArchiveImported",
|
||||
@@ -145,7 +150,6 @@ undocumentedResponses =
|
||||
"CRChatContentTypes",
|
||||
"CRChatHelp",
|
||||
"CRChatItemId",
|
||||
"CRChatItemInfo",
|
||||
"CRChatItems",
|
||||
"CRChatItemTTL",
|
||||
"CRChatRelayTestResult",
|
||||
@@ -159,7 +163,6 @@ undocumentedResponses =
|
||||
"CRConnNtfMessages",
|
||||
"CRContactAliasUpdated",
|
||||
"CRContactCode",
|
||||
"CRContactInfo",
|
||||
"CRContactDomainVerified",
|
||||
"CRContactRatchetSyncStarted",
|
||||
"CRContactSwitchAborted",
|
||||
@@ -182,16 +185,11 @@ undocumentedResponses =
|
||||
"CRGroupMemberSwitchStarted",
|
||||
"CRGroupProfile",
|
||||
"CRGroupUserChanged",
|
||||
"CRItemsReadForChat",
|
||||
"CRJoinedGroupMember",
|
||||
"CRMemberSupportChatRead",
|
||||
"CRMemberSupportChatDeleted",
|
||||
"CRMemberSupportChats",
|
||||
"CRNetworkConfig",
|
||||
"CRNewMemberContact",
|
||||
"CRNewMemberContactSentInv",
|
||||
"CRMemberContactAccepted",
|
||||
"CRNewPreparedChat",
|
||||
"CRNtfConns",
|
||||
"CRNtfToken",
|
||||
"CRNtfTokenStatus",
|
||||
@@ -215,7 +213,6 @@ undocumentedResponses =
|
||||
"CRUserPrivacy",
|
||||
"CRUserProfile",
|
||||
"CRUserProfileImage",
|
||||
"CRUserServers",
|
||||
"CRUserServersValidation",
|
||||
"CRVersionInfo",
|
||||
"CRWallet",
|
||||
|
||||
+69
-28
@@ -16,7 +16,7 @@ module API.Docs.Types where
|
||||
import API.Docs.Syntax.Types
|
||||
import API.TypeInfo
|
||||
import Data.Bifunctor (second)
|
||||
import Data.Char (isUpper, toLower, toUpper)
|
||||
import Data.Char (isLower, isUpper, toLower, toUpper)
|
||||
import Data.List (find, mapAccumL, sortOn)
|
||||
import qualified Data.List.NonEmpty as L
|
||||
import qualified Data.Map.Strict as M
|
||||
@@ -43,13 +43,15 @@ import Simplex.Chat.Types.Shared
|
||||
import Simplex.Chat.Types.UITheme
|
||||
import Simplex.FileTransfer.Transport
|
||||
import Simplex.FileTransfer.Types hiding (RcvFileStatus) -- the type with the same name is used in simplex-chat.
|
||||
import Simplex.Messaging.Agent.Env.SQLite (ServerRoles (..))
|
||||
import Simplex.Messaging.Agent.Protocol
|
||||
import Simplex.Messaging.Client
|
||||
import Simplex.Messaging.Crypto.File
|
||||
import Simplex.Messaging.Parsers (dropPrefix, fstToLower)
|
||||
import Simplex.Messaging.Protocol (BlockingInfo (..), BlockingReason (..), CommandError (..), ErrorType (..), NameErrorType (..), NetworkError (..), ProxyError (..))
|
||||
import Simplex.Messaging.Protocol (BlockingInfo (..), BlockingReason (..), CommandError (..), ErrorType (..), NameErrorType (..), NetworkError (..), ProtocolType (..), ProxyError (..))
|
||||
import Simplex.Messaging.Protocol.Types (ClientNotice (..))
|
||||
import Simplex.Messaging.Transport
|
||||
import Simplex.Messaging.Transport.KeepAlive (KeepAliveOpts (..))
|
||||
import Simplex.Chat.Remote.Types (CtrlAppInfo (..))
|
||||
import Simplex.RemoteControl.Types
|
||||
import System.Console.ANSI.Types (Color (..))
|
||||
@@ -160,6 +162,9 @@ consLower pfx = map toLower . dropPrefix pfx
|
||||
consSep :: String -> Char -> ConsName -> String
|
||||
consSep pfx sep = foldr (\c s -> if isUpper c then sep : toLower c : s else c : s) "" . dropPrefix pfx
|
||||
|
||||
consSnake :: String -> ConsName -> String
|
||||
consSnake pfx = snd . foldr (\c (upper, s) -> (isUpper c, if isLower c && upper then c : '_' : s else toLower c : s)) (False, "") . dropPrefix pfx
|
||||
|
||||
dropSuffix :: String -> String -> String
|
||||
dropSuffix sfx s =
|
||||
let (s', sfx') = splitAt (length s - length sfx) s
|
||||
@@ -260,6 +265,7 @@ chatTypesDocsData =
|
||||
(sti @CommandErrorType, STUnion, "", [], "", ""),
|
||||
(sti @CommentsGroupPreference, STRecord, "", [], "", ""),
|
||||
(sti @ComposedMessage, STRecord, "", [], "", ""),
|
||||
(sti @ConditionsAcceptance, STUnion, "CA", [], "", ""),
|
||||
(sti @Connection, STRecord, "", [], "", ""),
|
||||
(sti @ConnectionEntity, STUnion, "", [], "", ""),
|
||||
(sti @ConnectionErrorType, STUnion, "", [], "", ""),
|
||||
@@ -308,6 +314,7 @@ chatTypesDocsData =
|
||||
(sti @GroupMemberRole, STEnum' (dropPfxSfx "GR" ""), "", ["GRUnknown"], "", ""),
|
||||
(sti @GroupMemberSettings, STRecord, "", [], "", ""),
|
||||
(sti @GroupMemberStatus, STEnum' ((\case "group_deleted" -> "deleted"; "intro_invited" -> "intro-inv"; s -> s) . consSep "GSMem" '_'), "", [], "", ""),
|
||||
(sti @GroupOwnerContact, STRecord, "", [], "contact=" <> Param "contactId" <> " owner=" <> Param "memberId", ""),
|
||||
(sti @GroupPreference, STRecord, "", [], "", ""),
|
||||
(removeField "_json" $ sti @GroupPreferences, STRecord, "", [], "", ""),
|
||||
(sti @GroupProfile, STRecord, "", [], "", ""),
|
||||
@@ -318,9 +325,11 @@ chatTypesDocsData =
|
||||
(sti @GroupSupportChat, STRecord, "", [], "", ""),
|
||||
(sti @GroupType, STEnum, "GT", ["GTUnknown"], "", ""),
|
||||
(sti @HandshakeError, STEnum, "", [], "", ""),
|
||||
(sti @HostMode, STEnum, "HM", [], "", ""),
|
||||
(sti @InlineFileMode, STEnum, "IFM", [], "", ""),
|
||||
(sti @InvitationLinkPlan, STUnion, "ILP", [], "", ""),
|
||||
(sti @InvitedBy, STUnion, "IB", [], "", ""),
|
||||
(sti @KeepAliveOpts, STRecord, "", [], "", ""),
|
||||
(sti @LinkContent, STUnion, "LC", [], "", ""),
|
||||
(sti @LinkOwnerSig, STRecord, "", [], "", ""),
|
||||
(sti @LinkPreview, STRecord, "", [], "", ""),
|
||||
@@ -343,12 +352,15 @@ chatTypesDocsData =
|
||||
(sti @NameErrorType, STUnion, "", [], "", ""),
|
||||
(sti @NamePrice, STRecord, "", [], "", ""),
|
||||
(sti @NameWarning, STUnion, "NW", [], "", ""),
|
||||
(sti @NetworkConfig, STRecord, "", [], "", ""),
|
||||
(sti @NetworkError, STUnion, "NE", [], "", ""),
|
||||
(sti @NetworkTimeout, STRecord, "", [], "", ""),
|
||||
(sti @NewUser, STRecord, "", [], "", ""),
|
||||
(sti @NoteFolder, STRecord, "", [], "", ""),
|
||||
(sti @OperatorTag, STEnum, "OT", [], "", ""),
|
||||
(sti @OwnerVerification, STUnion, "OV", [], "", ""),
|
||||
(sti @PendingContactConnection, STRecord, "", [], "", ""),
|
||||
(sti @PlanResolveMode, STEnum, "PRM", [], "", ""),
|
||||
(sti @PlanResolveMode, STEnum, "PRM", [], Choice "self" [("allGroups", " resolve=allGroups"), ("never", " resolve=never")] "", ""),
|
||||
(sti @PrefEnabled, STRecord, "", [], "", ""),
|
||||
(removeField "_json" $ sti @Preferences, STRecord, "", [], "", ""),
|
||||
(sti @PreparedContact, STRecord, "", [], "", ""),
|
||||
@@ -360,6 +372,7 @@ chatTypesDocsData =
|
||||
(sti @PublicGroupAccess, STRecord, "", [], "", ""),
|
||||
(sti @PublicGroupData, STRecord, "", [], "", ""),
|
||||
(sti @PublicGroupProfile, STRecord, "", [], "", ""),
|
||||
(sti @QueueStatus, STEnum, "", [], "", ""),
|
||||
(sti @RatchetSyncState, STEnum, "RS", [], "", ""),
|
||||
(sti @RCErrorType, STUnion, "RCE", [], "", ""),
|
||||
(sti @RcvConnEvent, STUnion, "RCE", [], "", ""),
|
||||
@@ -380,6 +393,9 @@ chatTypesDocsData =
|
||||
(sti @RoleGroupPreference, STRecord, "", [], "", ""),
|
||||
(sti @SecurityCode, STRecord, "", [], "", ""),
|
||||
(sti @SegmentRange, STRecord, "", [], "", ""),
|
||||
((sti @ServerOperator) {typeName = "ServerOperator"}, STRecord, "", [], "", ""),
|
||||
(sti @ServerRoles, STRecord, "", [], "", ""),
|
||||
(sti @ServerRolesOverride, STRecord, "", [], "", ""),
|
||||
(sti @SimplePreference, STRecord, "", [], "", ""),
|
||||
(sti @SimplexDomain, STRecord, "", [], "", ""),
|
||||
(sti @SimplexDomainClaim, STRecord, "", [], "", ""),
|
||||
@@ -390,11 +406,15 @@ chatTypesDocsData =
|
||||
(sti @SimplexNameType, STEnum, "NT", [], "", ""),
|
||||
(sti @SimplexTLD, STEnum, "TLD", [], "", ""),
|
||||
(sti @SMPAgentError, STUnion, "", [], "", ""),
|
||||
(sti @SMPProxyFallback, STEnum, "SPF", [], "", ""),
|
||||
(sti @SMPProxyMode, STEnum, "SPM", [], "", ""),
|
||||
(sti @SMPWebPortServers, STEnum, "SWP", [], "", ""),
|
||||
(sti @SndCIStatusProgress, STEnum, "SSP", [], "", ""),
|
||||
(sti @SndConnEvent, STUnion, "SCE", [], "", ""),
|
||||
(sti @SndError, STUnion, "SndErr", [], "", ""),
|
||||
(sti @SndFileTransfer, STRecord, "", [], "", ""),
|
||||
(sti @SndGroupEvent, STUnion, "SGE", [], "", ""),
|
||||
(sti @SocksMode, STEnum, "SM", [], "", ""),
|
||||
(sti @SrvError, STUnion, "SrvErr", [], "", ""),
|
||||
(sti @StoreError, STUnion, "SE", [], "", ""),
|
||||
(sti @SubscriptionStatus, STUnion, "SS", [], "", ""),
|
||||
@@ -404,6 +424,7 @@ chatTypesDocsData =
|
||||
(sti @TimedMessagesGroupPreference, STRecord, "", [], "", ""),
|
||||
(sti @TimedMessagesPreference, STRecord, "", [], "", ""),
|
||||
(sti @TransportError, STUnion, "TE", [], "", ""),
|
||||
(sti @TransportSessionMode, STEnum, "TSM", [], "", ""),
|
||||
(sti @UIColorMode, STEnum, "UCM", [], "", ""),
|
||||
(sti @UIColors, STRecord, "", [], "", ""),
|
||||
(sti @UIThemeEntityOverride, STRecord, "", [], "", ""),
|
||||
@@ -415,32 +436,34 @@ chatTypesDocsData =
|
||||
(sti @UserContactLink, STRecord, "", [], "", ""),
|
||||
(sti @UserContactRequest, STRecord, "", [], "", ""),
|
||||
(sti @UserInfo, STRecord, "", [], "", ""),
|
||||
(sti @UserOperatorServers, STRecord, "", [], "", ""),
|
||||
(sti @UserProfileUpdateSummary, STRecord, "", [], "", ""),
|
||||
(sti @UserPwdHash, STRecord, "", [], "", ""),
|
||||
((sti @(UserServer 'PSMP)) {typeName = "UserServer"}, STRecord, "", [], "", ""),
|
||||
(sti @XFTPErrorType, STUnion, "", [], "", ""),
|
||||
(sti @XFTPRcvFile, STRecord, "", [], "", ""),
|
||||
(sti @XFTPSndFile, STRecord, "", [], "", ""),
|
||||
-- (sti @DatabaseError, STUnion, "DB", [], "", ""),
|
||||
-- (sti @ChatItemInfo, STRecord, "", [], "", ""),
|
||||
-- (sti @ChatItemVersion, STRecord, "", [], "", ""),
|
||||
(sti @ChatItemInfo, STRecord, "", [], "", ""),
|
||||
(sti @ChatItemVersion, STRecord, "", [], "", ""),
|
||||
(sti @ChatListQuery, STUnion, "CLQ", [], "", ""),
|
||||
-- (sti @ChatName, STRecord, "", [], "", ""),
|
||||
-- (sti @ChatPagination, STRecord, "CP", [], "", ""),
|
||||
-- (sti @ConnectionStats, STRecord, "", [], "", ""),
|
||||
-- (sti @GroupSndStatus, STUnion, "GSS", [], "", ""),
|
||||
-- (sti @MemberDeliveryStatus, STRecord, "", [], "", ""),
|
||||
(sti @ChatPagination, STUnion, "CP", [], Choice "self" [("last", "count=" <> Param "count"), ("after", "after=" <> Param "chatItemId" <> " count=" <> Param "count"), ("before", "before=" <> Param "chatItemId" <> " count=" <> Param "count"), ("around", "around=" <> Param "chatItemId" <> " count=" <> Param "count")] ("initial=" <> Param "count"), ""),
|
||||
(sti @ConnectionStats, STRecord, "", [], "", ""),
|
||||
(sti @GroupSndStatus, STUnion, "GSS", [], "", ""),
|
||||
(sti @MemberDeliveryStatus, STRecord, "", [], "", ""),
|
||||
-- (sti @MemberReaction, STRecord, "", [], "", ""),
|
||||
-- (sti @MsgContentTag, (STEnum' $ dropPfxSfx "MC" '_'), "", ["MCUnknown_"], "", ""),
|
||||
-- (sti @NavigationInfo, STRecord, "", [], "", ""),
|
||||
(sti @MsgContentTag, STEnum' (dropPfxSfx "MC" "_"), "", ["MCUnknown_"], "", ""),
|
||||
(sti @NavigationInfo, STRecord, "", [], "", ""),
|
||||
-- PTAfter / PTBefore are hidden — bots only need "tail last N chats".
|
||||
-- The wire format is parsed by paginationByTimeP in
|
||||
-- src/Simplex/Chat/Library/Commands.hs.
|
||||
(sti @PaginationByTime, STUnion1, "PT", ["PTAfter", "PTBefore"], "count=" <> Param "count", "")
|
||||
-- (sti @RcvQueueInfo, STRecord, "", [], "", ""),
|
||||
-- (sti @RcvSwitchStatus, STEnum, "", [], "", ""), -- incorrect
|
||||
(sti @PaginationByTime, STUnion1, "PT", ["PTAfter", "PTBefore"], "count=" <> Param "count", ""),
|
||||
(sti @RcvQueueInfo, STRecord, "", [], "", ""),
|
||||
(sti @RcvSwitchStatus, STEnum' (consSnake "RS"), "", [], "", ""),
|
||||
-- (sti @SendRef, STRecord, "", [], "", ""),
|
||||
-- (sti @SndQueueInfo, STRecord, "", [], "", ""),
|
||||
-- (sti @SndSwitchStatus, STEnum, "", [], "", ""), -- incorrect
|
||||
(sti @SndQueueInfo, STRecord, "", [], "", ""),
|
||||
(sti @SndSwitchStatus, STEnum' (consSnake "SS"), "", [], "", "")
|
||||
]
|
||||
|
||||
data SimplePreference = SimplePreference {allow :: FeatureAllowed} deriving (Generic)
|
||||
@@ -503,6 +526,7 @@ deriving instance Generic CommandError
|
||||
deriving instance Generic CommandErrorType
|
||||
deriving instance Generic CommentsGroupPreference
|
||||
deriving instance Generic ComposedMessage
|
||||
deriving instance Generic ConditionsAcceptance
|
||||
deriving instance Generic Connection
|
||||
deriving instance Generic ConnectionEntity
|
||||
deriving instance Generic ConnectionErrorType
|
||||
@@ -551,6 +575,7 @@ deriving instance Generic GroupMemberRef
|
||||
deriving instance Generic GroupMemberRole
|
||||
deriving instance Generic GroupMemberSettings
|
||||
deriving instance Generic GroupMemberStatus
|
||||
deriving instance Generic GroupOwnerContact
|
||||
deriving instance Generic GroupPreference
|
||||
deriving instance Generic GroupPreferences
|
||||
deriving instance Generic GroupProfile
|
||||
@@ -561,6 +586,7 @@ deriving instance Generic GroupType
|
||||
deriving instance Generic GroupSummary
|
||||
deriving instance Generic GroupSupportChat
|
||||
deriving instance Generic HandshakeError
|
||||
deriving instance Generic HostMode
|
||||
deriving instance Generic InlineFileMode
|
||||
deriving instance Generic InvitationLinkPlan
|
||||
deriving instance Generic InvitedBy
|
||||
@@ -571,6 +597,7 @@ deriving instance Generic JSONCIDeleted
|
||||
deriving instance Generic JSONCIDirection
|
||||
deriving instance Generic JSONCIFileStatus
|
||||
deriving instance Generic JSONCIStatus
|
||||
deriving instance Generic KeepAliveOpts
|
||||
deriving instance Generic LinkContent
|
||||
deriving instance Generic LinkOwnerSig
|
||||
deriving instance Generic LinkPreview
|
||||
@@ -593,9 +620,12 @@ deriving instance Generic NameChange
|
||||
deriving instance Generic NameErrorType
|
||||
deriving instance Generic NamePrice
|
||||
deriving instance Generic NameWarning
|
||||
deriving instance Generic NetworkConfig
|
||||
deriving instance Generic NetworkError
|
||||
deriving instance Generic NetworkTimeout
|
||||
deriving instance Generic NewUser
|
||||
deriving instance Generic NoteFolder
|
||||
deriving instance Generic OperatorTag
|
||||
deriving instance Generic OwnerVerification
|
||||
deriving instance Generic PendingContactConnection
|
||||
deriving instance Generic PlanResolveMode
|
||||
@@ -610,6 +640,7 @@ deriving instance Generic ProxyError
|
||||
deriving instance Generic PublicGroupAccess
|
||||
deriving instance Generic PublicGroupData
|
||||
deriving instance Generic PublicGroupProfile
|
||||
deriving instance Generic QueueStatus
|
||||
deriving instance Generic RatchetSyncState
|
||||
deriving instance Generic RCErrorType
|
||||
deriving instance Generic RcvConnEvent
|
||||
@@ -629,6 +660,9 @@ deriving instance Generic RemoteCtrlStopReason
|
||||
deriving instance Generic ReportReason
|
||||
deriving instance Generic SecurityCode
|
||||
deriving instance Generic SegmentRange
|
||||
deriving instance Generic (ServerOperator' 'DBStored)
|
||||
deriving instance Generic ServerRoles
|
||||
deriving instance Generic ServerRolesOverride
|
||||
deriving instance Generic SimplexDomain
|
||||
deriving instance Generic SimplexDomainClaim
|
||||
deriving instance Generic SimplexDomainError
|
||||
@@ -638,11 +672,15 @@ deriving instance Generic SimplexNameInfo
|
||||
deriving instance Generic SimplexNameType
|
||||
deriving instance Generic SimplexTLD
|
||||
deriving instance Generic SMPAgentError
|
||||
deriving instance Generic SMPProxyFallback
|
||||
deriving instance Generic SMPProxyMode
|
||||
deriving instance Generic SMPWebPortServers
|
||||
deriving instance Generic SndCIStatusProgress
|
||||
deriving instance Generic SndConnEvent
|
||||
deriving instance Generic SndError
|
||||
deriving instance Generic SndFileTransfer
|
||||
deriving instance Generic SndGroupEvent
|
||||
deriving instance Generic SocksMode
|
||||
deriving instance Generic SrvError
|
||||
deriving instance Generic StoreError
|
||||
deriving instance Generic SubscriptionStatus
|
||||
@@ -652,6 +690,7 @@ deriving instance Generic TableAlign
|
||||
deriving instance Generic TimedMessagesGroupPreference
|
||||
deriving instance Generic TimedMessagesPreference
|
||||
deriving instance Generic TransportError
|
||||
deriving instance Generic TransportSessionMode
|
||||
deriving instance Generic UIColorMode
|
||||
deriving instance Generic UIColors
|
||||
deriving instance Generic UIThemeEntityOverride
|
||||
@@ -663,28 +702,30 @@ deriving instance Generic UserContact
|
||||
deriving instance Generic UserContactLink
|
||||
deriving instance Generic UserContactRequest
|
||||
deriving instance Generic UserInfo
|
||||
deriving instance Generic UserOperatorServers
|
||||
deriving instance Generic UserProfileUpdateSummary
|
||||
deriving instance Generic UserPwdHash
|
||||
deriving instance Generic (UserServer' 'DBStored p)
|
||||
deriving instance Generic XFTPErrorType
|
||||
deriving instance Generic XFTPRcvFile
|
||||
deriving instance Generic XFTPSndFile
|
||||
|
||||
-- deriving instance Generic DatabaseError
|
||||
-- deriving instance Generic ChatItemInfo
|
||||
-- deriving instance Generic ChatItemVersion
|
||||
deriving instance Generic ChatItemInfo
|
||||
deriving instance Generic ChatItemVersion
|
||||
deriving instance Generic ChatListQuery
|
||||
-- deriving instance Generic ChatName
|
||||
-- deriving instance Generic ChatPagination
|
||||
-- deriving instance Generic ConnectionStats
|
||||
deriving instance Generic ChatPagination
|
||||
deriving instance Generic ConnectionStats
|
||||
-- deriving instance Generic Group
|
||||
-- deriving instance Generic GroupSndStatus
|
||||
-- deriving instance Generic MemberDeliveryStatus
|
||||
deriving instance Generic GroupSndStatus
|
||||
deriving instance Generic MemberDeliveryStatus
|
||||
-- deriving instance Generic MemberReaction
|
||||
-- deriving instance Generic MsgContentTag
|
||||
-- deriving instance Generic NavigationInfo
|
||||
deriving instance Generic MsgContentTag
|
||||
deriving instance Generic NavigationInfo
|
||||
deriving instance Generic PaginationByTime
|
||||
-- deriving instance Generic RcvQueueInfo
|
||||
-- deriving instance Generic RcvSwitchStatus
|
||||
deriving instance Generic RcvQueueInfo
|
||||
deriving instance Generic RcvSwitchStatus
|
||||
-- deriving instance Generic SendRef
|
||||
-- deriving instance Generic SndQueueInfo
|
||||
-- deriving instance Generic SndSwitchStatus
|
||||
deriving instance Generic SndQueueInfo
|
||||
deriving instance Generic SndSwitchStatus
|
||||
@@ -175,9 +175,12 @@ toTypeInfo tr =
|
||||
"BoolDef" -> ST TBool []
|
||||
"PQEncryption" -> ST TBool []
|
||||
"PQSupport" -> ST TBool []
|
||||
"AChatInfo" -> ST "ChatInfo" []
|
||||
"ACreatedConnLink" -> ST "CreatedConnLink" []
|
||||
"AChatInfo" -> ST "ChatInfo" []
|
||||
"UserChatRelay'" -> ST "UserChatRelay" []
|
||||
"ServerOperator'" -> ST "ServerOperator" []
|
||||
"UserServer'" -> ST "UserServer" []
|
||||
"CChatItem" -> ST "ChatItem" []
|
||||
"FormatColor" -> ST "Color" []
|
||||
"CustomData" -> ST "JSONObject" []
|
||||
@@ -221,11 +224,13 @@ toTypeInfo tr =
|
||||
"PrivateKey",
|
||||
"ProofPresHeader",
|
||||
"PublicKey",
|
||||
"ProtoServerWithAuth",
|
||||
"ProtocolServer",
|
||||
"RCSignedInvitation",
|
||||
"SbKey",
|
||||
"SharedMsgId",
|
||||
"Signature",
|
||||
"SocksProxyWithAuth",
|
||||
"StrJSON",
|
||||
"TransportHost",
|
||||
"UIColor",
|
||||
|
||||
Reference in new issue
Block a user