mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-02 00:31:45 +00:00
update api types
This commit is contained in:
@@ -438,7 +438,7 @@ APIAddContact_Response = CR.Invitation | CR.ChatCmdError
|
||||
# Network usage: interactive.
|
||||
class APIConnectPlan(TypedDict):
|
||||
userId: int # int64
|
||||
connectTarget: NotRequired["T.ConnectTarget"]
|
||||
connectTarget: NotRequired["T.AConnectTarget"]
|
||||
resolveKnown: bool
|
||||
linkOwnerSig: NotRequired["T.LinkOwnerSig"]
|
||||
|
||||
@@ -467,7 +467,7 @@ APIConnect_Response = CR.SentConfirmation | CR.ContactAlreadyExists | CR.SentInv
|
||||
# Network usage: interactive.
|
||||
class Connect(TypedDict):
|
||||
incognito: bool
|
||||
connTarget_: NotRequired["T.ConnectTarget"]
|
||||
connTarget_: NotRequired["T.AConnectTarget"]
|
||||
|
||||
|
||||
def Connect_cmd_string(self: Connect) -> str:
|
||||
|
||||
@@ -16,6 +16,20 @@ class AChatItem(TypedDict):
|
||||
chatInfo: "ChatInfo"
|
||||
chatItem: "ChatItem"
|
||||
|
||||
# Connect target: SimpleX link (`CTLink`) or SimpleX name (`CTName`). Wire form is the bare string returned by `strEncode` — `simplex:/...` for links, `#name.simplex` / `@name.simplex` for names.
|
||||
|
||||
class AConnectTarget_name(TypedDict):
|
||||
type: Literal["name"]
|
||||
: "SimplexNameInfo"
|
||||
|
||||
class AConnectTarget_link(TypedDict):
|
||||
type: Literal["link"]
|
||||
: str
|
||||
|
||||
AConnectTarget = AConnectTarget_name | AConnectTarget_link
|
||||
|
||||
AConnectTarget_Tag = Literal["name", "link"]
|
||||
|
||||
class AddRelayResult(TypedDict):
|
||||
relay: "UserChatRelay"
|
||||
relayError: NotRequired["ChatError"]
|
||||
@@ -1298,20 +1312,6 @@ ConnStatus_Tag = Literal["new", "prepared", "joined", "requested", "accepted", "
|
||||
|
||||
ConnType = Literal["contact", "member", "user_contact"]
|
||||
|
||||
# Connect target: SimpleX link (`CTLink`) or SimpleX name (`CTName`). Wire form is the bare string returned by `strEncode` — `simplex:/...` for links, `#name.simplex` / `@name.simplex` for names.
|
||||
|
||||
class ConnectTarget_link(TypedDict):
|
||||
type: Literal["link"]
|
||||
: str
|
||||
|
||||
class ConnectTarget_name(TypedDict):
|
||||
type: Literal["name"]
|
||||
: "SimplexNameInfo"
|
||||
|
||||
ConnectTarget = ConnectTarget_link | ConnectTarget_name
|
||||
|
||||
ConnectTarget_Tag = Literal["link", "name"]
|
||||
|
||||
class Connection(TypedDict):
|
||||
connId: int # int64
|
||||
agentConnId: str
|
||||
|
||||
Reference in New Issue
Block a user