update api types

This commit is contained in:
Evgeny Poberezkin
2026-06-28 13:01:54 +01:00
parent 7671225946
commit 07e81d59da
6 changed files with 59 additions and 59 deletions
+2 -2
View File
@@ -1369,7 +1369,7 @@ Determine SimpleX link type and if the bot is already connected via this link or
**Parameters**:
- userId: int64
- connectTarget: [ConnectTarget](./TYPES.md#connecttarget)?
- connectTarget: [AConnectTarget](./TYPES.md#aconnecttarget)?
- resolveKnown: bool
- linkOwnerSig: [LinkOwnerSig](./TYPES.md#linkownersig)?
@@ -1461,7 +1461,7 @@ Connect via SimpleX link or name as string in the active user profile.
**Parameters**:
- incognito: bool
- connTarget_: [ConnectTarget](./TYPES.md#connecttarget)?
- connTarget_: [AConnectTarget](./TYPES.md#aconnecttarget)?
**Syntax**:
+18 -18
View File
@@ -5,6 +5,7 @@ This file is generated automatically.
- [ACIReaction](#acireaction)
- [AChat](#achat)
- [AChatItem](#achatitem)
- [AConnectTarget](#aconnecttarget)
- [AddRelayResult](#addrelayresult)
- [AddressSettings](#addresssettings)
- [AgentCryptoError](#agentcryptoerror)
@@ -61,7 +62,6 @@ This file is generated automatically.
- [ComposedMessage](#composedmessage)
- [ConnStatus](#connstatus)
- [ConnType](#conntype)
- [ConnectTarget](#connecttarget)
- [Connection](#connection)
- [ConnectionEntity](#connectionentity)
- [ConnectionErrorType](#connectionerrortype)
@@ -241,6 +241,23 @@ This file is generated automatically.
- chatItem: [ChatItem](#chatitem)
---
## AConnectTarget
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.
**Discriminated union type**:
Name:
- type: "name"
- : [SimplexNameInfo](#simplexnameinfo)
Link:
- type: "link"
- : string
---
## AddRelayResult
@@ -1649,23 +1666,6 @@ Failed:
- "user_contact"
---
## ConnectTarget
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.
**Discriminated union type**:
Link:
- type: "link"
- : string
Name:
- type: "name"
- : [SimplexNameInfo](#simplexnameinfo)
---
## Connection
@@ -499,7 +499,7 @@ export namespace APIAddContact {
// Network usage: interactive.
export interface APIConnectPlan {
userId: number // int64
connectTarget?: T.ConnectTarget
connectTarget?: T.AConnectTarget
resolveKnown: boolean
linkOwnerSig?: T.LinkOwnerSig
}
@@ -532,7 +532,7 @@ export namespace APIConnect {
// Network usage: interactive.
export interface Connect {
incognito: boolean
connTarget_?: T.ConnectTarget
connTarget_?: T.AConnectTarget
}
export namespace Connect {
@@ -16,6 +16,27 @@ export interface AChatItem {
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.
export type AConnectTarget = AConnectTarget.Name | AConnectTarget.Link
export namespace AConnectTarget {
export type Tag = "name" | "link"
interface Interface {
type: Tag
}
export interface Name extends Interface {
type: "name"
: SimplexNameInfo
}
export interface Link extends Interface {
type: "link"
: string
}
}
export interface AddRelayResult {
relay: UserChatRelay
@@ -1865,27 +1886,6 @@ export enum ConnType {
Member = "member",
User_contact = "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.
export type ConnectTarget = ConnectTarget.Link | ConnectTarget.Name
export namespace ConnectTarget {
export type Tag = "link" | "name"
interface Interface {
type: Tag
}
export interface Link extends Interface {
type: "link"
: string
}
export interface Name extends Interface {
type: "name"
: SimplexNameInfo
}
}
export interface Connection {
connId: number // int64
@@ -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