bot types, schema

This commit is contained in:
Evgeny Poberezkin
2026-06-11 18:31:28 +01:00
parent 64a4c0c9ee
commit 68237e7398
10 changed files with 190 additions and 89 deletions
+1
View File
@@ -202,6 +202,7 @@ cliCommands =
"AbortSwitchGroupMember",
"AcceptContact",
"AcceptMember",
"AddBadge",
"AddContact",
"AddMember",
"AllowRelayGroup",
+5 -1
View File
@@ -34,7 +34,7 @@ import Simplex.Chat.Store.Profiles
import Simplex.Chat.Store.Shared
import Simplex.Chat.Operators
import Simplex.Messaging.Agent.Store.Entity (DBStored (..))
import Simplex.Chat.Badges (BadgeInfo (..), BadgeStatus (..), BadgeType (..))
import Simplex.Chat.Badges (BadgeInfo (..), BadgeStatus (..), BadgeType (..), JSONBadge (..), JBadge (..))
import Simplex.Chat.Types
import Simplex.Chat.Types.Preferences
import Simplex.Chat.Types.Shared
@@ -184,6 +184,8 @@ ciQuoteType =
chatTypesDocsData :: [(SumTypeInfo, SumTypeJsonEncoding, String, [ConsName], Expr, Text)]
chatTypesDocsData =
[ ((sti @(Chat 'CTDirect)) {typeName = "AChat"}, STRecord, "", [], "", ""),
((sti @JBadge) {typeName = "Badge"}, STUnion, "JBadge", [], "", ""),
((sti @JSONBadge) {typeName = "LocalBadge"}, STRecord, "", [], "", ""),
((sti @JSONChatInfo) {typeName = "ChatInfo"}, STUnion, "JCInfo", ["JCInfoInvalidJSON"], "", ""),
((sti @JSONCIContent) {typeName = "CIContent"}, STUnion, "JCI", ["JCIInvalidJSON"], "", ""),
((sti @JSONCIDeleted) {typeName = "CIDeleted"}, STUnion, "JCID", [], "", ""),
@@ -521,6 +523,8 @@ deriving instance Generic HandshakeError
deriving instance Generic InlineFileMode
deriving instance Generic InvitationLinkPlan
deriving instance Generic InvitedBy
deriving instance Generic JBadge
deriving instance Generic JSONBadge
deriving instance Generic JSONChatInfo
deriving instance Generic JSONCIContent
deriving instance Generic JSONCIDeleted
+2
View File
@@ -198,9 +198,11 @@ toTypeInfo tr =
"AgentInvId",
"AgentRcvFileId",
"AgentSndFileId",
"BadgeMasterKey",
"B64UrlByteString",
"BBSProof",
"BBSPresHeader",
"BBSSignature",
"CbNonce",
"ConnectionLink",
"ConnShortLink",