chat: register APIVerifySimplexName + verify events in bot docs

ebe90f716 added the verify command + events + SimplexNameVerifyFailReason
type without touching bots/src/API/Docs/. Mirrors commit 0d7ea8061 which
addressed the same gap for ConnectTarget. Regenerates the affected
markdown / TypeScript / Python artefacts.
This commit is contained in:
shum
2026-06-06 09:12:41 +00:00
parent ebe90f7169
commit 516d4d7abe
12 changed files with 255 additions and 2 deletions
@@ -596,6 +596,18 @@ def APISetUserAutoAcceptMemberContacts_cmd_string(self: APISetUserAutoAcceptMemb
APISetUserAutoAcceptMemberContacts_Response = CR.CmdOk | CR.ChatCmdError
# Verify a contact's or group's claimed SimpleX name by RSLV-resolving the claim and comparing the resolved link to the peer's stored connection link. Synchronously returns `CRCmdOk`; the verification outcome is delivered asynchronously via [CEvtSimplexNameVerified](./EVENTS.md#cevtsimplexnameverified) or [CEvtSimplexNameVerifyFailed](./EVENTS.md#cevtsimplexnameverifyfailed).
# Network usage: interactive.
class APIVerifySimplexName(TypedDict):
chatRef: "T.ChatRef"
def APIVerifySimplexName_cmd_string(self: APIVerifySimplexName) -> str:
return '/_verify simplex name ' + T.ChatRef_cmd_string(self['chatRef'])
APIVerifySimplexName_Response = CR.CmdOk | CR.ChatCmdError
# User profile commands
# Most bots don't need to use these commands, as bot profile can be configured manually via CLI or desktop client. These commands can be used by bots that need to manage multiple user profiles (e.g., the profiles of support agents).
@@ -43,6 +43,26 @@ class SimplexNameConflict(TypedDict):
claimedBy: str
displacedFrom: str
class SimplexNameVerified(TypedDict):
type: Literal["simplexNameVerified"]
user: "T.User"
chatRef: "T.ChatRef"
simplexName: "T.SimplexNameInfo"
verifiedAt: str # ISO-8601 timestamp
class SimplexNameVerifyFailed(TypedDict):
type: Literal["simplexNameVerifyFailed"]
user: "T.User"
chatRef: "T.ChatRef"
simplexName: "T.SimplexNameInfo"
reason: "T.SimplexNameVerifyFailReason"
class SimplexNameUnverified(TypedDict):
type: Literal["simplexNameUnverified"]
user: "T.User"
chatRef: "T.ChatRef"
simplexName: "T.SimplexNameInfo"
class ContactSndReady(TypedDict):
type: Literal["contactSndReady"]
user: "T.User"
@@ -339,6 +359,9 @@ ChatEvent = (
| ReceivedContactRequest
| NewMemberContactReceivedInv
| SimplexNameConflict
| SimplexNameVerified
| SimplexNameVerifyFailed
| SimplexNameUnverified
| ContactSndReady
| NewChatItems
| ChatItemReaction
@@ -386,7 +409,7 @@ ChatEvent = (
| ChatErrors
)
ChatEvent_Tag = Literal["contactConnected", "contactUpdated", "contactDeletedByContact", "receivedContactRequest", "newMemberContactReceivedInv", "simplexNameConflict", "contactSndReady", "newChatItems", "chatItemReaction", "chatItemsDeleted", "chatItemUpdated", "groupChatItemsDeleted", "chatItemsStatusesUpdated", "receivedGroupInvitation", "userJoinedGroup", "groupUpdated", "joinedGroupMember", "memberRole", "deletedMember", "leftMember", "deletedMemberUser", "groupDeleted", "connectedToGroupMember", "memberAcceptedByOther", "memberBlockedForAll", "groupMemberUpdated", "groupLinkDataUpdated", "groupRelayUpdated", "rcvFileDescrReady", "rcvFileComplete", "sndFileCompleteXFTP", "rcvFileStart", "rcvFileSndCancelled", "rcvFileAccepted", "rcvFileError", "rcvFileWarning", "sndFileError", "sndFileWarning", "acceptingContactRequest", "acceptingBusinessRequest", "contactConnecting", "businessLinkConnecting", "joinedGroupMemberConnecting", "sentGroupInvitation", "groupLinkConnecting", "hostConnected", "hostDisconnected", "subscriptionStatus", "messageError", "chatError", "chatErrors"]
ChatEvent_Tag = Literal["contactConnected", "contactUpdated", "contactDeletedByContact", "receivedContactRequest", "newMemberContactReceivedInv", "simplexNameConflict", "simplexNameVerified", "simplexNameVerifyFailed", "simplexNameUnverified", "contactSndReady", "newChatItems", "chatItemReaction", "chatItemsDeleted", "chatItemUpdated", "groupChatItemsDeleted", "chatItemsStatusesUpdated", "receivedGroupInvitation", "userJoinedGroup", "groupUpdated", "joinedGroupMember", "memberRole", "deletedMember", "leftMember", "deletedMemberUser", "groupDeleted", "connectedToGroupMember", "memberAcceptedByOther", "memberBlockedForAll", "groupMemberUpdated", "groupLinkDataUpdated", "groupRelayUpdated", "rcvFileDescrReady", "rcvFileComplete", "sndFileCompleteXFTP", "rcvFileStart", "rcvFileSndCancelled", "rcvFileAccepted", "rcvFileError", "rcvFileWarning", "sndFileError", "sndFileWarning", "acceptingContactRequest", "acceptingBusinessRequest", "contactConnecting", "businessLinkConnecting", "joinedGroupMemberConnecting", "sentGroupInvitation", "groupLinkConnecting", "hostConnected", "hostDisconnected", "subscriptionStatus", "messageError", "chatError", "chatErrors"]
class OnEventDecorator(Protocol):
@@ -433,6 +456,24 @@ class OnEventDecorator(Protocol):
Callable[["SimplexNameConflict"], Awaitable[None]],
]: ...
@overload
def __call__(self, event: Literal["simplexNameVerified"], /) -> Callable[
[Callable[["SimplexNameVerified"], Awaitable[None]]],
Callable[["SimplexNameVerified"], Awaitable[None]],
]: ...
@overload
def __call__(self, event: Literal["simplexNameVerifyFailed"], /) -> Callable[
[Callable[["SimplexNameVerifyFailed"], Awaitable[None]]],
Callable[["SimplexNameVerifyFailed"], Awaitable[None]],
]: ...
@overload
def __call__(self, event: Literal["simplexNameUnverified"], /) -> Callable[
[Callable[["SimplexNameUnverified"], Awaitable[None]]],
Callable[["SimplexNameUnverified"], Awaitable[None]],
]: ...
@overload
def __call__(self, event: Literal["contactSndReady"], /) -> Callable[
[Callable[["ContactSndReady"], Awaitable[None]]],
@@ -1429,6 +1429,7 @@ class Contact(TypedDict):
chatDeleted: bool
customData: NotRequired[dict[str, object]]
simplexName: NotRequired["SimplexNameInfo"]
simplexNameVerifiedAt: NotRequired[str] # ISO-8601 timestamp
class ContactAddressPlan_ok(TypedDict):
type: Literal["ok"]
@@ -1841,6 +1842,7 @@ class GroupInfo(TypedDict):
viaGroupLinkUri: NotRequired[str]
groupKeys: NotRequired["GroupKeys"]
simplexName: NotRequired["SimplexNameInfo"]
simplexNameVerifiedAt: NotRequired[str] # ISO-8601 timestamp
class GroupKeys(TypedDict):
publicGroupId: str
@@ -2748,6 +2750,24 @@ class SimplexNameInfo(TypedDict):
SimplexNameType = Literal["publicGroup", "contact"]
class SimplexNameVerifyFailReason_linkMismatch(TypedDict):
type: Literal["linkMismatch"]
class SimplexNameVerifyFailReason_nameNotRegistered(TypedDict):
type: Literal["nameNotRegistered"]
class SimplexNameVerifyFailReason_resolverError(TypedDict):
type: Literal["resolverError"]
agentError: "AgentErrorType"
SimplexNameVerifyFailReason = (
SimplexNameVerifyFailReason_linkMismatch
| SimplexNameVerifyFailReason_nameNotRegistered
| SimplexNameVerifyFailReason_resolverError
)
SimplexNameVerifyFailReason_Tag = Literal["linkMismatch", "nameNotRegistered", "resolverError"]
SimplexTLD = Literal["simplex", "testing", "web"]
SndCIStatusProgress = Literal["partial", "complete"]