mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 12:04:11 +00:00
fix bot apis
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,795 @@
|
||||
# API Events
|
||||
|
||||
This file is generated automatically.
|
||||
|
||||
[Contact connection events](#contact-connection-events)
|
||||
- Main event
|
||||
- [ContactConnected](#contactconnected)
|
||||
- Other events
|
||||
- [ContactUpdated](#contactupdated)
|
||||
- [ContactDeletedByContact](#contactdeletedbycontact)
|
||||
- [ReceivedContactRequest](#receivedcontactrequest)
|
||||
- [NewMemberContactReceivedInv](#newmembercontactreceivedinv)
|
||||
- [ContactSndReady](#contactsndready)
|
||||
|
||||
[Message events](#message-events)
|
||||
- Main event
|
||||
- [NewChatItems](#newchatitems)
|
||||
- Other events
|
||||
- [ChatItemReaction](#chatitemreaction)
|
||||
- [ChatItemsDeleted](#chatitemsdeleted)
|
||||
- [ChatItemUpdated](#chatitemupdated)
|
||||
- [GroupChatItemsDeleted](#groupchatitemsdeleted)
|
||||
- [ChatItemsStatusesUpdated](#chatitemsstatusesupdated)
|
||||
|
||||
[Group events](#group-events)
|
||||
- Main events
|
||||
- [ReceivedGroupInvitation](#receivedgroupinvitation)
|
||||
- [UserJoinedGroup](#userjoinedgroup)
|
||||
- [GroupUpdated](#groupupdated)
|
||||
- [JoinedGroupMember](#joinedgroupmember)
|
||||
- [MemberRole](#memberrole)
|
||||
- [DeletedMember](#deletedmember)
|
||||
- [LeftMember](#leftmember)
|
||||
- [DeletedMemberUser](#deletedmemberuser)
|
||||
- [GroupDeleted](#groupdeleted)
|
||||
- Other events
|
||||
- [ConnectedToGroupMember](#connectedtogroupmember)
|
||||
- [MemberAcceptedByOther](#memberacceptedbyother)
|
||||
- [MemberBlockedForAll](#memberblockedforall)
|
||||
- [GroupMemberUpdated](#groupmemberupdated)
|
||||
- [GroupLinkDataUpdated](#grouplinkdataupdated)
|
||||
- [GroupRelayUpdated](#grouprelayupdated)
|
||||
|
||||
[File events](#file-events)
|
||||
- Main events
|
||||
- [RcvFileDescrReady](#rcvfiledescrready)
|
||||
- [RcvFileComplete](#rcvfilecomplete)
|
||||
- [SndFileCompleteXFTP](#sndfilecompletexftp)
|
||||
- Other events
|
||||
- [RcvFileStart](#rcvfilestart)
|
||||
- [RcvFileSndCancelled](#rcvfilesndcancelled)
|
||||
- [RcvFileAccepted](#rcvfileaccepted)
|
||||
- [RcvFileError](#rcvfileerror)
|
||||
- [RcvFileWarning](#rcvfilewarning)
|
||||
- [SndFileError](#sndfileerror)
|
||||
- [SndFileWarning](#sndfilewarning)
|
||||
|
||||
[Connection progress events](#connection-progress-events)
|
||||
- [AcceptingContactRequest](#acceptingcontactrequest)
|
||||
- [AcceptingBusinessRequest](#acceptingbusinessrequest)
|
||||
- [ContactConnecting](#contactconnecting)
|
||||
- [BusinessLinkConnecting](#businesslinkconnecting)
|
||||
- [JoinedGroupMemberConnecting](#joinedgroupmemberconnecting)
|
||||
- [GroupLinkConnecting](#grouplinkconnecting)
|
||||
|
||||
[Network connection events](#network-connection-events)
|
||||
- [HostConnected](#hostconnected)
|
||||
- [HostDisconnected](#hostdisconnected)
|
||||
- [SubscriptionStatus](#subscriptionstatus)
|
||||
|
||||
[Error events](#error-events)
|
||||
- [MessageError](#messageerror)
|
||||
- [ChatError](#chaterror)
|
||||
- [ChatErrors](#chaterrors)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Contact connection events
|
||||
|
||||
Bots must use these events to process connecting users.
|
||||
|
||||
Most bots enable auto-accept and don't need to accept connections via commands.
|
||||
|
||||
You may create bot SimpleX address manually via CLI or desktop app or from bot code with these commands:
|
||||
- [APIShowMyAddress](./COMMANDS.md#apishowmyaddress) to check if address exists,
|
||||
- [APICreateMyAddress](./COMMANDS.md#apicreatemyaddress) to create address,
|
||||
- [APISetAddressSettings](./COMMANDS.md#apisetaddresssettings) to enable auto-access.
|
||||
|
||||
|
||||
### ContactConnected
|
||||
|
||||
This event is sent after a user connects via bot SimpleX address (not a business address).
|
||||
|
||||
**Record type**:
|
||||
- type: "contactConnected"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
- userCustomProfile: [Profile](./TYPES.md#profile)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ContactUpdated
|
||||
|
||||
Contact profile of another user is updated.
|
||||
|
||||
**Record type**:
|
||||
- type: "contactUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- fromContact: [Contact](./TYPES.md#contact)
|
||||
- toContact: [Contact](./TYPES.md#contact)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ContactDeletedByContact
|
||||
|
||||
Bot user's connection with another contact is deleted (conversation is kept).
|
||||
|
||||
**Record type**:
|
||||
- type: "contactDeletedByContact"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ReceivedContactRequest
|
||||
|
||||
Contact request received.
|
||||
|
||||
This event is only sent when auto-accept is disabled.
|
||||
|
||||
The request needs to be accepted using [APIAcceptContact](./COMMANDS.md#apiacceptcontact) command
|
||||
|
||||
**Record type**:
|
||||
- type: "receivedContactRequest"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contactRequest: [UserContactRequest](./TYPES.md#usercontactrequest)
|
||||
- chat_: [AChat](./TYPES.md#achat)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### NewMemberContactReceivedInv
|
||||
|
||||
Received invitation to connect directly with a group member.
|
||||
|
||||
This event only needs to be processed to associate contact with group, the connection will proceed automatically.
|
||||
|
||||
**Record type**:
|
||||
- type: "newMemberContactReceivedInv"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ContactSndReady
|
||||
|
||||
Connecting via 1-time invitation or after accepting contact request.
|
||||
|
||||
After this event bot can send messages to this contact.
|
||||
|
||||
**Record type**:
|
||||
- type: "contactSndReady"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Message events
|
||||
|
||||
Bots must use these events to process received messages.
|
||||
|
||||
|
||||
### NewChatItems
|
||||
|
||||
Received message(s).
|
||||
|
||||
**Record type**:
|
||||
- type: "newChatItems"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItems: [[AChatItem](./TYPES.md#achatitem)]
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ChatItemReaction
|
||||
|
||||
Received message reaction.
|
||||
|
||||
**Record type**:
|
||||
- type: "chatItemReaction"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- added: bool
|
||||
- reaction: [ACIReaction](./TYPES.md#acireaction)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ChatItemsDeleted
|
||||
|
||||
Message was deleted by another user.
|
||||
|
||||
**Record type**:
|
||||
- type: "chatItemsDeleted"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItemDeletions: [[ChatItemDeletion](./TYPES.md#chatitemdeletion)]
|
||||
- byUser: bool
|
||||
- timed: bool
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ChatItemUpdated
|
||||
|
||||
Message was updated by another user.
|
||||
|
||||
**Record type**:
|
||||
- type: "chatItemUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupChatItemsDeleted
|
||||
|
||||
Group messages are deleted or moderated.
|
||||
|
||||
**Record type**:
|
||||
- type: "groupChatItemsDeleted"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- chatItemIDs: [int64]
|
||||
- byUser: bool
|
||||
- member_: [GroupMember](./TYPES.md#groupmember)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ChatItemsStatusesUpdated
|
||||
|
||||
Message delivery status updates.
|
||||
|
||||
**Record type**:
|
||||
- type: "chatItemsStatusesUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItems: [[AChatItem](./TYPES.md#achatitem)]
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Group events
|
||||
|
||||
Bots may use these events to manage users' groups and business address groups.
|
||||
|
||||
*Please note*: programming groups is more complex than programming direct connections
|
||||
|
||||
|
||||
### ReceivedGroupInvitation
|
||||
|
||||
Received group invitation.
|
||||
|
||||
**Record type**:
|
||||
- type: "receivedGroupInvitation"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
- fromMemberRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### UserJoinedGroup
|
||||
|
||||
Bot user joined group. Received when connection via group link completes.
|
||||
|
||||
**Record type**:
|
||||
- type: "userJoinedGroup"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- hostMember: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupUpdated
|
||||
|
||||
Group profile or preferences updated.
|
||||
|
||||
**Record type**:
|
||||
- type: "groupUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- fromGroup: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- toGroup: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member_: [GroupMember](./TYPES.md#groupmember)?
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### JoinedGroupMember
|
||||
|
||||
Another member joined group.
|
||||
|
||||
**Record type**:
|
||||
- type: "joinedGroupMember"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### MemberRole
|
||||
|
||||
Member (or bot user's) group role changed.
|
||||
|
||||
**Record type**:
|
||||
- type: "memberRole"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- byMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- fromRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
- toRole: [GroupMemberRole](./TYPES.md#groupmemberrole)
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### DeletedMember
|
||||
|
||||
Another member is removed from the group.
|
||||
|
||||
**Record type**:
|
||||
- type: "deletedMember"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- byMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- deletedMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- withMessages: bool
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### LeftMember
|
||||
|
||||
Another member left the group.
|
||||
|
||||
**Record type**:
|
||||
- type: "leftMember"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### DeletedMemberUser
|
||||
|
||||
Bot user was removed from the group.
|
||||
|
||||
**Record type**:
|
||||
- type: "deletedMemberUser"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- withMessages: bool
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupDeleted
|
||||
|
||||
Group was deleted by the owner (not bot user).
|
||||
|
||||
**Record type**:
|
||||
- type: "groupDeleted"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ConnectedToGroupMember
|
||||
|
||||
Connected to another group member.
|
||||
|
||||
**Record type**:
|
||||
- type: "connectedToGroupMember"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- memberContact: [Contact](./TYPES.md#contact)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### MemberAcceptedByOther
|
||||
|
||||
Another group owner, admin or moderator accepted member to the group after review ("knocking").
|
||||
|
||||
**Record type**:
|
||||
- type: "memberAcceptedByOther"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- acceptingMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### MemberBlockedForAll
|
||||
|
||||
Another member blocked for all members.
|
||||
|
||||
**Record type**:
|
||||
- type: "memberBlockedForAll"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- byMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- blocked: bool
|
||||
- msgSigned: [MsgSigStatus](./TYPES.md#msgsigstatus)?
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupMemberUpdated
|
||||
|
||||
Another group member profile updated.
|
||||
|
||||
**Record type**:
|
||||
- type: "groupMemberUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- fromMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- toMember: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupLinkDataUpdated
|
||||
|
||||
Group link data updated.
|
||||
|
||||
**Record type**:
|
||||
- type: "groupLinkDataUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- groupLink: [GroupLink](./TYPES.md#grouplink)
|
||||
- groupRelays: [[GroupRelay](./TYPES.md#grouprelay)]
|
||||
- relaysChanged: bool
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupRelayUpdated
|
||||
|
||||
Group relay member updated.
|
||||
|
||||
**Record type**:
|
||||
- type: "groupRelayUpdated"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
- groupRelay: [GroupRelay](./TYPES.md#grouprelay)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## File events
|
||||
|
||||
Bots that send or receive files may process these events to track delivery status and to process completion.
|
||||
|
||||
Bots that need to receive or moderate files (e.g., based on name, size or extension), can use relevant commands (e.g., [ReceiveFile](./COMMANDS.md#receivefile) or [APIDeleteMemberChatItem](./COMMANDS.md#apideletememberchatitem)) when processing [NewChatItems](#newchatitems) event.
|
||||
|
||||
Bots that need to send files should use [APISendMessages](./COMMANDS.md#apisendmessages) command.
|
||||
|
||||
|
||||
### RcvFileDescrReady
|
||||
|
||||
File is ready to be received.
|
||||
|
||||
This event is useful for processing sender file servers and monitoring file reception progress.
|
||||
|
||||
[ReceiveFile](./COMMANDS.md#receivefile) command can be used before this event.
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileDescrReady"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
- rcvFileTransfer: [RcvFileTransfer](./TYPES.md#rcvfiletransfer)
|
||||
- rcvFileDescr: [RcvFileDescr](./TYPES.md#rcvfiledescr)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### RcvFileComplete
|
||||
|
||||
File reception is competed.
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileComplete"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### SndFileCompleteXFTP
|
||||
|
||||
File upload is competed.
|
||||
|
||||
**Record type**:
|
||||
- type: "sndFileCompleteXFTP"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
- fileTransferMeta: [FileTransferMeta](./TYPES.md#filetransfermeta)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### RcvFileStart
|
||||
|
||||
File reception started. This event will be sent after [CEvtRcvFileDescrReady](#rcvfiledescrready) event.
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileStart"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### RcvFileSndCancelled
|
||||
|
||||
File was cancelled by the sender. This event may be sent instead of [CEvtRcvFileDescrReady](#rcvfiledescrready) event.
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileSndCancelled"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
- rcvFileTransfer: [RcvFileTransfer](./TYPES.md#rcvfiletransfer)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### RcvFileAccepted
|
||||
|
||||
This event will be sent when file is automatically accepted because of CLI option.
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileAccepted"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem: [AChatItem](./TYPES.md#achatitem)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### RcvFileError
|
||||
|
||||
Error receiving file.
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileError"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem_: [AChatItem](./TYPES.md#achatitem)?
|
||||
- agentError: [AgentErrorType](./TYPES.md#agenterrortype)
|
||||
- rcvFileTransfer: [RcvFileTransfer](./TYPES.md#rcvfiletransfer)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### RcvFileWarning
|
||||
|
||||
Warning when receiving file. It can happen when CLI settings do not allow to connect to file server(s).
|
||||
|
||||
**Record type**:
|
||||
- type: "rcvFileWarning"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem_: [AChatItem](./TYPES.md#achatitem)?
|
||||
- agentError: [AgentErrorType](./TYPES.md#agenterrortype)
|
||||
- rcvFileTransfer: [RcvFileTransfer](./TYPES.md#rcvfiletransfer)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### SndFileError
|
||||
|
||||
Error sending file.
|
||||
|
||||
**Record type**:
|
||||
- type: "sndFileError"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem_: [AChatItem](./TYPES.md#achatitem)?
|
||||
- fileTransferMeta: [FileTransferMeta](./TYPES.md#filetransfermeta)
|
||||
- errorMessage: string
|
||||
|
||||
---
|
||||
|
||||
|
||||
### SndFileWarning
|
||||
|
||||
Warning when sending file.
|
||||
|
||||
**Record type**:
|
||||
- type: "sndFileWarning"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- chatItem_: [AChatItem](./TYPES.md#achatitem)?
|
||||
- fileTransferMeta: [FileTransferMeta](./TYPES.md#filetransfermeta)
|
||||
- errorMessage: string
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Connection progress events
|
||||
|
||||
Bots may use these events to track progress of connections for monitoring or debugging.
|
||||
|
||||
|
||||
### AcceptingContactRequest
|
||||
|
||||
Automatically accepting contact request via bot's SimpleX address with auto-accept enabled.
|
||||
|
||||
**Record type**:
|
||||
- type: "acceptingContactRequest"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### AcceptingBusinessRequest
|
||||
|
||||
Automatically accepting contact request via bot's business address.
|
||||
|
||||
**Record type**:
|
||||
- type: "acceptingBusinessRequest"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ContactConnecting
|
||||
|
||||
Contact confirmed connection.
|
||||
|
||||
Sent when contact started connecting via bot's 1-time invitation link or when bot connects to another SimpleX address.
|
||||
|
||||
**Record type**:
|
||||
- type: "contactConnecting"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- contact: [Contact](./TYPES.md#contact)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### BusinessLinkConnecting
|
||||
|
||||
Contact confirmed connection.
|
||||
|
||||
Sent when bot connects to another business address.
|
||||
|
||||
**Record type**:
|
||||
- type: "businessLinkConnecting"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- hostMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- fromContact: [Contact](./TYPES.md#contact)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### JoinedGroupMemberConnecting
|
||||
|
||||
Group member is announced to the group and will be connecting to bot.
|
||||
|
||||
**Record type**:
|
||||
- type: "joinedGroupMemberConnecting"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- hostMember: [GroupMember](./TYPES.md#groupmember)
|
||||
- member: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### GroupLinkConnecting
|
||||
|
||||
Sent when bot joins group via another user link.
|
||||
|
||||
**Record type**:
|
||||
- type: "groupLinkConnecting"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- groupInfo: [GroupInfo](./TYPES.md#groupinfo)
|
||||
- hostMember: [GroupMember](./TYPES.md#groupmember)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Network connection events
|
||||
|
||||
|
||||
|
||||
|
||||
### HostConnected
|
||||
|
||||
Messaging or file server connected
|
||||
|
||||
**Record type**:
|
||||
- type: "hostConnected"
|
||||
- protocol: string
|
||||
- transportHost: string
|
||||
|
||||
---
|
||||
|
||||
|
||||
### HostDisconnected
|
||||
|
||||
Messaging or file server disconnected
|
||||
|
||||
**Record type**:
|
||||
- type: "hostDisconnected"
|
||||
- protocol: string
|
||||
- transportHost: string
|
||||
|
||||
---
|
||||
|
||||
|
||||
### SubscriptionStatus
|
||||
|
||||
Messaging subscription status changed
|
||||
|
||||
**Record type**:
|
||||
- type: "subscriptionStatus"
|
||||
- server: string
|
||||
- subscriptionStatus: [SubscriptionStatus](./TYPES.md#subscriptionstatus)
|
||||
- connections: [string]
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Error events
|
||||
|
||||
Bots may log these events for debugging. There will be many error events - this does NOT indicate a malfunction - e.g., they may happen because of bad network connectivity, or because messages may be delivered to deleted chats for a short period of time (they will be ignored).
|
||||
|
||||
|
||||
### MessageError
|
||||
|
||||
Message error.
|
||||
|
||||
**Record type**:
|
||||
- type: "messageError"
|
||||
- user: [User](./TYPES.md#user)
|
||||
- severity: string
|
||||
- errorMessage: string
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ChatError
|
||||
|
||||
Chat error (only used in WebSockets API).
|
||||
|
||||
**Record type**:
|
||||
- type: "chatError"
|
||||
- chatError: [ChatError](./TYPES.md#chaterror)
|
||||
|
||||
---
|
||||
|
||||
|
||||
### ChatErrors
|
||||
|
||||
Chat errors.
|
||||
|
||||
**Record type**:
|
||||
- type: "chatErrors"
|
||||
- chatErrors: [[ChatError](./TYPES.md#chaterror)]
|
||||
|
||||
---
|
||||
|
||||
+4547
File diff suppressed because it is too large
Load Diff
@@ -307,6 +307,7 @@ chatTypesDocsData =
|
||||
(sti @InlineFileMode, STEnum, "IFM", [], "", ""),
|
||||
(sti @InvitationLinkPlan, STUnion, "ILP", [], "", ""),
|
||||
(sti @InvitedBy, STUnion, "IB", [], "", ""),
|
||||
(sti @KeySendStatus, STUnion, "KS", [], "", ""),
|
||||
(sti @LinkContent, STUnion, "LC", [], "", ""),
|
||||
(sti @LinkOwnerSig, STRecord, "", [], "", ""),
|
||||
(sti @LinkPreview, STRecord, "", [], "", ""),
|
||||
@@ -534,6 +535,7 @@ deriving instance Generic HandshakeError
|
||||
deriving instance Generic InlineFileMode
|
||||
deriving instance Generic InvitationLinkPlan
|
||||
deriving instance Generic InvitedBy
|
||||
deriving instance Generic KeySendStatus
|
||||
deriving instance Generic JSONBadge
|
||||
deriving instance Generic JSONChatInfo
|
||||
deriving instance Generic JSONCIContent
|
||||
|
||||
@@ -0,0 +1,818 @@
|
||||
// API Commands
|
||||
// This file is generated automatically.
|
||||
|
||||
import * as T from "./types"
|
||||
|
||||
import {CR} from "./responses"
|
||||
|
||||
// Address commands
|
||||
// Bots can use these commands to automatically check and create address when initialized
|
||||
|
||||
// Create bot address.
|
||||
// Network usage: interactive.
|
||||
export interface APICreateMyAddress {
|
||||
userId: number // int64
|
||||
}
|
||||
|
||||
export namespace APICreateMyAddress {
|
||||
export type Response = CR.UserContactLinkCreated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APICreateMyAddress): string {
|
||||
return '/_address ' + self.userId
|
||||
}
|
||||
}
|
||||
|
||||
// Delete bot address.
|
||||
// Network usage: background.
|
||||
export interface APIDeleteMyAddress {
|
||||
userId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIDeleteMyAddress {
|
||||
export type Response = CR.UserContactLinkDeleted | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIDeleteMyAddress): string {
|
||||
return '/_delete_address ' + self.userId
|
||||
}
|
||||
}
|
||||
|
||||
// Get bot address and settings.
|
||||
// Network usage: no.
|
||||
export interface APIShowMyAddress {
|
||||
userId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIShowMyAddress {
|
||||
export type Response = CR.UserContactLink | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIShowMyAddress): string {
|
||||
return '/_show_address ' + self.userId
|
||||
}
|
||||
}
|
||||
|
||||
// Add address to bot profile.
|
||||
// Network usage: interactive.
|
||||
export interface APISetProfileAddress {
|
||||
userId: number // int64
|
||||
enable: boolean
|
||||
}
|
||||
|
||||
export namespace APISetProfileAddress {
|
||||
export type Response = CR.UserProfileUpdated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetProfileAddress): string {
|
||||
return '/_profile_address ' + self.userId + ' ' + (self.enable ? 'on' : 'off')
|
||||
}
|
||||
}
|
||||
|
||||
// Set bot address settings.
|
||||
// Network usage: interactive.
|
||||
export interface APISetAddressSettings {
|
||||
userId: number // int64
|
||||
settings: T.AddressSettings
|
||||
}
|
||||
|
||||
export namespace APISetAddressSettings {
|
||||
export type Response = CR.UserContactLinkUpdated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetAddressSettings): string {
|
||||
return '/_address_settings ' + self.userId + ' ' + JSON.stringify(self.settings)
|
||||
}
|
||||
}
|
||||
|
||||
// Message commands
|
||||
// Commands to send, update, delete, moderate messages and set message reactions
|
||||
|
||||
// Send messages.
|
||||
// Network usage: background.
|
||||
export interface APISendMessages {
|
||||
sendRef: T.ChatRef
|
||||
liveMessage: boolean
|
||||
ttl?: number // int
|
||||
signMessages: boolean
|
||||
composedMessages: T.ComposedMessage[] // non-empty
|
||||
}
|
||||
|
||||
export namespace APISendMessages {
|
||||
export type Response = CR.NewChatItems | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISendMessages): string {
|
||||
return '/_send ' + T.ChatRef.cmdString(self.sendRef) + (self.liveMessage ? ' live=on' : '') + (self.ttl ? ' ttl=' + self.ttl : '') + (self.signMessages ? ' sign=on' : '') + ' json ' + JSON.stringify(self.composedMessages)
|
||||
}
|
||||
}
|
||||
|
||||
// Update message.
|
||||
// Network usage: background.
|
||||
export interface APIUpdateChatItem {
|
||||
chatRef: T.ChatRef
|
||||
chatItemId: number // int64
|
||||
liveMessage: boolean
|
||||
updatedMessage: T.UpdatedMessage
|
||||
}
|
||||
|
||||
export namespace APIUpdateChatItem {
|
||||
export type Response = CR.ChatItemUpdated | CR.ChatItemNotChanged | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIUpdateChatItem): string {
|
||||
return '/_update item ' + T.ChatRef.cmdString(self.chatRef) + ' ' + self.chatItemId + (self.liveMessage ? ' live=on' : '') + ' json ' + JSON.stringify(self.updatedMessage)
|
||||
}
|
||||
}
|
||||
|
||||
// Delete message.
|
||||
// Network usage: background.
|
||||
export interface APIDeleteChatItem {
|
||||
chatRef: T.ChatRef
|
||||
chatItemIds: number[] // int64, non-empty
|
||||
deleteMode: T.CIDeleteMode
|
||||
}
|
||||
|
||||
export namespace APIDeleteChatItem {
|
||||
export type Response = CR.ChatItemsDeleted | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIDeleteChatItem): string {
|
||||
return '/_delete item ' + T.ChatRef.cmdString(self.chatRef) + ' ' + self.chatItemIds.join(',') + ' ' + self.deleteMode
|
||||
}
|
||||
}
|
||||
|
||||
// Moderate message. Requires Moderator role (and higher than message author's).
|
||||
// Network usage: background.
|
||||
export interface APIDeleteMemberChatItem {
|
||||
groupId: number // int64
|
||||
chatItemIds: number[] // int64, non-empty
|
||||
}
|
||||
|
||||
export namespace APIDeleteMemberChatItem {
|
||||
export type Response = CR.ChatItemsDeleted | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIDeleteMemberChatItem): string {
|
||||
return '/_delete member item #' + self.groupId + ' ' + self.chatItemIds.join(',')
|
||||
}
|
||||
}
|
||||
|
||||
// Add/remove message reaction.
|
||||
// Network usage: background.
|
||||
export interface APIChatItemReaction {
|
||||
chatRef: T.ChatRef
|
||||
chatItemId: number // int64
|
||||
add: boolean
|
||||
reaction: T.MsgReaction
|
||||
}
|
||||
|
||||
export namespace APIChatItemReaction {
|
||||
export type Response = CR.ChatItemReaction | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIChatItemReaction): string {
|
||||
return '/_reaction ' + T.ChatRef.cmdString(self.chatRef) + ' ' + self.chatItemId + ' ' + (self.add ? 'on' : 'off') + ' ' + JSON.stringify(self.reaction)
|
||||
}
|
||||
}
|
||||
|
||||
// File commands
|
||||
// Commands to receive and to cancel files. Files are sent as part of the message, there are no separate commands to send files.
|
||||
|
||||
// Receive file.
|
||||
// Network usage: no.
|
||||
export interface ReceiveFile {
|
||||
fileId: number // int64
|
||||
userApprovedRelays: boolean
|
||||
storeEncrypted?: boolean
|
||||
fileInline?: boolean
|
||||
filePath?: string
|
||||
}
|
||||
|
||||
export namespace ReceiveFile {
|
||||
export type Response = CR.RcvFileAccepted | CR.RcvFileAcceptedSndCancelled | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: ReceiveFile): string {
|
||||
return '/freceive ' + self.fileId + (self.userApprovedRelays ? ' approved_relays=on' : '') + (typeof self.storeEncrypted == 'boolean' ? ' encrypt=' + (self.storeEncrypted ? 'on' : 'off') : '') + (typeof self.fileInline == 'boolean' ? ' inline=' + (self.fileInline ? 'on' : 'off') : '') + (self.filePath ? ' ' + self.filePath : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel file.
|
||||
// Network usage: background.
|
||||
export interface CancelFile {
|
||||
fileId: number // int64
|
||||
}
|
||||
|
||||
export namespace CancelFile {
|
||||
export type Response = CR.SndFileCancelled | CR.RcvFileCancelled | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: CancelFile): string {
|
||||
return '/fcancel ' + self.fileId
|
||||
}
|
||||
}
|
||||
|
||||
// Group commands
|
||||
// Commands to manage and moderate groups. These commands can be used with business chats as well - they are groups. E.g., a common scenario would be to add human agents to business chat with the customer who connected via business address.
|
||||
|
||||
// Add contact to group. Requires bot to have Admin role.
|
||||
// Network usage: interactive.
|
||||
export interface APIAddMember {
|
||||
groupId: number // int64
|
||||
contactId: number // int64
|
||||
memberRole: T.GroupMemberRole
|
||||
}
|
||||
|
||||
export namespace APIAddMember {
|
||||
export type Response = CR.SentGroupInvitation | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIAddMember): string {
|
||||
return '/_add #' + self.groupId + ' ' + self.contactId + ' ' + self.memberRole
|
||||
}
|
||||
}
|
||||
|
||||
// Join group.
|
||||
// Network usage: interactive.
|
||||
export interface APIJoinGroup {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIJoinGroup {
|
||||
export type Response = CR.UserAcceptedGroupSent | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIJoinGroup): string {
|
||||
return '/_join #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Accept group member. Requires Admin role.
|
||||
// Network usage: background.
|
||||
export interface APIAcceptMember {
|
||||
groupId: number // int64
|
||||
groupMemberId: number // int64
|
||||
memberRole: T.GroupMemberRole
|
||||
}
|
||||
|
||||
export namespace APIAcceptMember {
|
||||
export type Response = CR.MemberAccepted | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIAcceptMember): string {
|
||||
return '/_accept member #' + self.groupId + ' ' + self.groupMemberId + ' ' + self.memberRole
|
||||
}
|
||||
}
|
||||
|
||||
// Set members role. Requires Admin role.
|
||||
// Network usage: background.
|
||||
export interface APIMembersRole {
|
||||
groupId: number // int64
|
||||
groupMemberIds: number[] // int64, non-empty
|
||||
memberRole: T.GroupMemberRole
|
||||
}
|
||||
|
||||
export namespace APIMembersRole {
|
||||
export type Response = CR.MembersRoleUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIMembersRole): string {
|
||||
return '/_member role #' + self.groupId + ' ' + self.groupMemberIds.join(',') + ' ' + self.memberRole
|
||||
}
|
||||
}
|
||||
|
||||
// Block members. Requires Moderator role.
|
||||
// Network usage: background.
|
||||
export interface APIBlockMembersForAll {
|
||||
groupId: number // int64
|
||||
groupMemberIds: number[] // int64, non-empty
|
||||
blocked: boolean
|
||||
}
|
||||
|
||||
export namespace APIBlockMembersForAll {
|
||||
export type Response = CR.MembersBlockedForAllUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIBlockMembersForAll): string {
|
||||
return '/_block #' + self.groupId + ' ' + self.groupMemberIds.join(',') + ' blocked=' + (self.blocked ? 'on' : 'off')
|
||||
}
|
||||
}
|
||||
|
||||
// Remove members. Requires Admin role.
|
||||
// Network usage: background.
|
||||
export interface APIRemoveMembers {
|
||||
groupId: number // int64
|
||||
groupMemberIds: number[] // int64, non-empty
|
||||
withMessages: boolean
|
||||
}
|
||||
|
||||
export namespace APIRemoveMembers {
|
||||
export type Response = CR.UserDeletedMembers | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIRemoveMembers): string {
|
||||
return '/_remove #' + self.groupId + ' ' + self.groupMemberIds.join(',') + (self.withMessages ? ' messages=on' : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Leave group.
|
||||
// Network usage: background.
|
||||
export interface APILeaveGroup {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APILeaveGroup {
|
||||
export type Response = CR.LeftMemberUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APILeaveGroup): string {
|
||||
return '/_leave #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Get group members.
|
||||
// Network usage: no.
|
||||
export interface APIListMembers {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIListMembers {
|
||||
export type Response = CR.GroupMembers | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIListMembers): string {
|
||||
return '/_members #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Create group.
|
||||
// Network usage: no.
|
||||
export interface APINewGroup {
|
||||
userId: number // int64
|
||||
incognito: boolean
|
||||
groupProfile: T.GroupProfile
|
||||
}
|
||||
|
||||
export namespace APINewGroup {
|
||||
export type Response = CR.GroupCreated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APINewGroup): string {
|
||||
return '/_group ' + self.userId + (self.incognito ? ' incognito=on' : '') + ' ' + JSON.stringify(self.groupProfile)
|
||||
}
|
||||
}
|
||||
|
||||
// Create public group.
|
||||
// Network usage: interactive.
|
||||
export interface APINewPublicGroup {
|
||||
userId: number // int64
|
||||
incognito: boolean
|
||||
relayIds: number[] // int64, non-empty
|
||||
groupProfile: T.GroupProfile
|
||||
}
|
||||
|
||||
export namespace APINewPublicGroup {
|
||||
export type Response = CR.PublicGroupCreated | CR.PublicGroupCreationFailed | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APINewPublicGroup): string {
|
||||
return '/_public group ' + self.userId + (self.incognito ? ' incognito=on' : '') + ' ' + self.relayIds.join(',') + ' ' + JSON.stringify(self.groupProfile)
|
||||
}
|
||||
}
|
||||
|
||||
// Get group relays.
|
||||
// Network usage: no.
|
||||
export interface APIGetGroupRelays {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIGetGroupRelays {
|
||||
export type Response = CR.GroupRelays | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIGetGroupRelays): string {
|
||||
return '/_get relays #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Add relays to group.
|
||||
// Network usage: interactive.
|
||||
export interface APIAddGroupRelays {
|
||||
groupId: number // int64
|
||||
relayIds: number[] // int64, non-empty
|
||||
}
|
||||
|
||||
export namespace APIAddGroupRelays {
|
||||
export type Response = CR.GroupRelaysAdded | CR.GroupRelaysAddFailed | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIAddGroupRelays): string {
|
||||
return '/_add relays #' + self.groupId + ' ' + self.relayIds.join(',')
|
||||
}
|
||||
}
|
||||
|
||||
// Clear relay rejection for a channel (relay operator).
|
||||
// Network usage: background.
|
||||
export interface APIAllowRelayGroup {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIAllowRelayGroup {
|
||||
export type Response = CR.RelayGroupAllowed | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIAllowRelayGroup): string {
|
||||
return '/_relay allow #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Update group profile.
|
||||
// Network usage: background.
|
||||
export interface APIUpdateGroupProfile {
|
||||
groupId: number // int64
|
||||
groupProfile: T.GroupProfile
|
||||
}
|
||||
|
||||
export namespace APIUpdateGroupProfile {
|
||||
export type Response = CR.GroupUpdated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIUpdateGroupProfile): string {
|
||||
return '/_group_profile #' + self.groupId + ' ' + JSON.stringify(self.groupProfile)
|
||||
}
|
||||
}
|
||||
|
||||
// Group link commands
|
||||
// These commands can be used by bots that manage multiple public groups
|
||||
|
||||
// Create group link.
|
||||
// Network usage: interactive.
|
||||
export interface APICreateGroupLink {
|
||||
groupId: number // int64
|
||||
memberRole: T.GroupMemberRole
|
||||
}
|
||||
|
||||
export namespace APICreateGroupLink {
|
||||
export type Response = CR.GroupLinkCreated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APICreateGroupLink): string {
|
||||
return '/_create link #' + self.groupId + ' ' + self.memberRole
|
||||
}
|
||||
}
|
||||
|
||||
// Set member role for group link.
|
||||
// Network usage: no.
|
||||
export interface APIGroupLinkMemberRole {
|
||||
groupId: number // int64
|
||||
memberRole: T.GroupMemberRole
|
||||
}
|
||||
|
||||
export namespace APIGroupLinkMemberRole {
|
||||
export type Response = CR.GroupLink | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIGroupLinkMemberRole): string {
|
||||
return '/_set link role #' + self.groupId + ' ' + self.memberRole
|
||||
}
|
||||
}
|
||||
|
||||
// Delete group link.
|
||||
// Network usage: background.
|
||||
export interface APIDeleteGroupLink {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIDeleteGroupLink {
|
||||
export type Response = CR.GroupLinkDeleted | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIDeleteGroupLink): string {
|
||||
return '/_delete link #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Get group link.
|
||||
// Network usage: no.
|
||||
export interface APIGetGroupLink {
|
||||
groupId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIGetGroupLink {
|
||||
export type Response = CR.GroupLink | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIGetGroupLink): string {
|
||||
return '/_get link #' + self.groupId
|
||||
}
|
||||
}
|
||||
|
||||
// Connection commands
|
||||
// These commands may be used to create connections. Most bots do not need to use them - bot users will connect via bot address with auto-accept enabled.
|
||||
|
||||
// Create 1-time invitation link.
|
||||
// Network usage: interactive.
|
||||
export interface APIAddContact {
|
||||
userId: number // int64
|
||||
incognito: boolean
|
||||
}
|
||||
|
||||
export namespace APIAddContact {
|
||||
export type Response = CR.Invitation | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIAddContact): string {
|
||||
return '/_connect ' + self.userId + (self.incognito ? ' incognito=on' : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Determine SimpleX link type and if the bot is already connected via this link or name.
|
||||
// Network usage: interactive.
|
||||
export interface APIConnectPlan {
|
||||
userId: number // int64
|
||||
connectTarget?: string
|
||||
resolveMode: T.PlanResolveMode
|
||||
linkOwnerSig?: T.LinkOwnerSig
|
||||
}
|
||||
|
||||
export namespace APIConnectPlan {
|
||||
export type Response = CR.ConnectionPlan | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIConnectPlan): string {
|
||||
return '/_connect plan ' + self.userId + ' ' + self.connectTarget
|
||||
}
|
||||
}
|
||||
|
||||
// Connect via prepared SimpleX link. The link can be 1-time invitation link, contact address or group link.
|
||||
// Network usage: interactive.
|
||||
export interface APIConnect {
|
||||
userId: number // int64
|
||||
incognito: boolean
|
||||
preparedLink_?: T.CreatedConnLink
|
||||
}
|
||||
|
||||
export namespace APIConnect {
|
||||
export type Response = CR.SentConfirmation | CR.ContactAlreadyExists | CR.SentInvitation | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIConnect): string {
|
||||
return '/_connect ' + self.userId + (self.preparedLink_ ? ' ' + T.CreatedConnLink.cmdString(self.preparedLink_) : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Connect via SimpleX link or name as string in the active user profile.
|
||||
// Network usage: interactive.
|
||||
export interface Connect {
|
||||
incognito: boolean
|
||||
connTarget_?: string
|
||||
}
|
||||
|
||||
export namespace Connect {
|
||||
export type Response = CR.SentConfirmation | CR.ContactAlreadyExists | CR.SentInvitation | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: Connect): string {
|
||||
return '/connect' + (self.connTarget_ ? ' ' + self.connTarget_ : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Accept contact request.
|
||||
// Network usage: interactive.
|
||||
export interface APIAcceptContact {
|
||||
contactReqId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIAcceptContact {
|
||||
export type Response = CR.AcceptingContactRequest | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIAcceptContact): string {
|
||||
return '/_accept ' + self.contactReqId
|
||||
}
|
||||
}
|
||||
|
||||
// Reject contact request. The user who sent the request is **not notified**.
|
||||
// Network usage: no.
|
||||
export interface APIRejectContact {
|
||||
contactReqId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIRejectContact {
|
||||
export type Response = CR.ContactRequestRejected | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIRejectContact): string {
|
||||
return '/_reject ' + self.contactReqId
|
||||
}
|
||||
}
|
||||
|
||||
// Chat commands
|
||||
// Commands to list and delete conversations.
|
||||
|
||||
// Get contacts.
|
||||
// Network usage: no.
|
||||
export interface APIListContacts {
|
||||
userId: number // int64
|
||||
}
|
||||
|
||||
export namespace APIListContacts {
|
||||
export type Response = CR.ContactsList | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIListContacts): string {
|
||||
return '/_contacts ' + self.userId
|
||||
}
|
||||
}
|
||||
|
||||
// Get groups.
|
||||
// Network usage: no.
|
||||
export interface APIListGroups {
|
||||
userId: number // int64
|
||||
contactId_?: number // int64
|
||||
search?: string
|
||||
}
|
||||
|
||||
export namespace APIListGroups {
|
||||
export type Response = CR.GroupsList | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIListGroups): string {
|
||||
return '/_groups ' + self.userId + (self.contactId_ ? ' @' + self.contactId_ : '') + (self.search ? ' ' + self.search : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Get chat previews. Supports time-based pagination — use this instead of APIListContacts / APIListGroups when scanning at scale (those load every record into memory and fail on large databases).
|
||||
// Network usage: no.
|
||||
export interface APIGetChats {
|
||||
userId: number // int64
|
||||
pendingConnections: boolean
|
||||
pagination: T.PaginationByTime
|
||||
query: T.ChatListQuery
|
||||
}
|
||||
|
||||
export namespace APIGetChats {
|
||||
export type Response = CR.ApiChats | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIGetChats): string {
|
||||
return '/_get chats ' + self.userId + (self.pendingConnections ? ' pcc=on' : '') + ' ' + T.PaginationByTime.cmdString(self.pagination) + ' ' + JSON.stringify(self.query)
|
||||
}
|
||||
}
|
||||
|
||||
// Delete chat.
|
||||
// Network usage: background.
|
||||
export interface APIDeleteChat {
|
||||
chatRef: T.ChatRef
|
||||
chatDeleteMode: T.ChatDeleteMode
|
||||
}
|
||||
|
||||
export namespace APIDeleteChat {
|
||||
export type Response = CR.ContactDeleted | CR.ContactConnectionDeleted | CR.GroupDeletedUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIDeleteChat): string {
|
||||
return '/_delete ' + T.ChatRef.cmdString(self.chatRef) + ' ' + T.ChatDeleteMode.cmdString(self.chatDeleteMode)
|
||||
}
|
||||
}
|
||||
|
||||
// Set group custom data.
|
||||
// Network usage: no.
|
||||
export interface APISetGroupCustomData {
|
||||
groupId: number // int64
|
||||
customData?: object
|
||||
}
|
||||
|
||||
export namespace APISetGroupCustomData {
|
||||
export type Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetGroupCustomData): string {
|
||||
return '/_set custom #' + self.groupId + (self.customData ? ' ' + JSON.stringify(self.customData) : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Set contact custom data.
|
||||
// Network usage: no.
|
||||
export interface APISetContactCustomData {
|
||||
contactId: number // int64
|
||||
customData?: object
|
||||
}
|
||||
|
||||
export namespace APISetContactCustomData {
|
||||
export type Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetContactCustomData): string {
|
||||
return '/_set custom @' + self.contactId + (self.customData ? ' ' + JSON.stringify(self.customData) : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Set auto-accept member contacts.
|
||||
// Network usage: no.
|
||||
export interface APISetUserAutoAcceptMemberContacts {
|
||||
userId: number // int64
|
||||
onOff: boolean
|
||||
}
|
||||
|
||||
export namespace APISetUserAutoAcceptMemberContacts {
|
||||
export type Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetUserAutoAcceptMemberContacts): string {
|
||||
return '/_set accept member contacts ' + self.userId + ' ' + (self.onOff ? 'on' : 'off')
|
||||
}
|
||||
}
|
||||
|
||||
// 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).
|
||||
|
||||
// Get active user profile.
|
||||
// Network usage: no.
|
||||
export interface ShowActiveUser {
|
||||
}
|
||||
|
||||
export namespace ShowActiveUser {
|
||||
export type Response = CR.ActiveUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(_self: ShowActiveUser): string {
|
||||
return '/user'
|
||||
}
|
||||
}
|
||||
|
||||
// Create new user profile.
|
||||
// Network usage: no.
|
||||
export interface CreateActiveUser {
|
||||
newUser: T.NewUser
|
||||
}
|
||||
|
||||
export namespace CreateActiveUser {
|
||||
export type Response = CR.ActiveUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: CreateActiveUser): string {
|
||||
return '/_create user ' + JSON.stringify(self.newUser)
|
||||
}
|
||||
}
|
||||
|
||||
// Get all user profiles.
|
||||
// Network usage: no.
|
||||
export interface ListUsers {
|
||||
}
|
||||
|
||||
export namespace ListUsers {
|
||||
export type Response = CR.UsersList | CR.ChatCmdError
|
||||
|
||||
export function cmdString(_self: ListUsers): string {
|
||||
return '/users'
|
||||
}
|
||||
}
|
||||
|
||||
// Set active user profile.
|
||||
// Network usage: no.
|
||||
export interface APISetActiveUser {
|
||||
userId: number // int64
|
||||
viewPwd?: string
|
||||
}
|
||||
|
||||
export namespace APISetActiveUser {
|
||||
export type Response = CR.ActiveUser | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetActiveUser): string {
|
||||
return '/_user ' + self.userId + (self.viewPwd ? ' ' + JSON.stringify(self.viewPwd) : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Delete user profile.
|
||||
// Network usage: background.
|
||||
export interface APIDeleteUser {
|
||||
userId: number // int64
|
||||
delSMPQueues: boolean
|
||||
viewPwd?: string
|
||||
}
|
||||
|
||||
export namespace APIDeleteUser {
|
||||
export type Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIDeleteUser): string {
|
||||
return '/_delete user ' + self.userId + ' del_smp=' + (self.delSMPQueues ? 'on' : 'off') + (self.viewPwd ? ' ' + JSON.stringify(self.viewPwd) : '')
|
||||
}
|
||||
}
|
||||
|
||||
// Update user profile.
|
||||
// Network usage: background.
|
||||
export interface APIUpdateProfile {
|
||||
userId: number // int64
|
||||
profile: T.Profile
|
||||
}
|
||||
|
||||
export namespace APIUpdateProfile {
|
||||
export type Response = CR.UserProfileUpdated | CR.UserProfileNoChange | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APIUpdateProfile): string {
|
||||
return '/_profile ' + self.userId + ' ' + JSON.stringify(self.profile)
|
||||
}
|
||||
}
|
||||
|
||||
// Configure chat preference overrides for the contact.
|
||||
// Network usage: background.
|
||||
export interface APISetContactPrefs {
|
||||
contactId: number // int64
|
||||
preferences: T.Preferences
|
||||
}
|
||||
|
||||
export namespace APISetContactPrefs {
|
||||
export type Response = CR.ContactPrefsUpdated | CR.ChatCmdError
|
||||
|
||||
export function cmdString(self: APISetContactPrefs): string {
|
||||
return '/_set prefs @' + self.contactId + ' ' + JSON.stringify(self.preferences)
|
||||
}
|
||||
}
|
||||
|
||||
// Chat management
|
||||
// These commands should not be used with CLI-based bots
|
||||
|
||||
// Start chat controller.
|
||||
// Network usage: no.
|
||||
export interface StartChat {
|
||||
mainApp: boolean
|
||||
enableSndFiles: boolean
|
||||
}
|
||||
|
||||
export namespace StartChat {
|
||||
export type Response = CR.ChatStarted | CR.ChatRunning
|
||||
|
||||
export function cmdString(_self: StartChat): string {
|
||||
return '/_start'
|
||||
}
|
||||
}
|
||||
|
||||
// Stop chat controller.
|
||||
// Network usage: no.
|
||||
export interface APIStopChat {
|
||||
}
|
||||
|
||||
export namespace APIStopChat {
|
||||
export type Response = CR.ChatStopped
|
||||
|
||||
export function cmdString(_self: APIStopChat): string {
|
||||
return '/_stop'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,473 @@
|
||||
// API Events
|
||||
// This file is generated automatically.
|
||||
|
||||
import * as T from "./types"
|
||||
|
||||
export type ChatEvent =
|
||||
| CEvt.ContactConnected
|
||||
| CEvt.ContactUpdated
|
||||
| CEvt.ContactDeletedByContact
|
||||
| CEvt.ReceivedContactRequest
|
||||
| CEvt.NewMemberContactReceivedInv
|
||||
| CEvt.ContactSndReady
|
||||
| CEvt.NewChatItems
|
||||
| CEvt.ChatItemReaction
|
||||
| CEvt.ChatItemsDeleted
|
||||
| CEvt.ChatItemUpdated
|
||||
| CEvt.GroupChatItemsDeleted
|
||||
| CEvt.ChatItemsStatusesUpdated
|
||||
| CEvt.ReceivedGroupInvitation
|
||||
| CEvt.UserJoinedGroup
|
||||
| CEvt.GroupUpdated
|
||||
| CEvt.JoinedGroupMember
|
||||
| CEvt.MemberRole
|
||||
| CEvt.DeletedMember
|
||||
| CEvt.LeftMember
|
||||
| CEvt.DeletedMemberUser
|
||||
| CEvt.GroupDeleted
|
||||
| CEvt.ConnectedToGroupMember
|
||||
| CEvt.MemberAcceptedByOther
|
||||
| CEvt.MemberBlockedForAll
|
||||
| CEvt.GroupMemberUpdated
|
||||
| CEvt.GroupLinkDataUpdated
|
||||
| CEvt.GroupRelayUpdated
|
||||
| CEvt.RcvFileDescrReady
|
||||
| CEvt.RcvFileComplete
|
||||
| CEvt.SndFileCompleteXFTP
|
||||
| CEvt.RcvFileStart
|
||||
| CEvt.RcvFileSndCancelled
|
||||
| CEvt.RcvFileAccepted
|
||||
| CEvt.RcvFileError
|
||||
| CEvt.RcvFileWarning
|
||||
| CEvt.SndFileError
|
||||
| CEvt.SndFileWarning
|
||||
| CEvt.AcceptingContactRequest
|
||||
| CEvt.AcceptingBusinessRequest
|
||||
| CEvt.ContactConnecting
|
||||
| CEvt.BusinessLinkConnecting
|
||||
| CEvt.JoinedGroupMemberConnecting
|
||||
| CEvt.GroupLinkConnecting
|
||||
| CEvt.HostConnected
|
||||
| CEvt.HostDisconnected
|
||||
| CEvt.SubscriptionStatus
|
||||
| CEvt.MessageError
|
||||
| CEvt.ChatError
|
||||
| CEvt.ChatErrors
|
||||
|
||||
export namespace CEvt {
|
||||
export type Tag =
|
||||
| "contactConnected"
|
||||
| "contactUpdated"
|
||||
| "contactDeletedByContact"
|
||||
| "receivedContactRequest"
|
||||
| "newMemberContactReceivedInv"
|
||||
| "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"
|
||||
| "groupLinkConnecting"
|
||||
| "hostConnected"
|
||||
| "hostDisconnected"
|
||||
| "subscriptionStatus"
|
||||
| "messageError"
|
||||
| "chatError"
|
||||
| "chatErrors"
|
||||
|
||||
interface Interface {
|
||||
type: Tag
|
||||
}
|
||||
|
||||
export interface ContactConnected extends Interface {
|
||||
type: "contactConnected"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
userCustomProfile?: T.Profile
|
||||
}
|
||||
|
||||
export interface ContactUpdated extends Interface {
|
||||
type: "contactUpdated"
|
||||
user: T.User
|
||||
fromContact: T.Contact
|
||||
toContact: T.Contact
|
||||
}
|
||||
|
||||
export interface ContactDeletedByContact extends Interface {
|
||||
type: "contactDeletedByContact"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface ReceivedContactRequest extends Interface {
|
||||
type: "receivedContactRequest"
|
||||
user: T.User
|
||||
contactRequest: T.UserContactRequest
|
||||
chat_?: T.AChat
|
||||
}
|
||||
|
||||
export interface NewMemberContactReceivedInv extends Interface {
|
||||
type: "newMemberContactReceivedInv"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
}
|
||||
|
||||
export interface ContactSndReady extends Interface {
|
||||
type: "contactSndReady"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface NewChatItems extends Interface {
|
||||
type: "newChatItems"
|
||||
user: T.User
|
||||
chatItems: T.AChatItem[]
|
||||
}
|
||||
|
||||
export interface ChatItemReaction extends Interface {
|
||||
type: "chatItemReaction"
|
||||
user: T.User
|
||||
added: boolean
|
||||
reaction: T.ACIReaction
|
||||
}
|
||||
|
||||
export interface ChatItemsDeleted extends Interface {
|
||||
type: "chatItemsDeleted"
|
||||
user: T.User
|
||||
chatItemDeletions: T.ChatItemDeletion[]
|
||||
byUser: boolean
|
||||
timed: boolean
|
||||
}
|
||||
|
||||
export interface ChatItemUpdated extends Interface {
|
||||
type: "chatItemUpdated"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface GroupChatItemsDeleted extends Interface {
|
||||
type: "groupChatItemsDeleted"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
chatItemIDs: number[] // int64
|
||||
byUser: boolean
|
||||
member_?: T.GroupMember
|
||||
}
|
||||
|
||||
export interface ChatItemsStatusesUpdated extends Interface {
|
||||
type: "chatItemsStatusesUpdated"
|
||||
user: T.User
|
||||
chatItems: T.AChatItem[]
|
||||
}
|
||||
|
||||
export interface ReceivedGroupInvitation extends Interface {
|
||||
type: "receivedGroupInvitation"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
contact: T.Contact
|
||||
fromMemberRole: T.GroupMemberRole
|
||||
memberRole: T.GroupMemberRole
|
||||
}
|
||||
|
||||
export interface UserJoinedGroup extends Interface {
|
||||
type: "userJoinedGroup"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
hostMember: T.GroupMember
|
||||
}
|
||||
|
||||
export interface GroupUpdated extends Interface {
|
||||
type: "groupUpdated"
|
||||
user: T.User
|
||||
fromGroup: T.GroupInfo
|
||||
toGroup: T.GroupInfo
|
||||
member_?: T.GroupMember
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface JoinedGroupMember extends Interface {
|
||||
type: "joinedGroupMember"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
}
|
||||
|
||||
export interface MemberRole extends Interface {
|
||||
type: "memberRole"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
byMember: T.GroupMember
|
||||
member: T.GroupMember
|
||||
fromRole: T.GroupMemberRole
|
||||
toRole: T.GroupMemberRole
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface DeletedMember extends Interface {
|
||||
type: "deletedMember"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
byMember: T.GroupMember
|
||||
deletedMember: T.GroupMember
|
||||
withMessages: boolean
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface LeftMember extends Interface {
|
||||
type: "leftMember"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface DeletedMemberUser extends Interface {
|
||||
type: "deletedMemberUser"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
withMessages: boolean
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface GroupDeleted extends Interface {
|
||||
type: "groupDeleted"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface ConnectedToGroupMember extends Interface {
|
||||
type: "connectedToGroupMember"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
memberContact?: T.Contact
|
||||
}
|
||||
|
||||
export interface MemberAcceptedByOther extends Interface {
|
||||
type: "memberAcceptedByOther"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
acceptingMember: T.GroupMember
|
||||
member: T.GroupMember
|
||||
}
|
||||
|
||||
export interface MemberBlockedForAll extends Interface {
|
||||
type: "memberBlockedForAll"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
byMember: T.GroupMember
|
||||
member: T.GroupMember
|
||||
blocked: boolean
|
||||
msgSigned?: T.MsgSigStatus
|
||||
}
|
||||
|
||||
export interface GroupMemberUpdated extends Interface {
|
||||
type: "groupMemberUpdated"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
fromMember: T.GroupMember
|
||||
toMember: T.GroupMember
|
||||
}
|
||||
|
||||
export interface GroupLinkDataUpdated extends Interface {
|
||||
type: "groupLinkDataUpdated"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
groupLink: T.GroupLink
|
||||
groupRelays: T.GroupRelay[]
|
||||
relaysChanged: boolean
|
||||
}
|
||||
|
||||
export interface GroupRelayUpdated extends Interface {
|
||||
type: "groupRelayUpdated"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
groupRelay: T.GroupRelay
|
||||
}
|
||||
|
||||
export interface RcvFileDescrReady extends Interface {
|
||||
type: "rcvFileDescrReady"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
rcvFileTransfer: T.RcvFileTransfer
|
||||
rcvFileDescr: T.RcvFileDescr
|
||||
}
|
||||
|
||||
export interface RcvFileComplete extends Interface {
|
||||
type: "rcvFileComplete"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface SndFileCompleteXFTP extends Interface {
|
||||
type: "sndFileCompleteXFTP"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
fileTransferMeta: T.FileTransferMeta
|
||||
}
|
||||
|
||||
export interface RcvFileStart extends Interface {
|
||||
type: "rcvFileStart"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface RcvFileSndCancelled extends Interface {
|
||||
type: "rcvFileSndCancelled"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
rcvFileTransfer: T.RcvFileTransfer
|
||||
}
|
||||
|
||||
export interface RcvFileAccepted extends Interface {
|
||||
type: "rcvFileAccepted"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface RcvFileError extends Interface {
|
||||
type: "rcvFileError"
|
||||
user: T.User
|
||||
chatItem_?: T.AChatItem
|
||||
agentError: T.AgentErrorType
|
||||
rcvFileTransfer: T.RcvFileTransfer
|
||||
}
|
||||
|
||||
export interface RcvFileWarning extends Interface {
|
||||
type: "rcvFileWarning"
|
||||
user: T.User
|
||||
chatItem_?: T.AChatItem
|
||||
agentError: T.AgentErrorType
|
||||
rcvFileTransfer: T.RcvFileTransfer
|
||||
}
|
||||
|
||||
export interface SndFileError extends Interface {
|
||||
type: "sndFileError"
|
||||
user: T.User
|
||||
chatItem_?: T.AChatItem
|
||||
fileTransferMeta: T.FileTransferMeta
|
||||
errorMessage: string
|
||||
}
|
||||
|
||||
export interface SndFileWarning extends Interface {
|
||||
type: "sndFileWarning"
|
||||
user: T.User
|
||||
chatItem_?: T.AChatItem
|
||||
fileTransferMeta: T.FileTransferMeta
|
||||
errorMessage: string
|
||||
}
|
||||
|
||||
export interface AcceptingContactRequest extends Interface {
|
||||
type: "acceptingContactRequest"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface AcceptingBusinessRequest extends Interface {
|
||||
type: "acceptingBusinessRequest"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
}
|
||||
|
||||
export interface ContactConnecting extends Interface {
|
||||
type: "contactConnecting"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface BusinessLinkConnecting extends Interface {
|
||||
type: "businessLinkConnecting"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
hostMember: T.GroupMember
|
||||
fromContact: T.Contact
|
||||
}
|
||||
|
||||
export interface JoinedGroupMemberConnecting extends Interface {
|
||||
type: "joinedGroupMemberConnecting"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
hostMember: T.GroupMember
|
||||
member: T.GroupMember
|
||||
}
|
||||
|
||||
export interface GroupLinkConnecting extends Interface {
|
||||
type: "groupLinkConnecting"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
hostMember: T.GroupMember
|
||||
}
|
||||
|
||||
export interface HostConnected extends Interface {
|
||||
type: "hostConnected"
|
||||
protocol: string
|
||||
transportHost: string
|
||||
}
|
||||
|
||||
export interface HostDisconnected extends Interface {
|
||||
type: "hostDisconnected"
|
||||
protocol: string
|
||||
transportHost: string
|
||||
}
|
||||
|
||||
export interface SubscriptionStatus extends Interface {
|
||||
type: "subscriptionStatus"
|
||||
server: string
|
||||
subscriptionStatus: T.SubscriptionStatus
|
||||
connections: string[]
|
||||
}
|
||||
|
||||
export interface MessageError extends Interface {
|
||||
type: "messageError"
|
||||
user: T.User
|
||||
severity: string
|
||||
errorMessage: string
|
||||
}
|
||||
|
||||
export interface ChatError extends Interface {
|
||||
type: "chatError"
|
||||
chatError: T.ChatError
|
||||
}
|
||||
|
||||
export interface ChatErrors extends Interface {
|
||||
type: "chatErrors"
|
||||
chatErrors: T.ChatError[]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,482 @@
|
||||
// API Responses
|
||||
// This file is generated automatically.
|
||||
|
||||
import * as T from "./types"
|
||||
|
||||
export type ChatResponse =
|
||||
| CR.AcceptingContactRequest
|
||||
| CR.ActiveUser
|
||||
| CR.ChatItemNotChanged
|
||||
| CR.ChatItemReaction
|
||||
| CR.ChatItemUpdated
|
||||
| CR.ChatItemsDeleted
|
||||
| CR.ChatRunning
|
||||
| CR.ChatStarted
|
||||
| CR.ChatStopped
|
||||
| CR.CmdOk
|
||||
| CR.ChatCmdError
|
||||
| CR.ConnectionPlan
|
||||
| CR.ContactAlreadyExists
|
||||
| CR.ContactConnectionDeleted
|
||||
| CR.ContactDeleted
|
||||
| CR.ContactPrefsUpdated
|
||||
| CR.ContactRequestRejected
|
||||
| CR.ContactsList
|
||||
| CR.GroupDeletedUser
|
||||
| CR.GroupLink
|
||||
| CR.GroupLinkCreated
|
||||
| CR.GroupLinkDeleted
|
||||
| CR.GroupCreated
|
||||
| CR.PublicGroupCreated
|
||||
| CR.PublicGroupCreationFailed
|
||||
| CR.GroupRelays
|
||||
| CR.GroupRelaysAdded
|
||||
| CR.GroupRelaysAddFailed
|
||||
| CR.RelayGroupAllowed
|
||||
| CR.GroupMembers
|
||||
| CR.GroupUpdated
|
||||
| CR.GroupsList
|
||||
| CR.Invitation
|
||||
| CR.LeftMemberUser
|
||||
| CR.MemberAccepted
|
||||
| CR.MembersBlockedForAllUser
|
||||
| CR.MembersRoleUser
|
||||
| CR.NewChatItems
|
||||
| CR.RcvFileAccepted
|
||||
| CR.RcvFileAcceptedSndCancelled
|
||||
| CR.RcvFileCancelled
|
||||
| CR.SentConfirmation
|
||||
| CR.SentGroupInvitation
|
||||
| CR.SentInvitation
|
||||
| CR.SndFileCancelled
|
||||
| CR.UserAcceptedGroupSent
|
||||
| CR.UserContactLink
|
||||
| CR.UserContactLinkCreated
|
||||
| CR.UserContactLinkDeleted
|
||||
| CR.UserContactLinkUpdated
|
||||
| CR.UserDeletedMembers
|
||||
| CR.UserProfileUpdated
|
||||
| CR.UserProfileNoChange
|
||||
| CR.UsersList
|
||||
| CR.ApiChats
|
||||
|
||||
export namespace CR {
|
||||
export type Tag =
|
||||
| "acceptingContactRequest"
|
||||
| "activeUser"
|
||||
| "chatItemNotChanged"
|
||||
| "chatItemReaction"
|
||||
| "chatItemUpdated"
|
||||
| "chatItemsDeleted"
|
||||
| "chatRunning"
|
||||
| "chatStarted"
|
||||
| "chatStopped"
|
||||
| "cmdOk"
|
||||
| "chatCmdError"
|
||||
| "connectionPlan"
|
||||
| "contactAlreadyExists"
|
||||
| "contactConnectionDeleted"
|
||||
| "contactDeleted"
|
||||
| "contactPrefsUpdated"
|
||||
| "contactRequestRejected"
|
||||
| "contactsList"
|
||||
| "groupDeletedUser"
|
||||
| "groupLink"
|
||||
| "groupLinkCreated"
|
||||
| "groupLinkDeleted"
|
||||
| "groupCreated"
|
||||
| "publicGroupCreated"
|
||||
| "publicGroupCreationFailed"
|
||||
| "groupRelays"
|
||||
| "groupRelaysAdded"
|
||||
| "groupRelaysAddFailed"
|
||||
| "relayGroupAllowed"
|
||||
| "groupMembers"
|
||||
| "groupUpdated"
|
||||
| "groupsList"
|
||||
| "invitation"
|
||||
| "leftMemberUser"
|
||||
| "memberAccepted"
|
||||
| "membersBlockedForAllUser"
|
||||
| "membersRoleUser"
|
||||
| "newChatItems"
|
||||
| "rcvFileAccepted"
|
||||
| "rcvFileAcceptedSndCancelled"
|
||||
| "rcvFileCancelled"
|
||||
| "sentConfirmation"
|
||||
| "sentGroupInvitation"
|
||||
| "sentInvitation"
|
||||
| "sndFileCancelled"
|
||||
| "userAcceptedGroupSent"
|
||||
| "userContactLink"
|
||||
| "userContactLinkCreated"
|
||||
| "userContactLinkDeleted"
|
||||
| "userContactLinkUpdated"
|
||||
| "userDeletedMembers"
|
||||
| "userProfileUpdated"
|
||||
| "userProfileNoChange"
|
||||
| "usersList"
|
||||
| "apiChats"
|
||||
|
||||
interface Interface {
|
||||
type: Tag
|
||||
}
|
||||
|
||||
export interface AcceptingContactRequest extends Interface {
|
||||
type: "acceptingContactRequest"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface ActiveUser extends Interface {
|
||||
type: "activeUser"
|
||||
user: T.User
|
||||
}
|
||||
|
||||
export interface ChatItemNotChanged extends Interface {
|
||||
type: "chatItemNotChanged"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface ChatItemReaction extends Interface {
|
||||
type: "chatItemReaction"
|
||||
user: T.User
|
||||
added: boolean
|
||||
reaction: T.ACIReaction
|
||||
}
|
||||
|
||||
export interface ChatItemUpdated extends Interface {
|
||||
type: "chatItemUpdated"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface ChatItemsDeleted extends Interface {
|
||||
type: "chatItemsDeleted"
|
||||
user: T.User
|
||||
chatItemDeletions: T.ChatItemDeletion[]
|
||||
byUser: boolean
|
||||
timed: boolean
|
||||
}
|
||||
|
||||
export interface ChatRunning extends Interface {
|
||||
type: "chatRunning"
|
||||
}
|
||||
|
||||
export interface ChatStarted extends Interface {
|
||||
type: "chatStarted"
|
||||
}
|
||||
|
||||
export interface ChatStopped extends Interface {
|
||||
type: "chatStopped"
|
||||
}
|
||||
|
||||
export interface CmdOk extends Interface {
|
||||
type: "cmdOk"
|
||||
user_?: T.User
|
||||
}
|
||||
|
||||
export interface ChatCmdError extends Interface {
|
||||
type: "chatCmdError"
|
||||
chatError: T.ChatError
|
||||
}
|
||||
|
||||
export interface ConnectionPlan extends Interface {
|
||||
type: "connectionPlan"
|
||||
user: T.User
|
||||
connLink: T.CreatedConnLink
|
||||
planSimplexName?: T.SimplexNameInfo
|
||||
otherSimplexName?: T.SimplexNameInfo
|
||||
connectionPlan: T.ConnectionPlan
|
||||
}
|
||||
|
||||
export interface ContactAlreadyExists extends Interface {
|
||||
type: "contactAlreadyExists"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface ContactConnectionDeleted extends Interface {
|
||||
type: "contactConnectionDeleted"
|
||||
user: T.User
|
||||
connection: T.PendingContactConnection
|
||||
}
|
||||
|
||||
export interface ContactDeleted extends Interface {
|
||||
type: "contactDeleted"
|
||||
user: T.User
|
||||
contact: T.Contact
|
||||
}
|
||||
|
||||
export interface ContactPrefsUpdated extends Interface {
|
||||
type: "contactPrefsUpdated"
|
||||
user: T.User
|
||||
fromContact: T.Contact
|
||||
toContact: T.Contact
|
||||
}
|
||||
|
||||
export interface ContactRequestRejected extends Interface {
|
||||
type: "contactRequestRejected"
|
||||
user: T.User
|
||||
contactRequest: T.UserContactRequest
|
||||
contact_?: T.Contact
|
||||
}
|
||||
|
||||
export interface ContactsList extends Interface {
|
||||
type: "contactsList"
|
||||
user: T.User
|
||||
contacts: T.Contact[]
|
||||
}
|
||||
|
||||
export interface GroupDeletedUser extends Interface {
|
||||
type: "groupDeletedUser"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
msgSigned: boolean
|
||||
}
|
||||
|
||||
export interface GroupLink extends Interface {
|
||||
type: "groupLink"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
groupLink: T.GroupLink
|
||||
}
|
||||
|
||||
export interface GroupLinkCreated extends Interface {
|
||||
type: "groupLinkCreated"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
groupLink: T.GroupLink
|
||||
}
|
||||
|
||||
export interface GroupLinkDeleted extends Interface {
|
||||
type: "groupLinkDeleted"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
}
|
||||
|
||||
export interface GroupCreated extends Interface {
|
||||
type: "groupCreated"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
}
|
||||
|
||||
export interface PublicGroupCreated extends Interface {
|
||||
type: "publicGroupCreated"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
groupLink: T.GroupLink
|
||||
groupRelays: T.GroupRelay[]
|
||||
}
|
||||
|
||||
export interface PublicGroupCreationFailed extends Interface {
|
||||
type: "publicGroupCreationFailed"
|
||||
user: T.User
|
||||
addRelayResults: T.AddRelayResult[]
|
||||
}
|
||||
|
||||
export interface GroupRelays extends Interface {
|
||||
type: "groupRelays"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
groupRelays: T.GroupRelay[]
|
||||
}
|
||||
|
||||
export interface GroupRelaysAdded extends Interface {
|
||||
type: "groupRelaysAdded"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
groupLink: T.GroupLink
|
||||
groupRelays: T.GroupRelay[]
|
||||
}
|
||||
|
||||
export interface GroupRelaysAddFailed extends Interface {
|
||||
type: "groupRelaysAddFailed"
|
||||
user: T.User
|
||||
addRelayResults: T.AddRelayResult[]
|
||||
}
|
||||
|
||||
export interface RelayGroupAllowed extends Interface {
|
||||
type: "relayGroupAllowed"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
}
|
||||
|
||||
export interface GroupMembers extends Interface {
|
||||
type: "groupMembers"
|
||||
user: T.User
|
||||
group: T.Group
|
||||
}
|
||||
|
||||
export interface GroupUpdated extends Interface {
|
||||
type: "groupUpdated"
|
||||
user: T.User
|
||||
fromGroup: T.GroupInfo
|
||||
toGroup: T.GroupInfo
|
||||
member_?: T.GroupMember
|
||||
msgSigned: boolean
|
||||
}
|
||||
|
||||
export interface GroupsList extends Interface {
|
||||
type: "groupsList"
|
||||
user: T.User
|
||||
groups: T.GroupInfo[]
|
||||
}
|
||||
|
||||
export interface Invitation extends Interface {
|
||||
type: "invitation"
|
||||
user: T.User
|
||||
connLinkInvitation: T.CreatedConnLink
|
||||
connection: T.PendingContactConnection
|
||||
}
|
||||
|
||||
export interface LeftMemberUser extends Interface {
|
||||
type: "leftMemberUser"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
}
|
||||
|
||||
export interface MemberAccepted extends Interface {
|
||||
type: "memberAccepted"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
member: T.GroupMember
|
||||
}
|
||||
|
||||
export interface MembersBlockedForAllUser extends Interface {
|
||||
type: "membersBlockedForAllUser"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
members: T.GroupMember[]
|
||||
blocked: boolean
|
||||
msgSigned: boolean
|
||||
}
|
||||
|
||||
export interface MembersRoleUser extends Interface {
|
||||
type: "membersRoleUser"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
members: T.GroupMember[]
|
||||
toRole: T.GroupMemberRole
|
||||
msgSigned: boolean
|
||||
}
|
||||
|
||||
export interface NewChatItems extends Interface {
|
||||
type: "newChatItems"
|
||||
user: T.User
|
||||
chatItems: T.AChatItem[]
|
||||
}
|
||||
|
||||
export interface RcvFileAccepted extends Interface {
|
||||
type: "rcvFileAccepted"
|
||||
user: T.User
|
||||
chatItem: T.AChatItem
|
||||
}
|
||||
|
||||
export interface RcvFileAcceptedSndCancelled extends Interface {
|
||||
type: "rcvFileAcceptedSndCancelled"
|
||||
user: T.User
|
||||
rcvFileTransfer: T.RcvFileTransfer
|
||||
}
|
||||
|
||||
export interface RcvFileCancelled extends Interface {
|
||||
type: "rcvFileCancelled"
|
||||
user: T.User
|
||||
chatItem_?: T.AChatItem
|
||||
rcvFileTransfer: T.RcvFileTransfer
|
||||
}
|
||||
|
||||
export interface SentConfirmation extends Interface {
|
||||
type: "sentConfirmation"
|
||||
user: T.User
|
||||
connection: T.PendingContactConnection
|
||||
customUserProfile?: T.Profile
|
||||
}
|
||||
|
||||
export interface SentGroupInvitation extends Interface {
|
||||
type: "sentGroupInvitation"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
contact: T.Contact
|
||||
member: T.GroupMember
|
||||
}
|
||||
|
||||
export interface SentInvitation extends Interface {
|
||||
type: "sentInvitation"
|
||||
user: T.User
|
||||
connection: T.PendingContactConnection
|
||||
customUserProfile?: T.Profile
|
||||
}
|
||||
|
||||
export interface SndFileCancelled extends Interface {
|
||||
type: "sndFileCancelled"
|
||||
user: T.User
|
||||
chatItem_?: T.AChatItem
|
||||
fileTransferMeta: T.FileTransferMeta
|
||||
sndFileTransfers: T.SndFileTransfer[]
|
||||
}
|
||||
|
||||
export interface UserAcceptedGroupSent extends Interface {
|
||||
type: "userAcceptedGroupSent"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
hostContact?: T.Contact
|
||||
}
|
||||
|
||||
export interface UserContactLink extends Interface {
|
||||
type: "userContactLink"
|
||||
user: T.User
|
||||
contactLink: T.UserContactLink
|
||||
}
|
||||
|
||||
export interface UserContactLinkCreated extends Interface {
|
||||
type: "userContactLinkCreated"
|
||||
user: T.User
|
||||
connLinkContact: T.CreatedConnLink
|
||||
}
|
||||
|
||||
export interface UserContactLinkDeleted extends Interface {
|
||||
type: "userContactLinkDeleted"
|
||||
user: T.User
|
||||
}
|
||||
|
||||
export interface UserContactLinkUpdated extends Interface {
|
||||
type: "userContactLinkUpdated"
|
||||
user: T.User
|
||||
contactLink: T.UserContactLink
|
||||
}
|
||||
|
||||
export interface UserDeletedMembers extends Interface {
|
||||
type: "userDeletedMembers"
|
||||
user: T.User
|
||||
groupInfo: T.GroupInfo
|
||||
members: T.GroupMember[]
|
||||
withMessages: boolean
|
||||
msgSigned: boolean
|
||||
}
|
||||
|
||||
export interface UserProfileUpdated extends Interface {
|
||||
type: "userProfileUpdated"
|
||||
user: T.User
|
||||
fromProfile: T.Profile
|
||||
toProfile: T.Profile
|
||||
updateSummary: T.UserProfileUpdateSummary
|
||||
}
|
||||
|
||||
export interface UserProfileNoChange extends Interface {
|
||||
type: "userProfileNoChange"
|
||||
user: T.User
|
||||
}
|
||||
|
||||
export interface UsersList extends Interface {
|
||||
type: "usersList"
|
||||
users: T.UserInfo[]
|
||||
}
|
||||
|
||||
export interface ApiChats extends Interface {
|
||||
type: "apiChats"
|
||||
user: T.User
|
||||
chats: T.AChat[]
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,718 @@
|
||||
# API Commands
|
||||
# This file is generated automatically.
|
||||
from __future__ import annotations
|
||||
import json
|
||||
from typing import NotRequired, TypedDict
|
||||
from . import _types as T
|
||||
from . import _responses as CR
|
||||
|
||||
# Address commands
|
||||
# Bots can use these commands to automatically check and create address when initialized
|
||||
|
||||
# Create bot address.
|
||||
# Network usage: interactive.
|
||||
class APICreateMyAddress(TypedDict):
|
||||
userId: int # int64
|
||||
|
||||
|
||||
def APICreateMyAddress_cmd_string(self: APICreateMyAddress) -> str:
|
||||
return '/_address ' + str(self['userId'])
|
||||
|
||||
APICreateMyAddress_Response = CR.UserContactLinkCreated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Delete bot address.
|
||||
# Network usage: background.
|
||||
class APIDeleteMyAddress(TypedDict):
|
||||
userId: int # int64
|
||||
|
||||
|
||||
def APIDeleteMyAddress_cmd_string(self: APIDeleteMyAddress) -> str:
|
||||
return '/_delete_address ' + str(self['userId'])
|
||||
|
||||
APIDeleteMyAddress_Response = CR.UserContactLinkDeleted | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get bot address and settings.
|
||||
# Network usage: no.
|
||||
class APIShowMyAddress(TypedDict):
|
||||
userId: int # int64
|
||||
|
||||
|
||||
def APIShowMyAddress_cmd_string(self: APIShowMyAddress) -> str:
|
||||
return '/_show_address ' + str(self['userId'])
|
||||
|
||||
APIShowMyAddress_Response = CR.UserContactLink | CR.ChatCmdError
|
||||
|
||||
|
||||
# Add address to bot profile.
|
||||
# Network usage: interactive.
|
||||
class APISetProfileAddress(TypedDict):
|
||||
userId: int # int64
|
||||
enable: bool
|
||||
|
||||
|
||||
def APISetProfileAddress_cmd_string(self: APISetProfileAddress) -> str:
|
||||
return '/_profile_address ' + str(self['userId']) + ' ' + ('on' if self['enable'] else 'off')
|
||||
|
||||
APISetProfileAddress_Response = CR.UserProfileUpdated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set bot address settings.
|
||||
# Network usage: interactive.
|
||||
class APISetAddressSettings(TypedDict):
|
||||
userId: int # int64
|
||||
settings: "T.AddressSettings"
|
||||
|
||||
|
||||
def APISetAddressSettings_cmd_string(self: APISetAddressSettings) -> str:
|
||||
return '/_address_settings ' + str(self['userId']) + ' ' + json.dumps(self['settings'])
|
||||
|
||||
APISetAddressSettings_Response = CR.UserContactLinkUpdated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Message commands
|
||||
# Commands to send, update, delete, moderate messages and set message reactions
|
||||
|
||||
# Send messages.
|
||||
# Network usage: background.
|
||||
class APISendMessages(TypedDict):
|
||||
sendRef: "T.ChatRef"
|
||||
liveMessage: bool
|
||||
ttl: NotRequired[int] # int
|
||||
signMessages: bool
|
||||
composedMessages: list["T.ComposedMessage"] # non-empty
|
||||
|
||||
|
||||
def APISendMessages_cmd_string(self: APISendMessages) -> str:
|
||||
return '/_send ' + T.ChatRef_cmd_string(self['sendRef']) + (' live=on' if self['liveMessage'] else '') + ((' ttl=' + str(self.get('ttl'))) if self.get('ttl') is not None else '') + (' sign=on' if self['signMessages'] else '') + ' json ' + json.dumps(self['composedMessages'])
|
||||
|
||||
APISendMessages_Response = CR.NewChatItems | CR.ChatCmdError
|
||||
|
||||
|
||||
# Update message.
|
||||
# Network usage: background.
|
||||
class APIUpdateChatItem(TypedDict):
|
||||
chatRef: "T.ChatRef"
|
||||
chatItemId: int # int64
|
||||
liveMessage: bool
|
||||
updatedMessage: "T.UpdatedMessage"
|
||||
|
||||
|
||||
def APIUpdateChatItem_cmd_string(self: APIUpdateChatItem) -> str:
|
||||
return '/_update item ' + T.ChatRef_cmd_string(self['chatRef']) + ' ' + str(self['chatItemId']) + (' live=on' if self['liveMessage'] else '') + ' json ' + json.dumps(self['updatedMessage'])
|
||||
|
||||
APIUpdateChatItem_Response = CR.ChatItemUpdated | CR.ChatItemNotChanged | CR.ChatCmdError
|
||||
|
||||
|
||||
# Delete message.
|
||||
# Network usage: background.
|
||||
class APIDeleteChatItem(TypedDict):
|
||||
chatRef: "T.ChatRef"
|
||||
chatItemIds: list[int] # int64, non-empty
|
||||
deleteMode: "T.CIDeleteMode"
|
||||
|
||||
|
||||
def APIDeleteChatItem_cmd_string(self: APIDeleteChatItem) -> str:
|
||||
return '/_delete item ' + T.ChatRef_cmd_string(self['chatRef']) + ' ' + ','.join(map(str, self['chatItemIds'])) + ' ' + str(self['deleteMode'])
|
||||
|
||||
APIDeleteChatItem_Response = CR.ChatItemsDeleted | CR.ChatCmdError
|
||||
|
||||
|
||||
# Moderate message. Requires Moderator role (and higher than message author's).
|
||||
# Network usage: background.
|
||||
class APIDeleteMemberChatItem(TypedDict):
|
||||
groupId: int # int64
|
||||
chatItemIds: list[int] # int64, non-empty
|
||||
|
||||
|
||||
def APIDeleteMemberChatItem_cmd_string(self: APIDeleteMemberChatItem) -> str:
|
||||
return '/_delete member item #' + str(self['groupId']) + ' ' + ','.join(map(str, self['chatItemIds']))
|
||||
|
||||
APIDeleteMemberChatItem_Response = CR.ChatItemsDeleted | CR.ChatCmdError
|
||||
|
||||
|
||||
# Add/remove message reaction.
|
||||
# Network usage: background.
|
||||
class APIChatItemReaction(TypedDict):
|
||||
chatRef: "T.ChatRef"
|
||||
chatItemId: int # int64
|
||||
add: bool
|
||||
reaction: "T.MsgReaction"
|
||||
|
||||
|
||||
def APIChatItemReaction_cmd_string(self: APIChatItemReaction) -> str:
|
||||
return '/_reaction ' + T.ChatRef_cmd_string(self['chatRef']) + ' ' + str(self['chatItemId']) + ' ' + ('on' if self['add'] else 'off') + ' ' + json.dumps(self['reaction'])
|
||||
|
||||
APIChatItemReaction_Response = CR.ChatItemReaction | CR.ChatCmdError
|
||||
|
||||
|
||||
# File commands
|
||||
# Commands to receive and to cancel files. Files are sent as part of the message, there are no separate commands to send files.
|
||||
|
||||
# Receive file.
|
||||
# Network usage: no.
|
||||
class ReceiveFile(TypedDict):
|
||||
fileId: int # int64
|
||||
userApprovedRelays: bool
|
||||
storeEncrypted: NotRequired[bool]
|
||||
fileInline: NotRequired[bool]
|
||||
filePath: NotRequired[str]
|
||||
|
||||
|
||||
def ReceiveFile_cmd_string(self: ReceiveFile) -> str:
|
||||
return '/freceive ' + str(self['fileId']) + (' approved_relays=on' if self['userApprovedRelays'] else '') + ((' encrypt=' + ('on' if self.get('storeEncrypted') else 'off')) if self.get('storeEncrypted') is not None else '') + ((' inline=' + ('on' if self.get('fileInline') else 'off')) if self.get('fileInline') is not None else '') + ((' ' + self.get('filePath')) if self.get('filePath') is not None else '')
|
||||
|
||||
ReceiveFile_Response = CR.RcvFileAccepted | CR.RcvFileAcceptedSndCancelled | CR.ChatCmdError
|
||||
|
||||
|
||||
# Cancel file.
|
||||
# Network usage: background.
|
||||
class CancelFile(TypedDict):
|
||||
fileId: int # int64
|
||||
|
||||
|
||||
def CancelFile_cmd_string(self: CancelFile) -> str:
|
||||
return '/fcancel ' + str(self['fileId'])
|
||||
|
||||
CancelFile_Response = CR.SndFileCancelled | CR.RcvFileCancelled | CR.ChatCmdError
|
||||
|
||||
|
||||
# Group commands
|
||||
# Commands to manage and moderate groups. These commands can be used with business chats as well - they are groups. E.g., a common scenario would be to add human agents to business chat with the customer who connected via business address.
|
||||
|
||||
# Add contact to group. Requires bot to have Admin role.
|
||||
# Network usage: interactive.
|
||||
class APIAddMember(TypedDict):
|
||||
groupId: int # int64
|
||||
contactId: int # int64
|
||||
memberRole: "T.GroupMemberRole"
|
||||
|
||||
|
||||
def APIAddMember_cmd_string(self: APIAddMember) -> str:
|
||||
return '/_add #' + str(self['groupId']) + ' ' + str(self['contactId']) + ' ' + str(self['memberRole'])
|
||||
|
||||
APIAddMember_Response = CR.SentGroupInvitation | CR.ChatCmdError
|
||||
|
||||
|
||||
# Join group.
|
||||
# Network usage: interactive.
|
||||
class APIJoinGroup(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APIJoinGroup_cmd_string(self: APIJoinGroup) -> str:
|
||||
return '/_join #' + str(self['groupId'])
|
||||
|
||||
APIJoinGroup_Response = CR.UserAcceptedGroupSent | CR.ChatCmdError
|
||||
|
||||
|
||||
# Accept group member. Requires Admin role.
|
||||
# Network usage: background.
|
||||
class APIAcceptMember(TypedDict):
|
||||
groupId: int # int64
|
||||
groupMemberId: int # int64
|
||||
memberRole: "T.GroupMemberRole"
|
||||
|
||||
|
||||
def APIAcceptMember_cmd_string(self: APIAcceptMember) -> str:
|
||||
return '/_accept member #' + str(self['groupId']) + ' ' + str(self['groupMemberId']) + ' ' + str(self['memberRole'])
|
||||
|
||||
APIAcceptMember_Response = CR.MemberAccepted | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set members role. Requires Admin role.
|
||||
# Network usage: background.
|
||||
class APIMembersRole(TypedDict):
|
||||
groupId: int # int64
|
||||
groupMemberIds: list[int] # int64, non-empty
|
||||
memberRole: "T.GroupMemberRole"
|
||||
|
||||
|
||||
def APIMembersRole_cmd_string(self: APIMembersRole) -> str:
|
||||
return '/_member role #' + str(self['groupId']) + ' ' + ','.join(map(str, self['groupMemberIds'])) + ' ' + str(self['memberRole'])
|
||||
|
||||
APIMembersRole_Response = CR.MembersRoleUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Block members. Requires Moderator role.
|
||||
# Network usage: background.
|
||||
class APIBlockMembersForAll(TypedDict):
|
||||
groupId: int # int64
|
||||
groupMemberIds: list[int] # int64, non-empty
|
||||
blocked: bool
|
||||
|
||||
|
||||
def APIBlockMembersForAll_cmd_string(self: APIBlockMembersForAll) -> str:
|
||||
return '/_block #' + str(self['groupId']) + ' ' + ','.join(map(str, self['groupMemberIds'])) + ' blocked=' + ('on' if self['blocked'] else 'off')
|
||||
|
||||
APIBlockMembersForAll_Response = CR.MembersBlockedForAllUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Remove members. Requires Admin role.
|
||||
# Network usage: background.
|
||||
class APIRemoveMembers(TypedDict):
|
||||
groupId: int # int64
|
||||
groupMemberIds: list[int] # int64, non-empty
|
||||
withMessages: bool
|
||||
|
||||
|
||||
def APIRemoveMembers_cmd_string(self: APIRemoveMembers) -> str:
|
||||
return '/_remove #' + str(self['groupId']) + ' ' + ','.join(map(str, self['groupMemberIds'])) + (' messages=on' if self['withMessages'] else '')
|
||||
|
||||
APIRemoveMembers_Response = CR.UserDeletedMembers | CR.ChatCmdError
|
||||
|
||||
|
||||
# Leave group.
|
||||
# Network usage: background.
|
||||
class APILeaveGroup(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APILeaveGroup_cmd_string(self: APILeaveGroup) -> str:
|
||||
return '/_leave #' + str(self['groupId'])
|
||||
|
||||
APILeaveGroup_Response = CR.LeftMemberUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get group members.
|
||||
# Network usage: no.
|
||||
class APIListMembers(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APIListMembers_cmd_string(self: APIListMembers) -> str:
|
||||
return '/_members #' + str(self['groupId'])
|
||||
|
||||
APIListMembers_Response = CR.GroupMembers | CR.ChatCmdError
|
||||
|
||||
|
||||
# Create group.
|
||||
# Network usage: no.
|
||||
class APINewGroup(TypedDict):
|
||||
userId: int # int64
|
||||
incognito: bool
|
||||
groupProfile: "T.GroupProfile"
|
||||
|
||||
|
||||
def APINewGroup_cmd_string(self: APINewGroup) -> str:
|
||||
return '/_group ' + str(self['userId']) + (' incognito=on' if self['incognito'] else '') + ' ' + json.dumps(self['groupProfile'])
|
||||
|
||||
APINewGroup_Response = CR.GroupCreated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Create public group.
|
||||
# Network usage: interactive.
|
||||
class APINewPublicGroup(TypedDict):
|
||||
userId: int # int64
|
||||
incognito: bool
|
||||
relayIds: list[int] # int64, non-empty
|
||||
groupProfile: "T.GroupProfile"
|
||||
|
||||
|
||||
def APINewPublicGroup_cmd_string(self: APINewPublicGroup) -> str:
|
||||
return '/_public group ' + str(self['userId']) + (' incognito=on' if self['incognito'] else '') + ' ' + ','.join(map(str, self['relayIds'])) + ' ' + json.dumps(self['groupProfile'])
|
||||
|
||||
APINewPublicGroup_Response = CR.PublicGroupCreated | CR.PublicGroupCreationFailed | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get group relays.
|
||||
# Network usage: no.
|
||||
class APIGetGroupRelays(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APIGetGroupRelays_cmd_string(self: APIGetGroupRelays) -> str:
|
||||
return '/_get relays #' + str(self['groupId'])
|
||||
|
||||
APIGetGroupRelays_Response = CR.GroupRelays | CR.ChatCmdError
|
||||
|
||||
|
||||
# Add relays to group.
|
||||
# Network usage: interactive.
|
||||
class APIAddGroupRelays(TypedDict):
|
||||
groupId: int # int64
|
||||
relayIds: list[int] # int64, non-empty
|
||||
|
||||
|
||||
def APIAddGroupRelays_cmd_string(self: APIAddGroupRelays) -> str:
|
||||
return '/_add relays #' + str(self['groupId']) + ' ' + ','.join(map(str, self['relayIds']))
|
||||
|
||||
APIAddGroupRelays_Response = CR.GroupRelaysAdded | CR.GroupRelaysAddFailed | CR.ChatCmdError
|
||||
|
||||
|
||||
# Clear relay rejection for a channel (relay operator).
|
||||
# Network usage: background.
|
||||
class APIAllowRelayGroup(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APIAllowRelayGroup_cmd_string(self: APIAllowRelayGroup) -> str:
|
||||
return '/_relay allow #' + str(self['groupId'])
|
||||
|
||||
APIAllowRelayGroup_Response = CR.RelayGroupAllowed | CR.ChatCmdError
|
||||
|
||||
|
||||
# Update group profile.
|
||||
# Network usage: background.
|
||||
class APIUpdateGroupProfile(TypedDict):
|
||||
groupId: int # int64
|
||||
groupProfile: "T.GroupProfile"
|
||||
|
||||
|
||||
def APIUpdateGroupProfile_cmd_string(self: APIUpdateGroupProfile) -> str:
|
||||
return '/_group_profile #' + str(self['groupId']) + ' ' + json.dumps(self['groupProfile'])
|
||||
|
||||
APIUpdateGroupProfile_Response = CR.GroupUpdated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Group link commands
|
||||
# These commands can be used by bots that manage multiple public groups
|
||||
|
||||
# Create group link.
|
||||
# Network usage: interactive.
|
||||
class APICreateGroupLink(TypedDict):
|
||||
groupId: int # int64
|
||||
memberRole: "T.GroupMemberRole"
|
||||
|
||||
|
||||
def APICreateGroupLink_cmd_string(self: APICreateGroupLink) -> str:
|
||||
return '/_create link #' + str(self['groupId']) + ' ' + str(self['memberRole'])
|
||||
|
||||
APICreateGroupLink_Response = CR.GroupLinkCreated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set member role for group link.
|
||||
# Network usage: no.
|
||||
class APIGroupLinkMemberRole(TypedDict):
|
||||
groupId: int # int64
|
||||
memberRole: "T.GroupMemberRole"
|
||||
|
||||
|
||||
def APIGroupLinkMemberRole_cmd_string(self: APIGroupLinkMemberRole) -> str:
|
||||
return '/_set link role #' + str(self['groupId']) + ' ' + str(self['memberRole'])
|
||||
|
||||
APIGroupLinkMemberRole_Response = CR.GroupLink | CR.ChatCmdError
|
||||
|
||||
|
||||
# Delete group link.
|
||||
# Network usage: background.
|
||||
class APIDeleteGroupLink(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APIDeleteGroupLink_cmd_string(self: APIDeleteGroupLink) -> str:
|
||||
return '/_delete link #' + str(self['groupId'])
|
||||
|
||||
APIDeleteGroupLink_Response = CR.GroupLinkDeleted | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get group link.
|
||||
# Network usage: no.
|
||||
class APIGetGroupLink(TypedDict):
|
||||
groupId: int # int64
|
||||
|
||||
|
||||
def APIGetGroupLink_cmd_string(self: APIGetGroupLink) -> str:
|
||||
return '/_get link #' + str(self['groupId'])
|
||||
|
||||
APIGetGroupLink_Response = CR.GroupLink | CR.ChatCmdError
|
||||
|
||||
|
||||
# Connection commands
|
||||
# These commands may be used to create connections. Most bots do not need to use them - bot users will connect via bot address with auto-accept enabled.
|
||||
|
||||
# Create 1-time invitation link.
|
||||
# Network usage: interactive.
|
||||
class APIAddContact(TypedDict):
|
||||
userId: int # int64
|
||||
incognito: bool
|
||||
|
||||
|
||||
def APIAddContact_cmd_string(self: APIAddContact) -> str:
|
||||
return '/_connect ' + str(self['userId']) + (' incognito=on' if self['incognito'] else '')
|
||||
|
||||
APIAddContact_Response = CR.Invitation | CR.ChatCmdError
|
||||
|
||||
|
||||
# Determine SimpleX link type and if the bot is already connected via this link or name.
|
||||
# Network usage: interactive.
|
||||
class APIConnectPlan(TypedDict):
|
||||
userId: int # int64
|
||||
connectTarget: NotRequired[str]
|
||||
resolveMode: "T.PlanResolveMode"
|
||||
linkOwnerSig: NotRequired["T.LinkOwnerSig"]
|
||||
|
||||
|
||||
def APIConnectPlan_cmd_string(self: APIConnectPlan) -> str:
|
||||
return '/_connect plan ' + str(self['userId']) + ' ' + self.get('connectTarget')
|
||||
|
||||
APIConnectPlan_Response = CR.ConnectionPlan | CR.ChatCmdError
|
||||
|
||||
|
||||
# Connect via prepared SimpleX link. The link can be 1-time invitation link, contact address or group link.
|
||||
# Network usage: interactive.
|
||||
class APIConnect(TypedDict):
|
||||
userId: int # int64
|
||||
incognito: bool
|
||||
preparedLink_: NotRequired["T.CreatedConnLink"]
|
||||
|
||||
|
||||
def APIConnect_cmd_string(self: APIConnect) -> str:
|
||||
return '/_connect ' + str(self['userId']) + ((' ' + T.CreatedConnLink_cmd_string(self.get('preparedLink_'))) if self.get('preparedLink_') is not None else '')
|
||||
|
||||
APIConnect_Response = CR.SentConfirmation | CR.ContactAlreadyExists | CR.SentInvitation | CR.ChatCmdError
|
||||
|
||||
|
||||
# Connect via SimpleX link or name as string in the active user profile.
|
||||
# Network usage: interactive.
|
||||
class Connect(TypedDict):
|
||||
incognito: bool
|
||||
connTarget_: NotRequired[str]
|
||||
|
||||
|
||||
def Connect_cmd_string(self: Connect) -> str:
|
||||
return '/connect' + ((' ' + self.get('connTarget_')) if self.get('connTarget_') is not None else '')
|
||||
|
||||
Connect_Response = CR.SentConfirmation | CR.ContactAlreadyExists | CR.SentInvitation | CR.ChatCmdError
|
||||
|
||||
|
||||
# Accept contact request.
|
||||
# Network usage: interactive.
|
||||
class APIAcceptContact(TypedDict):
|
||||
contactReqId: int # int64
|
||||
|
||||
|
||||
def APIAcceptContact_cmd_string(self: APIAcceptContact) -> str:
|
||||
return '/_accept ' + str(self['contactReqId'])
|
||||
|
||||
APIAcceptContact_Response = CR.AcceptingContactRequest | CR.ChatCmdError
|
||||
|
||||
|
||||
# Reject contact request. The user who sent the request is **not notified**.
|
||||
# Network usage: no.
|
||||
class APIRejectContact(TypedDict):
|
||||
contactReqId: int # int64
|
||||
|
||||
|
||||
def APIRejectContact_cmd_string(self: APIRejectContact) -> str:
|
||||
return '/_reject ' + str(self['contactReqId'])
|
||||
|
||||
APIRejectContact_Response = CR.ContactRequestRejected | CR.ChatCmdError
|
||||
|
||||
|
||||
# Chat commands
|
||||
# Commands to list and delete conversations.
|
||||
|
||||
# Get contacts.
|
||||
# Network usage: no.
|
||||
class APIListContacts(TypedDict):
|
||||
userId: int # int64
|
||||
|
||||
|
||||
def APIListContacts_cmd_string(self: APIListContacts) -> str:
|
||||
return '/_contacts ' + str(self['userId'])
|
||||
|
||||
APIListContacts_Response = CR.ContactsList | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get groups.
|
||||
# Network usage: no.
|
||||
class APIListGroups(TypedDict):
|
||||
userId: int # int64
|
||||
contactId_: NotRequired[int] # int64
|
||||
search: NotRequired[str]
|
||||
|
||||
|
||||
def APIListGroups_cmd_string(self: APIListGroups) -> str:
|
||||
return '/_groups ' + str(self['userId']) + ((' @' + str(self.get('contactId_'))) if self.get('contactId_') is not None else '') + ((' ' + self.get('search')) if self.get('search') is not None else '')
|
||||
|
||||
APIListGroups_Response = CR.GroupsList | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get chat previews. Supports time-based pagination — use this instead of APIListContacts / APIListGroups when scanning at scale (those load every record into memory and fail on large databases).
|
||||
# Network usage: no.
|
||||
class APIGetChats(TypedDict):
|
||||
userId: int # int64
|
||||
pendingConnections: bool
|
||||
pagination: "T.PaginationByTime"
|
||||
query: "T.ChatListQuery"
|
||||
|
||||
|
||||
def APIGetChats_cmd_string(self: APIGetChats) -> str:
|
||||
return '/_get chats ' + str(self['userId']) + (' pcc=on' if self['pendingConnections'] else '') + ' ' + T.PaginationByTime_cmd_string(self['pagination']) + ' ' + json.dumps(self['query'])
|
||||
|
||||
APIGetChats_Response = CR.ApiChats | CR.ChatCmdError
|
||||
|
||||
|
||||
# Delete chat.
|
||||
# Network usage: background.
|
||||
class APIDeleteChat(TypedDict):
|
||||
chatRef: "T.ChatRef"
|
||||
chatDeleteMode: "T.ChatDeleteMode"
|
||||
|
||||
|
||||
def APIDeleteChat_cmd_string(self: APIDeleteChat) -> str:
|
||||
return '/_delete ' + T.ChatRef_cmd_string(self['chatRef']) + ' ' + T.ChatDeleteMode_cmd_string(self['chatDeleteMode'])
|
||||
|
||||
APIDeleteChat_Response = CR.ContactDeleted | CR.ContactConnectionDeleted | CR.GroupDeletedUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set group custom data.
|
||||
# Network usage: no.
|
||||
class APISetGroupCustomData(TypedDict):
|
||||
groupId: int # int64
|
||||
customData: NotRequired[dict[str, object]]
|
||||
|
||||
|
||||
def APISetGroupCustomData_cmd_string(self: APISetGroupCustomData) -> str:
|
||||
return '/_set custom #' + str(self['groupId']) + ((' ' + json.dumps(self.get('customData'))) if self.get('customData') is not None else '')
|
||||
|
||||
APISetGroupCustomData_Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set contact custom data.
|
||||
# Network usage: no.
|
||||
class APISetContactCustomData(TypedDict):
|
||||
contactId: int # int64
|
||||
customData: NotRequired[dict[str, object]]
|
||||
|
||||
|
||||
def APISetContactCustomData_cmd_string(self: APISetContactCustomData) -> str:
|
||||
return '/_set custom @' + str(self['contactId']) + ((' ' + json.dumps(self.get('customData'))) if self.get('customData') is not None else '')
|
||||
|
||||
APISetContactCustomData_Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set auto-accept member contacts.
|
||||
# Network usage: no.
|
||||
class APISetUserAutoAcceptMemberContacts(TypedDict):
|
||||
userId: int # int64
|
||||
onOff: bool
|
||||
|
||||
|
||||
def APISetUserAutoAcceptMemberContacts_cmd_string(self: APISetUserAutoAcceptMemberContacts) -> str:
|
||||
return '/_set accept member contacts ' + str(self['userId']) + ' ' + ('on' if self['onOff'] else 'off')
|
||||
|
||||
APISetUserAutoAcceptMemberContacts_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).
|
||||
|
||||
# Get active user profile.
|
||||
# Network usage: no.
|
||||
class ShowActiveUser(TypedDict):
|
||||
pass
|
||||
|
||||
|
||||
def ShowActiveUser_cmd_string(self: ShowActiveUser) -> str:
|
||||
return '/user'
|
||||
|
||||
ShowActiveUser_Response = CR.ActiveUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Create new user profile.
|
||||
# Network usage: no.
|
||||
class CreateActiveUser(TypedDict):
|
||||
newUser: "T.NewUser"
|
||||
|
||||
|
||||
def CreateActiveUser_cmd_string(self: CreateActiveUser) -> str:
|
||||
return '/_create user ' + json.dumps(self['newUser'])
|
||||
|
||||
CreateActiveUser_Response = CR.ActiveUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Get all user profiles.
|
||||
# Network usage: no.
|
||||
class ListUsers(TypedDict):
|
||||
pass
|
||||
|
||||
|
||||
def ListUsers_cmd_string(self: ListUsers) -> str:
|
||||
return '/users'
|
||||
|
||||
ListUsers_Response = CR.UsersList | CR.ChatCmdError
|
||||
|
||||
|
||||
# Set active user profile.
|
||||
# Network usage: no.
|
||||
class APISetActiveUser(TypedDict):
|
||||
userId: int # int64
|
||||
viewPwd: NotRequired[str]
|
||||
|
||||
|
||||
def APISetActiveUser_cmd_string(self: APISetActiveUser) -> str:
|
||||
return '/_user ' + str(self['userId']) + ((' ' + json.dumps(self.get('viewPwd'))) if self.get('viewPwd') is not None else '')
|
||||
|
||||
APISetActiveUser_Response = CR.ActiveUser | CR.ChatCmdError
|
||||
|
||||
|
||||
# Delete user profile.
|
||||
# Network usage: background.
|
||||
class APIDeleteUser(TypedDict):
|
||||
userId: int # int64
|
||||
delSMPQueues: bool
|
||||
viewPwd: NotRequired[str]
|
||||
|
||||
|
||||
def APIDeleteUser_cmd_string(self: APIDeleteUser) -> str:
|
||||
return '/_delete user ' + str(self['userId']) + ' del_smp=' + ('on' if self['delSMPQueues'] else 'off') + ((' ' + json.dumps(self.get('viewPwd'))) if self.get('viewPwd') is not None else '')
|
||||
|
||||
APIDeleteUser_Response = CR.CmdOk | CR.ChatCmdError
|
||||
|
||||
|
||||
# Update user profile.
|
||||
# Network usage: background.
|
||||
class APIUpdateProfile(TypedDict):
|
||||
userId: int # int64
|
||||
profile: "T.Profile"
|
||||
|
||||
|
||||
def APIUpdateProfile_cmd_string(self: APIUpdateProfile) -> str:
|
||||
return '/_profile ' + str(self['userId']) + ' ' + json.dumps(self['profile'])
|
||||
|
||||
APIUpdateProfile_Response = CR.UserProfileUpdated | CR.UserProfileNoChange | CR.ChatCmdError
|
||||
|
||||
|
||||
# Configure chat preference overrides for the contact.
|
||||
# Network usage: background.
|
||||
class APISetContactPrefs(TypedDict):
|
||||
contactId: int # int64
|
||||
preferences: "T.Preferences"
|
||||
|
||||
|
||||
def APISetContactPrefs_cmd_string(self: APISetContactPrefs) -> str:
|
||||
return '/_set prefs @' + str(self['contactId']) + ' ' + json.dumps(self['preferences'])
|
||||
|
||||
APISetContactPrefs_Response = CR.ContactPrefsUpdated | CR.ChatCmdError
|
||||
|
||||
|
||||
# Chat management
|
||||
# These commands should not be used with CLI-based bots
|
||||
|
||||
# Start chat controller.
|
||||
# Network usage: no.
|
||||
class StartChat(TypedDict):
|
||||
mainApp: bool
|
||||
enableSndFiles: bool
|
||||
|
||||
|
||||
def StartChat_cmd_string(self: StartChat) -> str:
|
||||
return '/_start'
|
||||
|
||||
StartChat_Response = CR.ChatStarted | CR.ChatRunning
|
||||
|
||||
|
||||
# Stop chat controller.
|
||||
# Network usage: no.
|
||||
class APIStopChat(TypedDict):
|
||||
pass
|
||||
|
||||
|
||||
def APIStopChat_cmd_string(self: APIStopChat) -> str:
|
||||
return '/_stop'
|
||||
|
||||
APIStopChat_Response = CR.ChatStopped
|
||||
|
||||
|
||||
@@ -0,0 +1,681 @@
|
||||
# API Events
|
||||
# This file is generated automatically.
|
||||
from __future__ import annotations
|
||||
from collections.abc import Awaitable, Callable
|
||||
from typing import Literal, NotRequired, Protocol, TypedDict, overload
|
||||
from . import _types as T
|
||||
|
||||
class ContactConnected(TypedDict):
|
||||
type: Literal["contactConnected"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
userCustomProfile: NotRequired["T.Profile"]
|
||||
|
||||
class ContactUpdated(TypedDict):
|
||||
type: Literal["contactUpdated"]
|
||||
user: "T.User"
|
||||
fromContact: "T.Contact"
|
||||
toContact: "T.Contact"
|
||||
|
||||
class ContactDeletedByContact(TypedDict):
|
||||
type: Literal["contactDeletedByContact"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class ReceivedContactRequest(TypedDict):
|
||||
type: Literal["receivedContactRequest"]
|
||||
user: "T.User"
|
||||
contactRequest: "T.UserContactRequest"
|
||||
chat_: NotRequired["T.AChat"]
|
||||
|
||||
class NewMemberContactReceivedInv(TypedDict):
|
||||
type: Literal["newMemberContactReceivedInv"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
|
||||
class ContactSndReady(TypedDict):
|
||||
type: Literal["contactSndReady"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class NewChatItems(TypedDict):
|
||||
type: Literal["newChatItems"]
|
||||
user: "T.User"
|
||||
chatItems: list["T.AChatItem"]
|
||||
|
||||
class ChatItemReaction(TypedDict):
|
||||
type: Literal["chatItemReaction"]
|
||||
user: "T.User"
|
||||
added: bool
|
||||
reaction: "T.ACIReaction"
|
||||
|
||||
class ChatItemsDeleted(TypedDict):
|
||||
type: Literal["chatItemsDeleted"]
|
||||
user: "T.User"
|
||||
chatItemDeletions: list["T.ChatItemDeletion"]
|
||||
byUser: bool
|
||||
timed: bool
|
||||
|
||||
class ChatItemUpdated(TypedDict):
|
||||
type: Literal["chatItemUpdated"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class GroupChatItemsDeleted(TypedDict):
|
||||
type: Literal["groupChatItemsDeleted"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
chatItemIDs: list[int] # int64
|
||||
byUser: bool
|
||||
member_: NotRequired["T.GroupMember"]
|
||||
|
||||
class ChatItemsStatusesUpdated(TypedDict):
|
||||
type: Literal["chatItemsStatusesUpdated"]
|
||||
user: "T.User"
|
||||
chatItems: list["T.AChatItem"]
|
||||
|
||||
class ReceivedGroupInvitation(TypedDict):
|
||||
type: Literal["receivedGroupInvitation"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
contact: "T.Contact"
|
||||
fromMemberRole: "T.GroupMemberRole"
|
||||
memberRole: "T.GroupMemberRole"
|
||||
|
||||
class UserJoinedGroup(TypedDict):
|
||||
type: Literal["userJoinedGroup"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
hostMember: "T.GroupMember"
|
||||
|
||||
class GroupUpdated(TypedDict):
|
||||
type: Literal["groupUpdated"]
|
||||
user: "T.User"
|
||||
fromGroup: "T.GroupInfo"
|
||||
toGroup: "T.GroupInfo"
|
||||
member_: NotRequired["T.GroupMember"]
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class JoinedGroupMember(TypedDict):
|
||||
type: Literal["joinedGroupMember"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
|
||||
class MemberRole(TypedDict):
|
||||
type: Literal["memberRole"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
byMember: "T.GroupMember"
|
||||
member: "T.GroupMember"
|
||||
fromRole: "T.GroupMemberRole"
|
||||
toRole: "T.GroupMemberRole"
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class DeletedMember(TypedDict):
|
||||
type: Literal["deletedMember"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
byMember: "T.GroupMember"
|
||||
deletedMember: "T.GroupMember"
|
||||
withMessages: bool
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class LeftMember(TypedDict):
|
||||
type: Literal["leftMember"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class DeletedMemberUser(TypedDict):
|
||||
type: Literal["deletedMemberUser"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
withMessages: bool
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class GroupDeleted(TypedDict):
|
||||
type: Literal["groupDeleted"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class ConnectedToGroupMember(TypedDict):
|
||||
type: Literal["connectedToGroupMember"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
memberContact: NotRequired["T.Contact"]
|
||||
|
||||
class MemberAcceptedByOther(TypedDict):
|
||||
type: Literal["memberAcceptedByOther"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
acceptingMember: "T.GroupMember"
|
||||
member: "T.GroupMember"
|
||||
|
||||
class MemberBlockedForAll(TypedDict):
|
||||
type: Literal["memberBlockedForAll"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
byMember: "T.GroupMember"
|
||||
member: "T.GroupMember"
|
||||
blocked: bool
|
||||
msgSigned: NotRequired["T.MsgSigStatus"]
|
||||
|
||||
class GroupMemberUpdated(TypedDict):
|
||||
type: Literal["groupMemberUpdated"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
fromMember: "T.GroupMember"
|
||||
toMember: "T.GroupMember"
|
||||
|
||||
class GroupLinkDataUpdated(TypedDict):
|
||||
type: Literal["groupLinkDataUpdated"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
groupLink: "T.GroupLink"
|
||||
groupRelays: list["T.GroupRelay"]
|
||||
relaysChanged: bool
|
||||
|
||||
class GroupRelayUpdated(TypedDict):
|
||||
type: Literal["groupRelayUpdated"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
groupRelay: "T.GroupRelay"
|
||||
|
||||
class RcvFileDescrReady(TypedDict):
|
||||
type: Literal["rcvFileDescrReady"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
rcvFileTransfer: "T.RcvFileTransfer"
|
||||
rcvFileDescr: "T.RcvFileDescr"
|
||||
|
||||
class RcvFileComplete(TypedDict):
|
||||
type: Literal["rcvFileComplete"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class SndFileCompleteXFTP(TypedDict):
|
||||
type: Literal["sndFileCompleteXFTP"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
fileTransferMeta: "T.FileTransferMeta"
|
||||
|
||||
class RcvFileStart(TypedDict):
|
||||
type: Literal["rcvFileStart"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class RcvFileSndCancelled(TypedDict):
|
||||
type: Literal["rcvFileSndCancelled"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
rcvFileTransfer: "T.RcvFileTransfer"
|
||||
|
||||
class RcvFileAccepted(TypedDict):
|
||||
type: Literal["rcvFileAccepted"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class RcvFileError(TypedDict):
|
||||
type: Literal["rcvFileError"]
|
||||
user: "T.User"
|
||||
chatItem_: NotRequired["T.AChatItem"]
|
||||
agentError: "T.AgentErrorType"
|
||||
rcvFileTransfer: "T.RcvFileTransfer"
|
||||
|
||||
class RcvFileWarning(TypedDict):
|
||||
type: Literal["rcvFileWarning"]
|
||||
user: "T.User"
|
||||
chatItem_: NotRequired["T.AChatItem"]
|
||||
agentError: "T.AgentErrorType"
|
||||
rcvFileTransfer: "T.RcvFileTransfer"
|
||||
|
||||
class SndFileError(TypedDict):
|
||||
type: Literal["sndFileError"]
|
||||
user: "T.User"
|
||||
chatItem_: NotRequired["T.AChatItem"]
|
||||
fileTransferMeta: "T.FileTransferMeta"
|
||||
errorMessage: str
|
||||
|
||||
class SndFileWarning(TypedDict):
|
||||
type: Literal["sndFileWarning"]
|
||||
user: "T.User"
|
||||
chatItem_: NotRequired["T.AChatItem"]
|
||||
fileTransferMeta: "T.FileTransferMeta"
|
||||
errorMessage: str
|
||||
|
||||
class AcceptingContactRequest(TypedDict):
|
||||
type: Literal["acceptingContactRequest"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class AcceptingBusinessRequest(TypedDict):
|
||||
type: Literal["acceptingBusinessRequest"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
|
||||
class ContactConnecting(TypedDict):
|
||||
type: Literal["contactConnecting"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class BusinessLinkConnecting(TypedDict):
|
||||
type: Literal["businessLinkConnecting"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
hostMember: "T.GroupMember"
|
||||
fromContact: "T.Contact"
|
||||
|
||||
class JoinedGroupMemberConnecting(TypedDict):
|
||||
type: Literal["joinedGroupMemberConnecting"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
hostMember: "T.GroupMember"
|
||||
member: "T.GroupMember"
|
||||
|
||||
class GroupLinkConnecting(TypedDict):
|
||||
type: Literal["groupLinkConnecting"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
hostMember: "T.GroupMember"
|
||||
|
||||
class HostConnected(TypedDict):
|
||||
type: Literal["hostConnected"]
|
||||
protocol: str
|
||||
transportHost: str
|
||||
|
||||
class HostDisconnected(TypedDict):
|
||||
type: Literal["hostDisconnected"]
|
||||
protocol: str
|
||||
transportHost: str
|
||||
|
||||
class SubscriptionStatus(TypedDict):
|
||||
type: Literal["subscriptionStatus"]
|
||||
server: str
|
||||
subscriptionStatus: "T.SubscriptionStatus"
|
||||
connections: list[str]
|
||||
|
||||
class MessageError(TypedDict):
|
||||
type: Literal["messageError"]
|
||||
user: "T.User"
|
||||
severity: str
|
||||
errorMessage: str
|
||||
|
||||
class ChatError(TypedDict):
|
||||
type: Literal["chatError"]
|
||||
chatError: "T.ChatError"
|
||||
|
||||
class ChatErrors(TypedDict):
|
||||
type: Literal["chatErrors"]
|
||||
chatErrors: list["T.ChatError"]
|
||||
|
||||
ChatEvent = (
|
||||
ContactConnected
|
||||
| ContactUpdated
|
||||
| ContactDeletedByContact
|
||||
| ReceivedContactRequest
|
||||
| NewMemberContactReceivedInv
|
||||
| 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
|
||||
| GroupLinkConnecting
|
||||
| HostConnected
|
||||
| HostDisconnected
|
||||
| SubscriptionStatus
|
||||
| MessageError
|
||||
| ChatError
|
||||
| ChatErrors
|
||||
)
|
||||
|
||||
ChatEvent_Tag = Literal["contactConnected", "contactUpdated", "contactDeletedByContact", "receivedContactRequest", "newMemberContactReceivedInv", "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", "groupLinkConnecting", "hostConnected", "hostDisconnected", "subscriptionStatus", "messageError", "chatError", "chatErrors"]
|
||||
|
||||
|
||||
class OnEventDecorator(Protocol):
|
||||
"""Per-tag narrowing protocol for ``Client.on_event``.
|
||||
|
||||
``@client.on_event("contactConnected")`` types the handler's
|
||||
``evt`` parameter as :class:`ContactConnected` rather than the
|
||||
unnarrowed :data:`ChatEvent` union.
|
||||
"""
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["contactConnected"], /) -> Callable[
|
||||
[Callable[["ContactConnected"], Awaitable[None]]],
|
||||
Callable[["ContactConnected"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["contactUpdated"], /) -> Callable[
|
||||
[Callable[["ContactUpdated"], Awaitable[None]]],
|
||||
Callable[["ContactUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["contactDeletedByContact"], /) -> Callable[
|
||||
[Callable[["ContactDeletedByContact"], Awaitable[None]]],
|
||||
Callable[["ContactDeletedByContact"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["receivedContactRequest"], /) -> Callable[
|
||||
[Callable[["ReceivedContactRequest"], Awaitable[None]]],
|
||||
Callable[["ReceivedContactRequest"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["newMemberContactReceivedInv"], /) -> Callable[
|
||||
[Callable[["NewMemberContactReceivedInv"], Awaitable[None]]],
|
||||
Callable[["NewMemberContactReceivedInv"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["contactSndReady"], /) -> Callable[
|
||||
[Callable[["ContactSndReady"], Awaitable[None]]],
|
||||
Callable[["ContactSndReady"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["newChatItems"], /) -> Callable[
|
||||
[Callable[["NewChatItems"], Awaitable[None]]],
|
||||
Callable[["NewChatItems"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["chatItemReaction"], /) -> Callable[
|
||||
[Callable[["ChatItemReaction"], Awaitable[None]]],
|
||||
Callable[["ChatItemReaction"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["chatItemsDeleted"], /) -> Callable[
|
||||
[Callable[["ChatItemsDeleted"], Awaitable[None]]],
|
||||
Callable[["ChatItemsDeleted"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["chatItemUpdated"], /) -> Callable[
|
||||
[Callable[["ChatItemUpdated"], Awaitable[None]]],
|
||||
Callable[["ChatItemUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupChatItemsDeleted"], /) -> Callable[
|
||||
[Callable[["GroupChatItemsDeleted"], Awaitable[None]]],
|
||||
Callable[["GroupChatItemsDeleted"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["chatItemsStatusesUpdated"], /) -> Callable[
|
||||
[Callable[["ChatItemsStatusesUpdated"], Awaitable[None]]],
|
||||
Callable[["ChatItemsStatusesUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["receivedGroupInvitation"], /) -> Callable[
|
||||
[Callable[["ReceivedGroupInvitation"], Awaitable[None]]],
|
||||
Callable[["ReceivedGroupInvitation"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["userJoinedGroup"], /) -> Callable[
|
||||
[Callable[["UserJoinedGroup"], Awaitable[None]]],
|
||||
Callable[["UserJoinedGroup"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupUpdated"], /) -> Callable[
|
||||
[Callable[["GroupUpdated"], Awaitable[None]]],
|
||||
Callable[["GroupUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["joinedGroupMember"], /) -> Callable[
|
||||
[Callable[["JoinedGroupMember"], Awaitable[None]]],
|
||||
Callable[["JoinedGroupMember"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["memberRole"], /) -> Callable[
|
||||
[Callable[["MemberRole"], Awaitable[None]]],
|
||||
Callable[["MemberRole"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["deletedMember"], /) -> Callable[
|
||||
[Callable[["DeletedMember"], Awaitable[None]]],
|
||||
Callable[["DeletedMember"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["leftMember"], /) -> Callable[
|
||||
[Callable[["LeftMember"], Awaitable[None]]],
|
||||
Callable[["LeftMember"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["deletedMemberUser"], /) -> Callable[
|
||||
[Callable[["DeletedMemberUser"], Awaitable[None]]],
|
||||
Callable[["DeletedMemberUser"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupDeleted"], /) -> Callable[
|
||||
[Callable[["GroupDeleted"], Awaitable[None]]],
|
||||
Callable[["GroupDeleted"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["connectedToGroupMember"], /) -> Callable[
|
||||
[Callable[["ConnectedToGroupMember"], Awaitable[None]]],
|
||||
Callable[["ConnectedToGroupMember"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["memberAcceptedByOther"], /) -> Callable[
|
||||
[Callable[["MemberAcceptedByOther"], Awaitable[None]]],
|
||||
Callable[["MemberAcceptedByOther"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["memberBlockedForAll"], /) -> Callable[
|
||||
[Callable[["MemberBlockedForAll"], Awaitable[None]]],
|
||||
Callable[["MemberBlockedForAll"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupMemberUpdated"], /) -> Callable[
|
||||
[Callable[["GroupMemberUpdated"], Awaitable[None]]],
|
||||
Callable[["GroupMemberUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupLinkDataUpdated"], /) -> Callable[
|
||||
[Callable[["GroupLinkDataUpdated"], Awaitable[None]]],
|
||||
Callable[["GroupLinkDataUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupRelayUpdated"], /) -> Callable[
|
||||
[Callable[["GroupRelayUpdated"], Awaitable[None]]],
|
||||
Callable[["GroupRelayUpdated"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileDescrReady"], /) -> Callable[
|
||||
[Callable[["RcvFileDescrReady"], Awaitable[None]]],
|
||||
Callable[["RcvFileDescrReady"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileComplete"], /) -> Callable[
|
||||
[Callable[["RcvFileComplete"], Awaitable[None]]],
|
||||
Callable[["RcvFileComplete"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["sndFileCompleteXFTP"], /) -> Callable[
|
||||
[Callable[["SndFileCompleteXFTP"], Awaitable[None]]],
|
||||
Callable[["SndFileCompleteXFTP"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileStart"], /) -> Callable[
|
||||
[Callable[["RcvFileStart"], Awaitable[None]]],
|
||||
Callable[["RcvFileStart"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileSndCancelled"], /) -> Callable[
|
||||
[Callable[["RcvFileSndCancelled"], Awaitable[None]]],
|
||||
Callable[["RcvFileSndCancelled"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileAccepted"], /) -> Callable[
|
||||
[Callable[["RcvFileAccepted"], Awaitable[None]]],
|
||||
Callable[["RcvFileAccepted"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileError"], /) -> Callable[
|
||||
[Callable[["RcvFileError"], Awaitable[None]]],
|
||||
Callable[["RcvFileError"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["rcvFileWarning"], /) -> Callable[
|
||||
[Callable[["RcvFileWarning"], Awaitable[None]]],
|
||||
Callable[["RcvFileWarning"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["sndFileError"], /) -> Callable[
|
||||
[Callable[["SndFileError"], Awaitable[None]]],
|
||||
Callable[["SndFileError"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["sndFileWarning"], /) -> Callable[
|
||||
[Callable[["SndFileWarning"], Awaitable[None]]],
|
||||
Callable[["SndFileWarning"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["acceptingContactRequest"], /) -> Callable[
|
||||
[Callable[["AcceptingContactRequest"], Awaitable[None]]],
|
||||
Callable[["AcceptingContactRequest"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["acceptingBusinessRequest"], /) -> Callable[
|
||||
[Callable[["AcceptingBusinessRequest"], Awaitable[None]]],
|
||||
Callable[["AcceptingBusinessRequest"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["contactConnecting"], /) -> Callable[
|
||||
[Callable[["ContactConnecting"], Awaitable[None]]],
|
||||
Callable[["ContactConnecting"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["businessLinkConnecting"], /) -> Callable[
|
||||
[Callable[["BusinessLinkConnecting"], Awaitable[None]]],
|
||||
Callable[["BusinessLinkConnecting"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["joinedGroupMemberConnecting"], /) -> Callable[
|
||||
[Callable[["JoinedGroupMemberConnecting"], Awaitable[None]]],
|
||||
Callable[["JoinedGroupMemberConnecting"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["groupLinkConnecting"], /) -> Callable[
|
||||
[Callable[["GroupLinkConnecting"], Awaitable[None]]],
|
||||
Callable[["GroupLinkConnecting"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["hostConnected"], /) -> Callable[
|
||||
[Callable[["HostConnected"], Awaitable[None]]],
|
||||
Callable[["HostConnected"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["hostDisconnected"], /) -> Callable[
|
||||
[Callable[["HostDisconnected"], Awaitable[None]]],
|
||||
Callable[["HostDisconnected"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["subscriptionStatus"], /) -> Callable[
|
||||
[Callable[["SubscriptionStatus"], Awaitable[None]]],
|
||||
Callable[["SubscriptionStatus"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["messageError"], /) -> Callable[
|
||||
[Callable[["MessageError"], Awaitable[None]]],
|
||||
Callable[["MessageError"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["chatError"], /) -> Callable[
|
||||
[Callable[["ChatError"], Awaitable[None]]],
|
||||
Callable[["ChatError"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: Literal["chatErrors"], /) -> Callable[
|
||||
[Callable[["ChatErrors"], Awaitable[None]]],
|
||||
Callable[["ChatErrors"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@overload
|
||||
def __call__(self, event: str, /) -> Callable[
|
||||
[Callable[["ChatEvent"], Awaitable[None]]],
|
||||
Callable[["ChatEvent"], Awaitable[None]],
|
||||
]: ...
|
||||
|
||||
@@ -0,0 +1,368 @@
|
||||
# API Responses
|
||||
# This file is generated automatically.
|
||||
from __future__ import annotations
|
||||
from typing import Literal, NotRequired, TypedDict
|
||||
from . import _types as T
|
||||
|
||||
class AcceptingContactRequest(TypedDict):
|
||||
type: Literal["acceptingContactRequest"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class ActiveUser(TypedDict):
|
||||
type: Literal["activeUser"]
|
||||
user: "T.User"
|
||||
|
||||
class ChatItemNotChanged(TypedDict):
|
||||
type: Literal["chatItemNotChanged"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class ChatItemReaction(TypedDict):
|
||||
type: Literal["chatItemReaction"]
|
||||
user: "T.User"
|
||||
added: bool
|
||||
reaction: "T.ACIReaction"
|
||||
|
||||
class ChatItemUpdated(TypedDict):
|
||||
type: Literal["chatItemUpdated"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class ChatItemsDeleted(TypedDict):
|
||||
type: Literal["chatItemsDeleted"]
|
||||
user: "T.User"
|
||||
chatItemDeletions: list["T.ChatItemDeletion"]
|
||||
byUser: bool
|
||||
timed: bool
|
||||
|
||||
class ChatRunning(TypedDict):
|
||||
type: Literal["chatRunning"]
|
||||
|
||||
class ChatStarted(TypedDict):
|
||||
type: Literal["chatStarted"]
|
||||
|
||||
class ChatStopped(TypedDict):
|
||||
type: Literal["chatStopped"]
|
||||
|
||||
class CmdOk(TypedDict):
|
||||
type: Literal["cmdOk"]
|
||||
user_: NotRequired["T.User"]
|
||||
|
||||
class ChatCmdError(TypedDict):
|
||||
type: Literal["chatCmdError"]
|
||||
chatError: "T.ChatError"
|
||||
|
||||
class ConnectionPlan(TypedDict):
|
||||
type: Literal["connectionPlan"]
|
||||
user: "T.User"
|
||||
connLink: "T.CreatedConnLink"
|
||||
planSimplexName: NotRequired["T.SimplexNameInfo"]
|
||||
otherSimplexName: NotRequired["T.SimplexNameInfo"]
|
||||
connectionPlan: "T.ConnectionPlan"
|
||||
|
||||
class ContactAlreadyExists(TypedDict):
|
||||
type: Literal["contactAlreadyExists"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class ContactConnectionDeleted(TypedDict):
|
||||
type: Literal["contactConnectionDeleted"]
|
||||
user: "T.User"
|
||||
connection: "T.PendingContactConnection"
|
||||
|
||||
class ContactDeleted(TypedDict):
|
||||
type: Literal["contactDeleted"]
|
||||
user: "T.User"
|
||||
contact: "T.Contact"
|
||||
|
||||
class ContactPrefsUpdated(TypedDict):
|
||||
type: Literal["contactPrefsUpdated"]
|
||||
user: "T.User"
|
||||
fromContact: "T.Contact"
|
||||
toContact: "T.Contact"
|
||||
|
||||
class ContactRequestRejected(TypedDict):
|
||||
type: Literal["contactRequestRejected"]
|
||||
user: "T.User"
|
||||
contactRequest: "T.UserContactRequest"
|
||||
contact_: NotRequired["T.Contact"]
|
||||
|
||||
class ContactsList(TypedDict):
|
||||
type: Literal["contactsList"]
|
||||
user: "T.User"
|
||||
contacts: list["T.Contact"]
|
||||
|
||||
class GroupDeletedUser(TypedDict):
|
||||
type: Literal["groupDeletedUser"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
msgSigned: bool
|
||||
|
||||
class GroupLink(TypedDict):
|
||||
type: Literal["groupLink"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
groupLink: "T.GroupLink"
|
||||
|
||||
class GroupLinkCreated(TypedDict):
|
||||
type: Literal["groupLinkCreated"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
groupLink: "T.GroupLink"
|
||||
|
||||
class GroupLinkDeleted(TypedDict):
|
||||
type: Literal["groupLinkDeleted"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
|
||||
class GroupCreated(TypedDict):
|
||||
type: Literal["groupCreated"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
|
||||
class PublicGroupCreated(TypedDict):
|
||||
type: Literal["publicGroupCreated"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
groupLink: "T.GroupLink"
|
||||
groupRelays: list["T.GroupRelay"]
|
||||
|
||||
class PublicGroupCreationFailed(TypedDict):
|
||||
type: Literal["publicGroupCreationFailed"]
|
||||
user: "T.User"
|
||||
addRelayResults: list["T.AddRelayResult"]
|
||||
|
||||
class GroupRelays(TypedDict):
|
||||
type: Literal["groupRelays"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
groupRelays: list["T.GroupRelay"]
|
||||
|
||||
class GroupRelaysAdded(TypedDict):
|
||||
type: Literal["groupRelaysAdded"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
groupLink: "T.GroupLink"
|
||||
groupRelays: list["T.GroupRelay"]
|
||||
|
||||
class GroupRelaysAddFailed(TypedDict):
|
||||
type: Literal["groupRelaysAddFailed"]
|
||||
user: "T.User"
|
||||
addRelayResults: list["T.AddRelayResult"]
|
||||
|
||||
class RelayGroupAllowed(TypedDict):
|
||||
type: Literal["relayGroupAllowed"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
|
||||
class GroupMembers(TypedDict):
|
||||
type: Literal["groupMembers"]
|
||||
user: "T.User"
|
||||
group: "T.Group"
|
||||
|
||||
class GroupUpdated(TypedDict):
|
||||
type: Literal["groupUpdated"]
|
||||
user: "T.User"
|
||||
fromGroup: "T.GroupInfo"
|
||||
toGroup: "T.GroupInfo"
|
||||
member_: NotRequired["T.GroupMember"]
|
||||
msgSigned: bool
|
||||
|
||||
class GroupsList(TypedDict):
|
||||
type: Literal["groupsList"]
|
||||
user: "T.User"
|
||||
groups: list["T.GroupInfo"]
|
||||
|
||||
class Invitation(TypedDict):
|
||||
type: Literal["invitation"]
|
||||
user: "T.User"
|
||||
connLinkInvitation: "T.CreatedConnLink"
|
||||
connection: "T.PendingContactConnection"
|
||||
|
||||
class LeftMemberUser(TypedDict):
|
||||
type: Literal["leftMemberUser"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
|
||||
class MemberAccepted(TypedDict):
|
||||
type: Literal["memberAccepted"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
member: "T.GroupMember"
|
||||
|
||||
class MembersBlockedForAllUser(TypedDict):
|
||||
type: Literal["membersBlockedForAllUser"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
members: list["T.GroupMember"]
|
||||
blocked: bool
|
||||
msgSigned: bool
|
||||
|
||||
class MembersRoleUser(TypedDict):
|
||||
type: Literal["membersRoleUser"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
members: list["T.GroupMember"]
|
||||
toRole: "T.GroupMemberRole"
|
||||
msgSigned: bool
|
||||
|
||||
class NewChatItems(TypedDict):
|
||||
type: Literal["newChatItems"]
|
||||
user: "T.User"
|
||||
chatItems: list["T.AChatItem"]
|
||||
|
||||
class RcvFileAccepted(TypedDict):
|
||||
type: Literal["rcvFileAccepted"]
|
||||
user: "T.User"
|
||||
chatItem: "T.AChatItem"
|
||||
|
||||
class RcvFileAcceptedSndCancelled(TypedDict):
|
||||
type: Literal["rcvFileAcceptedSndCancelled"]
|
||||
user: "T.User"
|
||||
rcvFileTransfer: "T.RcvFileTransfer"
|
||||
|
||||
class RcvFileCancelled(TypedDict):
|
||||
type: Literal["rcvFileCancelled"]
|
||||
user: "T.User"
|
||||
chatItem_: NotRequired["T.AChatItem"]
|
||||
rcvFileTransfer: "T.RcvFileTransfer"
|
||||
|
||||
class SentConfirmation(TypedDict):
|
||||
type: Literal["sentConfirmation"]
|
||||
user: "T.User"
|
||||
connection: "T.PendingContactConnection"
|
||||
customUserProfile: NotRequired["T.Profile"]
|
||||
|
||||
class SentGroupInvitation(TypedDict):
|
||||
type: Literal["sentGroupInvitation"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
contact: "T.Contact"
|
||||
member: "T.GroupMember"
|
||||
|
||||
class SentInvitation(TypedDict):
|
||||
type: Literal["sentInvitation"]
|
||||
user: "T.User"
|
||||
connection: "T.PendingContactConnection"
|
||||
customUserProfile: NotRequired["T.Profile"]
|
||||
|
||||
class SndFileCancelled(TypedDict):
|
||||
type: Literal["sndFileCancelled"]
|
||||
user: "T.User"
|
||||
chatItem_: NotRequired["T.AChatItem"]
|
||||
fileTransferMeta: "T.FileTransferMeta"
|
||||
sndFileTransfers: list["T.SndFileTransfer"]
|
||||
|
||||
class UserAcceptedGroupSent(TypedDict):
|
||||
type: Literal["userAcceptedGroupSent"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
hostContact: NotRequired["T.Contact"]
|
||||
|
||||
class UserContactLink(TypedDict):
|
||||
type: Literal["userContactLink"]
|
||||
user: "T.User"
|
||||
contactLink: "T.UserContactLink"
|
||||
|
||||
class UserContactLinkCreated(TypedDict):
|
||||
type: Literal["userContactLinkCreated"]
|
||||
user: "T.User"
|
||||
connLinkContact: "T.CreatedConnLink"
|
||||
|
||||
class UserContactLinkDeleted(TypedDict):
|
||||
type: Literal["userContactLinkDeleted"]
|
||||
user: "T.User"
|
||||
|
||||
class UserContactLinkUpdated(TypedDict):
|
||||
type: Literal["userContactLinkUpdated"]
|
||||
user: "T.User"
|
||||
contactLink: "T.UserContactLink"
|
||||
|
||||
class UserDeletedMembers(TypedDict):
|
||||
type: Literal["userDeletedMembers"]
|
||||
user: "T.User"
|
||||
groupInfo: "T.GroupInfo"
|
||||
members: list["T.GroupMember"]
|
||||
withMessages: bool
|
||||
msgSigned: bool
|
||||
|
||||
class UserProfileUpdated(TypedDict):
|
||||
type: Literal["userProfileUpdated"]
|
||||
user: "T.User"
|
||||
fromProfile: "T.Profile"
|
||||
toProfile: "T.Profile"
|
||||
updateSummary: "T.UserProfileUpdateSummary"
|
||||
|
||||
class UserProfileNoChange(TypedDict):
|
||||
type: Literal["userProfileNoChange"]
|
||||
user: "T.User"
|
||||
|
||||
class UsersList(TypedDict):
|
||||
type: Literal["usersList"]
|
||||
users: list["T.UserInfo"]
|
||||
|
||||
class ApiChats(TypedDict):
|
||||
type: Literal["apiChats"]
|
||||
user: "T.User"
|
||||
chats: list["T.AChat"]
|
||||
|
||||
ChatResponse = (
|
||||
AcceptingContactRequest
|
||||
| ActiveUser
|
||||
| ChatItemNotChanged
|
||||
| ChatItemReaction
|
||||
| ChatItemUpdated
|
||||
| ChatItemsDeleted
|
||||
| ChatRunning
|
||||
| ChatStarted
|
||||
| ChatStopped
|
||||
| CmdOk
|
||||
| ChatCmdError
|
||||
| ConnectionPlan
|
||||
| ContactAlreadyExists
|
||||
| ContactConnectionDeleted
|
||||
| ContactDeleted
|
||||
| ContactPrefsUpdated
|
||||
| ContactRequestRejected
|
||||
| ContactsList
|
||||
| GroupDeletedUser
|
||||
| GroupLink
|
||||
| GroupLinkCreated
|
||||
| GroupLinkDeleted
|
||||
| GroupCreated
|
||||
| PublicGroupCreated
|
||||
| PublicGroupCreationFailed
|
||||
| GroupRelays
|
||||
| GroupRelaysAdded
|
||||
| GroupRelaysAddFailed
|
||||
| RelayGroupAllowed
|
||||
| GroupMembers
|
||||
| GroupUpdated
|
||||
| GroupsList
|
||||
| Invitation
|
||||
| LeftMemberUser
|
||||
| MemberAccepted
|
||||
| MembersBlockedForAllUser
|
||||
| MembersRoleUser
|
||||
| NewChatItems
|
||||
| RcvFileAccepted
|
||||
| RcvFileAcceptedSndCancelled
|
||||
| RcvFileCancelled
|
||||
| SentConfirmation
|
||||
| SentGroupInvitation
|
||||
| SentInvitation
|
||||
| SndFileCancelled
|
||||
| UserAcceptedGroupSent
|
||||
| UserContactLink
|
||||
| UserContactLinkCreated
|
||||
| UserContactLinkDeleted
|
||||
| UserContactLinkUpdated
|
||||
| UserDeletedMembers
|
||||
| UserProfileUpdated
|
||||
| UserProfileNoChange
|
||||
| UsersList
|
||||
| ApiChats
|
||||
)
|
||||
|
||||
ChatResponse_Tag = Literal["acceptingContactRequest", "activeUser", "chatItemNotChanged", "chatItemReaction", "chatItemUpdated", "chatItemsDeleted", "chatRunning", "chatStarted", "chatStopped", "cmdOk", "chatCmdError", "connectionPlan", "contactAlreadyExists", "contactConnectionDeleted", "contactDeleted", "contactPrefsUpdated", "contactRequestRejected", "contactsList", "groupDeletedUser", "groupLink", "groupLinkCreated", "groupLinkDeleted", "groupCreated", "publicGroupCreated", "publicGroupCreationFailed", "groupRelays", "groupRelaysAdded", "groupRelaysAddFailed", "relayGroupAllowed", "groupMembers", "groupUpdated", "groupsList", "invitation", "leftMemberUser", "memberAccepted", "membersBlockedForAllUser", "membersRoleUser", "newChatItems", "rcvFileAccepted", "rcvFileAcceptedSndCancelled", "rcvFileCancelled", "sentConfirmation", "sentGroupInvitation", "sentInvitation", "sndFileCancelled", "userAcceptedGroupSent", "userContactLink", "userContactLinkCreated", "userContactLinkDeleted", "userContactLinkUpdated", "userDeletedMembers", "userProfileUpdated", "userProfileNoChange", "usersList", "apiChats"]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1114,11 +1114,11 @@ data ReceivedGroupInvitation = ReceivedGroupInvitation
|
||||
|
||||
type GroupMemberId = Int64
|
||||
|
||||
-- memberProfile's profileId is COALESCE(member_profile_id, contact_profile_id), member_profile_id is non null
|
||||
-- if incognito profile was saved for member (used for hosts and invitees in incognito groups)
|
||||
data KeySendStatus = KSSent | KSFailed | KSError Text | KSAttempts Int
|
||||
deriving (Eq, Show)
|
||||
|
||||
-- memberProfile's profileId is COALESCE(member_profile_id, contact_profile_id), member_profile_id is non null
|
||||
-- if incognito profile was saved for member (used for hosts and invitees in incognito groups)
|
||||
data GroupMember = GroupMember
|
||||
{ groupMemberId :: GroupMemberId,
|
||||
groupId :: GroupId,
|
||||
|
||||
Reference in New Issue
Block a user