schema and bot types

This commit is contained in:
Evgeny Poberezkin
2026-05-23 09:44:44 +01:00
parent 6116f2331a
commit 29bb06c6ff
2 changed files with 15 additions and 8 deletions
@@ -712,9 +712,6 @@ class ChatErrorType_noRcvFileUser(TypedDict):
class ChatErrorType_userUnknown(TypedDict):
type: Literal["userUnknown"]
class ChatErrorType_activeUserExists(TypedDict):
type: Literal["activeUserExists"]
class ChatErrorType_userExists(TypedDict):
type: Literal["userExists"]
contactName: str
@@ -987,7 +984,6 @@ ChatErrorType = (
| ChatErrorType_noSndFileUser
| ChatErrorType_noRcvFileUser
| ChatErrorType_userUnknown
| ChatErrorType_activeUserExists
| ChatErrorType_userExists
| ChatErrorType_chatRelayExists
| ChatErrorType_differentActiveUser
@@ -1059,7 +1055,7 @@ ChatErrorType = (
| ChatErrorType_exception
)
ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "activeUserExists", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"]
ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"]
ChatFeature = Literal["timedMessages", "fullDelete", "reactions", "voice", "files", "calls", "sessions"]
@@ -2226,6 +2222,7 @@ class NewUser(TypedDict):
profile: NotRequired["Profile"]
pastTimestamp: bool
userChatRelay: bool
clientService: bool
class NoteFolder(TypedDict):
noteFolderId: int # int64
@@ -3363,8 +3360,9 @@ class User(TypedDict):
sendRcptsSmallGroups: bool
autoAcceptMemberContacts: bool
userMemberProfileUpdatedAt: NotRequired[str] # ISO-8601 timestamp
uiThemes: NotRequired["UIThemeEntityOverrides"]
userChatRelay: bool
clientService: bool
uiThemes: NotRequired["UIThemeEntityOverrides"]
class UserChatRelay(TypedDict):
chatRelayId: int # int64
@@ -548,6 +548,15 @@ Plan:
SEARCH s USING PRIMARY KEY (conn_id=? AND internal_snd_id=?)
SEARCH m USING PRIMARY KEY (conn_id=? AND internal_id=?)
Query:
UPDATE rcv_messages
SET receive_attempts = receive_attempts + 1
WHERE conn_id = ? AND internal_id = ?
RETURNING receive_attempts
Plan:
SEARCH rcv_messages USING COVERING INDEX idx_rcv_messages_conn_id_internal_id (conn_id=? AND internal_id=?)
Query:
DELETE FROM conn_confirmations
WHERE conn_id = ?
@@ -1331,9 +1340,9 @@ Query: UPDATE rcv_queues SET rcv_primary = ?, replace_rcv_queue_id = ? WHERE con
Plan:
SEARCH rcv_queues USING COVERING INDEX idx_rcv_queue_id (conn_id=? AND rcv_queue_id=?)
Query: UPDATE rcv_queues SET rcv_service_assoc = 1 WHERE rcv_id = ?
Query: UPDATE rcv_queues SET rcv_service_assoc = 1 WHERE host = ? AND port = ? AND rcv_id = ?
Plan:
SCAN rcv_queues USING COVERING INDEX idx_rcv_queues_client_notice_id
SEARCH rcv_queues USING PRIMARY KEY (host=? AND port=? AND rcv_id=?)
Query: UPDATE rcv_queues SET to_subscribe = 0 WHERE to_subscribe = 1
Plan: