From 46e6835580b8ffaa27bae87989e17ff9aad8a1f1 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 31 Jul 2026 12:47:00 +0100 Subject: [PATCH] null --- bots/api/COMMANDS.md | 2170 ------- bots/api/EVENTS.md | 795 --- bots/api/TYPES.md | 4525 -------------- .../types/typescript/src/commands.ts | 818 --- .../types/typescript/src/events.ts | 473 -- .../types/typescript/src/responses.ts | 482 -- .../types/typescript/src/types.ts | 5194 ----------------- .../src/simplex_chat/types/_commands.py | 718 --- .../src/simplex_chat/types/_events.py | 681 --- .../src/simplex_chat/types/_responses.py | 368 -- .../src/simplex_chat/types/_types.py | 3643 ------------ src/Simplex/Chat/Library/Internal.hs | 10 +- src/Simplex/Chat/Store/Groups.hs | 2 +- 13 files changed, 6 insertions(+), 19873 deletions(-) diff --git a/bots/api/COMMANDS.md b/bots/api/COMMANDS.md index 463dd4088b..e69de29bb2 100644 --- a/bots/api/COMMANDS.md +++ b/bots/api/COMMANDS.md @@ -1,2170 +0,0 @@ -# API Commands and Responses - -This file is generated automatically. - -[Address commands](#address-commands) -- [APICreateMyAddress](#apicreatemyaddress) -- [APIDeleteMyAddress](#apideletemyaddress) -- [APIShowMyAddress](#apishowmyaddress) -- [APISetProfileAddress](#apisetprofileaddress) -- [APISetAddressSettings](#apisetaddresssettings) - -[Message commands](#message-commands) -- [APISendMessages](#apisendmessages) -- [APIUpdateChatItem](#apiupdatechatitem) -- [APIDeleteChatItem](#apideletechatitem) -- [APIDeleteMemberChatItem](#apideletememberchatitem) -- [APIChatItemReaction](#apichatitemreaction) - -[File commands](#file-commands) -- [ReceiveFile](#receivefile) -- [CancelFile](#cancelfile) - -[Group commands](#group-commands) -- [APIAddMember](#apiaddmember) -- [APIJoinGroup](#apijoingroup) -- [APIAcceptMember](#apiacceptmember) -- [APIMembersRole](#apimembersrole) -- [APIBlockMembersForAll](#apiblockmembersforall) -- [APIRemoveMembers](#apiremovemembers) -- [APILeaveGroup](#apileavegroup) -- [APIListMembers](#apilistmembers) -- [APINewGroup](#apinewgroup) -- [APINewPublicGroup](#apinewpublicgroup) -- [APIGetGroupRelays](#apigetgrouprelays) -- [APIAddGroupRelays](#apiaddgrouprelays) -- [APIAllowRelayGroup](#apiallowrelaygroup) -- [APIUpdateGroupProfile](#apiupdategroupprofile) - -[Group link commands](#group-link-commands) -- [APICreateGroupLink](#apicreategrouplink) -- [APIGroupLinkMemberRole](#apigrouplinkmemberrole) -- [APIDeleteGroupLink](#apideletegrouplink) -- [APIGetGroupLink](#apigetgrouplink) - -[Connection commands](#connection-commands) -- [APIAddContact](#apiaddcontact) -- [APIConnectPlan](#apiconnectplan) -- [APIConnect](#apiconnect) -- [Connect](#connect) -- [APIAcceptContact](#apiacceptcontact) -- [APIRejectContact](#apirejectcontact) - -[Chat commands](#chat-commands) -- [APIListContacts](#apilistcontacts) -- [APIListGroups](#apilistgroups) -- [APIGetChats](#apigetchats) -- [APIDeleteChat](#apideletechat) -- [APISetGroupCustomData](#apisetgroupcustomdata) -- [APISetContactCustomData](#apisetcontactcustomdata) -- [APISetUserAutoAcceptMemberContacts](#apisetuserautoacceptmembercontacts) - -[User profile commands](#user-profile-commands) -- [ShowActiveUser](#showactiveuser) -- [CreateActiveUser](#createactiveuser) -- [ListUsers](#listusers) -- [APISetActiveUser](#apisetactiveuser) -- [APIDeleteUser](#apideleteuser) -- [APIUpdateProfile](#apiupdateprofile) -- [APISetContactPrefs](#apisetcontactprefs) - -[Chat management](#chat-management) -- [StartChat](#startchat) -- [APIStopChat](#apistopchat) - ---- - - -## Address commands - -Bots can use these commands to automatically check and create address when initialized - - -### APICreateMyAddress - -Create bot address. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 - -**Syntax**: - -``` -/_address -``` - -```javascript -'/_address ' + userId // JavaScript -``` - -```python -'/_address ' + str(userId) # Python -``` - -**Responses**: - -UserContactLinkCreated: User contact address created. -- type: "userContactLinkCreated" -- user: [User](./TYPES.md#user) -- connLinkContact: [CreatedConnLink](./TYPES.md#createdconnlink) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIDeleteMyAddress - -Delete bot address. - -*Network usage*: background. - -**Parameters**: -- userId: int64 - -**Syntax**: - -``` -/_delete_address -``` - -```javascript -'/_delete_address ' + userId // JavaScript -``` - -```python -'/_delete_address ' + str(userId) # Python -``` - -**Responses**: - -UserContactLinkDeleted: User contact address deleted. -- type: "userContactLinkDeleted" -- user: [User](./TYPES.md#user) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIShowMyAddress - -Get bot address and settings. - -*Network usage*: no. - -**Parameters**: -- userId: int64 - -**Syntax**: - -``` -/_show_address -``` - -```javascript -'/_show_address ' + userId // JavaScript -``` - -```python -'/_show_address ' + str(userId) # Python -``` - -**Responses**: - -UserContactLink: User contact address. -- type: "userContactLink" -- user: [User](./TYPES.md#user) -- contactLink: [UserContactLink](./TYPES.md#usercontactlink) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetProfileAddress - -Add address to bot profile. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 -- enable: bool - -**Syntax**: - -``` -/_profile_address on|off -``` - -```javascript -'/_profile_address ' + userId + ' ' + (enable ? 'on' : 'off') // JavaScript -``` - -```python -'/_profile_address ' + str(userId) + ' ' + ('on' if enable else 'off') # Python -``` - -**Responses**: - -UserProfileUpdated: User profile updated. -- type: "userProfileUpdated" -- user: [User](./TYPES.md#user) -- fromProfile: [Profile](./TYPES.md#profile) -- toProfile: [Profile](./TYPES.md#profile) -- updateSummary: [UserProfileUpdateSummary](./TYPES.md#userprofileupdatesummary) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetAddressSettings - -Set bot address settings. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 -- settings: [AddressSettings](./TYPES.md#addresssettings) - -**Syntax**: - -``` -/_address_settings -``` - -```javascript -'/_address_settings ' + userId + ' ' + JSON.stringify(settings) // JavaScript -``` - -```python -'/_address_settings ' + str(userId) + ' ' + json.dumps(settings) # Python -``` - -**Responses**: - -UserContactLinkUpdated: User contact address updated. -- type: "userContactLinkUpdated" -- user: [User](./TYPES.md#user) -- contactLink: [UserContactLink](./TYPES.md#usercontactlink) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## Message commands - -Commands to send, update, delete, moderate messages and set message reactions - - -### APISendMessages - -Send messages. - -*Network usage*: background. - -**Parameters**: -- sendRef: [ChatRef](./TYPES.md#chatref) -- liveMessage: bool -- ttl: int? -- signMessages: bool -- composedMessages: [[ComposedMessage](./TYPES.md#composedmessage)] - -**Syntax**: - -``` -/_send [ live=on][ ttl=][ sign=on] json -``` - -```javascript -'/_send ' + ChatRef.cmdString(sendRef) + (liveMessage ? ' live=on' : '') + (ttl ? ' ttl=' + ttl : '') + (signMessages ? ' sign=on' : '') + ' json ' + JSON.stringify(composedMessages) // JavaScript -``` - -```python -'/_send ' + ChatRef_cmd_string(sendRef) + (' live=on' if liveMessage else '') + ((' ttl=' + str(ttl)) if ttl is not None else '') + (' sign=on' if signMessages else '') + ' json ' + json.dumps(composedMessages) # Python -``` - -**Responses**: - -NewChatItems: New messages. -- type: "newChatItems" -- user: [User](./TYPES.md#user) -- chatItems: [[AChatItem](./TYPES.md#achatitem)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIUpdateChatItem - -Update message. - -*Network usage*: background. - -**Parameters**: -- chatRef: [ChatRef](./TYPES.md#chatref) -- chatItemId: int64 -- liveMessage: bool -- updatedMessage: [UpdatedMessage](./TYPES.md#updatedmessage) - -**Syntax**: - -``` -/_update item [ live=on] json -``` - -```javascript -'/_update item ' + ChatRef.cmdString(chatRef) + ' ' + chatItemId + (liveMessage ? ' live=on' : '') + ' json ' + JSON.stringify(updatedMessage) // JavaScript -``` - -```python -'/_update item ' + ChatRef_cmd_string(chatRef) + ' ' + str(chatItemId) + (' live=on' if liveMessage else '') + ' json ' + json.dumps(updatedMessage) # Python -``` - -**Responses**: - -ChatItemUpdated: Message updated. -- type: "chatItemUpdated" -- user: [User](./TYPES.md#user) -- chatItem: [AChatItem](./TYPES.md#achatitem) - -ChatItemNotChanged: Message not changed. -- type: "chatItemNotChanged" -- user: [User](./TYPES.md#user) -- chatItem: [AChatItem](./TYPES.md#achatitem) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - -**Errors**: -- InvalidChatItemUpdate: Not user's message or cannot be edited. - ---- - - -### APIDeleteChatItem - -Delete message. - -*Network usage*: background. - -**Parameters**: -- chatRef: [ChatRef](./TYPES.md#chatref) -- chatItemIds: [int64] -- deleteMode: [CIDeleteMode](./TYPES.md#cideletemode) - -**Syntax**: - -``` -/_delete item [,...] broadcast|internal|internalMark|history -``` - -```javascript -'/_delete item ' + ChatRef.cmdString(chatRef) + ' ' + chatItemIds.join(',') + ' ' + deleteMode // JavaScript -``` - -```python -'/_delete item ' + ChatRef_cmd_string(chatRef) + ' ' + ','.join(map(str, chatItemIds)) + ' ' + str(deleteMode) # Python -``` - -**Responses**: - -ChatItemsDeleted: Messages deleted. -- type: "chatItemsDeleted" -- user: [User](./TYPES.md#user) -- chatItemDeletions: [[ChatItemDeletion](./TYPES.md#chatitemdeletion)] -- byUser: bool -- timed: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIDeleteMemberChatItem - -Moderate message. Requires Moderator role (and higher than message author's). - -*Network usage*: background. - -**Parameters**: -- groupId: int64 -- chatItemIds: [int64] - -**Syntax**: - -``` -/_delete member item # [,...] -``` - -```javascript -'/_delete member item #' + groupId + ' ' + chatItemIds.join(',') // JavaScript -``` - -```python -'/_delete member item #' + str(groupId) + ' ' + ','.join(map(str, chatItemIds)) # Python -``` - -**Responses**: - -ChatItemsDeleted: Messages deleted. -- type: "chatItemsDeleted" -- user: [User](./TYPES.md#user) -- chatItemDeletions: [[ChatItemDeletion](./TYPES.md#chatitemdeletion)] -- byUser: bool -- timed: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIChatItemReaction - -Add/remove message reaction. - -*Network usage*: background. - -**Parameters**: -- chatRef: [ChatRef](./TYPES.md#chatref) -- chatItemId: int64 -- add: bool -- reaction: [MsgReaction](./TYPES.md#msgreaction) - -**Syntax**: - -``` -/_reaction on|off -``` - -```javascript -'/_reaction ' + ChatRef.cmdString(chatRef) + ' ' + chatItemId + ' ' + (add ? 'on' : 'off') + ' ' + JSON.stringify(reaction) // JavaScript -``` - -```python -'/_reaction ' + ChatRef_cmd_string(chatRef) + ' ' + str(chatItemId) + ' ' + ('on' if add else 'off') + ' ' + json.dumps(reaction) # Python -``` - -**Responses**: - -ChatItemReaction: Message reaction. -- type: "chatItemReaction" -- user: [User](./TYPES.md#user) -- added: bool -- reaction: [ACIReaction](./TYPES.md#acireaction) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## 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. - - -### ReceiveFile - -Receive file. - -*Network usage*: no. - -**Parameters**: -- fileId: int64 -- userApprovedRelays: bool -- storeEncrypted: bool? -- fileInline: bool? -- filePath: string? - -**Syntax**: - -``` -/freceive [ approved_relays=on][ encrypt=on|off][ inline=on|off][ ] -``` - -```javascript -'/freceive ' + fileId + (userApprovedRelays ? ' approved_relays=on' : '') + (typeof storeEncrypted == 'boolean' ? ' encrypt=' + (storeEncrypted ? 'on' : 'off') : '') + (typeof fileInline == 'boolean' ? ' inline=' + (fileInline ? 'on' : 'off') : '') + (filePath ? ' ' + filePath : '') // JavaScript -``` - -```python -'/freceive ' + str(fileId) + (' approved_relays=on' if userApprovedRelays else '') + ((' encrypt=' + ('on' if storeEncrypted else 'off')) if storeEncrypted is not None else '') + ((' inline=' + ('on' if fileInline else 'off')) if fileInline is not None else '') + ((' ' + filePath) if filePath is not None else '') # Python -``` - -**Responses**: - -RcvFileAccepted: File accepted to be received. -- type: "rcvFileAccepted" -- user: [User](./TYPES.md#user) -- chatItem: [AChatItem](./TYPES.md#achatitem) - -RcvFileAcceptedSndCancelled: File accepted, but no longer sent. -- type: "rcvFileAcceptedSndCancelled" -- user: [User](./TYPES.md#user) -- rcvFileTransfer: [RcvFileTransfer](./TYPES.md#rcvfiletransfer) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### CancelFile - -Cancel file. - -*Network usage*: background. - -**Parameters**: -- fileId: int64 - -**Syntax**: - -``` -/fcancel -``` - -```javascript -'/fcancel ' + fileId // JavaScript -``` - -```python -'/fcancel ' + str(fileId) # Python -``` - -**Responses**: - -SndFileCancelled: Cancelled sending file. -- type: "sndFileCancelled" -- user: [User](./TYPES.md#user) -- chatItem_: [AChatItem](./TYPES.md#achatitem)? -- fileTransferMeta: [FileTransferMeta](./TYPES.md#filetransfermeta) -- sndFileTransfers: [[SndFileTransfer](./TYPES.md#sndfiletransfer)] - -RcvFileCancelled: Cancelled receiving file. -- type: "rcvFileCancelled" -- user: [User](./TYPES.md#user) -- chatItem_: [AChatItem](./TYPES.md#achatitem)? -- rcvFileTransfer: [RcvFileTransfer](./TYPES.md#rcvfiletransfer) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - -**Errors**: -- FileCancel: Cannot cancel file. - ---- - - -## 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. - - -### APIAddMember - -Add contact to group. Requires bot to have Admin role. - -*Network usage*: interactive. - -**Parameters**: -- groupId: int64 -- contactId: int64 -- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole) - -**Syntax**: - -``` -/_add # relay|observer|author|member|moderator|admin|owner -``` - -```javascript -'/_add #' + groupId + ' ' + contactId + ' ' + memberRole // JavaScript -``` - -```python -'/_add #' + str(groupId) + ' ' + str(contactId) + ' ' + str(memberRole) # Python -``` - -**Responses**: - -SentGroupInvitation: Group invitation sent. -- type: "sentGroupInvitation" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- contact: [Contact](./TYPES.md#contact) -- member: [GroupMember](./TYPES.md#groupmember) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIJoinGroup - -Join group. - -*Network usage*: interactive. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_join # -``` - -```javascript -'/_join #' + groupId // JavaScript -``` - -```python -'/_join #' + str(groupId) # Python -``` - -**Responses**: - -UserAcceptedGroupSent: User accepted group invitation. -- type: "userAcceptedGroupSent" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- hostContact: [Contact](./TYPES.md#contact)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIAcceptMember - -Accept group member. Requires Admin role. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 -- groupMemberId: int64 -- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole) - -**Syntax**: - -``` -/_accept member # relay|observer|author|member|moderator|admin|owner -``` - -```javascript -'/_accept member #' + groupId + ' ' + groupMemberId + ' ' + memberRole // JavaScript -``` - -```python -'/_accept member #' + str(groupId) + ' ' + str(groupMemberId) + ' ' + str(memberRole) # Python -``` - -**Responses**: - -MemberAccepted: Member accepted to group. -- type: "memberAccepted" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- member: [GroupMember](./TYPES.md#groupmember) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - -**Errors**: -- GroupMemberNotActive: Member is not connected yet. - ---- - - -### APIMembersRole - -Set members role. Requires Admin role. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 -- groupMemberIds: [int64] -- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole) - -**Syntax**: - -``` -/_member role # [,...] relay|observer|author|member|moderator|admin|owner -``` - -```javascript -'/_member role #' + groupId + ' ' + groupMemberIds.join(',') + ' ' + memberRole // JavaScript -``` - -```python -'/_member role #' + str(groupId) + ' ' + ','.join(map(str, groupMemberIds)) + ' ' + str(memberRole) # Python -``` - -**Responses**: - -MembersRoleUser: Members role changed by user. -- type: "membersRoleUser" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- members: [[GroupMember](./TYPES.md#groupmember)] -- toRole: [GroupMemberRole](./TYPES.md#groupmemberrole) -- msgSigned: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIBlockMembersForAll - -Block members. Requires Moderator role. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 -- groupMemberIds: [int64] -- blocked: bool - -**Syntax**: - -``` -/_block # [,...] blocked=on|off -``` - -```javascript -'/_block #' + groupId + ' ' + groupMemberIds.join(',') + ' blocked=' + (blocked ? 'on' : 'off') // JavaScript -``` - -```python -'/_block #' + str(groupId) + ' ' + ','.join(map(str, groupMemberIds)) + ' blocked=' + ('on' if blocked else 'off') # Python -``` - -**Responses**: - -MembersBlockedForAllUser: Members blocked for all by admin. -- type: "membersBlockedForAllUser" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- members: [[GroupMember](./TYPES.md#groupmember)] -- blocked: bool -- msgSigned: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIRemoveMembers - -Remove members. Requires Admin role. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 -- groupMemberIds: [int64] -- withMessages: bool - -**Syntax**: - -``` -/_remove # [,...][ messages=on] -``` - -```javascript -'/_remove #' + groupId + ' ' + groupMemberIds.join(',') + (withMessages ? ' messages=on' : '') // JavaScript -``` - -```python -'/_remove #' + str(groupId) + ' ' + ','.join(map(str, groupMemberIds)) + (' messages=on' if withMessages else '') # Python -``` - -**Responses**: - -UserDeletedMembers: Members deleted. -- type: "userDeletedMembers" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- members: [[GroupMember](./TYPES.md#groupmember)] -- withMessages: bool -- msgSigned: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - -**Errors**: -- GroupMemberNotFound: Group member not found. - ---- - - -### APILeaveGroup - -Leave group. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_leave # -``` - -```javascript -'/_leave #' + groupId // JavaScript -``` - -```python -'/_leave #' + str(groupId) # Python -``` - -**Responses**: - -LeftMemberUser: User left group. -- type: "leftMemberUser" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIListMembers - -Get group members. - -*Network usage*: no. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_members # -``` - -```javascript -'/_members #' + groupId // JavaScript -``` - -```python -'/_members #' + str(groupId) # Python -``` - -**Responses**: - -GroupMembers: Group members. -- type: "groupMembers" -- user: [User](./TYPES.md#user) -- group: [Group](./TYPES.md#group) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APINewGroup - -Create group. - -*Network usage*: no. - -**Parameters**: -- userId: int64 -- incognito: bool -- groupProfile: [GroupProfile](./TYPES.md#groupprofile) - -**Syntax**: - -``` -/_group [ incognito=on] -``` - -```javascript -'/_group ' + userId + (incognito ? ' incognito=on' : '') + ' ' + JSON.stringify(groupProfile) // JavaScript -``` - -```python -'/_group ' + str(userId) + (' incognito=on' if incognito else '') + ' ' + json.dumps(groupProfile) # Python -``` - -**Responses**: - -GroupCreated: Group created. -- type: "groupCreated" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APINewPublicGroup - -Create public group. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 -- incognito: bool -- relayIds: [int64] -- groupProfile: [GroupProfile](./TYPES.md#groupprofile) - -**Syntax**: - -``` -/_public group [ incognito=on] [,...] -``` - -```javascript -'/_public group ' + userId + (incognito ? ' incognito=on' : '') + ' ' + relayIds.join(',') + ' ' + JSON.stringify(groupProfile) // JavaScript -``` - -```python -'/_public group ' + str(userId) + (' incognito=on' if incognito else '') + ' ' + ','.join(map(str, relayIds)) + ' ' + json.dumps(groupProfile) # Python -``` - -**Responses**: - -PublicGroupCreated: Public group created. -- type: "publicGroupCreated" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- groupLink: [GroupLink](./TYPES.md#grouplink) -- groupRelays: [[GroupRelay](./TYPES.md#grouprelay)] - -PublicGroupCreationFailed: Public group creation failed. -- type: "publicGroupCreationFailed" -- user: [User](./TYPES.md#user) -- addRelayResults: [[AddRelayResult](./TYPES.md#addrelayresult)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIGetGroupRelays - -Get group relays. - -*Network usage*: no. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_get relays # -``` - -```javascript -'/_get relays #' + groupId // JavaScript -``` - -```python -'/_get relays #' + str(groupId) # Python -``` - -**Responses**: - -GroupRelays: Group relays. -- type: "groupRelays" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- groupRelays: [[GroupRelay](./TYPES.md#grouprelay)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIAddGroupRelays - -Add relays to group. - -*Network usage*: interactive. - -**Parameters**: -- groupId: int64 -- relayIds: [int64] - -**Syntax**: - -``` -/_add relays # [,...] -``` - -```javascript -'/_add relays #' + groupId + ' ' + relayIds.join(',') // JavaScript -``` - -```python -'/_add relays #' + str(groupId) + ' ' + ','.join(map(str, relayIds)) # Python -``` - -**Responses**: - -GroupRelaysAdded: Group relays added. -- type: "groupRelaysAdded" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- groupLink: [GroupLink](./TYPES.md#grouplink) -- groupRelays: [[GroupRelay](./TYPES.md#grouprelay)] - -GroupRelaysAddFailed: Group relays add failed. -- type: "groupRelaysAddFailed" -- user: [User](./TYPES.md#user) -- addRelayResults: [[AddRelayResult](./TYPES.md#addrelayresult)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIAllowRelayGroup - -Clear relay rejection for a channel (relay operator). - -*Network usage*: background. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_relay allow # -``` - -```javascript -'/_relay allow #' + groupId // JavaScript -``` - -```python -'/_relay allow #' + str(groupId) # Python -``` - -**Responses**: - -RelayGroupAllowed: Relay rejection cleared for a channel. -- type: "relayGroupAllowed" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIUpdateGroupProfile - -Update group profile. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 -- groupProfile: [GroupProfile](./TYPES.md#groupprofile) - -**Syntax**: - -``` -/_group_profile # -``` - -```javascript -'/_group_profile #' + groupId + ' ' + JSON.stringify(groupProfile) // JavaScript -``` - -```python -'/_group_profile #' + str(groupId) + ' ' + json.dumps(groupProfile) # Python -``` - -**Responses**: - -GroupUpdated: Group updated. -- type: "groupUpdated" -- user: [User](./TYPES.md#user) -- fromGroup: [GroupInfo](./TYPES.md#groupinfo) -- toGroup: [GroupInfo](./TYPES.md#groupinfo) -- member_: [GroupMember](./TYPES.md#groupmember)? -- msgSigned: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## Group link commands - -These commands can be used by bots that manage multiple public groups - - -### APICreateGroupLink - -Create group link. - -*Network usage*: interactive. - -**Parameters**: -- groupId: int64 -- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole) - -**Syntax**: - -``` -/_create link # relay|observer|author|member|moderator|admin|owner -``` - -```javascript -'/_create link #' + groupId + ' ' + memberRole // JavaScript -``` - -```python -'/_create link #' + str(groupId) + ' ' + str(memberRole) # Python -``` - -**Responses**: - -GroupLinkCreated: Group link created. -- type: "groupLinkCreated" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- groupLink: [GroupLink](./TYPES.md#grouplink) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIGroupLinkMemberRole - -Set member role for group link. - -*Network usage*: no. - -**Parameters**: -- groupId: int64 -- memberRole: [GroupMemberRole](./TYPES.md#groupmemberrole) - -**Syntax**: - -``` -/_set link role # relay|observer|author|member|moderator|admin|owner -``` - -```javascript -'/_set link role #' + groupId + ' ' + memberRole // JavaScript -``` - -```python -'/_set link role #' + str(groupId) + ' ' + str(memberRole) # Python -``` - -**Responses**: - -GroupLink: Group link. -- type: "groupLink" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- groupLink: [GroupLink](./TYPES.md#grouplink) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIDeleteGroupLink - -Delete group link. - -*Network usage*: background. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_delete link # -``` - -```javascript -'/_delete link #' + groupId // JavaScript -``` - -```python -'/_delete link #' + str(groupId) # Python -``` - -**Responses**: - -GroupLinkDeleted: Group link deleted. -- type: "groupLinkDeleted" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIGetGroupLink - -Get group link. - -*Network usage*: no. - -**Parameters**: -- groupId: int64 - -**Syntax**: - -``` -/_get link # -``` - -```javascript -'/_get link #' + groupId // JavaScript -``` - -```python -'/_get link #' + str(groupId) # Python -``` - -**Responses**: - -GroupLink: Group link. -- type: "groupLink" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- groupLink: [GroupLink](./TYPES.md#grouplink) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## 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. - - -### APIAddContact - -Create 1-time invitation link. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 -- incognito: bool - -**Syntax**: - -``` -/_connect [ incognito=on] -``` - -```javascript -'/_connect ' + userId + (incognito ? ' incognito=on' : '') // JavaScript -``` - -```python -'/_connect ' + str(userId) + (' incognito=on' if incognito else '') # Python -``` - -**Responses**: - -Invitation: One-time invitation. -- type: "invitation" -- user: [User](./TYPES.md#user) -- connLinkInvitation: [CreatedConnLink](./TYPES.md#createdconnlink) -- connection: [PendingContactConnection](./TYPES.md#pendingcontactconnection) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIConnectPlan - -Determine SimpleX link type and if the bot is already connected via this link or name. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 -- connectTarget: string? -- resolveMode: [PlanResolveMode](./TYPES.md#planresolvemode) -- linkOwnerSig: [LinkOwnerSig](./TYPES.md#linkownersig)? - -**Syntax**: - -``` -/_connect plan -``` - -```javascript -'/_connect plan ' + userId + ' ' + connectTarget // JavaScript -``` - -```python -'/_connect plan ' + str(userId) + ' ' + connectTarget # Python -``` - -**Responses**: - -ConnectionPlan: Connection link information. -- type: "connectionPlan" -- user: [User](./TYPES.md#user) -- connLink: [CreatedConnLink](./TYPES.md#createdconnlink) -- planSimplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)? -- otherSimplexName: [SimplexNameInfo](./TYPES.md#simplexnameinfo)? -- connectionPlan: [ConnectionPlan](./TYPES.md#connectionplan) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIConnect - -Connect via prepared SimpleX link. The link can be 1-time invitation link, contact address or group link. - -*Network usage*: interactive. - -**Parameters**: -- userId: int64 -- incognito: bool -- preparedLink_: [CreatedConnLink](./TYPES.md#createdconnlink)? - -**Syntax**: - -``` -/_connect [ ] -``` - -```javascript -'/_connect ' + userId + (preparedLink_ ? ' ' + CreatedConnLink.cmdString(preparedLink_) : '') // JavaScript -``` - -```python -'/_connect ' + str(userId) + ((' ' + CreatedConnLink_cmd_string(preparedLink_)) if preparedLink_ is not None else '') # Python -``` - -**Responses**: - -SentConfirmation: Confirmation sent to one-time invitation. -- type: "sentConfirmation" -- user: [User](./TYPES.md#user) -- connection: [PendingContactConnection](./TYPES.md#pendingcontactconnection) -- customUserProfile: [Profile](./TYPES.md#profile)? - -ContactAlreadyExists: Contact already exists. -- type: "contactAlreadyExists" -- user: [User](./TYPES.md#user) -- contact: [Contact](./TYPES.md#contact) - -SentInvitation: Invitation sent to contact address. -- type: "sentInvitation" -- user: [User](./TYPES.md#user) -- connection: [PendingContactConnection](./TYPES.md#pendingcontactconnection) -- customUserProfile: [Profile](./TYPES.md#profile)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### Connect - -Connect via SimpleX link or name as string in the active user profile. - -*Network usage*: interactive. - -**Parameters**: -- incognito: bool -- connTarget_: string? - -**Syntax**: - -``` -/connect[ ] -``` - -```javascript -'/connect' + (connTarget_ ? ' ' + connTarget_ : '') // JavaScript -``` - -```python -'/connect' + ((' ' + connTarget_) if connTarget_ is not None else '') # Python -``` - -**Responses**: - -SentConfirmation: Confirmation sent to one-time invitation. -- type: "sentConfirmation" -- user: [User](./TYPES.md#user) -- connection: [PendingContactConnection](./TYPES.md#pendingcontactconnection) -- customUserProfile: [Profile](./TYPES.md#profile)? - -ContactAlreadyExists: Contact already exists. -- type: "contactAlreadyExists" -- user: [User](./TYPES.md#user) -- contact: [Contact](./TYPES.md#contact) - -SentInvitation: Invitation sent to contact address. -- type: "sentInvitation" -- user: [User](./TYPES.md#user) -- connection: [PendingContactConnection](./TYPES.md#pendingcontactconnection) -- customUserProfile: [Profile](./TYPES.md#profile)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIAcceptContact - -Accept contact request. - -*Network usage*: interactive. - -**Parameters**: -- contactReqId: int64 - -**Syntax**: - -``` -/_accept -``` - -```javascript -'/_accept ' + contactReqId // JavaScript -``` - -```python -'/_accept ' + str(contactReqId) # Python -``` - -**Responses**: - -AcceptingContactRequest: Contact request accepted. -- type: "acceptingContactRequest" -- user: [User](./TYPES.md#user) -- contact: [Contact](./TYPES.md#contact) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIRejectContact - -Reject contact request. The user who sent the request is **not notified**. - -*Network usage*: no. - -**Parameters**: -- contactReqId: int64 - -**Syntax**: - -``` -/_reject -``` - -```javascript -'/_reject ' + contactReqId // JavaScript -``` - -```python -'/_reject ' + str(contactReqId) # Python -``` - -**Responses**: - -ContactRequestRejected: Contact request rejected. -- type: "contactRequestRejected" -- user: [User](./TYPES.md#user) -- contactRequest: [UserContactRequest](./TYPES.md#usercontactrequest) -- contact_: [Contact](./TYPES.md#contact)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## Chat commands - -Commands to list and delete conversations. - - -### APIListContacts - -Get contacts. - -*Network usage*: no. - -**Parameters**: -- userId: int64 - -**Syntax**: - -``` -/_contacts -``` - -```javascript -'/_contacts ' + userId // JavaScript -``` - -```python -'/_contacts ' + str(userId) # Python -``` - -**Responses**: - -ContactsList: Contacts. -- type: "contactsList" -- user: [User](./TYPES.md#user) -- contacts: [[Contact](./TYPES.md#contact)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIListGroups - -Get groups. - -*Network usage*: no. - -**Parameters**: -- userId: int64 -- contactId_: int64? -- search: string? - -**Syntax**: - -``` -/_groups [ @][ ] -``` - -```javascript -'/_groups ' + userId + (contactId_ ? ' @' + contactId_ : '') + (search ? ' ' + search : '') // JavaScript -``` - -```python -'/_groups ' + str(userId) + ((' @' + str(contactId_)) if contactId_ is not None else '') + ((' ' + search) if search is not None else '') # Python -``` - -**Responses**: - -GroupsList: Groups. -- type: "groupsList" -- user: [User](./TYPES.md#user) -- groups: [[GroupInfo](./TYPES.md#groupinfo)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIGetChats - -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. - -**Parameters**: -- userId: int64 -- pendingConnections: bool -- pagination: [PaginationByTime](./TYPES.md#paginationbytime) -- query: [ChatListQuery](./TYPES.md#chatlistquery) - -**Syntax**: - -``` -/_get chats [ pcc=on] -``` - -```javascript -'/_get chats ' + userId + (pendingConnections ? ' pcc=on' : '') + ' ' + PaginationByTime.cmdString(pagination) + ' ' + JSON.stringify(query) // JavaScript -``` - -```python -'/_get chats ' + str(userId) + (' pcc=on' if pendingConnections else '') + ' ' + PaginationByTime_cmd_string(pagination) + ' ' + json.dumps(query) # Python -``` - -**Responses**: - -ApiChats: Chat previews (paginated). Use this instead of CRContactsList / CRGroupsList when scanning at scale.. -- type: "apiChats" -- user: [User](./TYPES.md#user) -- chats: [[AChat](./TYPES.md#achat)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIDeleteChat - -Delete chat. - -*Network usage*: background. - -**Parameters**: -- chatRef: [ChatRef](./TYPES.md#chatref) -- chatDeleteMode: [ChatDeleteMode](./TYPES.md#chatdeletemode) - -**Syntax**: - -``` -/_delete -``` - -```javascript -'/_delete ' + ChatRef.cmdString(chatRef) + ' ' + ChatDeleteMode.cmdString(chatDeleteMode) // JavaScript -``` - -```python -'/_delete ' + ChatRef_cmd_string(chatRef) + ' ' + ChatDeleteMode_cmd_string(chatDeleteMode) # Python -``` - -**Responses**: - -ContactDeleted: Contact deleted. -- type: "contactDeleted" -- user: [User](./TYPES.md#user) -- contact: [Contact](./TYPES.md#contact) - -ContactConnectionDeleted: Connection deleted. -- type: "contactConnectionDeleted" -- user: [User](./TYPES.md#user) -- connection: [PendingContactConnection](./TYPES.md#pendingcontactconnection) - -GroupDeletedUser: User deleted group. -- type: "groupDeletedUser" -- user: [User](./TYPES.md#user) -- groupInfo: [GroupInfo](./TYPES.md#groupinfo) -- msgSigned: bool - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetGroupCustomData - -Set group custom data. - -*Network usage*: no. - -**Parameters**: -- groupId: int64 -- customData: JSONObject? - -**Syntax**: - -``` -/_set custom #[ ] -``` - -```javascript -'/_set custom #' + groupId + (customData ? ' ' + JSON.stringify(customData) : '') // JavaScript -``` - -```python -'/_set custom #' + str(groupId) + ((' ' + json.dumps(customData)) if customData is not None else '') # Python -``` - -**Responses**: - -CmdOk: Ok. -- type: "cmdOk" -- user_: [User](./TYPES.md#user)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetContactCustomData - -Set contact custom data. - -*Network usage*: no. - -**Parameters**: -- contactId: int64 -- customData: JSONObject? - -**Syntax**: - -``` -/_set custom @[ ] -``` - -```javascript -'/_set custom @' + contactId + (customData ? ' ' + JSON.stringify(customData) : '') // JavaScript -``` - -```python -'/_set custom @' + str(contactId) + ((' ' + json.dumps(customData)) if customData is not None else '') # Python -``` - -**Responses**: - -CmdOk: Ok. -- type: "cmdOk" -- user_: [User](./TYPES.md#user)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetUserAutoAcceptMemberContacts - -Set auto-accept member contacts. - -*Network usage*: no. - -**Parameters**: -- userId: int64 -- onOff: bool - -**Syntax**: - -``` -/_set accept member contacts on|off -``` - -```javascript -'/_set accept member contacts ' + userId + ' ' + (onOff ? 'on' : 'off') // JavaScript -``` - -```python -'/_set accept member contacts ' + str(userId) + ' ' + ('on' if onOff else 'off') # Python -``` - -**Responses**: - -CmdOk: Ok. -- type: "cmdOk" -- user_: [User](./TYPES.md#user)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## 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). - - -### ShowActiveUser - -Get active user profile. - -*Network usage*: no. - -**Syntax**: - -``` -/user -``` - -**Responses**: - -ActiveUser: Active user profile. -- type: "activeUser" -- user: [User](./TYPES.md#user) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### CreateActiveUser - -Create new user profile. - -*Network usage*: no. - -**Parameters**: -- newUser: [NewUser](./TYPES.md#newuser) - -**Syntax**: - -``` -/_create user -``` - -```javascript -'/_create user ' + JSON.stringify(newUser) // JavaScript -``` - -```python -'/_create user ' + json.dumps(newUser) # Python -``` - -**Responses**: - -ActiveUser: Active user profile. -- type: "activeUser" -- user: [User](./TYPES.md#user) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - -**Errors**: -- UserExists: User or contact with this name already exists. -- InvalidDisplayName: Invalid user display name. - ---- - - -### ListUsers - -Get all user profiles. - -*Network usage*: no. - -**Syntax**: - -``` -/users -``` - -**Responses**: - -UsersList: Users. -- type: "usersList" -- users: [[UserInfo](./TYPES.md#userinfo)] - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetActiveUser - -Set active user profile. - -*Network usage*: no. - -**Parameters**: -- userId: int64 -- viewPwd: string? - -**Syntax**: - -``` -/_user [ ] -``` - -```javascript -'/_user ' + userId + (viewPwd ? ' ' + JSON.stringify(viewPwd) : '') // JavaScript -``` - -```python -'/_user ' + str(userId) + ((' ' + json.dumps(viewPwd)) if viewPwd is not None else '') # Python -``` - -**Responses**: - -ActiveUser: Active user profile. -- type: "activeUser" -- user: [User](./TYPES.md#user) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - -**Errors**: -- ChatNotStarted: Chat not started. - ---- - - -### APIDeleteUser - -Delete user profile. - -*Network usage*: background. - -**Parameters**: -- userId: int64 -- delSMPQueues: bool -- viewPwd: string? - -**Syntax**: - -``` -/_delete user del_smp=on|off[ ] -``` - -```javascript -'/_delete user ' + userId + ' del_smp=' + (delSMPQueues ? 'on' : 'off') + (viewPwd ? ' ' + JSON.stringify(viewPwd) : '') // JavaScript -``` - -```python -'/_delete user ' + str(userId) + ' del_smp=' + ('on' if delSMPQueues else 'off') + ((' ' + json.dumps(viewPwd)) if viewPwd is not None else '') # Python -``` - -**Responses**: - -CmdOk: Ok. -- type: "cmdOk" -- user_: [User](./TYPES.md#user)? - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APIUpdateProfile - -Update user profile. - -*Network usage*: background. - -**Parameters**: -- userId: int64 -- profile: [Profile](./TYPES.md#profile) - -**Syntax**: - -``` -/_profile -``` - -```javascript -'/_profile ' + userId + ' ' + JSON.stringify(profile) // JavaScript -``` - -```python -'/_profile ' + str(userId) + ' ' + json.dumps(profile) # Python -``` - -**Responses**: - -UserProfileUpdated: User profile updated. -- type: "userProfileUpdated" -- user: [User](./TYPES.md#user) -- fromProfile: [Profile](./TYPES.md#profile) -- toProfile: [Profile](./TYPES.md#profile) -- updateSummary: [UserProfileUpdateSummary](./TYPES.md#userprofileupdatesummary) - -UserProfileNoChange: User profile was not changed. -- type: "userProfileNoChange" -- user: [User](./TYPES.md#user) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -### APISetContactPrefs - -Configure chat preference overrides for the contact. - -*Network usage*: background. - -**Parameters**: -- contactId: int64 -- preferences: [Preferences](./TYPES.md#preferences) - -**Syntax**: - -``` -/_set prefs @ -``` - -```javascript -'/_set prefs @' + contactId + ' ' + JSON.stringify(preferences) // JavaScript -``` - -```python -'/_set prefs @' + str(contactId) + ' ' + json.dumps(preferences) # Python -``` - -**Responses**: - -ContactPrefsUpdated: Contact preferences updated. -- type: "contactPrefsUpdated" -- user: [User](./TYPES.md#user) -- fromContact: [Contact](./TYPES.md#contact) -- toContact: [Contact](./TYPES.md#contact) - -ChatCmdError: Command error (only used in WebSockets API). -- type: "chatCmdError" -- chatError: [ChatError](./TYPES.md#chaterror) - ---- - - -## Chat management - -These commands should not be used with CLI-based bots - - -### StartChat - -Start chat controller. - -*Network usage*: no. - -**Parameters**: -- mainApp: bool -- enableSndFiles: bool - -**Syntax**: - -``` -/_start -``` - -**Responses**: - -ChatStarted: Chat started. -- type: "chatStarted" - -ChatRunning: Chat running. -- type: "chatRunning" - ---- - - -### APIStopChat - -Stop chat controller. - -*Network usage*: no. - -**Syntax**: - -``` -/_stop -``` - -**Response**: - -ChatStopped: Chat stopped. -- type: "chatStopped" - ---- diff --git a/bots/api/EVENTS.md b/bots/api/EVENTS.md index 794670c436..e69de29bb2 100644 --- a/bots/api/EVENTS.md +++ b/bots/api/EVENTS.md @@ -1,795 +0,0 @@ -# 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)] - ---- diff --git a/bots/api/TYPES.md b/bots/api/TYPES.md index 7076e740fb..e69de29bb2 100644 --- a/bots/api/TYPES.md +++ b/bots/api/TYPES.md @@ -1,4525 +0,0 @@ -# API Types - -This file is generated automatically. - -- [ACIReaction](#acireaction) -- [AChat](#achat) -- [AChatItem](#achatitem) -- [AddRelayResult](#addrelayresult) -- [AddressSettings](#addresssettings) -- [AgentCryptoError](#agentcryptoerror) -- [AgentErrorType](#agenterrortype) -- [AutoAccept](#autoaccept) -- [BadgeInfo](#badgeinfo) -- [BadgeProof](#badgeproof) -- [BadgeStatus](#badgestatus) -- [BadgeType](#badgetype) -- [BlockingInfo](#blockinginfo) -- [BlockingReason](#blockingreason) -- [BrokerErrorType](#brokererrortype) -- [BusinessChatInfo](#businesschatinfo) -- [BusinessChatType](#businesschattype) -- [CICallStatus](#cicallstatus) -- [CIContent](#cicontent) -- [CIDeleteMode](#cideletemode) -- [CIDeleted](#cideleted) -- [CIDirection](#cidirection) -- [CIFile](#cifile) -- [CIFileStatus](#cifilestatus) -- [CIForwardedFrom](#ciforwardedfrom) -- [CIGroupInvitation](#cigroupinvitation) -- [CIGroupInvitationStatus](#cigroupinvitationstatus) -- [CIMention](#cimention) -- [CIMentionMember](#cimentionmember) -- [CIMeta](#cimeta) -- [CIQuote](#ciquote) -- [CIReaction](#cireaction) -- [CIReactionCount](#cireactioncount) -- [CIStatus](#cistatus) -- [CITimed](#citimed) -- [ChatBotCommand](#chatbotcommand) -- [ChatDeleteMode](#chatdeletemode) -- [ChatError](#chaterror) -- [ChatErrorType](#chaterrortype) -- [ChatFeature](#chatfeature) -- [ChatInfo](#chatinfo) -- [ChatItem](#chatitem) -- [ChatItemDeletion](#chatitemdeletion) -- [ChatListQuery](#chatlistquery) -- [ChatPeerType](#chatpeertype) -- [ChatRef](#chatref) -- [ChatSettings](#chatsettings) -- [ChatStats](#chatstats) -- [ChatType](#chattype) -- [ChatWallpaper](#chatwallpaper) -- [ChatWallpaperScale](#chatwallpaperscale) -- [ClientNotice](#clientnotice) -- [Color](#color) -- [CommandError](#commanderror) -- [CommandErrorType](#commanderrortype) -- [CommentsGroupPreference](#commentsgrouppreference) -- [ComposedMessage](#composedmessage) -- [ConnStatus](#connstatus) -- [ConnType](#conntype) -- [Connection](#connection) -- [ConnectionEntity](#connectionentity) -- [ConnectionErrorType](#connectionerrortype) -- [ConnectionMode](#connectionmode) -- [ConnectionPlan](#connectionplan) -- [Contact](#contact) -- [ContactAddressPlan](#contactaddressplan) -- [ContactShortLinkData](#contactshortlinkdata) -- [ContactStatus](#contactstatus) -- [ContactUserPref](#contactuserpref) -- [ContactUserPreference](#contactuserpreference) -- [ContactUserPreferences](#contactuserpreferences) -- [CreatedConnLink](#createdconnlink) -- [CryptoFile](#cryptofile) -- [CryptoFileArgs](#cryptofileargs) -- [DroppedMsg](#droppedmsg) -- [E2EInfo](#e2einfo) -- [ErrorType](#errortype) -- [FeatureAllowed](#featureallowed) -- [FileDescr](#filedescr) -- [FileError](#fileerror) -- [FileErrorType](#fileerrortype) -- [FileInvitation](#fileinvitation) -- [FileProtocol](#fileprotocol) -- [FileStatus](#filestatus) -- [FileTransferMeta](#filetransfermeta) -- [FileType](#filetype) -- [Format](#format) -- [FormattedText](#formattedtext) -- [FullGroupPreferences](#fullgrouppreferences) -- [FullPreferences](#fullpreferences) -- [Group](#group) -- [GroupChatScope](#groupchatscope) -- [GroupChatScopeInfo](#groupchatscopeinfo) -- [GroupDirectInvitation](#groupdirectinvitation) -- [GroupFeature](#groupfeature) -- [GroupFeatureEnabled](#groupfeatureenabled) -- [GroupInfo](#groupinfo) -- [GroupKeys](#groupkeys) -- [GroupLink](#grouplink) -- [GroupLinkOwner](#grouplinkowner) -- [GroupLinkPlan](#grouplinkplan) -- [GroupMember](#groupmember) -- [GroupMemberAdmission](#groupmemberadmission) -- [GroupMemberCategory](#groupmembercategory) -- [GroupMemberRef](#groupmemberref) -- [GroupMemberRole](#groupmemberrole) -- [GroupMemberSettings](#groupmembersettings) -- [GroupMemberStatus](#groupmemberstatus) -- [GroupPreference](#grouppreference) -- [GroupPreferences](#grouppreferences) -- [GroupProfile](#groupprofile) -- [GroupRelay](#grouprelay) -- [GroupRootKey](#grouprootkey) -- [GroupShortLinkData](#groupshortlinkdata) -- [GroupShortLinkInfo](#groupshortlinkinfo) -- [GroupSummary](#groupsummary) -- [GroupSupportChat](#groupsupportchat) -- [GroupType](#grouptype) -- [HandshakeError](#handshakeerror) -- [InlineFileMode](#inlinefilemode) -- [InvitationLinkPlan](#invitationlinkplan) -- [InvitedBy](#invitedby) -- [LinkContent](#linkcontent) -- [LinkOwnerSig](#linkownersig) -- [LinkPreview](#linkpreview) -- [LocalBadge](#localbadge) -- [LocalProfile](#localprofile) -- [MemberCriteria](#membercriteria) -- [MsgChatLink](#msgchatlink) -- [MsgContent](#msgcontent) -- [MsgDecryptError](#msgdecrypterror) -- [MsgDirection](#msgdirection) -- [MsgErrorType](#msgerrortype) -- [MsgFilter](#msgfilter) -- [MsgReaction](#msgreaction) -- [MsgReceiptStatus](#msgreceiptstatus) -- [MsgSigStatus](#msgsigstatus) -- [MsgVerified](#msgverified) -- [NameErrorType](#nameerrortype) -- [NetworkError](#networkerror) -- [NewUser](#newuser) -- [NoteFolder](#notefolder) -- [OwnerVerification](#ownerverification) -- [PaginationByTime](#paginationbytime) -- [PendingContactConnection](#pendingcontactconnection) -- [PlanResolveMode](#planresolvemode) -- [PrefEnabled](#prefenabled) -- [Preferences](#preferences) -- [PreparedContact](#preparedcontact) -- [PreparedGroup](#preparedgroup) -- [Profile](#profile) -- [ProxyClientError](#proxyclienterror) -- [ProxyError](#proxyerror) -- [PublicGroupAccess](#publicgroupaccess) -- [PublicGroupData](#publicgroupdata) -- [PublicGroupKeys](#publicgroupkeys) -- [PublicGroupProfile](#publicgroupprofile) -- [RCErrorType](#rcerrortype) -- [RatchetSyncState](#ratchetsyncstate) -- [RcvConnEvent](#rcvconnevent) -- [RcvDirectEvent](#rcvdirectevent) -- [RcvFileDescr](#rcvfiledescr) -- [RcvFileStatus](#rcvfilestatus) -- [RcvFileTransfer](#rcvfiletransfer) -- [RcvGroupEvent](#rcvgroupevent) -- [RcvMsgError](#rcvmsgerror) -- [RelayCapabilities](#relaycapabilities) -- [RelayProfile](#relayprofile) -- [RelayStatus](#relaystatus) -- [ReportReason](#reportreason) -- [RoleGroupPreference](#rolegrouppreference) -- [SMPAgentError](#smpagenterror) -- [SecurityCode](#securitycode) -- [SimplePreference](#simplepreference) -- [SimplexDomain](#simplexdomain) -- [SimplexDomainClaim](#simplexdomainclaim) -- [SimplexDomainError](#simplexdomainerror) -- [SimplexDomainProof](#simplexdomainproof) -- [SimplexLinkType](#simplexlinktype) -- [SimplexNameInfo](#simplexnameinfo) -- [SimplexNameType](#simplexnametype) -- [SimplexTLD](#simplextld) -- [SndCIStatusProgress](#sndcistatusprogress) -- [SndConnEvent](#sndconnevent) -- [SndError](#snderror) -- [SndFileTransfer](#sndfiletransfer) -- [SndGroupEvent](#sndgroupevent) -- [SrvError](#srverror) -- [StoreError](#storeerror) -- [SubscriptionStatus](#subscriptionstatus) -- [SupportGroupPreference](#supportgrouppreference) -- [SwitchPhase](#switchphase) -- [TimedMessagesGroupPreference](#timedmessagesgrouppreference) -- [TimedMessagesPreference](#timedmessagespreference) -- [TransportError](#transporterror) -- [UIColorMode](#uicolormode) -- [UIColors](#uicolors) -- [UIThemeEntityOverride](#uithemeentityoverride) -- [UIThemeEntityOverrides](#uithemeentityoverrides) -- [UpdatedMessage](#updatedmessage) -- [User](#user) -- [UserChatRelay](#userchatrelay) -- [UserContact](#usercontact) -- [UserContactLink](#usercontactlink) -- [UserContactRequest](#usercontactrequest) -- [UserInfo](#userinfo) -- [UserProfileUpdateSummary](#userprofileupdatesummary) -- [UserPwdHash](#userpwdhash) -- [VersionRange](#versionrange) -- [XFTPErrorType](#xftperrortype) -- [XFTPRcvFile](#xftprcvfile) -- [XFTPSndFile](#xftpsndfile) - - ---- - -## ACIReaction - -**Record type**: -- chatInfo: [ChatInfo](#chatinfo) -- chatReaction: [CIReaction](#cireaction) - - ---- - -## AChat - -**Record type**: -- chatInfo: [ChatInfo](#chatinfo) -- chatItems: [[ChatItem](#chatitem)] -- chatStats: [ChatStats](#chatstats) - - ---- - -## AChatItem - -**Record type**: -- chatInfo: [ChatInfo](#chatinfo) -- chatItem: [ChatItem](#chatitem) - - ---- - -## AddRelayResult - -**Record type**: -- relay: [UserChatRelay](#userchatrelay) -- relayError: [ChatError](#chaterror)? - - ---- - -## AddressSettings - -**Record type**: -- businessAddress: bool -- autoAccept: [AutoAccept](#autoaccept)? -- autoReply: [MsgContent](#msgcontent)? - - ---- - -## AgentCryptoError - -**Discriminated union type**: - -DECRYPT_AES: -- type: "DECRYPT_AES" - -DECRYPT_CB: -- type: "DECRYPT_CB" - -RATCHET_HEADER: -- type: "RATCHET_HEADER" - -RATCHET_SYNC: -- type: "RATCHET_SYNC" - - ---- - -## AgentErrorType - -**Discriminated union type**: - -CMD: -- type: "CMD" -- cmdErr: [CommandErrorType](#commanderrortype) -- errContext: string - -CONN: -- type: "CONN" -- connErr: [ConnectionErrorType](#connectionerrortype) -- errContext: string - -NO_USER: -- type: "NO_USER" - -SMP: -- type: "SMP" -- serverAddress: string -- smpErr: [ErrorType](#errortype) - -NTF: -- type: "NTF" -- serverAddress: string -- ntfErr: [ErrorType](#errortype) - -XFTP: -- type: "XFTP" -- serverAddress: string -- xftpErr: [XFTPErrorType](#xftperrortype) - -FILE: -- type: "FILE" -- fileErr: [FileErrorType](#fileerrortype) - -NO_NAME_SERVERS: -- type: "NO_NAME_SERVERS" - -PROXY: -- type: "PROXY" -- proxyServer: string -- relayServer: string -- proxyErr: [ProxyClientError](#proxyclienterror) - -RCP: -- type: "RCP" -- rcpErr: [RCErrorType](#rcerrortype) - -BROKER: -- type: "BROKER" -- brokerAddress: string -- brokerErr: [BrokerErrorType](#brokererrortype) - -AGENT: -- type: "AGENT" -- agentErr: [SMPAgentError](#smpagenterror) - -NOTICE: -- type: "NOTICE" -- server: string -- preset: bool -- expiresAt: UTCTime? - -INTERNAL: -- type: "INTERNAL" -- internalErr: string - -CRITICAL: -- type: "CRITICAL" -- offerRestart: bool -- criticalErr: string - -INACTIVE: -- type: "INACTIVE" - - ---- - -## AutoAccept - -**Record type**: -- acceptIncognito: bool - - ---- - -## BadgeInfo - -**Record type**: -- badgeType: [BadgeType](#badgetype) -- badgeExpiry: UTCTime? -- badgeExtra: string - - ---- - -## BadgeProof - -**Record type**: -- badgeKeyIdx: int -- presHeader: string -- proof: string -- badgeInfo: [BadgeInfo](#badgeinfo) - - ---- - -## BadgeStatus - -**Enum type**: -- "active" -- "expired" -- "expiredOld" -- "failed" -- "unknownKey" - - ---- - -## BadgeType - -**Enum type**: -- "supporter" -- "legend" -- "investor" - - ---- - -## BlockingInfo - -**Record type**: -- reason: [BlockingReason](#blockingreason) -- notice: [ClientNotice](#clientnotice)? - - ---- - -## BlockingReason - -**Enum type**: -- "spam" -- "content" - - ---- - -## BrokerErrorType - -**Discriminated union type**: - -RESPONSE: -- type: "RESPONSE" -- respErr: string - -UNEXPECTED: -- type: "UNEXPECTED" -- respErr: string - -NETWORK: -- type: "NETWORK" -- networkError: [NetworkError](#networkerror) - -HOST: -- type: "HOST" - -NO_SERVICE: -- type: "NO_SERVICE" - -TRANSPORT: -- type: "TRANSPORT" -- transportErr: [TransportError](#transporterror) - -TIMEOUT: -- type: "TIMEOUT" - - ---- - -## BusinessChatInfo - -**Record type**: -- chatType: [BusinessChatType](#businesschattype) -- businessId: string -- customerId: string -- businessDomain: [SimplexDomainClaim](#simplexdomainclaim)? - - ---- - -## BusinessChatType - -**Enum type**: -- "business" -- "customer" - - ---- - -## CICallStatus - -**Enum type**: -- "pending" -- "missed" -- "rejected" -- "accepted" -- "negotiated" -- "progress" -- "ended" -- "error" - - ---- - -## CIContent - -**Discriminated union type**: - -SndMsgContent: -- type: "sndMsgContent" -- msgContent: [MsgContent](#msgcontent) - -RcvMsgContent: -- type: "rcvMsgContent" -- msgContent: [MsgContent](#msgcontent) - -SndDeleted: -- type: "sndDeleted" -- deleteMode: [CIDeleteMode](#cideletemode) - -RcvDeleted: -- type: "rcvDeleted" -- deleteMode: [CIDeleteMode](#cideletemode) - -SndCall: -- type: "sndCall" -- status: [CICallStatus](#cicallstatus) -- duration: int - -RcvCall: -- type: "rcvCall" -- status: [CICallStatus](#cicallstatus) -- duration: int - -RcvIntegrityError: -- type: "rcvIntegrityError" -- msgError: [MsgErrorType](#msgerrortype) - -RcvDecryptionError: -- type: "rcvDecryptionError" -- msgDecryptError: [MsgDecryptError](#msgdecrypterror) -- msgCount: word32 - -RcvMsgError: -- type: "rcvMsgError" -- rcvMsgError: [RcvMsgError](#rcvmsgerror) - -RcvGroupInvitation: -- type: "rcvGroupInvitation" -- groupInvitation: [CIGroupInvitation](#cigroupinvitation) -- memberRole: [GroupMemberRole](#groupmemberrole) - -SndGroupInvitation: -- type: "sndGroupInvitation" -- groupInvitation: [CIGroupInvitation](#cigroupinvitation) -- memberRole: [GroupMemberRole](#groupmemberrole) - -RcvDirectEvent: -- type: "rcvDirectEvent" -- rcvDirectEvent: [RcvDirectEvent](#rcvdirectevent) - -RcvGroupEvent: -- type: "rcvGroupEvent" -- rcvGroupEvent: [RcvGroupEvent](#rcvgroupevent) - -SndGroupEvent: -- type: "sndGroupEvent" -- sndGroupEvent: [SndGroupEvent](#sndgroupevent) - -RcvConnEvent: -- type: "rcvConnEvent" -- rcvConnEvent: [RcvConnEvent](#rcvconnevent) - -SndConnEvent: -- type: "sndConnEvent" -- sndConnEvent: [SndConnEvent](#sndconnevent) - -RcvChatFeature: -- type: "rcvChatFeature" -- feature: [ChatFeature](#chatfeature) -- enabled: [PrefEnabled](#prefenabled) -- param: int? - -SndChatFeature: -- type: "sndChatFeature" -- feature: [ChatFeature](#chatfeature) -- enabled: [PrefEnabled](#prefenabled) -- param: int? - -RcvChatPreference: -- type: "rcvChatPreference" -- feature: [ChatFeature](#chatfeature) -- allowed: [FeatureAllowed](#featureallowed) -- param: int? - -SndChatPreference: -- type: "sndChatPreference" -- feature: [ChatFeature](#chatfeature) -- allowed: [FeatureAllowed](#featureallowed) -- param: int? - -RcvGroupFeature: -- type: "rcvGroupFeature" -- groupFeature: [GroupFeature](#groupfeature) -- preference: [GroupPreference](#grouppreference) -- param: int? -- memberRole_: [GroupMemberRole](#groupmemberrole)? - -SndGroupFeature: -- type: "sndGroupFeature" -- groupFeature: [GroupFeature](#groupfeature) -- preference: [GroupPreference](#grouppreference) -- param: int? -- memberRole_: [GroupMemberRole](#groupmemberrole)? - -RcvChatFeatureRejected: -- type: "rcvChatFeatureRejected" -- feature: [ChatFeature](#chatfeature) - -RcvGroupFeatureRejected: -- type: "rcvGroupFeatureRejected" -- groupFeature: [GroupFeature](#groupfeature) - -SndModerated: -- type: "sndModerated" - -RcvModerated: -- type: "rcvModerated" - -RcvBlocked: -- type: "rcvBlocked" - -SndDirectE2EEInfo: -- type: "sndDirectE2EEInfo" -- e2eeInfo: [E2EInfo](#e2einfo) - -RcvDirectE2EEInfo: -- type: "rcvDirectE2EEInfo" -- e2eeInfo: [E2EInfo](#e2einfo) - -SndGroupE2EEInfo: -- type: "sndGroupE2EEInfo" -- e2eeInfo: [E2EInfo](#e2einfo) - -RcvGroupE2EEInfo: -- type: "rcvGroupE2EEInfo" -- e2eeInfo: [E2EInfo](#e2einfo) - -ChatBanner: -- type: "chatBanner" - - ---- - -## CIDeleteMode - -**Enum type**: -- "broadcast" -- "internal" -- "internalMark" -- "history" - - ---- - -## CIDeleted - -**Discriminated union type**: - -Deleted: -- type: "deleted" -- deletedTs: UTCTime? -- chatType: [ChatType](#chattype) - -Blocked: -- type: "blocked" -- deletedTs: UTCTime? - -BlockedByAdmin: -- type: "blockedByAdmin" -- deletedTs: UTCTime? - -Moderated: -- type: "moderated" -- deletedTs: UTCTime? -- byGroupMember: [GroupMember](#groupmember) - - ---- - -## CIDirection - -**Discriminated union type**: - -DirectSnd: -- type: "directSnd" - -DirectRcv: -- type: "directRcv" - -GroupSnd: -- type: "groupSnd" - -GroupRcv: -- type: "groupRcv" -- groupMember: [GroupMember](#groupmember) - -ChannelRcv: -- type: "channelRcv" - -LocalSnd: -- type: "localSnd" - -LocalRcv: -- type: "localRcv" - - ---- - -## CIFile - -**Record type**: -- fileId: int64 -- fileName: string -- fileSize: int64 -- fileSource: [CryptoFile](#cryptofile)? -- fileStatus: [CIFileStatus](#cifilestatus) -- fileProtocol: [FileProtocol](#fileprotocol) - - ---- - -## CIFileStatus - -**Discriminated union type**: - -SndStored: -- type: "sndStored" - -SndTransfer: -- type: "sndTransfer" -- sndProgress: int64 -- sndTotal: int64 - -SndCancelled: -- type: "sndCancelled" - -SndComplete: -- type: "sndComplete" - -SndError: -- type: "sndError" -- sndFileError: [FileError](#fileerror) - -SndWarning: -- type: "sndWarning" -- sndFileError: [FileError](#fileerror) - -RcvInvitation: -- type: "rcvInvitation" - -RcvAccepted: -- type: "rcvAccepted" - -RcvTransfer: -- type: "rcvTransfer" -- rcvProgress: int64 -- rcvTotal: int64 - -RcvAborted: -- type: "rcvAborted" - -RcvComplete: -- type: "rcvComplete" - -RcvCancelled: -- type: "rcvCancelled" - -RcvError: -- type: "rcvError" -- rcvFileError: [FileError](#fileerror) - -RcvWarning: -- type: "rcvWarning" -- rcvFileError: [FileError](#fileerror) - -Invalid: -- type: "invalid" -- text: string - - ---- - -## CIForwardedFrom - -**Discriminated union type**: - -Unknown: -- type: "unknown" - -Contact: -- type: "contact" -- chatName: string -- msgDir: [MsgDirection](#msgdirection) -- contactId: int64? -- chatItemId: int64? - -Group: -- type: "group" -- chatName: string -- msgDir: [MsgDirection](#msgdirection) -- groupId: int64? -- chatItemId: int64? - - ---- - -## CIGroupInvitation - -**Record type**: -- groupId: int64 -- groupMemberId: int64 -- localDisplayName: string -- groupProfile: [GroupProfile](#groupprofile) -- status: [CIGroupInvitationStatus](#cigroupinvitationstatus) - - ---- - -## CIGroupInvitationStatus - -**Enum type**: -- "pending" -- "accepted" -- "rejected" -- "expired" - - ---- - -## CIMention - -**Record type**: -- memberId: string -- memberRef: [CIMentionMember](#cimentionmember)? - - ---- - -## CIMentionMember - -**Record type**: -- groupMemberId: int64 -- displayName: string -- localAlias: string? -- memberRole: [GroupMemberRole](#groupmemberrole) - - ---- - -## CIMeta - -**Record type**: -- itemId: int64 -- itemTs: UTCTime -- itemText: string -- itemStatus: [CIStatus](#cistatus) -- sentViaProxy: bool? -- itemSharedMsgId: string? -- itemForwarded: [CIForwardedFrom](#ciforwardedfrom)? -- itemDeleted: [CIDeleted](#cideleted)? -- itemEdited: bool -- itemTimed: [CITimed](#citimed)? -- itemLive: bool? -- userMention: bool -- hasLink: bool -- deletable: bool -- editable: bool -- forwardedByMember: int64? -- showGroupAsSender: bool -- msgVerified: [MsgVerified](#msgverified)? -- createdAt: UTCTime -- updatedAt: UTCTime - - ---- - -## CIQuote - -**Record type**: -- chatDir: [CIDirection](#cidirection)? -- itemId: int64? -- sharedMsgId: string? -- sentAt: UTCTime -- content: [MsgContent](#msgcontent) -- formattedText: [[FormattedText](#formattedtext)]? - - ---- - -## CIReaction - -**Record type**: -- chatDir: [CIDirection](#cidirection) -- chatItem: [ChatItem](#chatitem) -- sentAt: UTCTime -- reaction: [MsgReaction](#msgreaction) - - ---- - -## CIReactionCount - -**Record type**: -- reaction: [MsgReaction](#msgreaction) -- userReacted: bool -- totalReacted: int - - ---- - -## CIStatus - -**Discriminated union type**: - -SndNew: -- type: "sndNew" - -SndSent: -- type: "sndSent" -- sndProgress: [SndCIStatusProgress](#sndcistatusprogress) - -SndRcvd: -- type: "sndRcvd" -- msgRcptStatus: [MsgReceiptStatus](#msgreceiptstatus) -- sndProgress: [SndCIStatusProgress](#sndcistatusprogress) - -SndErrorAuth: -- type: "sndErrorAuth" - -SndError: -- type: "sndError" -- agentError: [SndError](#snderror) - -SndWarning: -- type: "sndWarning" -- agentError: [SndError](#snderror) - -RcvNew: -- type: "rcvNew" - -RcvRead: -- type: "rcvRead" - -Invalid: -- type: "invalid" -- text: string - - ---- - -## CITimed - -**Record type**: -- ttl: int -- deleteAt: UTCTime? - - ---- - -## ChatBotCommand - -**Discriminated union type**: - -Command: -- type: "command" -- keyword: string -- label: string -- params: string? - -Menu: -- type: "menu" -- label: string -- commands: [[ChatBotCommand](#chatbotcommand)] - - ---- - -## ChatDeleteMode - -**Discriminated union type**: - -Full: -- type: "full" -- notify: bool - -Entity: -- type: "entity" -- notify: bool - -Messages: -- type: "messages" - -**Syntax**: - -``` -full|entity|messages[ notify=off] -``` - -```javascript -type + (type == 'messages' ? '' : (!notify ? ' notify=off' : '')) // JavaScript -``` - -```python -str(type) + ('' if str(type) == 'messages' else (' notify=off' if not notify else '')) # Python -``` - - ---- - -## ChatError - -**Discriminated union type**: - -Error: -- type: "error" -- errorType: [ChatErrorType](#chaterrortype) - -ErrorAgent: -- type: "errorAgent" -- agentError: [AgentErrorType](#agenterrortype) -- agentConnId: string -- connectionEntity_: [ConnectionEntity](#connectionentity)? - -ErrorStore: -- type: "errorStore" -- storeError: [StoreError](#storeerror) - - ---- - -## ChatErrorType - -**Discriminated union type**: - -NoActiveUser: -- type: "noActiveUser" - -NoConnectionUser: -- type: "noConnectionUser" -- agentConnId: string - -NoSndFileUser: -- type: "noSndFileUser" -- agentSndFileId: string - -NoRcvFileUser: -- type: "noRcvFileUser" -- agentRcvFileId: string - -UserUnknown: -- type: "userUnknown" - -UserExists: -- type: "userExists" -- contactName: string - -ChatRelayExists: -- type: "chatRelayExists" - -DifferentActiveUser: -- type: "differentActiveUser" -- commandUserId: int64 -- activeUserId: int64 - -CantDeleteActiveUser: -- type: "cantDeleteActiveUser" -- userId: int64 - -CantDeleteLastUser: -- type: "cantDeleteLastUser" -- userId: int64 - -CantHideLastUser: -- type: "cantHideLastUser" -- userId: int64 - -HiddenUserAlwaysMuted: -- type: "hiddenUserAlwaysMuted" -- userId: int64 - -EmptyUserPassword: -- type: "emptyUserPassword" -- userId: int64 - -UserAlreadyHidden: -- type: "userAlreadyHidden" -- userId: int64 - -UserNotHidden: -- type: "userNotHidden" -- userId: int64 - -InvalidDisplayName: -- type: "invalidDisplayName" -- displayName: string -- validName: string - -ChatNotStarted: -- type: "chatNotStarted" - -ChatNotStopped: -- type: "chatNotStopped" - -ChatStoreChanged: -- type: "chatStoreChanged" - -InvalidConnReq: -- type: "invalidConnReq" - -SimplexDomainNotReady: -- type: "simplexDomainNotReady" -- simplexDomain: [SimplexDomain](#simplexdomain) -- simplexDomainError: [SimplexDomainError](#simplexdomainerror) - -NotResolvedLocally: -- type: "notResolvedLocally" - -UnsupportedConnReq: -- type: "unsupportedConnReq" - -ConnReqMessageProhibited: -- type: "connReqMessageProhibited" - -ContactNotReady: -- type: "contactNotReady" -- contact: [Contact](#contact) - -ContactNotActive: -- type: "contactNotActive" -- contact: [Contact](#contact) - -ContactDisabled: -- type: "contactDisabled" -- contact: [Contact](#contact) - -ConnectionDisabled: -- type: "connectionDisabled" -- connection: [Connection](#connection) - -GroupUserRole: -- type: "groupUserRole" -- groupInfo: [GroupInfo](#groupinfo) -- requiredRole: [GroupMemberRole](#groupmemberrole) - -GroupMemberInitialRole: -- type: "groupMemberInitialRole" -- groupInfo: [GroupInfo](#groupinfo) -- initialRole: [GroupMemberRole](#groupmemberrole) - -ContactIncognitoCantInvite: -- type: "contactIncognitoCantInvite" - -GroupIncognitoCantInvite: -- type: "groupIncognitoCantInvite" - -GroupContactRole: -- type: "groupContactRole" -- contactName: string - -GroupDuplicateMember: -- type: "groupDuplicateMember" -- contactName: string - -GroupDuplicateMemberId: -- type: "groupDuplicateMemberId" - -GroupNotJoined: -- type: "groupNotJoined" -- groupInfo: [GroupInfo](#groupinfo) - -GroupMemberNotActive: -- type: "groupMemberNotActive" - -CantBlockMemberForSelf: -- type: "cantBlockMemberForSelf" -- groupInfo: [GroupInfo](#groupinfo) -- member: [GroupMember](#groupmember) -- setShowMessages: bool - -GroupMemberUserRemoved: -- type: "groupMemberUserRemoved" - -GroupMemberNotFound: -- type: "groupMemberNotFound" - -GroupCantResendInvitation: -- type: "groupCantResendInvitation" -- groupInfo: [GroupInfo](#groupinfo) -- contactName: string - -GroupInternal: -- type: "groupInternal" -- message: string - -FileNotFound: -- type: "fileNotFound" -- message: string - -FileSize: -- type: "fileSize" -- filePath: string - -FileAlreadyReceiving: -- type: "fileAlreadyReceiving" -- message: string - -FileCancelled: -- type: "fileCancelled" -- message: string - -FileCancel: -- type: "fileCancel" -- fileId: int64 -- message: string - -FileAlreadyExists: -- type: "fileAlreadyExists" -- filePath: string - -FileWrite: -- type: "fileWrite" -- filePath: string -- message: string - -FileSend: -- type: "fileSend" -- fileId: int64 -- agentError: [AgentErrorType](#agenterrortype) - -FileRcvChunk: -- type: "fileRcvChunk" -- message: string - -FileInternal: -- type: "fileInternal" -- message: string - -FileImageType: -- type: "fileImageType" -- filePath: string - -FileImageSize: -- type: "fileImageSize" -- filePath: string - -FileNotReceived: -- type: "fileNotReceived" -- fileId: int64 - -FileNotApproved: -- type: "fileNotApproved" -- fileId: int64 -- unknownServers: [string] - -FallbackToSMPProhibited: -- type: "fallbackToSMPProhibited" -- fileId: int64 - -InlineFileProhibited: -- type: "inlineFileProhibited" -- fileId: int64 - -InvalidForward: -- type: "invalidForward" - -InvalidChatItemUpdate: -- type: "invalidChatItemUpdate" - -InvalidChatItemDelete: -- type: "invalidChatItemDelete" - -HasCurrentCall: -- type: "hasCurrentCall" - -NoCurrentCall: -- type: "noCurrentCall" - -CallContact: -- type: "callContact" -- contactId: int64 - -DirectMessagesProhibited: -- type: "directMessagesProhibited" -- direction: [MsgDirection](#msgdirection) -- contact: [Contact](#contact) - -AgentVersion: -- type: "agentVersion" - -AgentNoSubResult: -- type: "agentNoSubResult" -- agentConnId: string - -CommandError: -- type: "commandError" -- message: string - -AgentCommandError: -- type: "agentCommandError" -- message: string - -InvalidFileDescription: -- type: "invalidFileDescription" -- message: string - -ConnectionIncognitoChangeProhibited: -- type: "connectionIncognitoChangeProhibited" - -ConnectionUserChangeProhibited: -- type: "connectionUserChangeProhibited" - -PeerChatVRangeIncompatible: -- type: "peerChatVRangeIncompatible" - -RelayTestError: -- type: "relayTestError" -- message: string - -InternalError: -- type: "internalError" -- message: string - -Exception: -- type: "exception" -- message: string - - ---- - -## ChatFeature - -**Enum type**: -- "timedMessages" -- "fullDelete" -- "reactions" -- "voice" -- "files" -- "calls" -- "sessions" - - ---- - -## ChatInfo - -**Discriminated union type**: - -Direct: -- type: "direct" -- contact: [Contact](#contact) - -Group: -- type: "group" -- groupInfo: [GroupInfo](#groupinfo) -- groupChatScope: [GroupChatScopeInfo](#groupchatscopeinfo)? - -Local: -- type: "local" -- noteFolder: [NoteFolder](#notefolder) - -ContactRequest: -- type: "contactRequest" -- contactRequest: [UserContactRequest](#usercontactrequest) - -ContactConnection: -- type: "contactConnection" -- contactConnection: [PendingContactConnection](#pendingcontactconnection) - - ---- - -## ChatItem - -**Record type**: -- chatDir: [CIDirection](#cidirection) -- meta: [CIMeta](#cimeta) -- content: [CIContent](#cicontent) -- mentions: {string : [CIMention](#cimention)} -- formattedText: [[FormattedText](#formattedtext)]? -- quotedItem: [CIQuote](#ciquote)? -- reactions: [[CIReactionCount](#cireactioncount)] -- file: [CIFile](#cifile)? - - ---- - -## ChatItemDeletion - -Message deletion result. - -**Record type**: -- deletedChatItem: [AChatItem](#achatitem) -- toChatItem: [AChatItem](#achatitem)? - - ---- - -## ChatListQuery - -**Discriminated union type**: - -Filters: -- type: "filters" -- favorite: bool -- unread: bool - -Search: -- type: "search" -- search: string - - ---- - -## ChatPeerType - -**Enum type**: -- "human" -- "bot" - - ---- - -## ChatRef - -Used in API commands. Chat scope can only be passed with groups. - -**Record type**: -- chatType: [ChatType](#chattype) -- chatId: int64 -- chatScope: [GroupChatScope](#groupchatscope)? - -**Syntax**: - -``` -[] -``` - -```javascript -ChatType.cmdString(chatType) + chatId + (chatScope ? GroupChatScope.cmdString(chatScope) : '') // JavaScript -``` - -```python -ChatType_cmd_string(chatType) + str(chatId) + ((GroupChatScope_cmd_string(chatScope)) if chatScope is not None else '') # Python -``` - - ---- - -## ChatSettings - -**Record type**: -- enableNtfs: [MsgFilter](#msgfilter) -- sendRcpts: bool? -- favorite: bool - - ---- - -## ChatStats - -**Record type**: -- unreadCount: int -- unreadMentions: int -- reportsCount: int -- minUnreadItemId: int64 -- unreadChat: bool - - ---- - -## ChatType - -**Enum type**: -- "direct" -- "group" -- "local" - -**Syntax**: - -``` -@|#|*| -``` - -```javascript -self == 'direct' ? '@' : self == 'group' ? '#' : self == 'local' ? '*' : '' // JavaScript -``` - -```python -'@' if str(self) == 'direct' else '#' if str(self) == 'group' else '*' if str(self) == 'local' else '' # Python -``` - - ---- - -## ChatWallpaper - -**Record type**: -- preset: string? -- imageFile: string? -- background: string? -- tint: string? -- scaleType: [ChatWallpaperScale](#chatwallpaperscale)? -- scale: double? - - ---- - -## ChatWallpaperScale - -**Enum type**: -- "fill" -- "fit" -- "repeat" - - ---- - -## ClientNotice - -**Record type**: -- ttl: int64? - - ---- - -## Color - -**Enum type**: -- "black" -- "red" -- "green" -- "yellow" -- "blue" -- "magenta" -- "cyan" -- "white" - - ---- - -## CommandError - -**Discriminated union type**: - -UNKNOWN: -- type: "UNKNOWN" - -SYNTAX: -- type: "SYNTAX" - -PROHIBITED: -- type: "PROHIBITED" - -NO_AUTH: -- type: "NO_AUTH" - -HAS_AUTH: -- type: "HAS_AUTH" - -NO_ENTITY: -- type: "NO_ENTITY" - - ---- - -## CommandErrorType - -**Discriminated union type**: - -PROHIBITED: -- type: "PROHIBITED" - -SYNTAX: -- type: "SYNTAX" - -NO_CONN: -- type: "NO_CONN" - -SIZE: -- type: "SIZE" - -LARGE: -- type: "LARGE" - - ---- - -## CommentsGroupPreference - -**Record type**: -- enable: [GroupFeatureEnabled](#groupfeatureenabled) -- duration: int? - - ---- - -## ComposedMessage - -**Record type**: -- fileSource: [CryptoFile](#cryptofile)? -- quotedItemId: int64? -- msgContent: [MsgContent](#msgcontent) -- mentions: {string : int64} - - ---- - -## ConnStatus - -**Discriminated union type**: - -New: -- type: "new" - -Prepared: -- type: "prepared" - -Joined: -- type: "joined" - -Requested: -- type: "requested" - -Accepted: -- type: "accepted" - -SndReady: -- type: "sndReady" - -Ready: -- type: "ready" - -Deleted: -- type: "deleted" - -Failed: -- type: "failed" -- connError: string - - ---- - -## ConnType - -**Enum type**: -- "contact" -- "member" -- "user_contact" - - ---- - -## Connection - -**Record type**: -- connId: int64 -- agentConnId: string -- connChatVersion: int -- peerChatVRange: [VersionRange](#versionrange) -- connLevel: int -- viaContact: int64? -- viaUserContactLink: int64? -- viaGroupLink: bool -- groupLinkId: string? -- xContactId: string? -- customUserProfileId: int64? -- connType: [ConnType](#conntype) -- connStatus: [ConnStatus](#connstatus) -- contactConnInitiated: bool -- localAlias: string -- entityId: int64? -- connectionCode: [SecurityCode](#securitycode)? -- pqSupport: bool -- pqEncryption: bool -- pqSndEnabled: bool? -- pqRcvEnabled: bool? -- authErrCounter: int -- quotaErrCounter: int -- createdAt: UTCTime - - ---- - -## ConnectionEntity - -**Discriminated union type**: - -RcvDirectMsgConnection: -- type: "rcvDirectMsgConnection" -- entityConnection: [Connection](#connection) -- contact: [Contact](#contact)? - -RcvGroupMsgConnection: -- type: "rcvGroupMsgConnection" -- entityConnection: [Connection](#connection) -- groupInfo: [GroupInfo](#groupinfo) -- groupMember: [GroupMember](#groupmember) - -UserContactConnection: -- type: "userContactConnection" -- entityConnection: [Connection](#connection) -- userContact: [UserContact](#usercontact) - - ---- - -## ConnectionErrorType - -**Discriminated union type**: - -NOT_FOUND: -- type: "NOT_FOUND" - -DUPLICATE: -- type: "DUPLICATE" - -SIMPLEX: -- type: "SIMPLEX" - -NOT_ACCEPTED: -- type: "NOT_ACCEPTED" - -NOT_AVAILABLE: -- type: "NOT_AVAILABLE" - - ---- - -## ConnectionMode - -**Enum type**: -- "inv" -- "con" - - ---- - -## ConnectionPlan - -**Discriminated union type**: - -InvitationLink: -- type: "invitationLink" -- invitationLinkPlan: [InvitationLinkPlan](#invitationlinkplan) - -ContactAddress: -- type: "contactAddress" -- contactAddressPlan: [ContactAddressPlan](#contactaddressplan) - -GroupLink: -- type: "groupLink" -- groupLinkPlan: [GroupLinkPlan](#grouplinkplan) - -Error: -- type: "error" -- chatError: [ChatError](#chaterror) - - ---- - -## Contact - -**Record type**: -- contactId: int64 -- localDisplayName: string -- profile: [LocalProfile](#localprofile) -- activeConn: [Connection](#connection)? -- contactUsed: bool -- contactStatus: [ContactStatus](#contactstatus) -- chatSettings: [ChatSettings](#chatsettings) -- userPreferences: [Preferences](#preferences) -- mergedPreferences: [ContactUserPreferences](#contactuserpreferences) -- createdAt: UTCTime -- updatedAt: UTCTime -- chatTs: UTCTime? -- preparedContact: [PreparedContact](#preparedcontact)? -- contactRequestId: int64? -- contactGroupMemberId: int64? -- contactGrpInvSent: bool -- groupDirectInv: [GroupDirectInvitation](#groupdirectinvitation)? -- chatTags: [int64] -- chatItemTTL: int64? -- uiThemes: [UIThemeEntityOverrides](#uithemeentityoverrides)? -- chatDeleted: bool -- customData: JSONObject? - - ---- - -## ContactAddressPlan - -**Discriminated union type**: - -Ok: -- type: "ok" -- contactSLinkData_: [ContactShortLinkData](#contactshortlinkdata)? -- ownerVerification: [OwnerVerification](#ownerverification)? - -OwnLink: -- type: "ownLink" - -ConnectingConfirmReconnect: -- type: "connectingConfirmReconnect" - -ConnectingProhibit: -- type: "connectingProhibit" -- contact: [Contact](#contact) - -Known: -- type: "known" -- contact: [Contact](#contact) - -ContactViaAddress: -- type: "contactViaAddress" -- contact: [Contact](#contact) - - ---- - -## ContactShortLinkData - -**Record type**: -- profile: [Profile](#profile) -- message: [MsgContent](#msgcontent)? -- business: bool -- localBadge: [LocalBadge](#localbadge)? - - ---- - -## ContactStatus - -**Enum type**: -- "active" -- "deleted" -- "deletedByUser" - - ---- - -## ContactUserPref - -**Discriminated union type**: - -Contact: -- type: "contact" -- preference: [SimplePreference](#simplepreference) - -User: -- type: "user" -- preference: [SimplePreference](#simplepreference) - - ---- - -## ContactUserPreference - -**Record type**: -- enabled: [PrefEnabled](#prefenabled) -- userPreference: [ContactUserPref](#contactuserpref) -- contactPreference: [SimplePreference](#simplepreference) - - ---- - -## ContactUserPreferences - -**Record type**: -- timedMessages: [ContactUserPreference](#contactuserpreference) -- fullDelete: [ContactUserPreference](#contactuserpreference) -- reactions: [ContactUserPreference](#contactuserpreference) -- voice: [ContactUserPreference](#contactuserpreference) -- files: [ContactUserPreference](#contactuserpreference) -- calls: [ContactUserPreference](#contactuserpreference) -- sessions: [ContactUserPreference](#contactuserpreference) -- commands: [[ChatBotCommand](#chatbotcommand)]? - - ---- - -## CreatedConnLink - -**Record type**: -- connFullLink: string -- connShortLink: string? - -**Syntax**: - -``` -[ ] -``` - -```javascript -connFullLink + (connShortLink ? ' ' + connShortLink : '') // JavaScript -``` - -```python -connFullLink + ((' ' + connShortLink) if connShortLink is not None else '') # Python -``` - - ---- - -## CryptoFile - -**Record type**: -- filePath: string -- cryptoArgs: [CryptoFileArgs](#cryptofileargs)? - - ---- - -## CryptoFileArgs - -**Record type**: -- fileKey: string -- fileNonce: string - - ---- - -## DroppedMsg - -**Record type**: -- brokerTs: UTCTime -- attempts: int - - ---- - -## E2EInfo - -**Record type**: -- public: bool? -- pqEnabled: bool? - - ---- - -## ErrorType - -**Discriminated union type**: - -BLOCK: -- type: "BLOCK" - -SESSION: -- type: "SESSION" - -CMD: -- type: "CMD" -- cmdErr: [CommandError](#commanderror) - -PROXY: -- type: "PROXY" -- proxyErr: [ProxyError](#proxyerror) - -AUTH: -- type: "AUTH" - -BLOCKED: -- type: "BLOCKED" -- blockInfo: [BlockingInfo](#blockinginfo) - -SERVICE: -- type: "SERVICE" - -CRYPTO: -- type: "CRYPTO" - -QUOTA: -- type: "QUOTA" - -STORE: -- type: "STORE" -- storeErr: string - -NO_MSG: -- type: "NO_MSG" - -LARGE_MSG: -- type: "LARGE_MSG" - -EXPIRED: -- type: "EXPIRED" - -INTERNAL: -- type: "INTERNAL" - -NAME: -- type: "NAME" -- nameErr: [NameErrorType](#nameerrortype) - -DUPLICATE_: -- type: "DUPLICATE_" - - ---- - -## FeatureAllowed - -**Enum type**: -- "always" -- "yes" -- "no" - - ---- - -## FileDescr - -**Record type**: -- fileDescrText: string -- fileDescrPartNo: int -- fileDescrComplete: bool - - ---- - -## FileError - -**Discriminated union type**: - -Auth: -- type: "auth" - -Blocked: -- type: "blocked" -- server: string -- blockInfo: [BlockingInfo](#blockinginfo) - -NoFile: -- type: "noFile" - -Relay: -- type: "relay" -- srvError: [SrvError](#srverror) - -Other: -- type: "other" -- fileError: string - - ---- - -## FileErrorType - -**Discriminated union type**: - -NOT_APPROVED: -- type: "NOT_APPROVED" - -SIZE: -- type: "SIZE" - -REDIRECT: -- type: "REDIRECT" -- redirectError: string - -FILE_IO: -- type: "FILE_IO" -- fileIOError: string - -NO_FILE: -- type: "NO_FILE" - - ---- - -## FileInvitation - -**Record type**: -- fileName: string -- fileSize: int64 -- fileDigest: string? -- fileConnReq: string? -- fileInline: [InlineFileMode](#inlinefilemode)? -- fileDescr: [FileDescr](#filedescr)? - - ---- - -## FileProtocol - -**Enum type**: -- "smp" -- "xftp" -- "local" - - ---- - -## FileStatus - -**Enum type**: -- "new" -- "accepted" -- "connected" -- "complete" -- "cancelled" - - ---- - -## FileTransferMeta - -**Record type**: -- fileId: int64 -- xftpSndFile: [XFTPSndFile](#xftpsndfile)? -- xftpRedirectFor: int64? -- fileName: string -- filePath: string -- fileSize: int64 -- fileInline: [InlineFileMode](#inlinefilemode)? -- chunkSize: int64 -- cancelled: bool - - ---- - -## FileType - -**Enum type**: -- "normal" -- "roster" - - ---- - -## Format - -**Discriminated union type**: - -Bold: -- type: "bold" - -Italic: -- type: "italic" - -StrikeThrough: -- type: "strikeThrough" - -Snippet: -- type: "snippet" - -Secret: -- type: "secret" - -Small: -- type: "small" - -Colored: -- type: "colored" -- color: [Color](#color) - -Uri: -- type: "uri" - -HyperLink: -- type: "hyperLink" -- showText: string? -- linkUri: string - -SimplexLink: -- type: "simplexLink" -- showText: string? -- linkType: [SimplexLinkType](#simplexlinktype) -- simplexUri: string -- smpHosts: [string] - -SimplexName: -- type: "simplexName" -- nameInfo: [SimplexNameInfo](#simplexnameinfo) - -Command: -- type: "command" -- commandStr: string - -Mention: -- type: "mention" -- memberName: string - -Email: -- type: "email" - -Phone: -- type: "phone" - - ---- - -## FormattedText - -**Record type**: -- format: [Format](#format)? -- text: string - - ---- - -## FullGroupPreferences - -**Record type**: -- timedMessages: [TimedMessagesGroupPreference](#timedmessagesgrouppreference) -- directMessages: [RoleGroupPreference](#rolegrouppreference) -- fullDelete: [GroupPreference](#grouppreference) -- reactions: [GroupPreference](#grouppreference) -- voice: [RoleGroupPreference](#rolegrouppreference) -- files: [RoleGroupPreference](#rolegrouppreference) -- simplexLinks: [RoleGroupPreference](#rolegrouppreference) -- reports: [GroupPreference](#grouppreference) -- history: [GroupPreference](#grouppreference) -- support: [SupportGroupPreference](#supportgrouppreference) -- sessions: [RoleGroupPreference](#rolegrouppreference) -- comments: [CommentsGroupPreference](#commentsgrouppreference) -- signMessages: [GroupPreference](#grouppreference) -- commands: [[ChatBotCommand](#chatbotcommand)] - - ---- - -## FullPreferences - -**Record type**: -- timedMessages: [TimedMessagesPreference](#timedmessagespreference) -- fullDelete: [SimplePreference](#simplepreference) -- reactions: [SimplePreference](#simplepreference) -- voice: [SimplePreference](#simplepreference) -- files: [SimplePreference](#simplepreference) -- calls: [SimplePreference](#simplepreference) -- sessions: [SimplePreference](#simplepreference) -- commands: [[ChatBotCommand](#chatbotcommand)] - - ---- - -## Group - -**Record type**: -- groupInfo: [GroupInfo](#groupinfo) -- members: [[GroupMember](#groupmember)] - - ---- - -## GroupChatScope - -**Discriminated union type**: - -MemberSupport: -- type: "memberSupport" -- groupMemberId_: int64? - -**Syntax**: - -``` -(_support[:]) -``` - -```javascript -'(_support' + (groupMemberId_ ? ':' + groupMemberId_ : '') + ')' // JavaScript -``` - -```python -'(_support' + ((':' + str(groupMemberId_)) if groupMemberId_ is not None else '') + ')' # Python -``` - - ---- - -## GroupChatScopeInfo - -**Discriminated union type**: - -MemberSupport: -- type: "memberSupport" -- groupMember_: [GroupMember](#groupmember)? - - ---- - -## GroupDirectInvitation - -**Record type**: -- groupDirectInvLink: string -- fromGroupId_: int64? -- fromGroupMemberId_: int64? -- fromGroupMemberConnId_: int64? -- groupDirectInvStartedConnection: bool - - ---- - -## GroupFeature - -**Enum type**: -- "timedMessages" -- "directMessages" -- "fullDelete" -- "reactions" -- "voice" -- "files" -- "simplexLinks" -- "reports" -- "history" -- "support" -- "sessions" -- "comments" -- "signMessages" - - ---- - -## GroupFeatureEnabled - -**Enum type**: -- "on" -- "off" - - ---- - -## GroupInfo - -**Record type**: -- groupId: int64 -- useRelays: bool -- relayOwnStatus: [RelayStatus](#relaystatus)? -- localDisplayName: string -- groupProfile: [GroupProfile](#groupprofile) -- localAlias: string -- businessChat: [BusinessChatInfo](#businesschatinfo)? -- fullGroupPreferences: [FullGroupPreferences](#fullgrouppreferences) -- membership: [GroupMember](#groupmember) -- chatSettings: [ChatSettings](#chatsettings) -- createdAt: UTCTime -- updatedAt: UTCTime -- chatTs: UTCTime? -- userMemberProfileSentAt: UTCTime? -- preparedGroup: [PreparedGroup](#preparedgroup)? -- chatTags: [int64] -- chatItemTTL: int64? -- uiThemes: [UIThemeEntityOverrides](#uithemeentityoverrides)? -- customData: JSONObject? -- groupSummary: [GroupSummary](#groupsummary) -- rosterVersion: int64? -- membersRequireAttention: int -- viaGroupLinkUri: string? -- groupKeys: [GroupKeys](#groupkeys)? -- groupDomainVerified: bool? - - ---- - -## GroupKeys - -**Record type**: -- publicGroupKeys: [PublicGroupKeys](#publicgroupkeys)? -- memberPrivKey: string - - ---- - -## GroupLink - -**Record type**: -- userContactLinkId: int64 -- connLinkContact: [CreatedConnLink](#createdconnlink) -- shortLinkDataSet: bool -- shortLinkLargeDataSet: bool -- groupLinkId: string -- acceptMemberRole: [GroupMemberRole](#groupmemberrole) - - ---- - -## GroupLinkOwner - -**Record type**: -- memberId: string -- memberKey: string - - ---- - -## GroupLinkPlan - -**Discriminated union type**: - -Ok: -- type: "ok" -- groupSLinkInfo_: [GroupShortLinkInfo](#groupshortlinkinfo)? -- groupSLinkData_: [GroupShortLinkData](#groupshortlinkdata)? -- ownerVerification: [OwnerVerification](#ownerverification)? - -OwnLink: -- type: "ownLink" -- groupInfo: [GroupInfo](#groupinfo) - -ConnectingConfirmReconnect: -- type: "connectingConfirmReconnect" - -ConnectingProhibit: -- type: "connectingProhibit" -- groupInfo_: [GroupInfo](#groupinfo)? - -Known: -- type: "known" -- groupInfo: [GroupInfo](#groupinfo) -- groupUpdated: bool -- ownerVerification: [OwnerVerification](#ownerverification)? -- linkOwners: [[GroupLinkOwner](#grouplinkowner)] - -NoRelays: -- type: "noRelays" -- groupSLinkData_: [GroupShortLinkData](#groupshortlinkdata)? - -UpdateRequired: -- type: "updateRequired" -- groupSLinkData_: [GroupShortLinkData](#groupshortlinkdata)? - - ---- - -## GroupMember - -**Record type**: -- groupMemberId: int64 -- groupId: int64 -- indexInGroup: int64 -- memberId: string -- memberRole: [GroupMemberRole](#groupmemberrole) -- memberCategory: [GroupMemberCategory](#groupmembercategory) -- memberStatus: [GroupMemberStatus](#groupmemberstatus) -- memberSettings: [GroupMemberSettings](#groupmembersettings) -- blockedByAdmin: bool -- invitedBy: [InvitedBy](#invitedby) -- invitedByGroupMemberId: int64? -- localDisplayName: string -- memberProfile: [LocalProfile](#localprofile) -- memberContactId: int64? -- memberContactProfileId: int64 -- activeConn: [Connection](#connection)? -- memberChatVRange: [VersionRange](#versionrange) -- createdAt: UTCTime -- updatedAt: UTCTime -- supportChat: [GroupSupportChat](#groupsupportchat)? -- memberPubKey: string? -- userMemberKeySent: bool -- relayLink: string? -- memberVerifiedCode: [SecurityCode](#securitycode)? - - ---- - -## GroupMemberAdmission - -**Record type**: -- review: [MemberCriteria](#membercriteria)? - - ---- - -## GroupMemberCategory - -**Enum type**: -- "user" -- "invitee" -- "host" -- "pre" -- "post" - - ---- - -## GroupMemberRef - -**Record type**: -- groupMemberId: int64 -- profile: [Profile](#profile) - - ---- - -## GroupMemberRole - -**Enum type**: -- "relay" -- "observer" -- "author" -- "member" -- "moderator" -- "admin" -- "owner" - - ---- - -## GroupMemberSettings - -**Record type**: -- showMessages: bool - - ---- - -## GroupMemberStatus - -**Enum type**: -- "rejected" -- "removed" -- "left" -- "deleted" -- "unknown" -- "invited" -- "pending_approval" -- "pending_review" -- "introduced" -- "intro-inv" -- "accepted" -- "announced" -- "connected" -- "complete" -- "creator" - - ---- - -## GroupPreference - -**Record type**: -- enable: [GroupFeatureEnabled](#groupfeatureenabled) - - ---- - -## GroupPreferences - -**Record type**: -- timedMessages: [TimedMessagesGroupPreference](#timedmessagesgrouppreference)? -- directMessages: [RoleGroupPreference](#rolegrouppreference)? -- fullDelete: [GroupPreference](#grouppreference)? -- reactions: [GroupPreference](#grouppreference)? -- voice: [RoleGroupPreference](#rolegrouppreference)? -- files: [RoleGroupPreference](#rolegrouppreference)? -- simplexLinks: [RoleGroupPreference](#rolegrouppreference)? -- reports: [GroupPreference](#grouppreference)? -- history: [GroupPreference](#grouppreference)? -- support: [SupportGroupPreference](#supportgrouppreference)? -- sessions: [RoleGroupPreference](#rolegrouppreference)? -- comments: [CommentsGroupPreference](#commentsgrouppreference)? -- signMessages: [GroupPreference](#grouppreference)? -- commands: [[ChatBotCommand](#chatbotcommand)]? - - ---- - -## GroupProfile - -**Record type**: -- displayName: string -- fullName: string -- shortDescr: string? -- description: string? -- image: string? -- publicGroup: [PublicGroupProfile](#publicgroupprofile)? -- groupPreferences: [GroupPreferences](#grouppreferences)? -- memberAdmission: [GroupMemberAdmission](#groupmemberadmission)? - - ---- - -## GroupRelay - -**Record type**: -- groupRelayId: int64 -- groupMemberId: int64 -- userChatRelay: [UserChatRelay](#userchatrelay) -- relayStatus: [RelayStatus](#relaystatus) -- relayLink: string? -- relayCap: [RelayCapabilities](#relaycapabilities) - - ---- - -## GroupRootKey - -**Discriminated union type**: - -Private: -- type: "private" -- rootPrivKey: string - -Public: -- type: "public" -- rootPubKey: string - - ---- - -## GroupShortLinkData - -**Record type**: -- groupProfile: [GroupProfile](#groupprofile) -- publicGroupData: [PublicGroupData](#publicgroupdata)? - - ---- - -## GroupShortLinkInfo - -**Record type**: -- direct: bool -- groupRelays: [string] -- publicGroupId: string? - - ---- - -## GroupSummary - -**Record type**: -- currentMembers: int64 -- publicMemberCount: int64? - - ---- - -## GroupSupportChat - -**Record type**: -- chatTs: UTCTime -- unread: int64 -- memberAttention: int64 -- mentions: int64 -- lastMsgFromMemberTs: UTCTime? - - ---- - -## GroupType - -**Enum type**: -- "channel" -- "group" - - ---- - -## HandshakeError - -**Enum type**: -- "PARSE" -- "IDENTITY" -- "BAD_AUTH" -- "BAD_SERVICE" - - ---- - -## InlineFileMode - -**Enum type**: -- "offer" -- "sent" - - ---- - -## InvitationLinkPlan - -**Discriminated union type**: - -Ok: -- type: "ok" -- contactSLinkData_: [ContactShortLinkData](#contactshortlinkdata)? -- ownerVerification: [OwnerVerification](#ownerverification)? - -OwnLink: -- type: "ownLink" - -Connecting: -- type: "connecting" -- contact_: [Contact](#contact)? - -Known: -- type: "known" -- contact: [Contact](#contact) - - ---- - -## InvitedBy - -**Discriminated union type**: - -Contact: -- type: "contact" -- byContactId: int64 - -User: -- type: "user" - -Unknown: -- type: "unknown" - - ---- - -## LinkContent - -**Discriminated union type**: - -Page: -- type: "page" - -Image: -- type: "image" - -Video: -- type: "video" -- duration: int? - -Unknown: -- type: "unknown" -- tag: string -- json: JSONObject - - ---- - -## LinkOwnerSig - -**Record type**: -- ownerId: string? -- chatBinding: string -- ownerSig: string - - ---- - -## LinkPreview - -**Record type**: -- uri: string -- title: string -- description: string -- image: string -- content: [LinkContent](#linkcontent)? - - ---- - -## LocalBadge - -**Record type**: -- badge: [BadgeInfo](#badgeinfo) -- status: [BadgeStatus](#badgestatus) - - ---- - -## LocalProfile - -**Record type**: -- profileId: int64 -- displayName: string -- fullName: string -- shortDescr: string? -- description: string? -- image: string? -- contactLink: string? -- preferences: [Preferences](#preferences)? -- peerType: [ChatPeerType](#chatpeertype)? -- localBadge: [LocalBadge](#localbadge)? -- localAlias: string -- contactDomain: [SimplexDomainClaim](#simplexdomainclaim)? -- contactDomainVerified: bool? - - ---- - -## MemberCriteria - -**Enum type**: -- "all" - - ---- - -## MsgChatLink - -Connection link sent in a message - only short links are allowed. - -**Discriminated union type**: - -Contact: -- type: "contact" -- connLink: string -- profile: [Profile](#profile) -- business: bool - -Invitation: -- type: "invitation" -- invLink: string -- profile: [Profile](#profile) - -Group: -- type: "group" -- connLink: string -- groupProfile: [GroupProfile](#groupprofile) - - ---- - -## MsgContent - -**Discriminated union type**: - -Text: -- type: "text" -- text: string - -Link: -- type: "link" -- text: string -- preview: [LinkPreview](#linkpreview) - -Image: -- type: "image" -- text: string -- image: string - -Video: -- type: "video" -- text: string -- image: string -- duration: int - -Voice: -- type: "voice" -- text: string -- duration: int - -File: -- type: "file" -- text: string - -Report: -- type: "report" -- text: string -- reason: [ReportReason](#reportreason) - -Chat: -- type: "chat" -- text: string -- chatLink: [MsgChatLink](#msgchatlink) -- ownerSig: [LinkOwnerSig](#linkownersig)? - -Unknown: -- type: "unknown" -- tag: string -- text: string -- json: JSONObject - - ---- - -## MsgDecryptError - -**Enum type**: -- "ratchetHeader" -- "tooManySkipped" -- "ratchetEarlier" -- "other" -- "ratchetSync" - - ---- - -## MsgDirection - -**Enum type**: -- "rcv" -- "snd" - - ---- - -## MsgErrorType - -**Discriminated union type**: - -MsgSkipped: -- type: "msgSkipped" -- fromMsgId: int64 -- toMsgId: int64 - -MsgBadId: -- type: "msgBadId" -- msgId: int64 - -MsgBadHash: -- type: "msgBadHash" - -MsgDuplicate: -- type: "msgDuplicate" - - ---- - -## MsgFilter - -**Enum type**: -- "none" -- "all" -- "mentions" - - ---- - -## MsgReaction - -**Discriminated union type**: - -Emoji: -- type: "emoji" -- emoji: string - -Unknown: -- type: "unknown" -- tag: string -- json: JSONObject - - ---- - -## MsgReceiptStatus - -**Enum type**: -- "ok" -- "badMsgHash" - - ---- - -## MsgSigStatus - -**Enum type**: -- "verified" -- "signedNoKey" - - ---- - -## MsgVerified - -**Discriminated union type**: - -Signed: -- type: "signed" -- sigStatus: [MsgSigStatus](#msgsigstatus) - -SigMissing: -- type: "sigMissing" - - ---- - -## NameErrorType - -**Discriminated union type**: - -NO_RESOLVER: -- type: "NO_RESOLVER" - -NOT_FOUND: -- type: "NOT_FOUND" - -RESOLVER: -- type: "RESOLVER" -- resolverErr: string - - ---- - -## NetworkError - -**Discriminated union type**: - -ConnectError: -- type: "connectError" -- connectError: string - -TLSError: -- type: "tLSError" -- tlsError: string - -UnknownCAError: -- type: "unknownCAError" - -FailedError: -- type: "failedError" - -TimeoutError: -- type: "timeoutError" - -SubscribeError: -- type: "subscribeError" -- subscribeError: string - - ---- - -## NewUser - -**Record type**: -- profile: [Profile](#profile)? -- pastTimestamp: bool -- userChatRelay: bool -- clientService: bool - - ---- - -## NoteFolder - -**Record type**: -- noteFolderId: int64 -- userId: int64 -- createdAt: UTCTime -- updatedAt: UTCTime -- chatTs: UTCTime -- favorite: bool -- unread: bool - - ---- - -## OwnerVerification - -**Discriminated union type**: - -Verified: -- type: "verified" - -Failed: -- type: "failed" -- reason: string - - ---- - -## PaginationByTime - -**Discriminated union type**: - -Last: -- type: "last" -- count: int - -**Syntax**: - -``` -count= -``` - -```javascript -'count=' + count // JavaScript -``` - -```python -'count=' + str(count) # Python -``` - - ---- - -## PendingContactConnection - -**Record type**: -- pccConnId: int64 -- pccAgentConnId: string -- pccConnStatus: [ConnStatus](#connstatus) -- viaContactUri: bool -- viaUserContactLink: int64? -- groupLinkId: string? -- customUserProfileId: int64? -- connLinkInv: [CreatedConnLink](#createdconnlink)? -- localAlias: string -- createdAt: UTCTime -- updatedAt: UTCTime - - ---- - -## PlanResolveMode - -**Enum type**: -- "allGroups" -- "unknown" -- "never" - - ---- - -## PrefEnabled - -**Record type**: -- forUser: bool -- forContact: bool - - ---- - -## Preferences - -**Record type**: -- timedMessages: [TimedMessagesPreference](#timedmessagespreference)? -- fullDelete: [SimplePreference](#simplepreference)? -- reactions: [SimplePreference](#simplepreference)? -- voice: [SimplePreference](#simplepreference)? -- files: [SimplePreference](#simplepreference)? -- calls: [SimplePreference](#simplepreference)? -- sessions: [SimplePreference](#simplepreference)? -- commands: [[ChatBotCommand](#chatbotcommand)]? - - ---- - -## PreparedContact - -**Record type**: -- connLinkToConnect: [CreatedConnLink](#createdconnlink) -- uiConnLinkType: [ConnectionMode](#connectionmode) -- welcomeSharedMsgId: string? -- requestSharedMsgId: string? - - ---- - -## PreparedGroup - -**Record type**: -- connLinkToConnect: [CreatedConnLink](#createdconnlink) -- connLinkPreparedConnection: bool -- connLinkStartedConnection: bool -- welcomeSharedMsgId: string? -- requestSharedMsgId: string? - - ---- - -## Profile - -**Record type**: -- displayName: string -- fullName: string -- shortDescr: string? -- description: string? -- image: string? -- contactLink: string? -- preferences: [Preferences](#preferences)? -- peerType: [ChatPeerType](#chatpeertype)? -- badge: [BadgeProof](#badgeproof)? -- contactDomain: [SimplexDomainClaim](#simplexdomainclaim)? - - ---- - -## ProxyClientError - -**Discriminated union type**: - -ProtocolError: -- type: "protocolError" -- protocolErr: [ErrorType](#errortype) - -UnexpectedResponse: -- type: "unexpectedResponse" -- responseStr: string - -ResponseError: -- type: "responseError" -- responseErr: [ErrorType](#errortype) - - ---- - -## ProxyError - -**Discriminated union type**: - -PROTOCOL: -- type: "PROTOCOL" -- protocolErr: [ErrorType](#errortype) - -BROKER: -- type: "BROKER" -- brokerErr: [BrokerErrorType](#brokererrortype) - -BASIC_AUTH: -- type: "BASIC_AUTH" - -NO_SESSION: -- type: "NO_SESSION" - - ---- - -## PublicGroupAccess - -**Record type**: -- groupWebPage: string? -- groupDomainClaim: [SimplexDomainClaim](#simplexdomainclaim)? -- domainWebPage: bool -- allowEmbedding: bool - - ---- - -## PublicGroupData - -**Record type**: -- publicMemberCount: int64 - - ---- - -## PublicGroupKeys - -**Record type**: -- publicGroupId: string -- groupRootKey: [GroupRootKey](#grouprootkey) - - ---- - -## PublicGroupProfile - -**Record type**: -- groupType: [GroupType](#grouptype) -- groupLink: string -- publicGroupId: string -- publicGroupAccess: [PublicGroupAccess](#publicgroupaccess)? - - ---- - -## RCErrorType - -**Discriminated union type**: - -Internal: -- type: "internal" -- internalErr: string - -Identity: -- type: "identity" - -NoLocalAddress: -- type: "noLocalAddress" - -NewController: -- type: "newController" - -NotDiscovered: -- type: "notDiscovered" - -TLSStartFailed: -- type: "tLSStartFailed" - -Exception: -- type: "exception" -- exception: string - -CtrlAuth: -- type: "ctrlAuth" - -CtrlNotFound: -- type: "ctrlNotFound" - -CtrlError: -- type: "ctrlError" -- ctrlErr: string - -Invitation: -- type: "invitation" - -Version: -- type: "version" - -Encrypt: -- type: "encrypt" - -Decrypt: -- type: "decrypt" - -BlockSize: -- type: "blockSize" - -Syntax: -- type: "syntax" -- syntaxErr: string - - ---- - -## RatchetSyncState - -**Enum type**: -- "ok" -- "allowed" -- "required" -- "started" -- "agreed" - - ---- - -## RcvConnEvent - -**Discriminated union type**: - -SwitchQueue: -- type: "switchQueue" -- phase: [SwitchPhase](#switchphase) - -RatchetSync: -- type: "ratchetSync" -- syncStatus: [RatchetSyncState](#ratchetsyncstate) - -VerificationCodeReset: -- type: "verificationCodeReset" - -PqEnabled: -- type: "pqEnabled" -- enabled: bool - - ---- - -## RcvDirectEvent - -**Discriminated union type**: - -ContactDeleted: -- type: "contactDeleted" - -ProfileUpdated: -- type: "profileUpdated" -- fromProfile: [Profile](#profile) -- toProfile: [Profile](#profile) - -GroupInvLinkReceived: -- type: "groupInvLinkReceived" -- groupProfile: [GroupProfile](#groupprofile) - - ---- - -## RcvFileDescr - -**Record type**: -- fileDescrId: int64 -- fileDescrText: string -- fileDescrPartNo: int -- fileDescrComplete: bool - - ---- - -## RcvFileStatus - -**Discriminated union type**: - -New: -- type: "new" - -Accepted: -- type: "accepted" -- filePath: string - -Connected: -- type: "connected" -- filePath: string - -Complete: -- type: "complete" -- filePath: string - -Cancelled: -- type: "cancelled" -- filePath_: string? - - ---- - -## RcvFileTransfer - -**Record type**: -- fileId: int64 -- xftpRcvFile: [XFTPRcvFile](#xftprcvfile)? -- fileInvitation: [FileInvitation](#fileinvitation) -- fileStatus: [RcvFileStatus](#rcvfilestatus) -- fileType: [FileType](#filetype) -- rcvFileInline: [InlineFileMode](#inlinefilemode)? -- senderDisplayName: string -- chunkSize: int64 -- cancelled: bool -- grpMemberId: int64? -- cryptoArgs: [CryptoFileArgs](#cryptofileargs)? - - ---- - -## RcvGroupEvent - -**Discriminated union type**: - -MemberAdded: -- type: "memberAdded" -- groupMemberId: int64 -- profile: [Profile](#profile) - -MemberConnected: -- type: "memberConnected" - -MemberAccepted: -- type: "memberAccepted" -- groupMemberId: int64 -- profile: [Profile](#profile) - -UserAccepted: -- type: "userAccepted" - -MemberLeft: -- type: "memberLeft" - -MemberRole: -- type: "memberRole" -- groupMemberId: int64 -- profile: [Profile](#profile) -- role: [GroupMemberRole](#groupmemberrole) - -MemberBlocked: -- type: "memberBlocked" -- groupMemberId: int64 -- profile: [Profile](#profile) -- blocked: bool - -UserRole: -- type: "userRole" -- role: [GroupMemberRole](#groupmemberrole) - -MemberDeleted: -- type: "memberDeleted" -- groupMemberId: int64 -- profile: [Profile](#profile) - -UserDeleted: -- type: "userDeleted" - -GroupDeleted: -- type: "groupDeleted" - -GroupUpdated: -- type: "groupUpdated" -- groupProfile: [GroupProfile](#groupprofile) - -InvitedViaGroupLink: -- type: "invitedViaGroupLink" - -MemberCreatedContact: -- type: "memberCreatedContact" - -MemberProfileUpdated: -- type: "memberProfileUpdated" -- fromProfile: [Profile](#profile) -- toProfile: [Profile](#profile) - -NewMemberPendingReview: -- type: "newMemberPendingReview" - -MsgBadSignature: -- type: "msgBadSignature" - - ---- - -## RcvMsgError - -**Discriminated union type**: - -Dropped: -- type: "dropped" -- attempts: int - -ParseError: -- type: "parseError" -- parseError: string - - ---- - -## RelayCapabilities - -**Record type**: -- webDomain: string? - - ---- - -## RelayProfile - -**Record type**: -- displayName: string -- fullName: string -- shortDescr: string? -- image: string? - - ---- - -## RelayStatus - -**Enum type**: -- "new" -- "invited" -- "accepted" -- "acknowledgedRoster" -- "active" -- "inactive" -- "rejected" - - ---- - -## ReportReason - -**Enum type**: -- "spam" -- "content" -- "community" -- "profile" -- "other" - - ---- - -## RoleGroupPreference - -**Record type**: -- enable: [GroupFeatureEnabled](#groupfeatureenabled) -- role: [GroupMemberRole](#groupmemberrole)? - - ---- - -## SMPAgentError - -**Discriminated union type**: - -A_MESSAGE: -- type: "A_MESSAGE" - -A_PROHIBITED: -- type: "A_PROHIBITED" -- prohibitedErr: string - -A_VERSION: -- type: "A_VERSION" - -A_LINK: -- type: "A_LINK" -- linkErr: string - -A_CRYPTO: -- type: "A_CRYPTO" -- cryptoErr: [AgentCryptoError](#agentcryptoerror) - -A_DUPLICATE: -- type: "A_DUPLICATE" -- droppedMsg_: [DroppedMsg](#droppedmsg)? - -A_QUEUE: -- type: "A_QUEUE" -- queueErr: string - - ---- - -## SecurityCode - -**Record type**: -- securityCode: string -- verifiedAt: UTCTime - - ---- - -## SimplePreference - -**Record type**: -- allow: [FeatureAllowed](#featureallowed) - - ---- - -## SimplexDomain - -**Record type**: -- nameTLD: [SimplexTLD](#simplextld) -- domain: string -- subDomain: [string] - - ---- - -## SimplexDomainClaim - -**Record type**: -- domain: string -- proof: [SimplexDomainProof](#simplexdomainproof)? - - ---- - -## SimplexDomainError - -**Discriminated union type**: - -NoValidLink: -- type: "noValidLink" - -UnknownDomain: -- type: "unknownDomain" - - ---- - -## SimplexDomainProof - -**Record type**: -- linkOwnerId: string? -- presHeader: string -- signature: string - - ---- - -## SimplexLinkType - -**Enum type**: -- "contact" -- "invitation" -- "group" -- "channel" -- "relay" - - ---- - -## SimplexNameInfo - -**Record type**: -- nameType: [SimplexNameType](#simplexnametype) -- nameDomain: [SimplexDomain](#simplexdomain) - - ---- - -## SimplexNameType - -**Enum type**: -- "publicGroup" -- "contact" - - ---- - -## SimplexTLD - -**Enum type**: -- "simplex" -- "testing" -- "web" - - ---- - -## SndCIStatusProgress - -**Enum type**: -- "partial" -- "complete" - - ---- - -## SndConnEvent - -**Discriminated union type**: - -SwitchQueue: -- type: "switchQueue" -- phase: [SwitchPhase](#switchphase) -- member: [GroupMemberRef](#groupmemberref)? - -RatchetSync: -- type: "ratchetSync" -- syncStatus: [RatchetSyncState](#ratchetsyncstate) -- member: [GroupMemberRef](#groupmemberref)? - -PqEnabled: -- type: "pqEnabled" -- enabled: bool - - ---- - -## SndError - -**Discriminated union type**: - -Auth: -- type: "auth" - -Quota: -- type: "quota" - -Expired: -- type: "expired" - -Relay: -- type: "relay" -- srvError: [SrvError](#srverror) - -Proxy: -- type: "proxy" -- proxyServer: string -- srvError: [SrvError](#srverror) - -ProxyRelay: -- type: "proxyRelay" -- proxyServer: string -- srvError: [SrvError](#srverror) - -Other: -- type: "other" -- sndError: string - - ---- - -## SndFileTransfer - -**Record type**: -- fileId: int64 -- fileName: string -- filePath: string -- fileSize: int64 -- chunkSize: int64 -- recipientDisplayName: string -- connId: int64 -- agentConnId: string -- groupMemberId: int64? -- fileStatus: [FileStatus](#filestatus) -- fileDescrId: int64? -- fileInline: [InlineFileMode](#inlinefilemode)? - - ---- - -## SndGroupEvent - -**Discriminated union type**: - -MemberRole: -- type: "memberRole" -- groupMemberId: int64 -- profile: [Profile](#profile) -- role: [GroupMemberRole](#groupmemberrole) - -MemberBlocked: -- type: "memberBlocked" -- groupMemberId: int64 -- profile: [Profile](#profile) -- blocked: bool - -UserRole: -- type: "userRole" -- role: [GroupMemberRole](#groupmemberrole) - -MemberDeleted: -- type: "memberDeleted" -- groupMemberId: int64 -- profile: [Profile](#profile) - -UserLeft: -- type: "userLeft" - -GroupUpdated: -- type: "groupUpdated" -- groupProfile: [GroupProfile](#groupprofile) - -MemberAccepted: -- type: "memberAccepted" -- groupMemberId: int64 -- profile: [Profile](#profile) - -UserPendingReview: -- type: "userPendingReview" - - ---- - -## SrvError - -**Discriminated union type**: - -Host: -- type: "host" - -Version: -- type: "version" - -Other: -- type: "other" -- srvError: string - - ---- - -## StoreError - -**Discriminated union type**: - -DuplicateName: -- type: "duplicateName" - -UserNotFound: -- type: "userNotFound" -- userId: int64 - -RelayUserNotFound: -- type: "relayUserNotFound" - -UserNotFoundByName: -- type: "userNotFoundByName" -- contactName: string - -UserNotFoundByContactId: -- type: "userNotFoundByContactId" -- contactId: int64 - -UserNotFoundByGroupId: -- type: "userNotFoundByGroupId" -- groupId: int64 - -UserNotFoundByFileId: -- type: "userNotFoundByFileId" -- fileId: int64 - -UserNotFoundByContactRequestId: -- type: "userNotFoundByContactRequestId" -- contactRequestId: int64 - -ContactNotFound: -- type: "contactNotFound" -- contactId: int64 - -ContactNotFoundByName: -- type: "contactNotFoundByName" -- contactName: string - -ContactNotFoundByMemberId: -- type: "contactNotFoundByMemberId" -- groupMemberId: int64 - -ContactNotReady: -- type: "contactNotReady" -- contactName: string - -DuplicateContactLink: -- type: "duplicateContactLink" - -UserContactLinkNotFound: -- type: "userContactLinkNotFound" - -ContactRequestNotFound: -- type: "contactRequestNotFound" -- contactRequestId: int64 - -ContactRequestNotFoundByName: -- type: "contactRequestNotFoundByName" -- contactName: string - -InvalidContactRequestEntity: -- type: "invalidContactRequestEntity" -- contactRequestId: int64 - -InvalidBusinessChatContactRequest: -- type: "invalidBusinessChatContactRequest" - -GroupNotFound: -- type: "groupNotFound" -- groupId: int64 - -GroupNotFoundByName: -- type: "groupNotFoundByName" -- groupName: string - -GroupMemberNameNotFound: -- type: "groupMemberNameNotFound" -- groupId: int64 -- groupMemberName: string - -GroupMemberNotFound: -- type: "groupMemberNotFound" -- groupMemberId: int64 - -GroupMemberNotFoundByIndex: -- type: "groupMemberNotFoundByIndex" -- groupMemberIndex: int64 - -MemberRelationsVectorNotFound: -- type: "memberRelationsVectorNotFound" -- groupMemberId: int64 - -GroupHostMemberNotFound: -- type: "groupHostMemberNotFound" -- groupId: int64 - -GroupMemberNotFoundByMemberId: -- type: "groupMemberNotFoundByMemberId" -- memberId: string - -MemberContactGroupMemberNotFound: -- type: "memberContactGroupMemberNotFound" -- contactId: int64 - -InvalidMemberRelationUpdate: -- type: "invalidMemberRelationUpdate" - -GroupWithoutUser: -- type: "groupWithoutUser" - -DuplicateGroupMember: -- type: "duplicateGroupMember" - -DuplicateMemberId: -- type: "duplicateMemberId" - -GroupAlreadyJoined: -- type: "groupAlreadyJoined" - -GroupInvitationNotFound: -- type: "groupInvitationNotFound" - -NoteFolderAlreadyExists: -- type: "noteFolderAlreadyExists" -- noteFolderId: int64 - -NoteFolderNotFound: -- type: "noteFolderNotFound" -- noteFolderId: int64 - -UserNoteFolderNotFound: -- type: "userNoteFolderNotFound" - -SndFileNotFound: -- type: "sndFileNotFound" -- fileId: int64 - -SndFileInvalid: -- type: "sndFileInvalid" -- fileId: int64 - -RcvFileNotFound: -- type: "rcvFileNotFound" -- fileId: int64 - -RcvFileDescrNotFound: -- type: "rcvFileDescrNotFound" -- fileId: int64 - -FileNotFound: -- type: "fileNotFound" -- fileId: int64 - -RcvFileInvalid: -- type: "rcvFileInvalid" -- fileId: int64 - -RcvFileInvalidDescrPart: -- type: "rcvFileInvalidDescrPart" - -LocalFileNoTransfer: -- type: "localFileNoTransfer" -- fileId: int64 - -SharedMsgIdNotFoundByFileId: -- type: "sharedMsgIdNotFoundByFileId" -- fileId: int64 - -FileIdNotFoundBySharedMsgId: -- type: "fileIdNotFoundBySharedMsgId" -- sharedMsgId: string - -SndFileNotFoundXFTP: -- type: "sndFileNotFoundXFTP" -- agentSndFileId: string - -RcvFileNotFoundXFTP: -- type: "rcvFileNotFoundXFTP" -- agentRcvFileId: string - -ConnectionNotFound: -- type: "connectionNotFound" -- agentConnId: string - -ConnectionNotFoundById: -- type: "connectionNotFoundById" -- connId: int64 - -ConnectionNotFoundByMemberId: -- type: "connectionNotFoundByMemberId" -- groupMemberId: int64 - -PendingConnectionNotFound: -- type: "pendingConnectionNotFound" -- connId: int64 - -UniqueID: -- type: "uniqueID" - -LargeMsg: -- type: "largeMsg" - -InternalError: -- type: "internalError" -- message: string - -DBException: -- type: "dBException" -- message: string - -DBBusyError: -- type: "dBBusyError" -- message: string - -BadChatItem: -- type: "badChatItem" -- itemId: int64 -- itemTs: UTCTime? - -ChatItemNotFound: -- type: "chatItemNotFound" -- itemId: int64 - -ChatItemNotFoundByText: -- type: "chatItemNotFoundByText" -- text: string - -ChatItemSharedMsgIdNotFound: -- type: "chatItemSharedMsgIdNotFound" -- sharedMsgId: string - -ChatItemNotFoundByFileId: -- type: "chatItemNotFoundByFileId" -- fileId: int64 - -ChatItemNotFoundByContactId: -- type: "chatItemNotFoundByContactId" -- contactId: int64 - -ChatItemNotFoundByGroupId: -- type: "chatItemNotFoundByGroupId" -- groupId: int64 - -ProfileNotFound: -- type: "profileNotFound" -- profileId: int64 - -DuplicateGroupLink: -- type: "duplicateGroupLink" -- groupInfo: [GroupInfo](#groupinfo) - -GroupLinkNotFound: -- type: "groupLinkNotFound" -- groupInfo: [GroupInfo](#groupinfo) - -HostMemberIdNotFound: -- type: "hostMemberIdNotFound" -- groupId: int64 - -ContactNotFoundByFileId: -- type: "contactNotFoundByFileId" -- fileId: int64 - -NoGroupSndStatus: -- type: "noGroupSndStatus" -- itemId: int64 -- groupMemberId: int64 - -DuplicateGroupMessage: -- type: "duplicateGroupMessage" -- groupId: int64 -- sharedMsgId: string -- authorGroupMemberId: int64? -- forwardedByGroupMemberId: int64? - -RemoteHostNotFound: -- type: "remoteHostNotFound" -- remoteHostId: int64 - -RemoteHostUnknown: -- type: "remoteHostUnknown" - -RemoteHostDuplicateCA: -- type: "remoteHostDuplicateCA" - -RemoteCtrlNotFound: -- type: "remoteCtrlNotFound" -- remoteCtrlId: int64 - -RemoteCtrlDuplicateCA: -- type: "remoteCtrlDuplicateCA" - -ProhibitedDeleteUser: -- type: "prohibitedDeleteUser" -- userId: int64 -- contactId: int64 - -OperatorNotFound: -- type: "operatorNotFound" -- serverOperatorId: int64 - -UsageConditionsNotFound: -- type: "usageConditionsNotFound" - -UserChatRelayNotFound: -- type: "userChatRelayNotFound" -- chatRelayId: int64 - -GroupRelayNotFound: -- type: "groupRelayNotFound" -- groupRelayId: int64 - -GroupRelayNotFoundByMemberId: -- type: "groupRelayNotFoundByMemberId" -- groupMemberId: int64 - -InvalidQuote: -- type: "invalidQuote" - -InvalidMention: -- type: "invalidMention" - -InvalidDeliveryTask: -- type: "invalidDeliveryTask" -- taskId: int64 - -DeliveryTaskNotFound: -- type: "deliveryTaskNotFound" -- taskId: int64 - -InvalidDeliveryJob: -- type: "invalidDeliveryJob" -- jobId: int64 - -DeliveryJobNotFound: -- type: "deliveryJobNotFound" -- jobId: int64 - -WorkItemError: -- type: "workItemError" -- errContext: string - - ---- - -## SubscriptionStatus - -**Discriminated union type**: - -Active: -- type: "active" - -Pending: -- type: "pending" - -Removed: -- type: "removed" -- subError: string - -NoSub: -- type: "noSub" - - ---- - -## SupportGroupPreference - -**Record type**: -- enable: [GroupFeatureEnabled](#groupfeatureenabled) - - ---- - -## SwitchPhase - -**Enum type**: -- "started" -- "confirmed" -- "secured" -- "completed" - - ---- - -## TimedMessagesGroupPreference - -**Record type**: -- enable: [GroupFeatureEnabled](#groupfeatureenabled) -- ttl: int? - - ---- - -## TimedMessagesPreference - -**Record type**: -- allow: [FeatureAllowed](#featureallowed) -- ttl: int? - - ---- - -## TransportError - -**Discriminated union type**: - -BadBlock: -- type: "badBlock" - -Version: -- type: "version" - -LargeMsg: -- type: "largeMsg" - -BadSession: -- type: "badSession" - -NoServerAuth: -- type: "noServerAuth" - -Handshake: -- type: "handshake" -- handshakeErr: [HandshakeError](#handshakeerror) - - ---- - -## UIColorMode - -**Enum type**: -- "light" -- "dark" - - ---- - -## UIColors - -**Record type**: -- accent: string? -- accentVariant: string? -- secondary: string? -- secondaryVariant: string? -- background: string? -- menus: string? -- title: string? -- accentVariant2: string? -- sentMessage: string? -- sentReply: string? -- receivedMessage: string? -- receivedReply: string? - - ---- - -## UIThemeEntityOverride - -**Record type**: -- mode: [UIColorMode](#uicolormode) -- wallpaper: [ChatWallpaper](#chatwallpaper)? -- colors: [UIColors](#uicolors) - - ---- - -## UIThemeEntityOverrides - -**Record type**: -- light: [UIThemeEntityOverride](#uithemeentityoverride)? -- dark: [UIThemeEntityOverride](#uithemeentityoverride)? - - ---- - -## UpdatedMessage - -**Record type**: -- msgContent: [MsgContent](#msgcontent) -- mentions: {string : int64} - - ---- - -## User - -**Record type**: -- userId: int64 -- agentUserId: int64 -- userContactId: int64 -- localDisplayName: string -- profile: [LocalProfile](#localprofile) -- fullPreferences: [FullPreferences](#fullpreferences) -- activeUser: bool -- activeOrder: int64 -- viewPwdHash: [UserPwdHash](#userpwdhash)? -- showNtfs: bool -- sendRcptsContacts: bool -- sendRcptsSmallGroups: bool -- autoAcceptMemberContacts: bool -- userMemberProfileUpdatedAt: UTCTime? -- userChatRelay: bool -- clientService: bool -- uiThemes: [UIThemeEntityOverrides](#uithemeentityoverrides)? - - ---- - -## UserChatRelay - -**Record type**: -- chatRelayId: int64 -- address: string -- relayProfile: [RelayProfile](#relayprofile) -- domains: [string] -- preset: bool -- tested: bool? -- enabled: bool -- deleted: bool - - ---- - -## UserContact - -**Record type**: -- userContactLinkId: int64 -- connReqContact: string -- groupId: int64? - - ---- - -## UserContactLink - -**Record type**: -- userContactLinkId: int64 -- connLinkContact: [CreatedConnLink](#createdconnlink) -- shortLinkDataSet: bool -- shortLinkLargeDataSet: bool -- addressSettings: [AddressSettings](#addresssettings) - - ---- - -## UserContactRequest - -**Record type**: -- contactRequestId: int64 -- agentInvitationId: string -- contactId_: int64? -- businessGroupId_: int64? -- userContactLinkId_: int64? -- cReqChatVRange: [VersionRange](#versionrange) -- localDisplayName: string -- profileId: int64 -- profile: [LocalProfile](#localprofile) -- createdAt: UTCTime -- updatedAt: UTCTime -- xContactId: string? -- pqSupport: bool -- welcomeSharedMsgId: string? -- requestSharedMsgId: string? - - ---- - -## UserInfo - -**Record type**: -- user: [User](#user) -- unreadCount: int - - ---- - -## UserProfileUpdateSummary - -**Record type**: -- updateSuccesses: int -- updateFailures: int -- changedContacts: [[Contact](#contact)] - - ---- - -## UserPwdHash - -**Record type**: -- hash: string -- salt: string - - ---- - -## VersionRange - -**Record type**: -- minVersion: int -- maxVersion: int - - ---- - -## XFTPErrorType - -**Discriminated union type**: - -BLOCK: -- type: "BLOCK" - -SESSION: -- type: "SESSION" - -HANDSHAKE: -- type: "HANDSHAKE" - -CMD: -- type: "CMD" -- cmdErr: [CommandError](#commanderror) - -AUTH: -- type: "AUTH" - -BLOCKED: -- type: "BLOCKED" -- blockInfo: [BlockingInfo](#blockinginfo) - -SIZE: -- type: "SIZE" - -QUOTA: -- type: "QUOTA" - -DIGEST: -- type: "DIGEST" - -CRYPTO: -- type: "CRYPTO" - -NO_FILE: -- type: "NO_FILE" - -HAS_FILE: -- type: "HAS_FILE" - -FILE_IO: -- type: "FILE_IO" - -TIMEOUT: -- type: "TIMEOUT" - -INTERNAL: -- type: "INTERNAL" - -DUPLICATE_: -- type: "DUPLICATE_" - - ---- - -## XFTPRcvFile - -**Record type**: -- rcvFileDescription: [RcvFileDescr](#rcvfiledescr) -- agentRcvFileId: string? -- agentRcvFileDeleted: bool -- userApprovedRelays: bool - - ---- - -## XFTPSndFile - -**Record type**: -- agentSndFileId: string -- privateSndFileDescr: string? -- agentSndFileDeleted: bool -- cryptoArgs: [CryptoFileArgs](#cryptofileargs)? diff --git a/packages/simplex-chat-client/types/typescript/src/commands.ts b/packages/simplex-chat-client/types/typescript/src/commands.ts index 3f4e3ad7ee..e69de29bb2 100644 --- a/packages/simplex-chat-client/types/typescript/src/commands.ts +++ b/packages/simplex-chat-client/types/typescript/src/commands.ts @@ -1,818 +0,0 @@ -// 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' - } -} diff --git a/packages/simplex-chat-client/types/typescript/src/events.ts b/packages/simplex-chat-client/types/typescript/src/events.ts index a3de141e97..e69de29bb2 100644 --- a/packages/simplex-chat-client/types/typescript/src/events.ts +++ b/packages/simplex-chat-client/types/typescript/src/events.ts @@ -1,473 +0,0 @@ -// 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[] - } -} diff --git a/packages/simplex-chat-client/types/typescript/src/responses.ts b/packages/simplex-chat-client/types/typescript/src/responses.ts index f54acfbeb1..e69de29bb2 100644 --- a/packages/simplex-chat-client/types/typescript/src/responses.ts +++ b/packages/simplex-chat-client/types/typescript/src/responses.ts @@ -1,482 +0,0 @@ -// 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[] - } -} diff --git a/packages/simplex-chat-client/types/typescript/src/types.ts b/packages/simplex-chat-client/types/typescript/src/types.ts index fd5d278741..e69de29bb2 100644 --- a/packages/simplex-chat-client/types/typescript/src/types.ts +++ b/packages/simplex-chat-client/types/typescript/src/types.ts @@ -1,5194 +0,0 @@ -// API Types -// This file is generated automatically. - -export interface ACIReaction { - chatInfo: ChatInfo - chatReaction: CIReaction -} - -export interface AChat { - chatInfo: ChatInfo - chatItems: ChatItem[] - chatStats: ChatStats -} - -export interface AChatItem { - chatInfo: ChatInfo - chatItem: ChatItem -} - -export interface AddRelayResult { - relay: UserChatRelay - relayError?: ChatError -} - -export interface AddressSettings { - businessAddress: boolean - autoAccept?: AutoAccept - autoReply?: MsgContent -} - -export type AgentCryptoError = - | AgentCryptoError.DECRYPT_AES - | AgentCryptoError.DECRYPT_CB - | AgentCryptoError.RATCHET_HEADER - | AgentCryptoError.RATCHET_SYNC - -export namespace AgentCryptoError { - export type Tag = "DECRYPT_AES" | "DECRYPT_CB" | "RATCHET_HEADER" | "RATCHET_SYNC" - - interface Interface { - type: Tag - } - - export interface DECRYPT_AES extends Interface { - type: "DECRYPT_AES" - } - - export interface DECRYPT_CB extends Interface { - type: "DECRYPT_CB" - } - - export interface RATCHET_HEADER extends Interface { - type: "RATCHET_HEADER" - } - - export interface RATCHET_SYNC extends Interface { - type: "RATCHET_SYNC" - } -} - -export type AgentErrorType = - | AgentErrorType.CMD - | AgentErrorType.CONN - | AgentErrorType.NO_USER - | AgentErrorType.SMP - | AgentErrorType.NTF - | AgentErrorType.XFTP - | AgentErrorType.FILE - | AgentErrorType.NO_NAME_SERVERS - | AgentErrorType.PROXY - | AgentErrorType.RCP - | AgentErrorType.BROKER - | AgentErrorType.AGENT - | AgentErrorType.NOTICE - | AgentErrorType.INTERNAL - | AgentErrorType.CRITICAL - | AgentErrorType.INACTIVE - -export namespace AgentErrorType { - export type Tag = - | "CMD" - | "CONN" - | "NO_USER" - | "SMP" - | "NTF" - | "XFTP" - | "FILE" - | "NO_NAME_SERVERS" - | "PROXY" - | "RCP" - | "BROKER" - | "AGENT" - | "NOTICE" - | "INTERNAL" - | "CRITICAL" - | "INACTIVE" - - interface Interface { - type: Tag - } - - export interface CMD extends Interface { - type: "CMD" - cmdErr: CommandErrorType - errContext: string - } - - export interface CONN extends Interface { - type: "CONN" - connErr: ConnectionErrorType - errContext: string - } - - export interface NO_USER extends Interface { - type: "NO_USER" - } - - export interface SMP extends Interface { - type: "SMP" - serverAddress: string - smpErr: ErrorType - } - - export interface NTF extends Interface { - type: "NTF" - serverAddress: string - ntfErr: ErrorType - } - - export interface XFTP extends Interface { - type: "XFTP" - serverAddress: string - xftpErr: XFTPErrorType - } - - export interface FILE extends Interface { - type: "FILE" - fileErr: FileErrorType - } - - export interface NO_NAME_SERVERS extends Interface { - type: "NO_NAME_SERVERS" - } - - export interface PROXY extends Interface { - type: "PROXY" - proxyServer: string - relayServer: string - proxyErr: ProxyClientError - } - - export interface RCP extends Interface { - type: "RCP" - rcpErr: RCErrorType - } - - export interface BROKER extends Interface { - type: "BROKER" - brokerAddress: string - brokerErr: BrokerErrorType - } - - export interface AGENT extends Interface { - type: "AGENT" - agentErr: SMPAgentError - } - - export interface NOTICE extends Interface { - type: "NOTICE" - server: string - preset: boolean - expiresAt?: string // ISO-8601 timestamp - } - - export interface INTERNAL extends Interface { - type: "INTERNAL" - internalErr: string - } - - export interface CRITICAL extends Interface { - type: "CRITICAL" - offerRestart: boolean - criticalErr: string - } - - export interface INACTIVE extends Interface { - type: "INACTIVE" - } -} - -export interface AutoAccept { - acceptIncognito: boolean -} - -export interface BadgeInfo { - badgeType: BadgeType - badgeExpiry?: string // ISO-8601 timestamp - badgeExtra: string -} - -export interface BadgeProof { - badgeKeyIdx: number // int - presHeader: string - proof: string - badgeInfo: BadgeInfo -} - -export enum BadgeStatus { - Active = "active", - Expired = "expired", - ExpiredOld = "expiredOld", - Failed = "failed", - UnknownKey = "unknownKey", -} - -export enum BadgeType { - Supporter = "supporter", - Legend = "legend", - Investor = "investor", -} - -export interface BlockingInfo { - reason: BlockingReason - notice?: ClientNotice -} - -export enum BlockingReason { - Spam = "spam", - Content = "content", -} - -export type BrokerErrorType = - | BrokerErrorType.RESPONSE - | BrokerErrorType.UNEXPECTED - | BrokerErrorType.NETWORK - | BrokerErrorType.HOST - | BrokerErrorType.NO_SERVICE - | BrokerErrorType.TRANSPORT - | BrokerErrorType.TIMEOUT - -export namespace BrokerErrorType { - export type Tag = - | "RESPONSE" - | "UNEXPECTED" - | "NETWORK" - | "HOST" - | "NO_SERVICE" - | "TRANSPORT" - | "TIMEOUT" - - interface Interface { - type: Tag - } - - export interface RESPONSE extends Interface { - type: "RESPONSE" - respErr: string - } - - export interface UNEXPECTED extends Interface { - type: "UNEXPECTED" - respErr: string - } - - export interface NETWORK extends Interface { - type: "NETWORK" - networkError: NetworkError - } - - export interface HOST extends Interface { - type: "HOST" - } - - export interface NO_SERVICE extends Interface { - type: "NO_SERVICE" - } - - export interface TRANSPORT extends Interface { - type: "TRANSPORT" - transportErr: TransportError - } - - export interface TIMEOUT extends Interface { - type: "TIMEOUT" - } -} - -export interface BusinessChatInfo { - chatType: BusinessChatType - businessId: string - customerId: string - businessDomain?: SimplexDomainClaim -} - -export enum BusinessChatType { - Business = "business", - Customer = "customer", -} - -export enum CICallStatus { - Pending = "pending", - Missed = "missed", - Rejected = "rejected", - Accepted = "accepted", - Negotiated = "negotiated", - Progress = "progress", - Ended = "ended", - Error = "error", -} - -export type CIContent = - | CIContent.SndMsgContent - | CIContent.RcvMsgContent - | CIContent.SndDeleted - | CIContent.RcvDeleted - | CIContent.SndCall - | CIContent.RcvCall - | CIContent.RcvIntegrityError - | CIContent.RcvDecryptionError - | CIContent.RcvMsgError - | CIContent.RcvGroupInvitation - | CIContent.SndGroupInvitation - | CIContent.RcvDirectEvent - | CIContent.RcvGroupEvent - | CIContent.SndGroupEvent - | CIContent.RcvConnEvent - | CIContent.SndConnEvent - | CIContent.RcvChatFeature - | CIContent.SndChatFeature - | CIContent.RcvChatPreference - | CIContent.SndChatPreference - | CIContent.RcvGroupFeature - | CIContent.SndGroupFeature - | CIContent.RcvChatFeatureRejected - | CIContent.RcvGroupFeatureRejected - | CIContent.SndModerated - | CIContent.RcvModerated - | CIContent.RcvBlocked - | CIContent.SndDirectE2EEInfo - | CIContent.RcvDirectE2EEInfo - | CIContent.SndGroupE2EEInfo - | CIContent.RcvGroupE2EEInfo - | CIContent.ChatBanner - -export namespace CIContent { - export type Tag = - | "sndMsgContent" - | "rcvMsgContent" - | "sndDeleted" - | "rcvDeleted" - | "sndCall" - | "rcvCall" - | "rcvIntegrityError" - | "rcvDecryptionError" - | "rcvMsgError" - | "rcvGroupInvitation" - | "sndGroupInvitation" - | "rcvDirectEvent" - | "rcvGroupEvent" - | "sndGroupEvent" - | "rcvConnEvent" - | "sndConnEvent" - | "rcvChatFeature" - | "sndChatFeature" - | "rcvChatPreference" - | "sndChatPreference" - | "rcvGroupFeature" - | "sndGroupFeature" - | "rcvChatFeatureRejected" - | "rcvGroupFeatureRejected" - | "sndModerated" - | "rcvModerated" - | "rcvBlocked" - | "sndDirectE2EEInfo" - | "rcvDirectE2EEInfo" - | "sndGroupE2EEInfo" - | "rcvGroupE2EEInfo" - | "chatBanner" - - interface Interface { - type: Tag - } - - export interface SndMsgContent extends Interface { - type: "sndMsgContent" - msgContent: MsgContent - } - - export interface RcvMsgContent extends Interface { - type: "rcvMsgContent" - msgContent: MsgContent - } - - export interface SndDeleted extends Interface { - type: "sndDeleted" - deleteMode: CIDeleteMode - } - - export interface RcvDeleted extends Interface { - type: "rcvDeleted" - deleteMode: CIDeleteMode - } - - export interface SndCall extends Interface { - type: "sndCall" - status: CICallStatus - duration: number // int - } - - export interface RcvCall extends Interface { - type: "rcvCall" - status: CICallStatus - duration: number // int - } - - export interface RcvIntegrityError extends Interface { - type: "rcvIntegrityError" - msgError: MsgErrorType - } - - export interface RcvDecryptionError extends Interface { - type: "rcvDecryptionError" - msgDecryptError: MsgDecryptError - msgCount: number // word32 - } - - export interface RcvMsgError extends Interface { - type: "rcvMsgError" - rcvMsgError: RcvMsgError - } - - export interface RcvGroupInvitation extends Interface { - type: "rcvGroupInvitation" - groupInvitation: CIGroupInvitation - memberRole: GroupMemberRole - } - - export interface SndGroupInvitation extends Interface { - type: "sndGroupInvitation" - groupInvitation: CIGroupInvitation - memberRole: GroupMemberRole - } - - export interface RcvDirectEvent extends Interface { - type: "rcvDirectEvent" - rcvDirectEvent: RcvDirectEvent - } - - export interface RcvGroupEvent extends Interface { - type: "rcvGroupEvent" - rcvGroupEvent: RcvGroupEvent - } - - export interface SndGroupEvent extends Interface { - type: "sndGroupEvent" - sndGroupEvent: SndGroupEvent - } - - export interface RcvConnEvent extends Interface { - type: "rcvConnEvent" - rcvConnEvent: RcvConnEvent - } - - export interface SndConnEvent extends Interface { - type: "sndConnEvent" - sndConnEvent: SndConnEvent - } - - export interface RcvChatFeature extends Interface { - type: "rcvChatFeature" - feature: ChatFeature - enabled: PrefEnabled - param?: number // int - } - - export interface SndChatFeature extends Interface { - type: "sndChatFeature" - feature: ChatFeature - enabled: PrefEnabled - param?: number // int - } - - export interface RcvChatPreference extends Interface { - type: "rcvChatPreference" - feature: ChatFeature - allowed: FeatureAllowed - param?: number // int - } - - export interface SndChatPreference extends Interface { - type: "sndChatPreference" - feature: ChatFeature - allowed: FeatureAllowed - param?: number // int - } - - export interface RcvGroupFeature extends Interface { - type: "rcvGroupFeature" - groupFeature: GroupFeature - preference: GroupPreference - param?: number // int - memberRole_?: GroupMemberRole - } - - export interface SndGroupFeature extends Interface { - type: "sndGroupFeature" - groupFeature: GroupFeature - preference: GroupPreference - param?: number // int - memberRole_?: GroupMemberRole - } - - export interface RcvChatFeatureRejected extends Interface { - type: "rcvChatFeatureRejected" - feature: ChatFeature - } - - export interface RcvGroupFeatureRejected extends Interface { - type: "rcvGroupFeatureRejected" - groupFeature: GroupFeature - } - - export interface SndModerated extends Interface { - type: "sndModerated" - } - - export interface RcvModerated extends Interface { - type: "rcvModerated" - } - - export interface RcvBlocked extends Interface { - type: "rcvBlocked" - } - - export interface SndDirectE2EEInfo extends Interface { - type: "sndDirectE2EEInfo" - e2eeInfo: E2EInfo - } - - export interface RcvDirectE2EEInfo extends Interface { - type: "rcvDirectE2EEInfo" - e2eeInfo: E2EInfo - } - - export interface SndGroupE2EEInfo extends Interface { - type: "sndGroupE2EEInfo" - e2eeInfo: E2EInfo - } - - export interface RcvGroupE2EEInfo extends Interface { - type: "rcvGroupE2EEInfo" - e2eeInfo: E2EInfo - } - - export interface ChatBanner extends Interface { - type: "chatBanner" - } -} - -export enum CIDeleteMode { - Broadcast = "broadcast", - Internal = "internal", - InternalMark = "internalMark", - History = "history", -} - -export type CIDeleted = CIDeleted.Deleted | CIDeleted.Blocked | CIDeleted.BlockedByAdmin | CIDeleted.Moderated - -export namespace CIDeleted { - export type Tag = "deleted" | "blocked" | "blockedByAdmin" | "moderated" - - interface Interface { - type: Tag - } - - export interface Deleted extends Interface { - type: "deleted" - deletedTs?: string // ISO-8601 timestamp - chatType: ChatType - } - - export interface Blocked extends Interface { - type: "blocked" - deletedTs?: string // ISO-8601 timestamp - } - - export interface BlockedByAdmin extends Interface { - type: "blockedByAdmin" - deletedTs?: string // ISO-8601 timestamp - } - - export interface Moderated extends Interface { - type: "moderated" - deletedTs?: string // ISO-8601 timestamp - byGroupMember: GroupMember - } -} - -export type CIDirection = - | CIDirection.DirectSnd - | CIDirection.DirectRcv - | CIDirection.GroupSnd - | CIDirection.GroupRcv - | CIDirection.ChannelRcv - | CIDirection.LocalSnd - | CIDirection.LocalRcv - -export namespace CIDirection { - export type Tag = - | "directSnd" - | "directRcv" - | "groupSnd" - | "groupRcv" - | "channelRcv" - | "localSnd" - | "localRcv" - - interface Interface { - type: Tag - } - - export interface DirectSnd extends Interface { - type: "directSnd" - } - - export interface DirectRcv extends Interface { - type: "directRcv" - } - - export interface GroupSnd extends Interface { - type: "groupSnd" - } - - export interface GroupRcv extends Interface { - type: "groupRcv" - groupMember: GroupMember - } - - export interface ChannelRcv extends Interface { - type: "channelRcv" - } - - export interface LocalSnd extends Interface { - type: "localSnd" - } - - export interface LocalRcv extends Interface { - type: "localRcv" - } -} - -export interface CIFile { - fileId: number // int64 - fileName: string - fileSize: number // int64 - fileSource?: CryptoFile - fileStatus: CIFileStatus - fileProtocol: FileProtocol -} - -export type CIFileStatus = - | CIFileStatus.SndStored - | CIFileStatus.SndTransfer - | CIFileStatus.SndCancelled - | CIFileStatus.SndComplete - | CIFileStatus.SndError - | CIFileStatus.SndWarning - | CIFileStatus.RcvInvitation - | CIFileStatus.RcvAccepted - | CIFileStatus.RcvTransfer - | CIFileStatus.RcvAborted - | CIFileStatus.RcvComplete - | CIFileStatus.RcvCancelled - | CIFileStatus.RcvError - | CIFileStatus.RcvWarning - | CIFileStatus.Invalid - -export namespace CIFileStatus { - export type Tag = - | "sndStored" - | "sndTransfer" - | "sndCancelled" - | "sndComplete" - | "sndError" - | "sndWarning" - | "rcvInvitation" - | "rcvAccepted" - | "rcvTransfer" - | "rcvAborted" - | "rcvComplete" - | "rcvCancelled" - | "rcvError" - | "rcvWarning" - | "invalid" - - interface Interface { - type: Tag - } - - export interface SndStored extends Interface { - type: "sndStored" - } - - export interface SndTransfer extends Interface { - type: "sndTransfer" - sndProgress: number // int64 - sndTotal: number // int64 - } - - export interface SndCancelled extends Interface { - type: "sndCancelled" - } - - export interface SndComplete extends Interface { - type: "sndComplete" - } - - export interface SndError extends Interface { - type: "sndError" - sndFileError: FileError - } - - export interface SndWarning extends Interface { - type: "sndWarning" - sndFileError: FileError - } - - export interface RcvInvitation extends Interface { - type: "rcvInvitation" - } - - export interface RcvAccepted extends Interface { - type: "rcvAccepted" - } - - export interface RcvTransfer extends Interface { - type: "rcvTransfer" - rcvProgress: number // int64 - rcvTotal: number // int64 - } - - export interface RcvAborted extends Interface { - type: "rcvAborted" - } - - export interface RcvComplete extends Interface { - type: "rcvComplete" - } - - export interface RcvCancelled extends Interface { - type: "rcvCancelled" - } - - export interface RcvError extends Interface { - type: "rcvError" - rcvFileError: FileError - } - - export interface RcvWarning extends Interface { - type: "rcvWarning" - rcvFileError: FileError - } - - export interface Invalid extends Interface { - type: "invalid" - text: string - } -} - -export type CIForwardedFrom = CIForwardedFrom.Unknown | CIForwardedFrom.Contact | CIForwardedFrom.Group - -export namespace CIForwardedFrom { - export type Tag = "unknown" | "contact" | "group" - - interface Interface { - type: Tag - } - - export interface Unknown extends Interface { - type: "unknown" - } - - export interface Contact extends Interface { - type: "contact" - chatName: string - msgDir: MsgDirection - contactId?: number // int64 - chatItemId?: number // int64 - } - - export interface Group extends Interface { - type: "group" - chatName: string - msgDir: MsgDirection - groupId?: number // int64 - chatItemId?: number // int64 - } -} - -export interface CIGroupInvitation { - groupId: number // int64 - groupMemberId: number // int64 - localDisplayName: string - groupProfile: GroupProfile - status: CIGroupInvitationStatus -} - -export enum CIGroupInvitationStatus { - Pending = "pending", - Accepted = "accepted", - Rejected = "rejected", - Expired = "expired", -} - -export interface CIMention { - memberId: string - memberRef?: CIMentionMember -} - -export interface CIMentionMember { - groupMemberId: number // int64 - displayName: string - localAlias?: string - memberRole: GroupMemberRole -} - -export interface CIMeta { - itemId: number // int64 - itemTs: string // ISO-8601 timestamp - itemText: string - itemStatus: CIStatus - sentViaProxy?: boolean - itemSharedMsgId?: string - itemForwarded?: CIForwardedFrom - itemDeleted?: CIDeleted - itemEdited: boolean - itemTimed?: CITimed - itemLive?: boolean - userMention: boolean - hasLink: boolean - deletable: boolean - editable: boolean - forwardedByMember?: number // int64 - showGroupAsSender: boolean - msgVerified?: MsgVerified - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp -} - -export interface CIQuote { - chatDir?: CIDirection - itemId?: number // int64 - sharedMsgId?: string - sentAt: string // ISO-8601 timestamp - content: MsgContent - formattedText?: FormattedText[] -} - -export interface CIReaction { - chatDir: CIDirection - chatItem: ChatItem - sentAt: string // ISO-8601 timestamp - reaction: MsgReaction -} - -export interface CIReactionCount { - reaction: MsgReaction - userReacted: boolean - totalReacted: number // int -} - -export type CIStatus = - | CIStatus.SndNew - | CIStatus.SndSent - | CIStatus.SndRcvd - | CIStatus.SndErrorAuth - | CIStatus.SndError - | CIStatus.SndWarning - | CIStatus.RcvNew - | CIStatus.RcvRead - | CIStatus.Invalid - -export namespace CIStatus { - export type Tag = - | "sndNew" - | "sndSent" - | "sndRcvd" - | "sndErrorAuth" - | "sndError" - | "sndWarning" - | "rcvNew" - | "rcvRead" - | "invalid" - - interface Interface { - type: Tag - } - - export interface SndNew extends Interface { - type: "sndNew" - } - - export interface SndSent extends Interface { - type: "sndSent" - sndProgress: SndCIStatusProgress - } - - export interface SndRcvd extends Interface { - type: "sndRcvd" - msgRcptStatus: MsgReceiptStatus - sndProgress: SndCIStatusProgress - } - - export interface SndErrorAuth extends Interface { - type: "sndErrorAuth" - } - - export interface SndError extends Interface { - type: "sndError" - agentError: SndError - } - - export interface SndWarning extends Interface { - type: "sndWarning" - agentError: SndError - } - - export interface RcvNew extends Interface { - type: "rcvNew" - } - - export interface RcvRead extends Interface { - type: "rcvRead" - } - - export interface Invalid extends Interface { - type: "invalid" - text: string - } -} - -export interface CITimed { - ttl: number // int - deleteAt?: string // ISO-8601 timestamp -} - -export type ChatBotCommand = ChatBotCommand.Command | ChatBotCommand.Menu - -export namespace ChatBotCommand { - export type Tag = "command" | "menu" - - interface Interface { - type: Tag - } - - export interface Command extends Interface { - type: "command" - keyword: string - label: string - params?: string - } - - export interface Menu extends Interface { - type: "menu" - label: string - commands: ChatBotCommand[] - } -} - -export type ChatDeleteMode = ChatDeleteMode.Full | ChatDeleteMode.Entity | ChatDeleteMode.Messages - -export namespace ChatDeleteMode { - export type Tag = "full" | "entity" | "messages" - - interface Interface { - type: Tag - } - - export interface Full extends Interface { - type: "full" - notify: boolean - } - - export interface Entity extends Interface { - type: "entity" - notify: boolean - } - - export interface Messages extends Interface { - type: "messages" - } - - export function cmdString(self: ChatDeleteMode): string { - return self.type + (self.type == 'messages' ? '' : (!self.notify ? ' notify=off' : '')) - } -} - -export type ChatError = ChatError.Error | ChatError.ErrorAgent | ChatError.ErrorStore - -export namespace ChatError { - export type Tag = "error" | "errorAgent" | "errorStore" - - interface Interface { - type: Tag - } - - export interface Error extends Interface { - type: "error" - errorType: ChatErrorType - } - - export interface ErrorAgent extends Interface { - type: "errorAgent" - agentError: AgentErrorType - agentConnId: string - connectionEntity_?: ConnectionEntity - } - - export interface ErrorStore extends Interface { - type: "errorStore" - storeError: StoreError - } -} - -export type ChatErrorType = - | ChatErrorType.NoActiveUser - | ChatErrorType.NoConnectionUser - | ChatErrorType.NoSndFileUser - | ChatErrorType.NoRcvFileUser - | ChatErrorType.UserUnknown - | ChatErrorType.UserExists - | ChatErrorType.ChatRelayExists - | ChatErrorType.DifferentActiveUser - | ChatErrorType.CantDeleteActiveUser - | ChatErrorType.CantDeleteLastUser - | ChatErrorType.CantHideLastUser - | ChatErrorType.HiddenUserAlwaysMuted - | ChatErrorType.EmptyUserPassword - | ChatErrorType.UserAlreadyHidden - | ChatErrorType.UserNotHidden - | ChatErrorType.InvalidDisplayName - | ChatErrorType.ChatNotStarted - | ChatErrorType.ChatNotStopped - | ChatErrorType.ChatStoreChanged - | ChatErrorType.InvalidConnReq - | ChatErrorType.SimplexDomainNotReady - | ChatErrorType.NotResolvedLocally - | ChatErrorType.UnsupportedConnReq - | ChatErrorType.ConnReqMessageProhibited - | ChatErrorType.ContactNotReady - | ChatErrorType.ContactNotActive - | ChatErrorType.ContactDisabled - | ChatErrorType.ConnectionDisabled - | ChatErrorType.GroupUserRole - | ChatErrorType.GroupMemberInitialRole - | ChatErrorType.ContactIncognitoCantInvite - | ChatErrorType.GroupIncognitoCantInvite - | ChatErrorType.GroupContactRole - | ChatErrorType.GroupDuplicateMember - | ChatErrorType.GroupDuplicateMemberId - | ChatErrorType.GroupNotJoined - | ChatErrorType.GroupMemberNotActive - | ChatErrorType.CantBlockMemberForSelf - | ChatErrorType.GroupMemberUserRemoved - | ChatErrorType.GroupMemberNotFound - | ChatErrorType.GroupCantResendInvitation - | ChatErrorType.GroupInternal - | ChatErrorType.FileNotFound - | ChatErrorType.FileSize - | ChatErrorType.FileAlreadyReceiving - | ChatErrorType.FileCancelled - | ChatErrorType.FileCancel - | ChatErrorType.FileAlreadyExists - | ChatErrorType.FileWrite - | ChatErrorType.FileSend - | ChatErrorType.FileRcvChunk - | ChatErrorType.FileInternal - | ChatErrorType.FileImageType - | ChatErrorType.FileImageSize - | ChatErrorType.FileNotReceived - | ChatErrorType.FileNotApproved - | ChatErrorType.FallbackToSMPProhibited - | ChatErrorType.InlineFileProhibited - | ChatErrorType.InvalidForward - | ChatErrorType.InvalidChatItemUpdate - | ChatErrorType.InvalidChatItemDelete - | ChatErrorType.HasCurrentCall - | ChatErrorType.NoCurrentCall - | ChatErrorType.CallContact - | ChatErrorType.DirectMessagesProhibited - | ChatErrorType.AgentVersion - | ChatErrorType.AgentNoSubResult - | ChatErrorType.CommandError - | ChatErrorType.AgentCommandError - | ChatErrorType.InvalidFileDescription - | ChatErrorType.ConnectionIncognitoChangeProhibited - | ChatErrorType.ConnectionUserChangeProhibited - | ChatErrorType.PeerChatVRangeIncompatible - | ChatErrorType.RelayTestError - | ChatErrorType.InternalError - | ChatErrorType.Exception - -export namespace ChatErrorType { - export type Tag = - | "noActiveUser" - | "noConnectionUser" - | "noSndFileUser" - | "noRcvFileUser" - | "userUnknown" - | "userExists" - | "chatRelayExists" - | "differentActiveUser" - | "cantDeleteActiveUser" - | "cantDeleteLastUser" - | "cantHideLastUser" - | "hiddenUserAlwaysMuted" - | "emptyUserPassword" - | "userAlreadyHidden" - | "userNotHidden" - | "invalidDisplayName" - | "chatNotStarted" - | "chatNotStopped" - | "chatStoreChanged" - | "invalidConnReq" - | "simplexDomainNotReady" - | "notResolvedLocally" - | "unsupportedConnReq" - | "connReqMessageProhibited" - | "contactNotReady" - | "contactNotActive" - | "contactDisabled" - | "connectionDisabled" - | "groupUserRole" - | "groupMemberInitialRole" - | "contactIncognitoCantInvite" - | "groupIncognitoCantInvite" - | "groupContactRole" - | "groupDuplicateMember" - | "groupDuplicateMemberId" - | "groupNotJoined" - | "groupMemberNotActive" - | "cantBlockMemberForSelf" - | "groupMemberUserRemoved" - | "groupMemberNotFound" - | "groupCantResendInvitation" - | "groupInternal" - | "fileNotFound" - | "fileSize" - | "fileAlreadyReceiving" - | "fileCancelled" - | "fileCancel" - | "fileAlreadyExists" - | "fileWrite" - | "fileSend" - | "fileRcvChunk" - | "fileInternal" - | "fileImageType" - | "fileImageSize" - | "fileNotReceived" - | "fileNotApproved" - | "fallbackToSMPProhibited" - | "inlineFileProhibited" - | "invalidForward" - | "invalidChatItemUpdate" - | "invalidChatItemDelete" - | "hasCurrentCall" - | "noCurrentCall" - | "callContact" - | "directMessagesProhibited" - | "agentVersion" - | "agentNoSubResult" - | "commandError" - | "agentCommandError" - | "invalidFileDescription" - | "connectionIncognitoChangeProhibited" - | "connectionUserChangeProhibited" - | "peerChatVRangeIncompatible" - | "relayTestError" - | "internalError" - | "exception" - - interface Interface { - type: Tag - } - - export interface NoActiveUser extends Interface { - type: "noActiveUser" - } - - export interface NoConnectionUser extends Interface { - type: "noConnectionUser" - agentConnId: string - } - - export interface NoSndFileUser extends Interface { - type: "noSndFileUser" - agentSndFileId: string - } - - export interface NoRcvFileUser extends Interface { - type: "noRcvFileUser" - agentRcvFileId: string - } - - export interface UserUnknown extends Interface { - type: "userUnknown" - } - - export interface UserExists extends Interface { - type: "userExists" - contactName: string - } - - export interface ChatRelayExists extends Interface { - type: "chatRelayExists" - } - - export interface DifferentActiveUser extends Interface { - type: "differentActiveUser" - commandUserId: number // int64 - activeUserId: number // int64 - } - - export interface CantDeleteActiveUser extends Interface { - type: "cantDeleteActiveUser" - userId: number // int64 - } - - export interface CantDeleteLastUser extends Interface { - type: "cantDeleteLastUser" - userId: number // int64 - } - - export interface CantHideLastUser extends Interface { - type: "cantHideLastUser" - userId: number // int64 - } - - export interface HiddenUserAlwaysMuted extends Interface { - type: "hiddenUserAlwaysMuted" - userId: number // int64 - } - - export interface EmptyUserPassword extends Interface { - type: "emptyUserPassword" - userId: number // int64 - } - - export interface UserAlreadyHidden extends Interface { - type: "userAlreadyHidden" - userId: number // int64 - } - - export interface UserNotHidden extends Interface { - type: "userNotHidden" - userId: number // int64 - } - - export interface InvalidDisplayName extends Interface { - type: "invalidDisplayName" - displayName: string - validName: string - } - - export interface ChatNotStarted extends Interface { - type: "chatNotStarted" - } - - export interface ChatNotStopped extends Interface { - type: "chatNotStopped" - } - - export interface ChatStoreChanged extends Interface { - type: "chatStoreChanged" - } - - export interface InvalidConnReq extends Interface { - type: "invalidConnReq" - } - - export interface SimplexDomainNotReady extends Interface { - type: "simplexDomainNotReady" - simplexDomain: SimplexDomain - simplexDomainError: SimplexDomainError - } - - export interface NotResolvedLocally extends Interface { - type: "notResolvedLocally" - } - - export interface UnsupportedConnReq extends Interface { - type: "unsupportedConnReq" - } - - export interface ConnReqMessageProhibited extends Interface { - type: "connReqMessageProhibited" - } - - export interface ContactNotReady extends Interface { - type: "contactNotReady" - contact: Contact - } - - export interface ContactNotActive extends Interface { - type: "contactNotActive" - contact: Contact - } - - export interface ContactDisabled extends Interface { - type: "contactDisabled" - contact: Contact - } - - export interface ConnectionDisabled extends Interface { - type: "connectionDisabled" - connection: Connection - } - - export interface GroupUserRole extends Interface { - type: "groupUserRole" - groupInfo: GroupInfo - requiredRole: GroupMemberRole - } - - export interface GroupMemberInitialRole extends Interface { - type: "groupMemberInitialRole" - groupInfo: GroupInfo - initialRole: GroupMemberRole - } - - export interface ContactIncognitoCantInvite extends Interface { - type: "contactIncognitoCantInvite" - } - - export interface GroupIncognitoCantInvite extends Interface { - type: "groupIncognitoCantInvite" - } - - export interface GroupContactRole extends Interface { - type: "groupContactRole" - contactName: string - } - - export interface GroupDuplicateMember extends Interface { - type: "groupDuplicateMember" - contactName: string - } - - export interface GroupDuplicateMemberId extends Interface { - type: "groupDuplicateMemberId" - } - - export interface GroupNotJoined extends Interface { - type: "groupNotJoined" - groupInfo: GroupInfo - } - - export interface GroupMemberNotActive extends Interface { - type: "groupMemberNotActive" - } - - export interface CantBlockMemberForSelf extends Interface { - type: "cantBlockMemberForSelf" - groupInfo: GroupInfo - member: GroupMember - setShowMessages: boolean - } - - export interface GroupMemberUserRemoved extends Interface { - type: "groupMemberUserRemoved" - } - - export interface GroupMemberNotFound extends Interface { - type: "groupMemberNotFound" - } - - export interface GroupCantResendInvitation extends Interface { - type: "groupCantResendInvitation" - groupInfo: GroupInfo - contactName: string - } - - export interface GroupInternal extends Interface { - type: "groupInternal" - message: string - } - - export interface FileNotFound extends Interface { - type: "fileNotFound" - message: string - } - - export interface FileSize extends Interface { - type: "fileSize" - filePath: string - } - - export interface FileAlreadyReceiving extends Interface { - type: "fileAlreadyReceiving" - message: string - } - - export interface FileCancelled extends Interface { - type: "fileCancelled" - message: string - } - - export interface FileCancel extends Interface { - type: "fileCancel" - fileId: number // int64 - message: string - } - - export interface FileAlreadyExists extends Interface { - type: "fileAlreadyExists" - filePath: string - } - - export interface FileWrite extends Interface { - type: "fileWrite" - filePath: string - message: string - } - - export interface FileSend extends Interface { - type: "fileSend" - fileId: number // int64 - agentError: AgentErrorType - } - - export interface FileRcvChunk extends Interface { - type: "fileRcvChunk" - message: string - } - - export interface FileInternal extends Interface { - type: "fileInternal" - message: string - } - - export interface FileImageType extends Interface { - type: "fileImageType" - filePath: string - } - - export interface FileImageSize extends Interface { - type: "fileImageSize" - filePath: string - } - - export interface FileNotReceived extends Interface { - type: "fileNotReceived" - fileId: number // int64 - } - - export interface FileNotApproved extends Interface { - type: "fileNotApproved" - fileId: number // int64 - unknownServers: string[] - } - - export interface FallbackToSMPProhibited extends Interface { - type: "fallbackToSMPProhibited" - fileId: number // int64 - } - - export interface InlineFileProhibited extends Interface { - type: "inlineFileProhibited" - fileId: number // int64 - } - - export interface InvalidForward extends Interface { - type: "invalidForward" - } - - export interface InvalidChatItemUpdate extends Interface { - type: "invalidChatItemUpdate" - } - - export interface InvalidChatItemDelete extends Interface { - type: "invalidChatItemDelete" - } - - export interface HasCurrentCall extends Interface { - type: "hasCurrentCall" - } - - export interface NoCurrentCall extends Interface { - type: "noCurrentCall" - } - - export interface CallContact extends Interface { - type: "callContact" - contactId: number // int64 - } - - export interface DirectMessagesProhibited extends Interface { - type: "directMessagesProhibited" - direction: MsgDirection - contact: Contact - } - - export interface AgentVersion extends Interface { - type: "agentVersion" - } - - export interface AgentNoSubResult extends Interface { - type: "agentNoSubResult" - agentConnId: string - } - - export interface CommandError extends Interface { - type: "commandError" - message: string - } - - export interface AgentCommandError extends Interface { - type: "agentCommandError" - message: string - } - - export interface InvalidFileDescription extends Interface { - type: "invalidFileDescription" - message: string - } - - export interface ConnectionIncognitoChangeProhibited extends Interface { - type: "connectionIncognitoChangeProhibited" - } - - export interface ConnectionUserChangeProhibited extends Interface { - type: "connectionUserChangeProhibited" - } - - export interface PeerChatVRangeIncompatible extends Interface { - type: "peerChatVRangeIncompatible" - } - - export interface RelayTestError extends Interface { - type: "relayTestError" - message: string - } - - export interface InternalError extends Interface { - type: "internalError" - message: string - } - - export interface Exception extends Interface { - type: "exception" - message: string - } -} - -export enum ChatFeature { - TimedMessages = "timedMessages", - FullDelete = "fullDelete", - Reactions = "reactions", - Voice = "voice", - Files = "files", - Calls = "calls", - Sessions = "sessions", -} - -export type ChatInfo = - | ChatInfo.Direct - | ChatInfo.Group - | ChatInfo.Local - | ChatInfo.ContactRequest - | ChatInfo.ContactConnection - -export namespace ChatInfo { - export type Tag = "direct" | "group" | "local" | "contactRequest" | "contactConnection" - - interface Interface { - type: Tag - } - - export interface Direct extends Interface { - type: "direct" - contact: Contact - } - - export interface Group extends Interface { - type: "group" - groupInfo: GroupInfo - groupChatScope?: GroupChatScopeInfo - } - - export interface Local extends Interface { - type: "local" - noteFolder: NoteFolder - } - - export interface ContactRequest extends Interface { - type: "contactRequest" - contactRequest: UserContactRequest - } - - export interface ContactConnection extends Interface { - type: "contactConnection" - contactConnection: PendingContactConnection - } -} - -export interface ChatItem { - chatDir: CIDirection - meta: CIMeta - content: CIContent - mentions: {[key: string]: CIMention} - formattedText?: FormattedText[] - quotedItem?: CIQuote - reactions: CIReactionCount[] - file?: CIFile -} -// Message deletion result. - -export interface ChatItemDeletion { - deletedChatItem: AChatItem - toChatItem?: AChatItem -} - -export type ChatListQuery = ChatListQuery.Filters | ChatListQuery.Search - -export namespace ChatListQuery { - export type Tag = "filters" | "search" - - interface Interface { - type: Tag - } - - export interface Filters extends Interface { - type: "filters" - favorite: boolean - unread: boolean - } - - export interface Search extends Interface { - type: "search" - search: string - } -} - -export enum ChatPeerType { - Human = "human", - Bot = "bot", -} -// Used in API commands. Chat scope can only be passed with groups. - -export interface ChatRef { - chatType: ChatType - chatId: number // int64 - chatScope?: GroupChatScope -} - -export namespace ChatRef { - export function cmdString(self: ChatRef): string { - return ChatType.cmdString(self.chatType) + self.chatId + (self.chatScope ? GroupChatScope.cmdString(self.chatScope) : '') - } -} - -export interface ChatSettings { - enableNtfs: MsgFilter - sendRcpts?: boolean - favorite: boolean -} - -export interface ChatStats { - unreadCount: number // int - unreadMentions: number // int - reportsCount: number // int - minUnreadItemId: number // int64 - unreadChat: boolean -} - -export enum ChatType { - Direct = "direct", - Group = "group", - Local = "local", -} - -export namespace ChatType { - export function cmdString(self: ChatType): string { - return self == 'direct' ? '@' : self == 'group' ? '#' : self == 'local' ? '*' : '' - } -} - -export interface ChatWallpaper { - preset?: string - imageFile?: string - background?: string - tint?: string - scaleType?: ChatWallpaperScale - scale?: number // double -} - -export enum ChatWallpaperScale { - Fill = "fill", - Fit = "fit", - Repeat = "repeat", -} - -export interface ClientNotice { - ttl?: number // int64 -} - -export enum Color { - Black = "black", - Red = "red", - Green = "green", - Yellow = "yellow", - Blue = "blue", - Magenta = "magenta", - Cyan = "cyan", - White = "white", -} - -export type CommandError = - | CommandError.UNKNOWN - | CommandError.SYNTAX - | CommandError.PROHIBITED - | CommandError.NO_AUTH - | CommandError.HAS_AUTH - | CommandError.NO_ENTITY - -export namespace CommandError { - export type Tag = "UNKNOWN" | "SYNTAX" | "PROHIBITED" | "NO_AUTH" | "HAS_AUTH" | "NO_ENTITY" - - interface Interface { - type: Tag - } - - export interface UNKNOWN extends Interface { - type: "UNKNOWN" - } - - export interface SYNTAX extends Interface { - type: "SYNTAX" - } - - export interface PROHIBITED extends Interface { - type: "PROHIBITED" - } - - export interface NO_AUTH extends Interface { - type: "NO_AUTH" - } - - export interface HAS_AUTH extends Interface { - type: "HAS_AUTH" - } - - export interface NO_ENTITY extends Interface { - type: "NO_ENTITY" - } -} - -export type CommandErrorType = - | CommandErrorType.PROHIBITED - | CommandErrorType.SYNTAX - | CommandErrorType.NO_CONN - | CommandErrorType.SIZE - | CommandErrorType.LARGE - -export namespace CommandErrorType { - export type Tag = "PROHIBITED" | "SYNTAX" | "NO_CONN" | "SIZE" | "LARGE" - - interface Interface { - type: Tag - } - - export interface PROHIBITED extends Interface { - type: "PROHIBITED" - } - - export interface SYNTAX extends Interface { - type: "SYNTAX" - } - - export interface NO_CONN extends Interface { - type: "NO_CONN" - } - - export interface SIZE extends Interface { - type: "SIZE" - } - - export interface LARGE extends Interface { - type: "LARGE" - } -} - -export interface CommentsGroupPreference { - enable: GroupFeatureEnabled - duration?: number // int -} - -export interface ComposedMessage { - fileSource?: CryptoFile - quotedItemId?: number // int64 - msgContent: MsgContent - mentions: {[key: string]: number} // string : int64 -} - -export type ConnStatus = - | ConnStatus.New - | ConnStatus.Prepared - | ConnStatus.Joined - | ConnStatus.Requested - | ConnStatus.Accepted - | ConnStatus.SndReady - | ConnStatus.Ready - | ConnStatus.Deleted - | ConnStatus.Failed - -export namespace ConnStatus { - export type Tag = - | "new" - | "prepared" - | "joined" - | "requested" - | "accepted" - | "sndReady" - | "ready" - | "deleted" - | "failed" - - interface Interface { - type: Tag - } - - export interface New extends Interface { - type: "new" - } - - export interface Prepared extends Interface { - type: "prepared" - } - - export interface Joined extends Interface { - type: "joined" - } - - export interface Requested extends Interface { - type: "requested" - } - - export interface Accepted extends Interface { - type: "accepted" - } - - export interface SndReady extends Interface { - type: "sndReady" - } - - export interface Ready extends Interface { - type: "ready" - } - - export interface Deleted extends Interface { - type: "deleted" - } - - export interface Failed extends Interface { - type: "failed" - connError: string - } -} - -export enum ConnType { - Contact = "contact", - Member = "member", - User_contact = "user_contact", -} - -export interface Connection { - connId: number // int64 - agentConnId: string - connChatVersion: number // int - peerChatVRange: VersionRange - connLevel: number // int - viaContact?: number // int64 - viaUserContactLink?: number // int64 - viaGroupLink: boolean - groupLinkId?: string - xContactId?: string - customUserProfileId?: number // int64 - connType: ConnType - connStatus: ConnStatus - contactConnInitiated: boolean - localAlias: string - entityId?: number // int64 - connectionCode?: SecurityCode - pqSupport: boolean - pqEncryption: boolean - pqSndEnabled?: boolean - pqRcvEnabled?: boolean - authErrCounter: number // int - quotaErrCounter: number // int - createdAt: string // ISO-8601 timestamp -} - -export type ConnectionEntity = - | ConnectionEntity.RcvDirectMsgConnection - | ConnectionEntity.RcvGroupMsgConnection - | ConnectionEntity.UserContactConnection - -export namespace ConnectionEntity { - export type Tag = "rcvDirectMsgConnection" | "rcvGroupMsgConnection" | "userContactConnection" - - interface Interface { - type: Tag - } - - export interface RcvDirectMsgConnection extends Interface { - type: "rcvDirectMsgConnection" - entityConnection: Connection - contact?: Contact - } - - export interface RcvGroupMsgConnection extends Interface { - type: "rcvGroupMsgConnection" - entityConnection: Connection - groupInfo: GroupInfo - groupMember: GroupMember - } - - export interface UserContactConnection extends Interface { - type: "userContactConnection" - entityConnection: Connection - userContact: UserContact - } -} - -export type ConnectionErrorType = - | ConnectionErrorType.NOT_FOUND - | ConnectionErrorType.DUPLICATE - | ConnectionErrorType.SIMPLEX - | ConnectionErrorType.NOT_ACCEPTED - | ConnectionErrorType.NOT_AVAILABLE - -export namespace ConnectionErrorType { - export type Tag = "NOT_FOUND" | "DUPLICATE" | "SIMPLEX" | "NOT_ACCEPTED" | "NOT_AVAILABLE" - - interface Interface { - type: Tag - } - - export interface NOT_FOUND extends Interface { - type: "NOT_FOUND" - } - - export interface DUPLICATE extends Interface { - type: "DUPLICATE" - } - - export interface SIMPLEX extends Interface { - type: "SIMPLEX" - } - - export interface NOT_ACCEPTED extends Interface { - type: "NOT_ACCEPTED" - } - - export interface NOT_AVAILABLE extends Interface { - type: "NOT_AVAILABLE" - } -} - -export enum ConnectionMode { - INV = "inv", - CON = "con", -} - -export type ConnectionPlan = - | ConnectionPlan.InvitationLink - | ConnectionPlan.ContactAddress - | ConnectionPlan.GroupLink - | ConnectionPlan.Error - -export namespace ConnectionPlan { - export type Tag = "invitationLink" | "contactAddress" | "groupLink" | "error" - - interface Interface { - type: Tag - } - - export interface InvitationLink extends Interface { - type: "invitationLink" - invitationLinkPlan: InvitationLinkPlan - } - - export interface ContactAddress extends Interface { - type: "contactAddress" - contactAddressPlan: ContactAddressPlan - } - - export interface GroupLink extends Interface { - type: "groupLink" - groupLinkPlan: GroupLinkPlan - } - - export interface Error extends Interface { - type: "error" - chatError: ChatError - } -} - -export interface Contact { - contactId: number // int64 - localDisplayName: string - profile: LocalProfile - activeConn?: Connection - contactUsed: boolean - contactStatus: ContactStatus - chatSettings: ChatSettings - userPreferences: Preferences - mergedPreferences: ContactUserPreferences - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp - chatTs?: string // ISO-8601 timestamp - preparedContact?: PreparedContact - contactRequestId?: number // int64 - contactGroupMemberId?: number // int64 - contactGrpInvSent: boolean - groupDirectInv?: GroupDirectInvitation - chatTags: number[] // int64 - chatItemTTL?: number // int64 - uiThemes?: UIThemeEntityOverrides - chatDeleted: boolean - customData?: object -} - -export type ContactAddressPlan = - | ContactAddressPlan.Ok - | ContactAddressPlan.OwnLink - | ContactAddressPlan.ConnectingConfirmReconnect - | ContactAddressPlan.ConnectingProhibit - | ContactAddressPlan.Known - | ContactAddressPlan.ContactViaAddress - -export namespace ContactAddressPlan { - export type Tag = - | "ok" - | "ownLink" - | "connectingConfirmReconnect" - | "connectingProhibit" - | "known" - | "contactViaAddress" - - interface Interface { - type: Tag - } - - export interface Ok extends Interface { - type: "ok" - contactSLinkData_?: ContactShortLinkData - ownerVerification?: OwnerVerification - } - - export interface OwnLink extends Interface { - type: "ownLink" - } - - export interface ConnectingConfirmReconnect extends Interface { - type: "connectingConfirmReconnect" - } - - export interface ConnectingProhibit extends Interface { - type: "connectingProhibit" - contact: Contact - } - - export interface Known extends Interface { - type: "known" - contact: Contact - } - - export interface ContactViaAddress extends Interface { - type: "contactViaAddress" - contact: Contact - } -} - -export interface ContactShortLinkData { - profile: Profile - message?: MsgContent - business: boolean - localBadge?: LocalBadge -} - -export enum ContactStatus { - Active = "active", - Deleted = "deleted", - DeletedByUser = "deletedByUser", -} - -export type ContactUserPref = ContactUserPref.Contact | ContactUserPref.User - -export namespace ContactUserPref { - export type Tag = "contact" | "user" - - interface Interface { - type: Tag - } - - export interface Contact extends Interface { - type: "contact" - preference: SimplePreference - } - - export interface User extends Interface { - type: "user" - preference: SimplePreference - } -} - -export interface ContactUserPreference { - enabled: PrefEnabled - userPreference: ContactUserPref - contactPreference: SimplePreference -} - -export interface ContactUserPreferences { - timedMessages: ContactUserPreference - fullDelete: ContactUserPreference - reactions: ContactUserPreference - voice: ContactUserPreference - files: ContactUserPreference - calls: ContactUserPreference - sessions: ContactUserPreference - commands?: ChatBotCommand[] -} - -export interface CreatedConnLink { - connFullLink: string - connShortLink?: string -} - -export namespace CreatedConnLink { - export function cmdString(self: CreatedConnLink): string { - return self.connFullLink + (self.connShortLink ? ' ' + self.connShortLink : '') - } -} - -export interface CryptoFile { - filePath: string - cryptoArgs?: CryptoFileArgs -} - -export interface CryptoFileArgs { - fileKey: string - fileNonce: string -} - -export interface DroppedMsg { - brokerTs: string // ISO-8601 timestamp - attempts: number // int -} - -export interface E2EInfo { - public?: boolean - pqEnabled?: boolean -} - -export type ErrorType = - | ErrorType.BLOCK - | ErrorType.SESSION - | ErrorType.CMD - | ErrorType.PROXY - | ErrorType.AUTH - | ErrorType.BLOCKED - | ErrorType.SERVICE - | ErrorType.CRYPTO - | ErrorType.QUOTA - | ErrorType.STORE - | ErrorType.NO_MSG - | ErrorType.LARGE_MSG - | ErrorType.EXPIRED - | ErrorType.INTERNAL - | ErrorType.NAME - | ErrorType.DUPLICATE_ - -export namespace ErrorType { - export type Tag = - | "BLOCK" - | "SESSION" - | "CMD" - | "PROXY" - | "AUTH" - | "BLOCKED" - | "SERVICE" - | "CRYPTO" - | "QUOTA" - | "STORE" - | "NO_MSG" - | "LARGE_MSG" - | "EXPIRED" - | "INTERNAL" - | "NAME" - | "DUPLICATE_" - - interface Interface { - type: Tag - } - - export interface BLOCK extends Interface { - type: "BLOCK" - } - - export interface SESSION extends Interface { - type: "SESSION" - } - - export interface CMD extends Interface { - type: "CMD" - cmdErr: CommandError - } - - export interface PROXY extends Interface { - type: "PROXY" - proxyErr: ProxyError - } - - export interface AUTH extends Interface { - type: "AUTH" - } - - export interface BLOCKED extends Interface { - type: "BLOCKED" - blockInfo: BlockingInfo - } - - export interface SERVICE extends Interface { - type: "SERVICE" - } - - export interface CRYPTO extends Interface { - type: "CRYPTO" - } - - export interface QUOTA extends Interface { - type: "QUOTA" - } - - export interface STORE extends Interface { - type: "STORE" - storeErr: string - } - - export interface NO_MSG extends Interface { - type: "NO_MSG" - } - - export interface LARGE_MSG extends Interface { - type: "LARGE_MSG" - } - - export interface EXPIRED extends Interface { - type: "EXPIRED" - } - - export interface INTERNAL extends Interface { - type: "INTERNAL" - } - - export interface NAME extends Interface { - type: "NAME" - nameErr: NameErrorType - } - - export interface DUPLICATE_ extends Interface { - type: "DUPLICATE_" - } -} - -export enum FeatureAllowed { - Always = "always", - Yes = "yes", - No = "no", -} - -export interface FileDescr { - fileDescrText: string - fileDescrPartNo: number // int - fileDescrComplete: boolean -} - -export type FileError = - | FileError.Auth - | FileError.Blocked - | FileError.NoFile - | FileError.Relay - | FileError.Other - -export namespace FileError { - export type Tag = "auth" | "blocked" | "noFile" | "relay" | "other" - - interface Interface { - type: Tag - } - - export interface Auth extends Interface { - type: "auth" - } - - export interface Blocked extends Interface { - type: "blocked" - server: string - blockInfo: BlockingInfo - } - - export interface NoFile extends Interface { - type: "noFile" - } - - export interface Relay extends Interface { - type: "relay" - srvError: SrvError - } - - export interface Other extends Interface { - type: "other" - fileError: string - } -} - -export type FileErrorType = - | FileErrorType.NOT_APPROVED - | FileErrorType.SIZE - | FileErrorType.REDIRECT - | FileErrorType.FILE_IO - | FileErrorType.NO_FILE - -export namespace FileErrorType { - export type Tag = "NOT_APPROVED" | "SIZE" | "REDIRECT" | "FILE_IO" | "NO_FILE" - - interface Interface { - type: Tag - } - - export interface NOT_APPROVED extends Interface { - type: "NOT_APPROVED" - } - - export interface SIZE extends Interface { - type: "SIZE" - } - - export interface REDIRECT extends Interface { - type: "REDIRECT" - redirectError: string - } - - export interface FILE_IO extends Interface { - type: "FILE_IO" - fileIOError: string - } - - export interface NO_FILE extends Interface { - type: "NO_FILE" - } -} - -export interface FileInvitation { - fileName: string - fileSize: number // int64 - fileDigest?: string - fileConnReq?: string - fileInline?: InlineFileMode - fileDescr?: FileDescr -} - -export enum FileProtocol { - SMP = "smp", - XFTP = "xftp", - LOCAL = "local", -} - -export enum FileStatus { - New = "new", - Accepted = "accepted", - Connected = "connected", - Complete = "complete", - Cancelled = "cancelled", -} - -export interface FileTransferMeta { - fileId: number // int64 - xftpSndFile?: XFTPSndFile - xftpRedirectFor?: number // int64 - fileName: string - filePath: string - fileSize: number // int64 - fileInline?: InlineFileMode - chunkSize: number // int64 - cancelled: boolean -} - -export enum FileType { - Normal = "normal", - Roster = "roster", -} - -export type Format = - | Format.Bold - | Format.Italic - | Format.StrikeThrough - | Format.Snippet - | Format.Secret - | Format.Small - | Format.Colored - | Format.Uri - | Format.HyperLink - | Format.SimplexLink - | Format.SimplexName - | Format.Command - | Format.Mention - | Format.Email - | Format.Phone - -export namespace Format { - export type Tag = - | "bold" - | "italic" - | "strikeThrough" - | "snippet" - | "secret" - | "small" - | "colored" - | "uri" - | "hyperLink" - | "simplexLink" - | "simplexName" - | "command" - | "mention" - | "email" - | "phone" - - interface Interface { - type: Tag - } - - export interface Bold extends Interface { - type: "bold" - } - - export interface Italic extends Interface { - type: "italic" - } - - export interface StrikeThrough extends Interface { - type: "strikeThrough" - } - - export interface Snippet extends Interface { - type: "snippet" - } - - export interface Secret extends Interface { - type: "secret" - } - - export interface Small extends Interface { - type: "small" - } - - export interface Colored extends Interface { - type: "colored" - color: Color - } - - export interface Uri extends Interface { - type: "uri" - } - - export interface HyperLink extends Interface { - type: "hyperLink" - showText?: string - linkUri: string - } - - export interface SimplexLink extends Interface { - type: "simplexLink" - showText?: string - linkType: SimplexLinkType - simplexUri: string - smpHosts: string[] // non-empty - } - - export interface SimplexName extends Interface { - type: "simplexName" - nameInfo: SimplexNameInfo - } - - export interface Command extends Interface { - type: "command" - commandStr: string - } - - export interface Mention extends Interface { - type: "mention" - memberName: string - } - - export interface Email extends Interface { - type: "email" - } - - export interface Phone extends Interface { - type: "phone" - } -} - -export interface FormattedText { - format?: Format - text: string -} - -export interface FullGroupPreferences { - timedMessages: TimedMessagesGroupPreference - directMessages: RoleGroupPreference - fullDelete: GroupPreference - reactions: GroupPreference - voice: RoleGroupPreference - files: RoleGroupPreference - simplexLinks: RoleGroupPreference - reports: GroupPreference - history: GroupPreference - support: SupportGroupPreference - sessions: RoleGroupPreference - comments: CommentsGroupPreference - signMessages: GroupPreference - commands: ChatBotCommand[] -} - -export interface FullPreferences { - timedMessages: TimedMessagesPreference - fullDelete: SimplePreference - reactions: SimplePreference - voice: SimplePreference - files: SimplePreference - calls: SimplePreference - sessions: SimplePreference - commands: ChatBotCommand[] -} - -export interface Group { - groupInfo: GroupInfo - members: GroupMember[] -} - -export type GroupChatScope = GroupChatScope.MemberSupport - -export namespace GroupChatScope { - export type Tag = "memberSupport" - - interface Interface { - type: Tag - } - - export interface MemberSupport extends Interface { - type: "memberSupport" - groupMemberId_?: number // int64 - } - - export function cmdString(self: GroupChatScope): string { - return '(_support' + (self.groupMemberId_ ? ':' + self.groupMemberId_ : '') + ')' - } -} - -export type GroupChatScopeInfo = GroupChatScopeInfo.MemberSupport - -export namespace GroupChatScopeInfo { - export type Tag = "memberSupport" - - interface Interface { - type: Tag - } - - export interface MemberSupport extends Interface { - type: "memberSupport" - groupMember_?: GroupMember - } -} - -export interface GroupDirectInvitation { - groupDirectInvLink: string - fromGroupId_?: number // int64 - fromGroupMemberId_?: number // int64 - fromGroupMemberConnId_?: number // int64 - groupDirectInvStartedConnection: boolean -} - -export enum GroupFeature { - TimedMessages = "timedMessages", - DirectMessages = "directMessages", - FullDelete = "fullDelete", - Reactions = "reactions", - Voice = "voice", - Files = "files", - SimplexLinks = "simplexLinks", - Reports = "reports", - History = "history", - Support = "support", - Sessions = "sessions", - Comments = "comments", - SignMessages = "signMessages", -} - -export enum GroupFeatureEnabled { - On = "on", - Off = "off", -} - -export interface GroupInfo { - groupId: number // int64 - useRelays: boolean - relayOwnStatus?: RelayStatus - localDisplayName: string - groupProfile: GroupProfile - localAlias: string - businessChat?: BusinessChatInfo - fullGroupPreferences: FullGroupPreferences - membership: GroupMember - chatSettings: ChatSettings - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp - chatTs?: string // ISO-8601 timestamp - userMemberProfileSentAt?: string // ISO-8601 timestamp - preparedGroup?: PreparedGroup - chatTags: number[] // int64 - chatItemTTL?: number // int64 - uiThemes?: UIThemeEntityOverrides - customData?: object - groupSummary: GroupSummary - rosterVersion?: number // int64 - membersRequireAttention: number // int - viaGroupLinkUri?: string - groupKeys?: GroupKeys - groupDomainVerified?: boolean -} - -export interface GroupKeys { - publicGroupKeys?: PublicGroupKeys - memberPrivKey: string -} - -export interface GroupLink { - userContactLinkId: number // int64 - connLinkContact: CreatedConnLink - shortLinkDataSet: boolean - shortLinkLargeDataSet: boolean - groupLinkId: string - acceptMemberRole: GroupMemberRole -} - -export interface GroupLinkOwner { - memberId: string - memberKey: string -} - -export type GroupLinkPlan = - | GroupLinkPlan.Ok - | GroupLinkPlan.OwnLink - | GroupLinkPlan.ConnectingConfirmReconnect - | GroupLinkPlan.ConnectingProhibit - | GroupLinkPlan.Known - | GroupLinkPlan.NoRelays - | GroupLinkPlan.UpdateRequired - -export namespace GroupLinkPlan { - export type Tag = - | "ok" - | "ownLink" - | "connectingConfirmReconnect" - | "connectingProhibit" - | "known" - | "noRelays" - | "updateRequired" - - interface Interface { - type: Tag - } - - export interface Ok extends Interface { - type: "ok" - groupSLinkInfo_?: GroupShortLinkInfo - groupSLinkData_?: GroupShortLinkData - ownerVerification?: OwnerVerification - } - - export interface OwnLink extends Interface { - type: "ownLink" - groupInfo: GroupInfo - } - - export interface ConnectingConfirmReconnect extends Interface { - type: "connectingConfirmReconnect" - } - - export interface ConnectingProhibit extends Interface { - type: "connectingProhibit" - groupInfo_?: GroupInfo - } - - export interface Known extends Interface { - type: "known" - groupInfo: GroupInfo - groupUpdated: boolean - ownerVerification?: OwnerVerification - linkOwners: GroupLinkOwner[] - } - - export interface NoRelays extends Interface { - type: "noRelays" - groupSLinkData_?: GroupShortLinkData - } - - export interface UpdateRequired extends Interface { - type: "updateRequired" - groupSLinkData_?: GroupShortLinkData - } -} - -export interface GroupMember { - groupMemberId: number // int64 - groupId: number // int64 - indexInGroup: number // int64 - memberId: string - memberRole: GroupMemberRole - memberCategory: GroupMemberCategory - memberStatus: GroupMemberStatus - memberSettings: GroupMemberSettings - blockedByAdmin: boolean - invitedBy: InvitedBy - invitedByGroupMemberId?: number // int64 - localDisplayName: string - memberProfile: LocalProfile - memberContactId?: number // int64 - memberContactProfileId: number // int64 - activeConn?: Connection - memberChatVRange: VersionRange - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp - supportChat?: GroupSupportChat - memberPubKey?: string - userMemberKeySent: boolean - relayLink?: string - memberVerifiedCode?: SecurityCode -} - -export interface GroupMemberAdmission { - review?: MemberCriteria -} - -export enum GroupMemberCategory { - User = "user", - Invitee = "invitee", - Host = "host", - Pre = "pre", - Post = "post", -} - -export interface GroupMemberRef { - groupMemberId: number // int64 - profile: Profile -} - -export enum GroupMemberRole { - Relay = "relay", - Observer = "observer", - Author = "author", - Member = "member", - Moderator = "moderator", - Admin = "admin", - Owner = "owner", -} - -export interface GroupMemberSettings { - showMessages: boolean -} - -export enum GroupMemberStatus { - Rejected = "rejected", - Removed = "removed", - Left = "left", - Deleted = "deleted", - Unknown = "unknown", - Invited = "invited", - Pending_approval = "pending_approval", - Pending_review = "pending_review", - Introduced = "introduced", - Intro_inv = "intro-inv", - Accepted = "accepted", - Announced = "announced", - Connected = "connected", - Complete = "complete", - Creator = "creator", -} - -export interface GroupPreference { - enable: GroupFeatureEnabled -} - -export interface GroupPreferences { - timedMessages?: TimedMessagesGroupPreference - directMessages?: RoleGroupPreference - fullDelete?: GroupPreference - reactions?: GroupPreference - voice?: RoleGroupPreference - files?: RoleGroupPreference - simplexLinks?: RoleGroupPreference - reports?: GroupPreference - history?: GroupPreference - support?: SupportGroupPreference - sessions?: RoleGroupPreference - comments?: CommentsGroupPreference - signMessages?: GroupPreference - commands?: ChatBotCommand[] -} - -export interface GroupProfile { - displayName: string - fullName: string - shortDescr?: string - description?: string - image?: string - publicGroup?: PublicGroupProfile - groupPreferences?: GroupPreferences - memberAdmission?: GroupMemberAdmission -} - -export interface GroupRelay { - groupRelayId: number // int64 - groupMemberId: number // int64 - userChatRelay: UserChatRelay - relayStatus: RelayStatus - relayLink?: string - relayCap: RelayCapabilities -} - -export type GroupRootKey = GroupRootKey.Private | GroupRootKey.Public - -export namespace GroupRootKey { - export type Tag = "private" | "public" - - interface Interface { - type: Tag - } - - export interface Private extends Interface { - type: "private" - rootPrivKey: string - } - - export interface Public extends Interface { - type: "public" - rootPubKey: string - } -} - -export interface GroupShortLinkData { - groupProfile: GroupProfile - publicGroupData?: PublicGroupData -} - -export interface GroupShortLinkInfo { - direct: boolean - groupRelays: string[] - publicGroupId?: string -} - -export interface GroupSummary { - currentMembers: number // int64 - publicMemberCount?: number // int64 -} - -export interface GroupSupportChat { - chatTs: string // ISO-8601 timestamp - unread: number // int64 - memberAttention: number // int64 - mentions: number // int64 - lastMsgFromMemberTs?: string // ISO-8601 timestamp -} - -export enum GroupType { - Channel = "channel", - Group = "group", -} - -export enum HandshakeError { - PARSE = "PARSE", - IDENTITY = "IDENTITY", - BAD_AUTH = "BAD_AUTH", - BAD_SERVICE = "BAD_SERVICE", -} - -export enum InlineFileMode { - Offer = "offer", - Sent = "sent", -} - -export type InvitationLinkPlan = - | InvitationLinkPlan.Ok - | InvitationLinkPlan.OwnLink - | InvitationLinkPlan.Connecting - | InvitationLinkPlan.Known - -export namespace InvitationLinkPlan { - export type Tag = "ok" | "ownLink" | "connecting" | "known" - - interface Interface { - type: Tag - } - - export interface Ok extends Interface { - type: "ok" - contactSLinkData_?: ContactShortLinkData - ownerVerification?: OwnerVerification - } - - export interface OwnLink extends Interface { - type: "ownLink" - } - - export interface Connecting extends Interface { - type: "connecting" - contact_?: Contact - } - - export interface Known extends Interface { - type: "known" - contact: Contact - } -} - -export type InvitedBy = InvitedBy.Contact | InvitedBy.User | InvitedBy.Unknown - -export namespace InvitedBy { - export type Tag = "contact" | "user" | "unknown" - - interface Interface { - type: Tag - } - - export interface Contact extends Interface { - type: "contact" - byContactId: number // int64 - } - - export interface User extends Interface { - type: "user" - } - - export interface Unknown extends Interface { - type: "unknown" - } -} - -export type LinkContent = LinkContent.Page | LinkContent.Image | LinkContent.Video | LinkContent.Unknown - -export namespace LinkContent { - export type Tag = "page" | "image" | "video" | "unknown" - - interface Interface { - type: Tag - } - - export interface Page extends Interface { - type: "page" - } - - export interface Image extends Interface { - type: "image" - } - - export interface Video extends Interface { - type: "video" - duration?: number // int - } - - export interface Unknown extends Interface { - type: "unknown" - tag: string - json: object - } -} - -export interface LinkOwnerSig { - ownerId?: string - chatBinding: string - ownerSig: string -} - -export interface LinkPreview { - uri: string - title: string - description: string - image: string - content?: LinkContent -} - -export interface LocalBadge { - badge: BadgeInfo - status: BadgeStatus -} - -export interface LocalProfile { - profileId: number // int64 - displayName: string - fullName: string - shortDescr?: string - description?: string - image?: string - contactLink?: string - preferences?: Preferences - peerType?: ChatPeerType - localBadge?: LocalBadge - localAlias: string - contactDomain?: SimplexDomainClaim - contactDomainVerified?: boolean -} - -export enum MemberCriteria { - All = "all", -} -// Connection link sent in a message - only short links are allowed. - -export type MsgChatLink = MsgChatLink.Contact | MsgChatLink.Invitation | MsgChatLink.Group - -export namespace MsgChatLink { - export type Tag = "contact" | "invitation" | "group" - - interface Interface { - type: Tag - } - - export interface Contact extends Interface { - type: "contact" - connLink: string - profile: Profile - business: boolean - } - - export interface Invitation extends Interface { - type: "invitation" - invLink: string - profile: Profile - } - - export interface Group extends Interface { - type: "group" - connLink: string - groupProfile: GroupProfile - } -} - -export type MsgContent = - | MsgContent.Text - | MsgContent.Link - | MsgContent.Image - | MsgContent.Video - | MsgContent.Voice - | MsgContent.File - | MsgContent.Report - | MsgContent.Chat - | MsgContent.Unknown - -export namespace MsgContent { - export type Tag = "text" | "link" | "image" | "video" | "voice" | "file" | "report" | "chat" | "unknown" - - interface Interface { - type: Tag - } - - export interface Text extends Interface { - type: "text" - text: string - } - - export interface Link extends Interface { - type: "link" - text: string - preview: LinkPreview - } - - export interface Image extends Interface { - type: "image" - text: string - image: string - } - - export interface Video extends Interface { - type: "video" - text: string - image: string - duration: number // int - } - - export interface Voice extends Interface { - type: "voice" - text: string - duration: number // int - } - - export interface File extends Interface { - type: "file" - text: string - } - - export interface Report extends Interface { - type: "report" - text: string - reason: ReportReason - } - - export interface Chat extends Interface { - type: "chat" - text: string - chatLink: MsgChatLink - ownerSig?: LinkOwnerSig - } - - export interface Unknown extends Interface { - type: "unknown" - tag: string - text: string - json: object - } -} - -export enum MsgDecryptError { - RatchetHeader = "ratchetHeader", - TooManySkipped = "tooManySkipped", - RatchetEarlier = "ratchetEarlier", - Other = "other", - RatchetSync = "ratchetSync", -} - -export enum MsgDirection { - Rcv = "rcv", - Snd = "snd", -} - -export type MsgErrorType = - | MsgErrorType.MsgSkipped - | MsgErrorType.MsgBadId - | MsgErrorType.MsgBadHash - | MsgErrorType.MsgDuplicate - -export namespace MsgErrorType { - export type Tag = "msgSkipped" | "msgBadId" | "msgBadHash" | "msgDuplicate" - - interface Interface { - type: Tag - } - - export interface MsgSkipped extends Interface { - type: "msgSkipped" - fromMsgId: number // int64 - toMsgId: number // int64 - } - - export interface MsgBadId extends Interface { - type: "msgBadId" - msgId: number // int64 - } - - export interface MsgBadHash extends Interface { - type: "msgBadHash" - } - - export interface MsgDuplicate extends Interface { - type: "msgDuplicate" - } -} - -export enum MsgFilter { - None = "none", - All = "all", - Mentions = "mentions", -} - -export type MsgReaction = MsgReaction.Emoji | MsgReaction.Unknown - -export namespace MsgReaction { - export type Tag = "emoji" | "unknown" - - interface Interface { - type: Tag - } - - export interface Emoji extends Interface { - type: "emoji" - emoji: string - } - - export interface Unknown extends Interface { - type: "unknown" - tag: string - json: object - } -} - -export enum MsgReceiptStatus { - Ok = "ok", - BadMsgHash = "badMsgHash", -} - -export enum MsgSigStatus { - Verified = "verified", - SignedNoKey = "signedNoKey", -} - -export type MsgVerified = MsgVerified.Signed | MsgVerified.SigMissing - -export namespace MsgVerified { - export type Tag = "signed" | "sigMissing" - - interface Interface { - type: Tag - } - - export interface Signed extends Interface { - type: "signed" - sigStatus: MsgSigStatus - } - - export interface SigMissing extends Interface { - type: "sigMissing" - } -} - -export type NameErrorType = NameErrorType.NO_RESOLVER | NameErrorType.NOT_FOUND | NameErrorType.RESOLVER - -export namespace NameErrorType { - export type Tag = "NO_RESOLVER" | "NOT_FOUND" | "RESOLVER" - - interface Interface { - type: Tag - } - - export interface NO_RESOLVER extends Interface { - type: "NO_RESOLVER" - } - - export interface NOT_FOUND extends Interface { - type: "NOT_FOUND" - } - - export interface RESOLVER extends Interface { - type: "RESOLVER" - resolverErr: string - } -} - -export type NetworkError = - | NetworkError.ConnectError - | NetworkError.TLSError - | NetworkError.UnknownCAError - | NetworkError.FailedError - | NetworkError.TimeoutError - | NetworkError.SubscribeError - -export namespace NetworkError { - export type Tag = - | "connectError" - | "tLSError" - | "unknownCAError" - | "failedError" - | "timeoutError" - | "subscribeError" - - interface Interface { - type: Tag - } - - export interface ConnectError extends Interface { - type: "connectError" - connectError: string - } - - export interface TLSError extends Interface { - type: "tLSError" - tlsError: string - } - - export interface UnknownCAError extends Interface { - type: "unknownCAError" - } - - export interface FailedError extends Interface { - type: "failedError" - } - - export interface TimeoutError extends Interface { - type: "timeoutError" - } - - export interface SubscribeError extends Interface { - type: "subscribeError" - subscribeError: string - } -} - -export interface NewUser { - profile?: Profile - pastTimestamp: boolean - userChatRelay: boolean - clientService: boolean -} - -export interface NoteFolder { - noteFolderId: number // int64 - userId: number // int64 - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp - chatTs: string // ISO-8601 timestamp - favorite: boolean - unread: boolean -} - -export type OwnerVerification = OwnerVerification.Verified | OwnerVerification.Failed - -export namespace OwnerVerification { - export type Tag = "verified" | "failed" - - interface Interface { - type: Tag - } - - export interface Verified extends Interface { - type: "verified" - } - - export interface Failed extends Interface { - type: "failed" - reason: string - } -} - -export type PaginationByTime = PaginationByTime.Last - -export namespace PaginationByTime { - export type Tag = "last" - - interface Interface { - type: Tag - } - - export interface Last extends Interface { - type: "last" - count: number // int - } - - export function cmdString(self: PaginationByTime): string { - return 'count=' + self.count - } -} - -export interface PendingContactConnection { - pccConnId: number // int64 - pccAgentConnId: string - pccConnStatus: ConnStatus - viaContactUri: boolean - viaUserContactLink?: number // int64 - groupLinkId?: string - customUserProfileId?: number // int64 - connLinkInv?: CreatedConnLink - localAlias: string - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp -} - -export enum PlanResolveMode { - AllGroups = "allGroups", - Unknown = "unknown", - Never = "never", -} - -export interface PrefEnabled { - forUser: boolean - forContact: boolean -} - -export interface Preferences { - timedMessages?: TimedMessagesPreference - fullDelete?: SimplePreference - reactions?: SimplePreference - voice?: SimplePreference - files?: SimplePreference - calls?: SimplePreference - sessions?: SimplePreference - commands?: ChatBotCommand[] -} - -export interface PreparedContact { - connLinkToConnect: CreatedConnLink - uiConnLinkType: ConnectionMode - welcomeSharedMsgId?: string - requestSharedMsgId?: string -} - -export interface PreparedGroup { - connLinkToConnect: CreatedConnLink - connLinkPreparedConnection: boolean - connLinkStartedConnection: boolean - welcomeSharedMsgId?: string - requestSharedMsgId?: string -} - -export interface Profile { - displayName: string - fullName: string - shortDescr?: string - description?: string - image?: string - contactLink?: string - preferences?: Preferences - peerType?: ChatPeerType - badge?: BadgeProof - contactDomain?: SimplexDomainClaim -} - -export type ProxyClientError = - | ProxyClientError.ProtocolError - | ProxyClientError.UnexpectedResponse - | ProxyClientError.ResponseError - -export namespace ProxyClientError { - export type Tag = "protocolError" | "unexpectedResponse" | "responseError" - - interface Interface { - type: Tag - } - - export interface ProtocolError extends Interface { - type: "protocolError" - protocolErr: ErrorType - } - - export interface UnexpectedResponse extends Interface { - type: "unexpectedResponse" - responseStr: string - } - - export interface ResponseError extends Interface { - type: "responseError" - responseErr: ErrorType - } -} - -export type ProxyError = ProxyError.PROTOCOL | ProxyError.BROKER | ProxyError.BASIC_AUTH | ProxyError.NO_SESSION - -export namespace ProxyError { - export type Tag = "PROTOCOL" | "BROKER" | "BASIC_AUTH" | "NO_SESSION" - - interface Interface { - type: Tag - } - - export interface PROTOCOL extends Interface { - type: "PROTOCOL" - protocolErr: ErrorType - } - - export interface BROKER extends Interface { - type: "BROKER" - brokerErr: BrokerErrorType - } - - export interface BASIC_AUTH extends Interface { - type: "BASIC_AUTH" - } - - export interface NO_SESSION extends Interface { - type: "NO_SESSION" - } -} - -export interface PublicGroupAccess { - groupWebPage?: string - groupDomainClaim?: SimplexDomainClaim - domainWebPage: boolean - allowEmbedding: boolean -} - -export interface PublicGroupData { - publicMemberCount: number // int64 -} - -export interface PublicGroupKeys { - publicGroupId: string - groupRootKey: GroupRootKey -} - -export interface PublicGroupProfile { - groupType: GroupType - groupLink: string - publicGroupId: string - publicGroupAccess?: PublicGroupAccess -} - -export type RCErrorType = - | RCErrorType.Internal - | RCErrorType.Identity - | RCErrorType.NoLocalAddress - | RCErrorType.NewController - | RCErrorType.NotDiscovered - | RCErrorType.TLSStartFailed - | RCErrorType.Exception - | RCErrorType.CtrlAuth - | RCErrorType.CtrlNotFound - | RCErrorType.CtrlError - | RCErrorType.Invitation - | RCErrorType.Version - | RCErrorType.Encrypt - | RCErrorType.Decrypt - | RCErrorType.BlockSize - | RCErrorType.Syntax - -export namespace RCErrorType { - export type Tag = - | "internal" - | "identity" - | "noLocalAddress" - | "newController" - | "notDiscovered" - | "tLSStartFailed" - | "exception" - | "ctrlAuth" - | "ctrlNotFound" - | "ctrlError" - | "invitation" - | "version" - | "encrypt" - | "decrypt" - | "blockSize" - | "syntax" - - interface Interface { - type: Tag - } - - export interface Internal extends Interface { - type: "internal" - internalErr: string - } - - export interface Identity extends Interface { - type: "identity" - } - - export interface NoLocalAddress extends Interface { - type: "noLocalAddress" - } - - export interface NewController extends Interface { - type: "newController" - } - - export interface NotDiscovered extends Interface { - type: "notDiscovered" - } - - export interface TLSStartFailed extends Interface { - type: "tLSStartFailed" - } - - export interface Exception extends Interface { - type: "exception" - exception: string - } - - export interface CtrlAuth extends Interface { - type: "ctrlAuth" - } - - export interface CtrlNotFound extends Interface { - type: "ctrlNotFound" - } - - export interface CtrlError extends Interface { - type: "ctrlError" - ctrlErr: string - } - - export interface Invitation extends Interface { - type: "invitation" - } - - export interface Version extends Interface { - type: "version" - } - - export interface Encrypt extends Interface { - type: "encrypt" - } - - export interface Decrypt extends Interface { - type: "decrypt" - } - - export interface BlockSize extends Interface { - type: "blockSize" - } - - export interface Syntax extends Interface { - type: "syntax" - syntaxErr: string - } -} - -export enum RatchetSyncState { - Ok = "ok", - Allowed = "allowed", - Required = "required", - Started = "started", - Agreed = "agreed", -} - -export type RcvConnEvent = - | RcvConnEvent.SwitchQueue - | RcvConnEvent.RatchetSync - | RcvConnEvent.VerificationCodeReset - | RcvConnEvent.PqEnabled - -export namespace RcvConnEvent { - export type Tag = "switchQueue" | "ratchetSync" | "verificationCodeReset" | "pqEnabled" - - interface Interface { - type: Tag - } - - export interface SwitchQueue extends Interface { - type: "switchQueue" - phase: SwitchPhase - } - - export interface RatchetSync extends Interface { - type: "ratchetSync" - syncStatus: RatchetSyncState - } - - export interface VerificationCodeReset extends Interface { - type: "verificationCodeReset" - } - - export interface PqEnabled extends Interface { - type: "pqEnabled" - enabled: boolean - } -} - -export type RcvDirectEvent = - | RcvDirectEvent.ContactDeleted - | RcvDirectEvent.ProfileUpdated - | RcvDirectEvent.GroupInvLinkReceived - -export namespace RcvDirectEvent { - export type Tag = "contactDeleted" | "profileUpdated" | "groupInvLinkReceived" - - interface Interface { - type: Tag - } - - export interface ContactDeleted extends Interface { - type: "contactDeleted" - } - - export interface ProfileUpdated extends Interface { - type: "profileUpdated" - fromProfile: Profile - toProfile: Profile - } - - export interface GroupInvLinkReceived extends Interface { - type: "groupInvLinkReceived" - groupProfile: GroupProfile - } -} - -export interface RcvFileDescr { - fileDescrId: number // int64 - fileDescrText: string - fileDescrPartNo: number // int - fileDescrComplete: boolean -} - -export type RcvFileStatus = - | RcvFileStatus.New - | RcvFileStatus.Accepted - | RcvFileStatus.Connected - | RcvFileStatus.Complete - | RcvFileStatus.Cancelled - -export namespace RcvFileStatus { - export type Tag = "new" | "accepted" | "connected" | "complete" | "cancelled" - - interface Interface { - type: Tag - } - - export interface New extends Interface { - type: "new" - } - - export interface Accepted extends Interface { - type: "accepted" - filePath: string - } - - export interface Connected extends Interface { - type: "connected" - filePath: string - } - - export interface Complete extends Interface { - type: "complete" - filePath: string - } - - export interface Cancelled extends Interface { - type: "cancelled" - filePath_?: string - } -} - -export interface RcvFileTransfer { - fileId: number // int64 - xftpRcvFile?: XFTPRcvFile - fileInvitation: FileInvitation - fileStatus: RcvFileStatus - fileType: FileType - rcvFileInline?: InlineFileMode - senderDisplayName: string - chunkSize: number // int64 - cancelled: boolean - grpMemberId?: number // int64 - cryptoArgs?: CryptoFileArgs -} - -export type RcvGroupEvent = - | RcvGroupEvent.MemberAdded - | RcvGroupEvent.MemberConnected - | RcvGroupEvent.MemberAccepted - | RcvGroupEvent.UserAccepted - | RcvGroupEvent.MemberLeft - | RcvGroupEvent.MemberRole - | RcvGroupEvent.MemberBlocked - | RcvGroupEvent.UserRole - | RcvGroupEvent.MemberDeleted - | RcvGroupEvent.UserDeleted - | RcvGroupEvent.GroupDeleted - | RcvGroupEvent.GroupUpdated - | RcvGroupEvent.InvitedViaGroupLink - | RcvGroupEvent.MemberCreatedContact - | RcvGroupEvent.MemberProfileUpdated - | RcvGroupEvent.NewMemberPendingReview - | RcvGroupEvent.MsgBadSignature - -export namespace RcvGroupEvent { - export type Tag = - | "memberAdded" - | "memberConnected" - | "memberAccepted" - | "userAccepted" - | "memberLeft" - | "memberRole" - | "memberBlocked" - | "userRole" - | "memberDeleted" - | "userDeleted" - | "groupDeleted" - | "groupUpdated" - | "invitedViaGroupLink" - | "memberCreatedContact" - | "memberProfileUpdated" - | "newMemberPendingReview" - | "msgBadSignature" - - interface Interface { - type: Tag - } - - export interface MemberAdded extends Interface { - type: "memberAdded" - groupMemberId: number // int64 - profile: Profile - } - - export interface MemberConnected extends Interface { - type: "memberConnected" - } - - export interface MemberAccepted extends Interface { - type: "memberAccepted" - groupMemberId: number // int64 - profile: Profile - } - - export interface UserAccepted extends Interface { - type: "userAccepted" - } - - export interface MemberLeft extends Interface { - type: "memberLeft" - } - - export interface MemberRole extends Interface { - type: "memberRole" - groupMemberId: number // int64 - profile: Profile - role: GroupMemberRole - } - - export interface MemberBlocked extends Interface { - type: "memberBlocked" - groupMemberId: number // int64 - profile: Profile - blocked: boolean - } - - export interface UserRole extends Interface { - type: "userRole" - role: GroupMemberRole - } - - export interface MemberDeleted extends Interface { - type: "memberDeleted" - groupMemberId: number // int64 - profile: Profile - } - - export interface UserDeleted extends Interface { - type: "userDeleted" - } - - export interface GroupDeleted extends Interface { - type: "groupDeleted" - } - - export interface GroupUpdated extends Interface { - type: "groupUpdated" - groupProfile: GroupProfile - } - - export interface InvitedViaGroupLink extends Interface { - type: "invitedViaGroupLink" - } - - export interface MemberCreatedContact extends Interface { - type: "memberCreatedContact" - } - - export interface MemberProfileUpdated extends Interface { - type: "memberProfileUpdated" - fromProfile: Profile - toProfile: Profile - } - - export interface NewMemberPendingReview extends Interface { - type: "newMemberPendingReview" - } - - export interface MsgBadSignature extends Interface { - type: "msgBadSignature" - } -} - -export type RcvMsgError = RcvMsgError.Dropped | RcvMsgError.ParseError - -export namespace RcvMsgError { - export type Tag = "dropped" | "parseError" - - interface Interface { - type: Tag - } - - export interface Dropped extends Interface { - type: "dropped" - attempts: number // int - } - - export interface ParseError extends Interface { - type: "parseError" - parseError: string - } -} - -export interface RelayCapabilities { - webDomain?: string -} - -export interface RelayProfile { - displayName: string - fullName: string - shortDescr?: string - image?: string -} - -export enum RelayStatus { - New = "new", - Invited = "invited", - Accepted = "accepted", - AcknowledgedRoster = "acknowledgedRoster", - Active = "active", - Inactive = "inactive", - Rejected = "rejected", -} - -export enum ReportReason { - Spam = "spam", - Content = "content", - Community = "community", - Profile = "profile", - Other = "other", -} - -export interface RoleGroupPreference { - enable: GroupFeatureEnabled - role?: GroupMemberRole -} - -export type SMPAgentError = - | SMPAgentError.A_MESSAGE - | SMPAgentError.A_PROHIBITED - | SMPAgentError.A_VERSION - | SMPAgentError.A_LINK - | SMPAgentError.A_CRYPTO - | SMPAgentError.A_DUPLICATE - | SMPAgentError.A_QUEUE - -export namespace SMPAgentError { - export type Tag = - | "A_MESSAGE" - | "A_PROHIBITED" - | "A_VERSION" - | "A_LINK" - | "A_CRYPTO" - | "A_DUPLICATE" - | "A_QUEUE" - - interface Interface { - type: Tag - } - - export interface A_MESSAGE extends Interface { - type: "A_MESSAGE" - } - - export interface A_PROHIBITED extends Interface { - type: "A_PROHIBITED" - prohibitedErr: string - } - - export interface A_VERSION extends Interface { - type: "A_VERSION" - } - - export interface A_LINK extends Interface { - type: "A_LINK" - linkErr: string - } - - export interface A_CRYPTO extends Interface { - type: "A_CRYPTO" - cryptoErr: AgentCryptoError - } - - export interface A_DUPLICATE extends Interface { - type: "A_DUPLICATE" - droppedMsg_?: DroppedMsg - } - - export interface A_QUEUE extends Interface { - type: "A_QUEUE" - queueErr: string - } -} - -export interface SecurityCode { - securityCode: string - verifiedAt: string // ISO-8601 timestamp -} - -export interface SimplePreference { - allow: FeatureAllowed -} - -export interface SimplexDomain { - nameTLD: SimplexTLD - domain: string - subDomain: string[] -} - -export interface SimplexDomainClaim { - domain: string - proof?: SimplexDomainProof -} - -export type SimplexDomainError = SimplexDomainError.NoValidLink | SimplexDomainError.UnknownDomain - -export namespace SimplexDomainError { - export type Tag = "noValidLink" | "unknownDomain" - - interface Interface { - type: Tag - } - - export interface NoValidLink extends Interface { - type: "noValidLink" - } - - export interface UnknownDomain extends Interface { - type: "unknownDomain" - } -} - -export interface SimplexDomainProof { - linkOwnerId?: string - presHeader: string - signature: string -} - -export enum SimplexLinkType { - Contact = "contact", - Invitation = "invitation", - Group = "group", - Channel = "channel", - Relay = "relay", -} - -export interface SimplexNameInfo { - nameType: SimplexNameType - nameDomain: SimplexDomain -} - -export enum SimplexNameType { - PublicGroup = "publicGroup", - Contact = "contact", -} - -export enum SimplexTLD { - Simplex = "simplex", - Testing = "testing", - Web = "web", -} - -export enum SndCIStatusProgress { - Partial = "partial", - Complete = "complete", -} - -export type SndConnEvent = SndConnEvent.SwitchQueue | SndConnEvent.RatchetSync | SndConnEvent.PqEnabled - -export namespace SndConnEvent { - export type Tag = "switchQueue" | "ratchetSync" | "pqEnabled" - - interface Interface { - type: Tag - } - - export interface SwitchQueue extends Interface { - type: "switchQueue" - phase: SwitchPhase - member?: GroupMemberRef - } - - export interface RatchetSync extends Interface { - type: "ratchetSync" - syncStatus: RatchetSyncState - member?: GroupMemberRef - } - - export interface PqEnabled extends Interface { - type: "pqEnabled" - enabled: boolean - } -} - -export type SndError = - | SndError.Auth - | SndError.Quota - | SndError.Expired - | SndError.Relay - | SndError.Proxy - | SndError.ProxyRelay - | SndError.Other - -export namespace SndError { - export type Tag = "auth" | "quota" | "expired" | "relay" | "proxy" | "proxyRelay" | "other" - - interface Interface { - type: Tag - } - - export interface Auth extends Interface { - type: "auth" - } - - export interface Quota extends Interface { - type: "quota" - } - - export interface Expired extends Interface { - type: "expired" - } - - export interface Relay extends Interface { - type: "relay" - srvError: SrvError - } - - export interface Proxy extends Interface { - type: "proxy" - proxyServer: string - srvError: SrvError - } - - export interface ProxyRelay extends Interface { - type: "proxyRelay" - proxyServer: string - srvError: SrvError - } - - export interface Other extends Interface { - type: "other" - sndError: string - } -} - -export interface SndFileTransfer { - fileId: number // int64 - fileName: string - filePath: string - fileSize: number // int64 - chunkSize: number // int64 - recipientDisplayName: string - connId: number // int64 - agentConnId: string - groupMemberId?: number // int64 - fileStatus: FileStatus - fileDescrId?: number // int64 - fileInline?: InlineFileMode -} - -export type SndGroupEvent = - | SndGroupEvent.MemberRole - | SndGroupEvent.MemberBlocked - | SndGroupEvent.UserRole - | SndGroupEvent.MemberDeleted - | SndGroupEvent.UserLeft - | SndGroupEvent.GroupUpdated - | SndGroupEvent.MemberAccepted - | SndGroupEvent.UserPendingReview - -export namespace SndGroupEvent { - export type Tag = - | "memberRole" - | "memberBlocked" - | "userRole" - | "memberDeleted" - | "userLeft" - | "groupUpdated" - | "memberAccepted" - | "userPendingReview" - - interface Interface { - type: Tag - } - - export interface MemberRole extends Interface { - type: "memberRole" - groupMemberId: number // int64 - profile: Profile - role: GroupMemberRole - } - - export interface MemberBlocked extends Interface { - type: "memberBlocked" - groupMemberId: number // int64 - profile: Profile - blocked: boolean - } - - export interface UserRole extends Interface { - type: "userRole" - role: GroupMemberRole - } - - export interface MemberDeleted extends Interface { - type: "memberDeleted" - groupMemberId: number // int64 - profile: Profile - } - - export interface UserLeft extends Interface { - type: "userLeft" - } - - export interface GroupUpdated extends Interface { - type: "groupUpdated" - groupProfile: GroupProfile - } - - export interface MemberAccepted extends Interface { - type: "memberAccepted" - groupMemberId: number // int64 - profile: Profile - } - - export interface UserPendingReview extends Interface { - type: "userPendingReview" - } -} - -export type SrvError = SrvError.Host | SrvError.Version | SrvError.Other - -export namespace SrvError { - export type Tag = "host" | "version" | "other" - - interface Interface { - type: Tag - } - - export interface Host extends Interface { - type: "host" - } - - export interface Version extends Interface { - type: "version" - } - - export interface Other extends Interface { - type: "other" - srvError: string - } -} - -export type StoreError = - | StoreError.DuplicateName - | StoreError.UserNotFound - | StoreError.RelayUserNotFound - | StoreError.UserNotFoundByName - | StoreError.UserNotFoundByContactId - | StoreError.UserNotFoundByGroupId - | StoreError.UserNotFoundByFileId - | StoreError.UserNotFoundByContactRequestId - | StoreError.ContactNotFound - | StoreError.ContactNotFoundByName - | StoreError.ContactNotFoundByMemberId - | StoreError.ContactNotReady - | StoreError.DuplicateContactLink - | StoreError.UserContactLinkNotFound - | StoreError.ContactRequestNotFound - | StoreError.ContactRequestNotFoundByName - | StoreError.InvalidContactRequestEntity - | StoreError.InvalidBusinessChatContactRequest - | StoreError.GroupNotFound - | StoreError.GroupNotFoundByName - | StoreError.GroupMemberNameNotFound - | StoreError.GroupMemberNotFound - | StoreError.GroupMemberNotFoundByIndex - | StoreError.MemberRelationsVectorNotFound - | StoreError.GroupHostMemberNotFound - | StoreError.GroupMemberNotFoundByMemberId - | StoreError.MemberContactGroupMemberNotFound - | StoreError.InvalidMemberRelationUpdate - | StoreError.GroupWithoutUser - | StoreError.DuplicateGroupMember - | StoreError.DuplicateMemberId - | StoreError.GroupAlreadyJoined - | StoreError.GroupInvitationNotFound - | StoreError.NoteFolderAlreadyExists - | StoreError.NoteFolderNotFound - | StoreError.UserNoteFolderNotFound - | StoreError.SndFileNotFound - | StoreError.SndFileInvalid - | StoreError.RcvFileNotFound - | StoreError.RcvFileDescrNotFound - | StoreError.FileNotFound - | StoreError.RcvFileInvalid - | StoreError.RcvFileInvalidDescrPart - | StoreError.LocalFileNoTransfer - | StoreError.SharedMsgIdNotFoundByFileId - | StoreError.FileIdNotFoundBySharedMsgId - | StoreError.SndFileNotFoundXFTP - | StoreError.RcvFileNotFoundXFTP - | StoreError.ConnectionNotFound - | StoreError.ConnectionNotFoundById - | StoreError.ConnectionNotFoundByMemberId - | StoreError.PendingConnectionNotFound - | StoreError.UniqueID - | StoreError.LargeMsg - | StoreError.InternalError - | StoreError.DBException - | StoreError.DBBusyError - | StoreError.BadChatItem - | StoreError.ChatItemNotFound - | StoreError.ChatItemNotFoundByText - | StoreError.ChatItemSharedMsgIdNotFound - | StoreError.ChatItemNotFoundByFileId - | StoreError.ChatItemNotFoundByContactId - | StoreError.ChatItemNotFoundByGroupId - | StoreError.ProfileNotFound - | StoreError.DuplicateGroupLink - | StoreError.GroupLinkNotFound - | StoreError.HostMemberIdNotFound - | StoreError.ContactNotFoundByFileId - | StoreError.NoGroupSndStatus - | StoreError.DuplicateGroupMessage - | StoreError.RemoteHostNotFound - | StoreError.RemoteHostUnknown - | StoreError.RemoteHostDuplicateCA - | StoreError.RemoteCtrlNotFound - | StoreError.RemoteCtrlDuplicateCA - | StoreError.ProhibitedDeleteUser - | StoreError.OperatorNotFound - | StoreError.UsageConditionsNotFound - | StoreError.UserChatRelayNotFound - | StoreError.GroupRelayNotFound - | StoreError.GroupRelayNotFoundByMemberId - | StoreError.InvalidQuote - | StoreError.InvalidMention - | StoreError.InvalidDeliveryTask - | StoreError.DeliveryTaskNotFound - | StoreError.InvalidDeliveryJob - | StoreError.DeliveryJobNotFound - | StoreError.WorkItemError - -export namespace StoreError { - export type Tag = - | "duplicateName" - | "userNotFound" - | "relayUserNotFound" - | "userNotFoundByName" - | "userNotFoundByContactId" - | "userNotFoundByGroupId" - | "userNotFoundByFileId" - | "userNotFoundByContactRequestId" - | "contactNotFound" - | "contactNotFoundByName" - | "contactNotFoundByMemberId" - | "contactNotReady" - | "duplicateContactLink" - | "userContactLinkNotFound" - | "contactRequestNotFound" - | "contactRequestNotFoundByName" - | "invalidContactRequestEntity" - | "invalidBusinessChatContactRequest" - | "groupNotFound" - | "groupNotFoundByName" - | "groupMemberNameNotFound" - | "groupMemberNotFound" - | "groupMemberNotFoundByIndex" - | "memberRelationsVectorNotFound" - | "groupHostMemberNotFound" - | "groupMemberNotFoundByMemberId" - | "memberContactGroupMemberNotFound" - | "invalidMemberRelationUpdate" - | "groupWithoutUser" - | "duplicateGroupMember" - | "duplicateMemberId" - | "groupAlreadyJoined" - | "groupInvitationNotFound" - | "noteFolderAlreadyExists" - | "noteFolderNotFound" - | "userNoteFolderNotFound" - | "sndFileNotFound" - | "sndFileInvalid" - | "rcvFileNotFound" - | "rcvFileDescrNotFound" - | "fileNotFound" - | "rcvFileInvalid" - | "rcvFileInvalidDescrPart" - | "localFileNoTransfer" - | "sharedMsgIdNotFoundByFileId" - | "fileIdNotFoundBySharedMsgId" - | "sndFileNotFoundXFTP" - | "rcvFileNotFoundXFTP" - | "connectionNotFound" - | "connectionNotFoundById" - | "connectionNotFoundByMemberId" - | "pendingConnectionNotFound" - | "uniqueID" - | "largeMsg" - | "internalError" - | "dBException" - | "dBBusyError" - | "badChatItem" - | "chatItemNotFound" - | "chatItemNotFoundByText" - | "chatItemSharedMsgIdNotFound" - | "chatItemNotFoundByFileId" - | "chatItemNotFoundByContactId" - | "chatItemNotFoundByGroupId" - | "profileNotFound" - | "duplicateGroupLink" - | "groupLinkNotFound" - | "hostMemberIdNotFound" - | "contactNotFoundByFileId" - | "noGroupSndStatus" - | "duplicateGroupMessage" - | "remoteHostNotFound" - | "remoteHostUnknown" - | "remoteHostDuplicateCA" - | "remoteCtrlNotFound" - | "remoteCtrlDuplicateCA" - | "prohibitedDeleteUser" - | "operatorNotFound" - | "usageConditionsNotFound" - | "userChatRelayNotFound" - | "groupRelayNotFound" - | "groupRelayNotFoundByMemberId" - | "invalidQuote" - | "invalidMention" - | "invalidDeliveryTask" - | "deliveryTaskNotFound" - | "invalidDeliveryJob" - | "deliveryJobNotFound" - | "workItemError" - - interface Interface { - type: Tag - } - - export interface DuplicateName extends Interface { - type: "duplicateName" - } - - export interface UserNotFound extends Interface { - type: "userNotFound" - userId: number // int64 - } - - export interface RelayUserNotFound extends Interface { - type: "relayUserNotFound" - } - - export interface UserNotFoundByName extends Interface { - type: "userNotFoundByName" - contactName: string - } - - export interface UserNotFoundByContactId extends Interface { - type: "userNotFoundByContactId" - contactId: number // int64 - } - - export interface UserNotFoundByGroupId extends Interface { - type: "userNotFoundByGroupId" - groupId: number // int64 - } - - export interface UserNotFoundByFileId extends Interface { - type: "userNotFoundByFileId" - fileId: number // int64 - } - - export interface UserNotFoundByContactRequestId extends Interface { - type: "userNotFoundByContactRequestId" - contactRequestId: number // int64 - } - - export interface ContactNotFound extends Interface { - type: "contactNotFound" - contactId: number // int64 - } - - export interface ContactNotFoundByName extends Interface { - type: "contactNotFoundByName" - contactName: string - } - - export interface ContactNotFoundByMemberId extends Interface { - type: "contactNotFoundByMemberId" - groupMemberId: number // int64 - } - - export interface ContactNotReady extends Interface { - type: "contactNotReady" - contactName: string - } - - export interface DuplicateContactLink extends Interface { - type: "duplicateContactLink" - } - - export interface UserContactLinkNotFound extends Interface { - type: "userContactLinkNotFound" - } - - export interface ContactRequestNotFound extends Interface { - type: "contactRequestNotFound" - contactRequestId: number // int64 - } - - export interface ContactRequestNotFoundByName extends Interface { - type: "contactRequestNotFoundByName" - contactName: string - } - - export interface InvalidContactRequestEntity extends Interface { - type: "invalidContactRequestEntity" - contactRequestId: number // int64 - } - - export interface InvalidBusinessChatContactRequest extends Interface { - type: "invalidBusinessChatContactRequest" - } - - export interface GroupNotFound extends Interface { - type: "groupNotFound" - groupId: number // int64 - } - - export interface GroupNotFoundByName extends Interface { - type: "groupNotFoundByName" - groupName: string - } - - export interface GroupMemberNameNotFound extends Interface { - type: "groupMemberNameNotFound" - groupId: number // int64 - groupMemberName: string - } - - export interface GroupMemberNotFound extends Interface { - type: "groupMemberNotFound" - groupMemberId: number // int64 - } - - export interface GroupMemberNotFoundByIndex extends Interface { - type: "groupMemberNotFoundByIndex" - groupMemberIndex: number // int64 - } - - export interface MemberRelationsVectorNotFound extends Interface { - type: "memberRelationsVectorNotFound" - groupMemberId: number // int64 - } - - export interface GroupHostMemberNotFound extends Interface { - type: "groupHostMemberNotFound" - groupId: number // int64 - } - - export interface GroupMemberNotFoundByMemberId extends Interface { - type: "groupMemberNotFoundByMemberId" - memberId: string - } - - export interface MemberContactGroupMemberNotFound extends Interface { - type: "memberContactGroupMemberNotFound" - contactId: number // int64 - } - - export interface InvalidMemberRelationUpdate extends Interface { - type: "invalidMemberRelationUpdate" - } - - export interface GroupWithoutUser extends Interface { - type: "groupWithoutUser" - } - - export interface DuplicateGroupMember extends Interface { - type: "duplicateGroupMember" - } - - export interface DuplicateMemberId extends Interface { - type: "duplicateMemberId" - } - - export interface GroupAlreadyJoined extends Interface { - type: "groupAlreadyJoined" - } - - export interface GroupInvitationNotFound extends Interface { - type: "groupInvitationNotFound" - } - - export interface NoteFolderAlreadyExists extends Interface { - type: "noteFolderAlreadyExists" - noteFolderId: number // int64 - } - - export interface NoteFolderNotFound extends Interface { - type: "noteFolderNotFound" - noteFolderId: number // int64 - } - - export interface UserNoteFolderNotFound extends Interface { - type: "userNoteFolderNotFound" - } - - export interface SndFileNotFound extends Interface { - type: "sndFileNotFound" - fileId: number // int64 - } - - export interface SndFileInvalid extends Interface { - type: "sndFileInvalid" - fileId: number // int64 - } - - export interface RcvFileNotFound extends Interface { - type: "rcvFileNotFound" - fileId: number // int64 - } - - export interface RcvFileDescrNotFound extends Interface { - type: "rcvFileDescrNotFound" - fileId: number // int64 - } - - export interface FileNotFound extends Interface { - type: "fileNotFound" - fileId: number // int64 - } - - export interface RcvFileInvalid extends Interface { - type: "rcvFileInvalid" - fileId: number // int64 - } - - export interface RcvFileInvalidDescrPart extends Interface { - type: "rcvFileInvalidDescrPart" - } - - export interface LocalFileNoTransfer extends Interface { - type: "localFileNoTransfer" - fileId: number // int64 - } - - export interface SharedMsgIdNotFoundByFileId extends Interface { - type: "sharedMsgIdNotFoundByFileId" - fileId: number // int64 - } - - export interface FileIdNotFoundBySharedMsgId extends Interface { - type: "fileIdNotFoundBySharedMsgId" - sharedMsgId: string - } - - export interface SndFileNotFoundXFTP extends Interface { - type: "sndFileNotFoundXFTP" - agentSndFileId: string - } - - export interface RcvFileNotFoundXFTP extends Interface { - type: "rcvFileNotFoundXFTP" - agentRcvFileId: string - } - - export interface ConnectionNotFound extends Interface { - type: "connectionNotFound" - agentConnId: string - } - - export interface ConnectionNotFoundById extends Interface { - type: "connectionNotFoundById" - connId: number // int64 - } - - export interface ConnectionNotFoundByMemberId extends Interface { - type: "connectionNotFoundByMemberId" - groupMemberId: number // int64 - } - - export interface PendingConnectionNotFound extends Interface { - type: "pendingConnectionNotFound" - connId: number // int64 - } - - export interface UniqueID extends Interface { - type: "uniqueID" - } - - export interface LargeMsg extends Interface { - type: "largeMsg" - } - - export interface InternalError extends Interface { - type: "internalError" - message: string - } - - export interface DBException extends Interface { - type: "dBException" - message: string - } - - export interface DBBusyError extends Interface { - type: "dBBusyError" - message: string - } - - export interface BadChatItem extends Interface { - type: "badChatItem" - itemId: number // int64 - itemTs?: string // ISO-8601 timestamp - } - - export interface ChatItemNotFound extends Interface { - type: "chatItemNotFound" - itemId: number // int64 - } - - export interface ChatItemNotFoundByText extends Interface { - type: "chatItemNotFoundByText" - text: string - } - - export interface ChatItemSharedMsgIdNotFound extends Interface { - type: "chatItemSharedMsgIdNotFound" - sharedMsgId: string - } - - export interface ChatItemNotFoundByFileId extends Interface { - type: "chatItemNotFoundByFileId" - fileId: number // int64 - } - - export interface ChatItemNotFoundByContactId extends Interface { - type: "chatItemNotFoundByContactId" - contactId: number // int64 - } - - export interface ChatItemNotFoundByGroupId extends Interface { - type: "chatItemNotFoundByGroupId" - groupId: number // int64 - } - - export interface ProfileNotFound extends Interface { - type: "profileNotFound" - profileId: number // int64 - } - - export interface DuplicateGroupLink extends Interface { - type: "duplicateGroupLink" - groupInfo: GroupInfo - } - - export interface GroupLinkNotFound extends Interface { - type: "groupLinkNotFound" - groupInfo: GroupInfo - } - - export interface HostMemberIdNotFound extends Interface { - type: "hostMemberIdNotFound" - groupId: number // int64 - } - - export interface ContactNotFoundByFileId extends Interface { - type: "contactNotFoundByFileId" - fileId: number // int64 - } - - export interface NoGroupSndStatus extends Interface { - type: "noGroupSndStatus" - itemId: number // int64 - groupMemberId: number // int64 - } - - export interface DuplicateGroupMessage extends Interface { - type: "duplicateGroupMessage" - groupId: number // int64 - sharedMsgId: string - authorGroupMemberId?: number // int64 - forwardedByGroupMemberId?: number // int64 - } - - export interface RemoteHostNotFound extends Interface { - type: "remoteHostNotFound" - remoteHostId: number // int64 - } - - export interface RemoteHostUnknown extends Interface { - type: "remoteHostUnknown" - } - - export interface RemoteHostDuplicateCA extends Interface { - type: "remoteHostDuplicateCA" - } - - export interface RemoteCtrlNotFound extends Interface { - type: "remoteCtrlNotFound" - remoteCtrlId: number // int64 - } - - export interface RemoteCtrlDuplicateCA extends Interface { - type: "remoteCtrlDuplicateCA" - } - - export interface ProhibitedDeleteUser extends Interface { - type: "prohibitedDeleteUser" - userId: number // int64 - contactId: number // int64 - } - - export interface OperatorNotFound extends Interface { - type: "operatorNotFound" - serverOperatorId: number // int64 - } - - export interface UsageConditionsNotFound extends Interface { - type: "usageConditionsNotFound" - } - - export interface UserChatRelayNotFound extends Interface { - type: "userChatRelayNotFound" - chatRelayId: number // int64 - } - - export interface GroupRelayNotFound extends Interface { - type: "groupRelayNotFound" - groupRelayId: number // int64 - } - - export interface GroupRelayNotFoundByMemberId extends Interface { - type: "groupRelayNotFoundByMemberId" - groupMemberId: number // int64 - } - - export interface InvalidQuote extends Interface { - type: "invalidQuote" - } - - export interface InvalidMention extends Interface { - type: "invalidMention" - } - - export interface InvalidDeliveryTask extends Interface { - type: "invalidDeliveryTask" - taskId: number // int64 - } - - export interface DeliveryTaskNotFound extends Interface { - type: "deliveryTaskNotFound" - taskId: number // int64 - } - - export interface InvalidDeliveryJob extends Interface { - type: "invalidDeliveryJob" - jobId: number // int64 - } - - export interface DeliveryJobNotFound extends Interface { - type: "deliveryJobNotFound" - jobId: number // int64 - } - - export interface WorkItemError extends Interface { - type: "workItemError" - errContext: string - } -} - -export type SubscriptionStatus = - | SubscriptionStatus.Active - | SubscriptionStatus.Pending - | SubscriptionStatus.Removed - | SubscriptionStatus.NoSub - -export namespace SubscriptionStatus { - export type Tag = "active" | "pending" | "removed" | "noSub" - - interface Interface { - type: Tag - } - - export interface Active extends Interface { - type: "active" - } - - export interface Pending extends Interface { - type: "pending" - } - - export interface Removed extends Interface { - type: "removed" - subError: string - } - - export interface NoSub extends Interface { - type: "noSub" - } -} - -export interface SupportGroupPreference { - enable: GroupFeatureEnabled -} - -export enum SwitchPhase { - Started = "started", - Confirmed = "confirmed", - Secured = "secured", - Completed = "completed", -} - -export interface TimedMessagesGroupPreference { - enable: GroupFeatureEnabled - ttl?: number // int -} - -export interface TimedMessagesPreference { - allow: FeatureAllowed - ttl?: number // int -} - -export type TransportError = - | TransportError.BadBlock - | TransportError.Version - | TransportError.LargeMsg - | TransportError.BadSession - | TransportError.NoServerAuth - | TransportError.Handshake - -export namespace TransportError { - export type Tag = "badBlock" | "version" | "largeMsg" | "badSession" | "noServerAuth" | "handshake" - - interface Interface { - type: Tag - } - - export interface BadBlock extends Interface { - type: "badBlock" - } - - export interface Version extends Interface { - type: "version" - } - - export interface LargeMsg extends Interface { - type: "largeMsg" - } - - export interface BadSession extends Interface { - type: "badSession" - } - - export interface NoServerAuth extends Interface { - type: "noServerAuth" - } - - export interface Handshake extends Interface { - type: "handshake" - handshakeErr: HandshakeError - } -} - -export enum UIColorMode { - Light = "light", - Dark = "dark", -} - -export interface UIColors { - accent?: string - accentVariant?: string - secondary?: string - secondaryVariant?: string - background?: string - menus?: string - title?: string - accentVariant2?: string - sentMessage?: string - sentReply?: string - receivedMessage?: string - receivedReply?: string -} - -export interface UIThemeEntityOverride { - mode: UIColorMode - wallpaper?: ChatWallpaper - colors: UIColors -} - -export interface UIThemeEntityOverrides { - light?: UIThemeEntityOverride - dark?: UIThemeEntityOverride -} - -export interface UpdatedMessage { - msgContent: MsgContent - mentions: {[key: string]: number} // string : int64 -} - -export interface User { - userId: number // int64 - agentUserId: number // int64 - userContactId: number // int64 - localDisplayName: string - profile: LocalProfile - fullPreferences: FullPreferences - activeUser: boolean - activeOrder: number // int64 - viewPwdHash?: UserPwdHash - showNtfs: boolean - sendRcptsContacts: boolean - sendRcptsSmallGroups: boolean - autoAcceptMemberContacts: boolean - userMemberProfileUpdatedAt?: string // ISO-8601 timestamp - userChatRelay: boolean - clientService: boolean - uiThemes?: UIThemeEntityOverrides -} - -export interface UserChatRelay { - chatRelayId: number // int64 - address: string - relayProfile: RelayProfile - domains: string[] - preset: boolean - tested?: boolean - enabled: boolean - deleted: boolean -} - -export interface UserContact { - userContactLinkId: number // int64 - connReqContact: string - groupId?: number // int64 -} - -export interface UserContactLink { - userContactLinkId: number // int64 - connLinkContact: CreatedConnLink - shortLinkDataSet: boolean - shortLinkLargeDataSet: boolean - addressSettings: AddressSettings -} - -export interface UserContactRequest { - contactRequestId: number // int64 - agentInvitationId: string - contactId_?: number // int64 - businessGroupId_?: number // int64 - userContactLinkId_?: number // int64 - cReqChatVRange: VersionRange - localDisplayName: string - profileId: number // int64 - profile: LocalProfile - createdAt: string // ISO-8601 timestamp - updatedAt: string // ISO-8601 timestamp - xContactId?: string - pqSupport: boolean - welcomeSharedMsgId?: string - requestSharedMsgId?: string -} - -export interface UserInfo { - user: User - unreadCount: number // int -} - -export interface UserProfileUpdateSummary { - updateSuccesses: number // int - updateFailures: number // int - changedContacts: Contact[] -} - -export interface UserPwdHash { - hash: string - salt: string -} - -export interface VersionRange { - minVersion: number // int - maxVersion: number // int -} - -export type XFTPErrorType = - | XFTPErrorType.BLOCK - | XFTPErrorType.SESSION - | XFTPErrorType.HANDSHAKE - | XFTPErrorType.CMD - | XFTPErrorType.AUTH - | XFTPErrorType.BLOCKED - | XFTPErrorType.SIZE - | XFTPErrorType.QUOTA - | XFTPErrorType.DIGEST - | XFTPErrorType.CRYPTO - | XFTPErrorType.NO_FILE - | XFTPErrorType.HAS_FILE - | XFTPErrorType.FILE_IO - | XFTPErrorType.TIMEOUT - | XFTPErrorType.INTERNAL - | XFTPErrorType.DUPLICATE_ - -export namespace XFTPErrorType { - export type Tag = - | "BLOCK" - | "SESSION" - | "HANDSHAKE" - | "CMD" - | "AUTH" - | "BLOCKED" - | "SIZE" - | "QUOTA" - | "DIGEST" - | "CRYPTO" - | "NO_FILE" - | "HAS_FILE" - | "FILE_IO" - | "TIMEOUT" - | "INTERNAL" - | "DUPLICATE_" - - interface Interface { - type: Tag - } - - export interface BLOCK extends Interface { - type: "BLOCK" - } - - export interface SESSION extends Interface { - type: "SESSION" - } - - export interface HANDSHAKE extends Interface { - type: "HANDSHAKE" - } - - export interface CMD extends Interface { - type: "CMD" - cmdErr: CommandError - } - - export interface AUTH extends Interface { - type: "AUTH" - } - - export interface BLOCKED extends Interface { - type: "BLOCKED" - blockInfo: BlockingInfo - } - - export interface SIZE extends Interface { - type: "SIZE" - } - - export interface QUOTA extends Interface { - type: "QUOTA" - } - - export interface DIGEST extends Interface { - type: "DIGEST" - } - - export interface CRYPTO extends Interface { - type: "CRYPTO" - } - - export interface NO_FILE extends Interface { - type: "NO_FILE" - } - - export interface HAS_FILE extends Interface { - type: "HAS_FILE" - } - - export interface FILE_IO extends Interface { - type: "FILE_IO" - } - - export interface TIMEOUT extends Interface { - type: "TIMEOUT" - } - - export interface INTERNAL extends Interface { - type: "INTERNAL" - } - - export interface DUPLICATE_ extends Interface { - type: "DUPLICATE_" - } -} - -export interface XFTPRcvFile { - rcvFileDescription: RcvFileDescr - agentRcvFileId?: string - agentRcvFileDeleted: boolean - userApprovedRelays: boolean -} - -export interface XFTPSndFile { - agentSndFileId: string - privateSndFileDescr?: string - agentSndFileDeleted: boolean - cryptoArgs?: CryptoFileArgs -} diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_commands.py b/packages/simplex-chat-python/src/simplex_chat/types/_commands.py index a7f4a56465..e69de29bb2 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_commands.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_commands.py @@ -1,718 +0,0 @@ -# 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 - diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_events.py b/packages/simplex-chat-python/src/simplex_chat/types/_events.py index 3b293eb608..e69de29bb2 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_events.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_events.py @@ -1,681 +0,0 @@ -# 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]], - ]: ... diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_responses.py b/packages/simplex-chat-python/src/simplex_chat/types/_responses.py index bd61e6dae1..e69de29bb2 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_responses.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_responses.py @@ -1,368 +0,0 @@ -# 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"] diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_types.py b/packages/simplex-chat-python/src/simplex_chat/types/_types.py index 7e69047660..e69de29bb2 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_types.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_types.py @@ -1,3643 +0,0 @@ -# API Types -# This file is generated automatically. -from __future__ import annotations -from typing import Literal, NotRequired, TypedDict - -class ACIReaction(TypedDict): - chatInfo: "ChatInfo" - chatReaction: "CIReaction" - -class AChat(TypedDict): - chatInfo: "ChatInfo" - chatItems: list["ChatItem"] - chatStats: "ChatStats" - -class AChatItem(TypedDict): - chatInfo: "ChatInfo" - chatItem: "ChatItem" - -class AddRelayResult(TypedDict): - relay: "UserChatRelay" - relayError: NotRequired["ChatError"] - -class AddressSettings(TypedDict): - businessAddress: bool - autoAccept: NotRequired["AutoAccept"] - autoReply: NotRequired["MsgContent"] - -class AgentCryptoError_DECRYPT_AES(TypedDict): - type: Literal["DECRYPT_AES"] - -class AgentCryptoError_DECRYPT_CB(TypedDict): - type: Literal["DECRYPT_CB"] - -class AgentCryptoError_RATCHET_HEADER(TypedDict): - type: Literal["RATCHET_HEADER"] - -class AgentCryptoError_RATCHET_SYNC(TypedDict): - type: Literal["RATCHET_SYNC"] - -AgentCryptoError = ( - AgentCryptoError_DECRYPT_AES - | AgentCryptoError_DECRYPT_CB - | AgentCryptoError_RATCHET_HEADER - | AgentCryptoError_RATCHET_SYNC -) - -AgentCryptoError_Tag = Literal["DECRYPT_AES", "DECRYPT_CB", "RATCHET_HEADER", "RATCHET_SYNC"] - -class AgentErrorType_CMD(TypedDict): - type: Literal["CMD"] - cmdErr: "CommandErrorType" - errContext: str - -class AgentErrorType_CONN(TypedDict): - type: Literal["CONN"] - connErr: "ConnectionErrorType" - errContext: str - -class AgentErrorType_NO_USER(TypedDict): - type: Literal["NO_USER"] - -class AgentErrorType_SMP(TypedDict): - type: Literal["SMP"] - serverAddress: str - smpErr: "ErrorType" - -class AgentErrorType_NTF(TypedDict): - type: Literal["NTF"] - serverAddress: str - ntfErr: "ErrorType" - -class AgentErrorType_XFTP(TypedDict): - type: Literal["XFTP"] - serverAddress: str - xftpErr: "XFTPErrorType" - -class AgentErrorType_FILE(TypedDict): - type: Literal["FILE"] - fileErr: "FileErrorType" - -class AgentErrorType_NO_NAME_SERVERS(TypedDict): - type: Literal["NO_NAME_SERVERS"] - -class AgentErrorType_PROXY(TypedDict): - type: Literal["PROXY"] - proxyServer: str - relayServer: str - proxyErr: "ProxyClientError" - -class AgentErrorType_RCP(TypedDict): - type: Literal["RCP"] - rcpErr: "RCErrorType" - -class AgentErrorType_BROKER(TypedDict): - type: Literal["BROKER"] - brokerAddress: str - brokerErr: "BrokerErrorType" - -class AgentErrorType_AGENT(TypedDict): - type: Literal["AGENT"] - agentErr: "SMPAgentError" - -class AgentErrorType_NOTICE(TypedDict): - type: Literal["NOTICE"] - server: str - preset: bool - expiresAt: NotRequired[str] # ISO-8601 timestamp - -class AgentErrorType_INTERNAL(TypedDict): - type: Literal["INTERNAL"] - internalErr: str - -class AgentErrorType_CRITICAL(TypedDict): - type: Literal["CRITICAL"] - offerRestart: bool - criticalErr: str - -class AgentErrorType_INACTIVE(TypedDict): - type: Literal["INACTIVE"] - -AgentErrorType = ( - AgentErrorType_CMD - | AgentErrorType_CONN - | AgentErrorType_NO_USER - | AgentErrorType_SMP - | AgentErrorType_NTF - | AgentErrorType_XFTP - | AgentErrorType_FILE - | AgentErrorType_NO_NAME_SERVERS - | AgentErrorType_PROXY - | AgentErrorType_RCP - | AgentErrorType_BROKER - | AgentErrorType_AGENT - | AgentErrorType_NOTICE - | AgentErrorType_INTERNAL - | AgentErrorType_CRITICAL - | AgentErrorType_INACTIVE -) - -AgentErrorType_Tag = Literal["CMD", "CONN", "NO_USER", "SMP", "NTF", "XFTP", "FILE", "NO_NAME_SERVERS", "PROXY", "RCP", "BROKER", "AGENT", "NOTICE", "INTERNAL", "CRITICAL", "INACTIVE"] - -class AutoAccept(TypedDict): - acceptIncognito: bool - -class BadgeInfo(TypedDict): - badgeType: "BadgeType" - badgeExpiry: NotRequired[str] # ISO-8601 timestamp - badgeExtra: str - -class BadgeProof(TypedDict): - badgeKeyIdx: int # int - presHeader: str - proof: str - badgeInfo: "BadgeInfo" - -BadgeStatus = Literal["active", "expired", "expiredOld", "failed", "unknownKey"] - -BadgeType = Literal["supporter", "legend", "investor"] - -class BlockingInfo(TypedDict): - reason: "BlockingReason" - notice: NotRequired["ClientNotice"] - -BlockingReason = Literal["spam", "content"] - -class BrokerErrorType_RESPONSE(TypedDict): - type: Literal["RESPONSE"] - respErr: str - -class BrokerErrorType_UNEXPECTED(TypedDict): - type: Literal["UNEXPECTED"] - respErr: str - -class BrokerErrorType_NETWORK(TypedDict): - type: Literal["NETWORK"] - networkError: "NetworkError" - -class BrokerErrorType_HOST(TypedDict): - type: Literal["HOST"] - -class BrokerErrorType_NO_SERVICE(TypedDict): - type: Literal["NO_SERVICE"] - -class BrokerErrorType_TRANSPORT(TypedDict): - type: Literal["TRANSPORT"] - transportErr: "TransportError" - -class BrokerErrorType_TIMEOUT(TypedDict): - type: Literal["TIMEOUT"] - -BrokerErrorType = ( - BrokerErrorType_RESPONSE - | BrokerErrorType_UNEXPECTED - | BrokerErrorType_NETWORK - | BrokerErrorType_HOST - | BrokerErrorType_NO_SERVICE - | BrokerErrorType_TRANSPORT - | BrokerErrorType_TIMEOUT -) - -BrokerErrorType_Tag = Literal["RESPONSE", "UNEXPECTED", "NETWORK", "HOST", "NO_SERVICE", "TRANSPORT", "TIMEOUT"] - -class BusinessChatInfo(TypedDict): - chatType: "BusinessChatType" - businessId: str - customerId: str - businessDomain: NotRequired["SimplexDomainClaim"] - -BusinessChatType = Literal["business", "customer"] - -CICallStatus = Literal["pending", "missed", "rejected", "accepted", "negotiated", "progress", "ended", "error"] - -class CIContent_sndMsgContent(TypedDict): - type: Literal["sndMsgContent"] - msgContent: "MsgContent" - -class CIContent_rcvMsgContent(TypedDict): - type: Literal["rcvMsgContent"] - msgContent: "MsgContent" - -class CIContent_sndDeleted(TypedDict): - type: Literal["sndDeleted"] - deleteMode: "CIDeleteMode" - -class CIContent_rcvDeleted(TypedDict): - type: Literal["rcvDeleted"] - deleteMode: "CIDeleteMode" - -class CIContent_sndCall(TypedDict): - type: Literal["sndCall"] - status: "CICallStatus" - duration: int # int - -class CIContent_rcvCall(TypedDict): - type: Literal["rcvCall"] - status: "CICallStatus" - duration: int # int - -class CIContent_rcvIntegrityError(TypedDict): - type: Literal["rcvIntegrityError"] - msgError: "MsgErrorType" - -class CIContent_rcvDecryptionError(TypedDict): - type: Literal["rcvDecryptionError"] - msgDecryptError: "MsgDecryptError" - msgCount: int # word32 - -class CIContent_rcvMsgError(TypedDict): - type: Literal["rcvMsgError"] - rcvMsgError: "RcvMsgError" - -class CIContent_rcvGroupInvitation(TypedDict): - type: Literal["rcvGroupInvitation"] - groupInvitation: "CIGroupInvitation" - memberRole: "GroupMemberRole" - -class CIContent_sndGroupInvitation(TypedDict): - type: Literal["sndGroupInvitation"] - groupInvitation: "CIGroupInvitation" - memberRole: "GroupMemberRole" - -class CIContent_rcvDirectEvent(TypedDict): - type: Literal["rcvDirectEvent"] - rcvDirectEvent: "RcvDirectEvent" - -class CIContent_rcvGroupEvent(TypedDict): - type: Literal["rcvGroupEvent"] - rcvGroupEvent: "RcvGroupEvent" - -class CIContent_sndGroupEvent(TypedDict): - type: Literal["sndGroupEvent"] - sndGroupEvent: "SndGroupEvent" - -class CIContent_rcvConnEvent(TypedDict): - type: Literal["rcvConnEvent"] - rcvConnEvent: "RcvConnEvent" - -class CIContent_sndConnEvent(TypedDict): - type: Literal["sndConnEvent"] - sndConnEvent: "SndConnEvent" - -class CIContent_rcvChatFeature(TypedDict): - type: Literal["rcvChatFeature"] - feature: "ChatFeature" - enabled: "PrefEnabled" - param: NotRequired[int] # int - -class CIContent_sndChatFeature(TypedDict): - type: Literal["sndChatFeature"] - feature: "ChatFeature" - enabled: "PrefEnabled" - param: NotRequired[int] # int - -class CIContent_rcvChatPreference(TypedDict): - type: Literal["rcvChatPreference"] - feature: "ChatFeature" - allowed: "FeatureAllowed" - param: NotRequired[int] # int - -class CIContent_sndChatPreference(TypedDict): - type: Literal["sndChatPreference"] - feature: "ChatFeature" - allowed: "FeatureAllowed" - param: NotRequired[int] # int - -class CIContent_rcvGroupFeature(TypedDict): - type: Literal["rcvGroupFeature"] - groupFeature: "GroupFeature" - preference: "GroupPreference" - param: NotRequired[int] # int - memberRole_: NotRequired["GroupMemberRole"] - -class CIContent_sndGroupFeature(TypedDict): - type: Literal["sndGroupFeature"] - groupFeature: "GroupFeature" - preference: "GroupPreference" - param: NotRequired[int] # int - memberRole_: NotRequired["GroupMemberRole"] - -class CIContent_rcvChatFeatureRejected(TypedDict): - type: Literal["rcvChatFeatureRejected"] - feature: "ChatFeature" - -class CIContent_rcvGroupFeatureRejected(TypedDict): - type: Literal["rcvGroupFeatureRejected"] - groupFeature: "GroupFeature" - -class CIContent_sndModerated(TypedDict): - type: Literal["sndModerated"] - -class CIContent_rcvModerated(TypedDict): - type: Literal["rcvModerated"] - -class CIContent_rcvBlocked(TypedDict): - type: Literal["rcvBlocked"] - -class CIContent_sndDirectE2EEInfo(TypedDict): - type: Literal["sndDirectE2EEInfo"] - e2eeInfo: "E2EInfo" - -class CIContent_rcvDirectE2EEInfo(TypedDict): - type: Literal["rcvDirectE2EEInfo"] - e2eeInfo: "E2EInfo" - -class CIContent_sndGroupE2EEInfo(TypedDict): - type: Literal["sndGroupE2EEInfo"] - e2eeInfo: "E2EInfo" - -class CIContent_rcvGroupE2EEInfo(TypedDict): - type: Literal["rcvGroupE2EEInfo"] - e2eeInfo: "E2EInfo" - -class CIContent_chatBanner(TypedDict): - type: Literal["chatBanner"] - -CIContent = ( - CIContent_sndMsgContent - | CIContent_rcvMsgContent - | CIContent_sndDeleted - | CIContent_rcvDeleted - | CIContent_sndCall - | CIContent_rcvCall - | CIContent_rcvIntegrityError - | CIContent_rcvDecryptionError - | CIContent_rcvMsgError - | CIContent_rcvGroupInvitation - | CIContent_sndGroupInvitation - | CIContent_rcvDirectEvent - | CIContent_rcvGroupEvent - | CIContent_sndGroupEvent - | CIContent_rcvConnEvent - | CIContent_sndConnEvent - | CIContent_rcvChatFeature - | CIContent_sndChatFeature - | CIContent_rcvChatPreference - | CIContent_sndChatPreference - | CIContent_rcvGroupFeature - | CIContent_sndGroupFeature - | CIContent_rcvChatFeatureRejected - | CIContent_rcvGroupFeatureRejected - | CIContent_sndModerated - | CIContent_rcvModerated - | CIContent_rcvBlocked - | CIContent_sndDirectE2EEInfo - | CIContent_rcvDirectE2EEInfo - | CIContent_sndGroupE2EEInfo - | CIContent_rcvGroupE2EEInfo - | CIContent_chatBanner -) - -CIContent_Tag = Literal["sndMsgContent", "rcvMsgContent", "sndDeleted", "rcvDeleted", "sndCall", "rcvCall", "rcvIntegrityError", "rcvDecryptionError", "rcvMsgError", "rcvGroupInvitation", "sndGroupInvitation", "rcvDirectEvent", "rcvGroupEvent", "sndGroupEvent", "rcvConnEvent", "sndConnEvent", "rcvChatFeature", "sndChatFeature", "rcvChatPreference", "sndChatPreference", "rcvGroupFeature", "sndGroupFeature", "rcvChatFeatureRejected", "rcvGroupFeatureRejected", "sndModerated", "rcvModerated", "rcvBlocked", "sndDirectE2EEInfo", "rcvDirectE2EEInfo", "sndGroupE2EEInfo", "rcvGroupE2EEInfo", "chatBanner"] - -CIDeleteMode = Literal["broadcast", "internal", "internalMark", "history"] - -class CIDeleted_deleted(TypedDict): - type: Literal["deleted"] - deletedTs: NotRequired[str] # ISO-8601 timestamp - chatType: "ChatType" - -class CIDeleted_blocked(TypedDict): - type: Literal["blocked"] - deletedTs: NotRequired[str] # ISO-8601 timestamp - -class CIDeleted_blockedByAdmin(TypedDict): - type: Literal["blockedByAdmin"] - deletedTs: NotRequired[str] # ISO-8601 timestamp - -class CIDeleted_moderated(TypedDict): - type: Literal["moderated"] - deletedTs: NotRequired[str] # ISO-8601 timestamp - byGroupMember: "GroupMember" - -CIDeleted = CIDeleted_deleted | CIDeleted_blocked | CIDeleted_blockedByAdmin | CIDeleted_moderated - -CIDeleted_Tag = Literal["deleted", "blocked", "blockedByAdmin", "moderated"] - -class CIDirection_directSnd(TypedDict): - type: Literal["directSnd"] - -class CIDirection_directRcv(TypedDict): - type: Literal["directRcv"] - -class CIDirection_groupSnd(TypedDict): - type: Literal["groupSnd"] - -class CIDirection_groupRcv(TypedDict): - type: Literal["groupRcv"] - groupMember: "GroupMember" - -class CIDirection_channelRcv(TypedDict): - type: Literal["channelRcv"] - -class CIDirection_localSnd(TypedDict): - type: Literal["localSnd"] - -class CIDirection_localRcv(TypedDict): - type: Literal["localRcv"] - -CIDirection = ( - CIDirection_directSnd - | CIDirection_directRcv - | CIDirection_groupSnd - | CIDirection_groupRcv - | CIDirection_channelRcv - | CIDirection_localSnd - | CIDirection_localRcv -) - -CIDirection_Tag = Literal["directSnd", "directRcv", "groupSnd", "groupRcv", "channelRcv", "localSnd", "localRcv"] - -class CIFile(TypedDict): - fileId: int # int64 - fileName: str - fileSize: int # int64 - fileSource: NotRequired["CryptoFile"] - fileStatus: "CIFileStatus" - fileProtocol: "FileProtocol" - -class CIFileStatus_sndStored(TypedDict): - type: Literal["sndStored"] - -class CIFileStatus_sndTransfer(TypedDict): - type: Literal["sndTransfer"] - sndProgress: int # int64 - sndTotal: int # int64 - -class CIFileStatus_sndCancelled(TypedDict): - type: Literal["sndCancelled"] - -class CIFileStatus_sndComplete(TypedDict): - type: Literal["sndComplete"] - -class CIFileStatus_sndError(TypedDict): - type: Literal["sndError"] - sndFileError: "FileError" - -class CIFileStatus_sndWarning(TypedDict): - type: Literal["sndWarning"] - sndFileError: "FileError" - -class CIFileStatus_rcvInvitation(TypedDict): - type: Literal["rcvInvitation"] - -class CIFileStatus_rcvAccepted(TypedDict): - type: Literal["rcvAccepted"] - -class CIFileStatus_rcvTransfer(TypedDict): - type: Literal["rcvTransfer"] - rcvProgress: int # int64 - rcvTotal: int # int64 - -class CIFileStatus_rcvAborted(TypedDict): - type: Literal["rcvAborted"] - -class CIFileStatus_rcvComplete(TypedDict): - type: Literal["rcvComplete"] - -class CIFileStatus_rcvCancelled(TypedDict): - type: Literal["rcvCancelled"] - -class CIFileStatus_rcvError(TypedDict): - type: Literal["rcvError"] - rcvFileError: "FileError" - -class CIFileStatus_rcvWarning(TypedDict): - type: Literal["rcvWarning"] - rcvFileError: "FileError" - -class CIFileStatus_invalid(TypedDict): - type: Literal["invalid"] - text: str - -CIFileStatus = ( - CIFileStatus_sndStored - | CIFileStatus_sndTransfer - | CIFileStatus_sndCancelled - | CIFileStatus_sndComplete - | CIFileStatus_sndError - | CIFileStatus_sndWarning - | CIFileStatus_rcvInvitation - | CIFileStatus_rcvAccepted - | CIFileStatus_rcvTransfer - | CIFileStatus_rcvAborted - | CIFileStatus_rcvComplete - | CIFileStatus_rcvCancelled - | CIFileStatus_rcvError - | CIFileStatus_rcvWarning - | CIFileStatus_invalid -) - -CIFileStatus_Tag = Literal["sndStored", "sndTransfer", "sndCancelled", "sndComplete", "sndError", "sndWarning", "rcvInvitation", "rcvAccepted", "rcvTransfer", "rcvAborted", "rcvComplete", "rcvCancelled", "rcvError", "rcvWarning", "invalid"] - -class CIForwardedFrom_unknown(TypedDict): - type: Literal["unknown"] - -class CIForwardedFrom_contact(TypedDict): - type: Literal["contact"] - chatName: str - msgDir: "MsgDirection" - contactId: NotRequired[int] # int64 - chatItemId: NotRequired[int] # int64 - -class CIForwardedFrom_group(TypedDict): - type: Literal["group"] - chatName: str - msgDir: "MsgDirection" - groupId: NotRequired[int] # int64 - chatItemId: NotRequired[int] # int64 - -CIForwardedFrom = CIForwardedFrom_unknown | CIForwardedFrom_contact | CIForwardedFrom_group - -CIForwardedFrom_Tag = Literal["unknown", "contact", "group"] - -class CIGroupInvitation(TypedDict): - groupId: int # int64 - groupMemberId: int # int64 - localDisplayName: str - groupProfile: "GroupProfile" - status: "CIGroupInvitationStatus" - -CIGroupInvitationStatus = Literal["pending", "accepted", "rejected", "expired"] - -class CIMention(TypedDict): - memberId: str - memberRef: NotRequired["CIMentionMember"] - -class CIMentionMember(TypedDict): - groupMemberId: int # int64 - displayName: str - localAlias: NotRequired[str] - memberRole: "GroupMemberRole" - -class CIMeta(TypedDict): - itemId: int # int64 - itemTs: str # ISO-8601 timestamp - itemText: str - itemStatus: "CIStatus" - sentViaProxy: NotRequired[bool] - itemSharedMsgId: NotRequired[str] - itemForwarded: NotRequired["CIForwardedFrom"] - itemDeleted: NotRequired["CIDeleted"] - itemEdited: bool - itemTimed: NotRequired["CITimed"] - itemLive: NotRequired[bool] - userMention: bool - hasLink: bool - deletable: bool - editable: bool - forwardedByMember: NotRequired[int] # int64 - showGroupAsSender: bool - msgVerified: NotRequired["MsgVerified"] - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - -class CIQuote(TypedDict): - chatDir: NotRequired["CIDirection"] - itemId: NotRequired[int] # int64 - sharedMsgId: NotRequired[str] - sentAt: str # ISO-8601 timestamp - content: "MsgContent" - formattedText: NotRequired[list["FormattedText"]] - -class CIReaction(TypedDict): - chatDir: "CIDirection" - chatItem: "ChatItem" - sentAt: str # ISO-8601 timestamp - reaction: "MsgReaction" - -class CIReactionCount(TypedDict): - reaction: "MsgReaction" - userReacted: bool - totalReacted: int # int - -class CIStatus_sndNew(TypedDict): - type: Literal["sndNew"] - -class CIStatus_sndSent(TypedDict): - type: Literal["sndSent"] - sndProgress: "SndCIStatusProgress" - -class CIStatus_sndRcvd(TypedDict): - type: Literal["sndRcvd"] - msgRcptStatus: "MsgReceiptStatus" - sndProgress: "SndCIStatusProgress" - -class CIStatus_sndErrorAuth(TypedDict): - type: Literal["sndErrorAuth"] - -class CIStatus_sndError(TypedDict): - type: Literal["sndError"] - agentError: "SndError" - -class CIStatus_sndWarning(TypedDict): - type: Literal["sndWarning"] - agentError: "SndError" - -class CIStatus_rcvNew(TypedDict): - type: Literal["rcvNew"] - -class CIStatus_rcvRead(TypedDict): - type: Literal["rcvRead"] - -class CIStatus_invalid(TypedDict): - type: Literal["invalid"] - text: str - -CIStatus = ( - CIStatus_sndNew - | CIStatus_sndSent - | CIStatus_sndRcvd - | CIStatus_sndErrorAuth - | CIStatus_sndError - | CIStatus_sndWarning - | CIStatus_rcvNew - | CIStatus_rcvRead - | CIStatus_invalid -) - -CIStatus_Tag = Literal["sndNew", "sndSent", "sndRcvd", "sndErrorAuth", "sndError", "sndWarning", "rcvNew", "rcvRead", "invalid"] - -class CITimed(TypedDict): - ttl: int # int - deleteAt: NotRequired[str] # ISO-8601 timestamp - -class ChatBotCommand_command(TypedDict): - type: Literal["command"] - keyword: str - label: str - params: NotRequired[str] - -class ChatBotCommand_menu(TypedDict): - type: Literal["menu"] - label: str - commands: list["ChatBotCommand"] - -ChatBotCommand = ChatBotCommand_command | ChatBotCommand_menu - -ChatBotCommand_Tag = Literal["command", "menu"] - -class ChatDeleteMode_full(TypedDict): - type: Literal["full"] - notify: bool - -class ChatDeleteMode_entity(TypedDict): - type: Literal["entity"] - notify: bool - -class ChatDeleteMode_messages(TypedDict): - type: Literal["messages"] - -ChatDeleteMode = ChatDeleteMode_full | ChatDeleteMode_entity | ChatDeleteMode_messages - -ChatDeleteMode_Tag = Literal["full", "entity", "messages"] - - -def ChatDeleteMode_cmd_string(self: ChatDeleteMode) -> str: - return str(self['type']) + ('' if str(self['type']) == 'messages' else (' notify=off' if not self['notify'] else '')) # type: ignore[typeddict-item] - -class ChatError_error(TypedDict): - type: Literal["error"] - errorType: "ChatErrorType" - -class ChatError_errorAgent(TypedDict): - type: Literal["errorAgent"] - agentError: "AgentErrorType" - agentConnId: str - connectionEntity_: NotRequired["ConnectionEntity"] - -class ChatError_errorStore(TypedDict): - type: Literal["errorStore"] - storeError: "StoreError" - -ChatError = ChatError_error | ChatError_errorAgent | ChatError_errorStore - -ChatError_Tag = Literal["error", "errorAgent", "errorStore"] - -class ChatErrorType_noActiveUser(TypedDict): - type: Literal["noActiveUser"] - -class ChatErrorType_noConnectionUser(TypedDict): - type: Literal["noConnectionUser"] - agentConnId: str - -class ChatErrorType_noSndFileUser(TypedDict): - type: Literal["noSndFileUser"] - agentSndFileId: str - -class ChatErrorType_noRcvFileUser(TypedDict): - type: Literal["noRcvFileUser"] - agentRcvFileId: str - -class ChatErrorType_userUnknown(TypedDict): - type: Literal["userUnknown"] - -class ChatErrorType_userExists(TypedDict): - type: Literal["userExists"] - contactName: str - -class ChatErrorType_chatRelayExists(TypedDict): - type: Literal["chatRelayExists"] - -class ChatErrorType_differentActiveUser(TypedDict): - type: Literal["differentActiveUser"] - commandUserId: int # int64 - activeUserId: int # int64 - -class ChatErrorType_cantDeleteActiveUser(TypedDict): - type: Literal["cantDeleteActiveUser"] - userId: int # int64 - -class ChatErrorType_cantDeleteLastUser(TypedDict): - type: Literal["cantDeleteLastUser"] - userId: int # int64 - -class ChatErrorType_cantHideLastUser(TypedDict): - type: Literal["cantHideLastUser"] - userId: int # int64 - -class ChatErrorType_hiddenUserAlwaysMuted(TypedDict): - type: Literal["hiddenUserAlwaysMuted"] - userId: int # int64 - -class ChatErrorType_emptyUserPassword(TypedDict): - type: Literal["emptyUserPassword"] - userId: int # int64 - -class ChatErrorType_userAlreadyHidden(TypedDict): - type: Literal["userAlreadyHidden"] - userId: int # int64 - -class ChatErrorType_userNotHidden(TypedDict): - type: Literal["userNotHidden"] - userId: int # int64 - -class ChatErrorType_invalidDisplayName(TypedDict): - type: Literal["invalidDisplayName"] - displayName: str - validName: str - -class ChatErrorType_chatNotStarted(TypedDict): - type: Literal["chatNotStarted"] - -class ChatErrorType_chatNotStopped(TypedDict): - type: Literal["chatNotStopped"] - -class ChatErrorType_chatStoreChanged(TypedDict): - type: Literal["chatStoreChanged"] - -class ChatErrorType_invalidConnReq(TypedDict): - type: Literal["invalidConnReq"] - -class ChatErrorType_simplexDomainNotReady(TypedDict): - type: Literal["simplexDomainNotReady"] - simplexDomain: "SimplexDomain" - simplexDomainError: "SimplexDomainError" - -class ChatErrorType_notResolvedLocally(TypedDict): - type: Literal["notResolvedLocally"] - -class ChatErrorType_unsupportedConnReq(TypedDict): - type: Literal["unsupportedConnReq"] - -class ChatErrorType_connReqMessageProhibited(TypedDict): - type: Literal["connReqMessageProhibited"] - -class ChatErrorType_contactNotReady(TypedDict): - type: Literal["contactNotReady"] - contact: "Contact" - -class ChatErrorType_contactNotActive(TypedDict): - type: Literal["contactNotActive"] - contact: "Contact" - -class ChatErrorType_contactDisabled(TypedDict): - type: Literal["contactDisabled"] - contact: "Contact" - -class ChatErrorType_connectionDisabled(TypedDict): - type: Literal["connectionDisabled"] - connection: "Connection" - -class ChatErrorType_groupUserRole(TypedDict): - type: Literal["groupUserRole"] - groupInfo: "GroupInfo" - requiredRole: "GroupMemberRole" - -class ChatErrorType_groupMemberInitialRole(TypedDict): - type: Literal["groupMemberInitialRole"] - groupInfo: "GroupInfo" - initialRole: "GroupMemberRole" - -class ChatErrorType_contactIncognitoCantInvite(TypedDict): - type: Literal["contactIncognitoCantInvite"] - -class ChatErrorType_groupIncognitoCantInvite(TypedDict): - type: Literal["groupIncognitoCantInvite"] - -class ChatErrorType_groupContactRole(TypedDict): - type: Literal["groupContactRole"] - contactName: str - -class ChatErrorType_groupDuplicateMember(TypedDict): - type: Literal["groupDuplicateMember"] - contactName: str - -class ChatErrorType_groupDuplicateMemberId(TypedDict): - type: Literal["groupDuplicateMemberId"] - -class ChatErrorType_groupNotJoined(TypedDict): - type: Literal["groupNotJoined"] - groupInfo: "GroupInfo" - -class ChatErrorType_groupMemberNotActive(TypedDict): - type: Literal["groupMemberNotActive"] - -class ChatErrorType_cantBlockMemberForSelf(TypedDict): - type: Literal["cantBlockMemberForSelf"] - groupInfo: "GroupInfo" - member: "GroupMember" - setShowMessages: bool - -class ChatErrorType_groupMemberUserRemoved(TypedDict): - type: Literal["groupMemberUserRemoved"] - -class ChatErrorType_groupMemberNotFound(TypedDict): - type: Literal["groupMemberNotFound"] - -class ChatErrorType_groupCantResendInvitation(TypedDict): - type: Literal["groupCantResendInvitation"] - groupInfo: "GroupInfo" - contactName: str - -class ChatErrorType_groupInternal(TypedDict): - type: Literal["groupInternal"] - message: str - -class ChatErrorType_fileNotFound(TypedDict): - type: Literal["fileNotFound"] - message: str - -class ChatErrorType_fileSize(TypedDict): - type: Literal["fileSize"] - filePath: str - -class ChatErrorType_fileAlreadyReceiving(TypedDict): - type: Literal["fileAlreadyReceiving"] - message: str - -class ChatErrorType_fileCancelled(TypedDict): - type: Literal["fileCancelled"] - message: str - -class ChatErrorType_fileCancel(TypedDict): - type: Literal["fileCancel"] - fileId: int # int64 - message: str - -class ChatErrorType_fileAlreadyExists(TypedDict): - type: Literal["fileAlreadyExists"] - filePath: str - -class ChatErrorType_fileWrite(TypedDict): - type: Literal["fileWrite"] - filePath: str - message: str - -class ChatErrorType_fileSend(TypedDict): - type: Literal["fileSend"] - fileId: int # int64 - agentError: "AgentErrorType" - -class ChatErrorType_fileRcvChunk(TypedDict): - type: Literal["fileRcvChunk"] - message: str - -class ChatErrorType_fileInternal(TypedDict): - type: Literal["fileInternal"] - message: str - -class ChatErrorType_fileImageType(TypedDict): - type: Literal["fileImageType"] - filePath: str - -class ChatErrorType_fileImageSize(TypedDict): - type: Literal["fileImageSize"] - filePath: str - -class ChatErrorType_fileNotReceived(TypedDict): - type: Literal["fileNotReceived"] - fileId: int # int64 - -class ChatErrorType_fileNotApproved(TypedDict): - type: Literal["fileNotApproved"] - fileId: int # int64 - unknownServers: list[str] - -class ChatErrorType_fallbackToSMPProhibited(TypedDict): - type: Literal["fallbackToSMPProhibited"] - fileId: int # int64 - -class ChatErrorType_inlineFileProhibited(TypedDict): - type: Literal["inlineFileProhibited"] - fileId: int # int64 - -class ChatErrorType_invalidForward(TypedDict): - type: Literal["invalidForward"] - -class ChatErrorType_invalidChatItemUpdate(TypedDict): - type: Literal["invalidChatItemUpdate"] - -class ChatErrorType_invalidChatItemDelete(TypedDict): - type: Literal["invalidChatItemDelete"] - -class ChatErrorType_hasCurrentCall(TypedDict): - type: Literal["hasCurrentCall"] - -class ChatErrorType_noCurrentCall(TypedDict): - type: Literal["noCurrentCall"] - -class ChatErrorType_callContact(TypedDict): - type: Literal["callContact"] - contactId: int # int64 - -class ChatErrorType_directMessagesProhibited(TypedDict): - type: Literal["directMessagesProhibited"] - direction: "MsgDirection" - contact: "Contact" - -class ChatErrorType_agentVersion(TypedDict): - type: Literal["agentVersion"] - -class ChatErrorType_agentNoSubResult(TypedDict): - type: Literal["agentNoSubResult"] - agentConnId: str - -class ChatErrorType_commandError(TypedDict): - type: Literal["commandError"] - message: str - -class ChatErrorType_agentCommandError(TypedDict): - type: Literal["agentCommandError"] - message: str - -class ChatErrorType_invalidFileDescription(TypedDict): - type: Literal["invalidFileDescription"] - message: str - -class ChatErrorType_connectionIncognitoChangeProhibited(TypedDict): - type: Literal["connectionIncognitoChangeProhibited"] - -class ChatErrorType_connectionUserChangeProhibited(TypedDict): - type: Literal["connectionUserChangeProhibited"] - -class ChatErrorType_peerChatVRangeIncompatible(TypedDict): - type: Literal["peerChatVRangeIncompatible"] - -class ChatErrorType_relayTestError(TypedDict): - type: Literal["relayTestError"] - message: str - -class ChatErrorType_internalError(TypedDict): - type: Literal["internalError"] - message: str - -class ChatErrorType_exception(TypedDict): - type: Literal["exception"] - message: str - -ChatErrorType = ( - ChatErrorType_noActiveUser - | ChatErrorType_noConnectionUser - | ChatErrorType_noSndFileUser - | ChatErrorType_noRcvFileUser - | ChatErrorType_userUnknown - | ChatErrorType_userExists - | ChatErrorType_chatRelayExists - | ChatErrorType_differentActiveUser - | ChatErrorType_cantDeleteActiveUser - | ChatErrorType_cantDeleteLastUser - | ChatErrorType_cantHideLastUser - | ChatErrorType_hiddenUserAlwaysMuted - | ChatErrorType_emptyUserPassword - | ChatErrorType_userAlreadyHidden - | ChatErrorType_userNotHidden - | ChatErrorType_invalidDisplayName - | ChatErrorType_chatNotStarted - | ChatErrorType_chatNotStopped - | ChatErrorType_chatStoreChanged - | ChatErrorType_invalidConnReq - | ChatErrorType_simplexDomainNotReady - | ChatErrorType_notResolvedLocally - | ChatErrorType_unsupportedConnReq - | ChatErrorType_connReqMessageProhibited - | ChatErrorType_contactNotReady - | ChatErrorType_contactNotActive - | ChatErrorType_contactDisabled - | ChatErrorType_connectionDisabled - | ChatErrorType_groupUserRole - | ChatErrorType_groupMemberInitialRole - | ChatErrorType_contactIncognitoCantInvite - | ChatErrorType_groupIncognitoCantInvite - | ChatErrorType_groupContactRole - | ChatErrorType_groupDuplicateMember - | ChatErrorType_groupDuplicateMemberId - | ChatErrorType_groupNotJoined - | ChatErrorType_groupMemberNotActive - | ChatErrorType_cantBlockMemberForSelf - | ChatErrorType_groupMemberUserRemoved - | ChatErrorType_groupMemberNotFound - | ChatErrorType_groupCantResendInvitation - | ChatErrorType_groupInternal - | ChatErrorType_fileNotFound - | ChatErrorType_fileSize - | ChatErrorType_fileAlreadyReceiving - | ChatErrorType_fileCancelled - | ChatErrorType_fileCancel - | ChatErrorType_fileAlreadyExists - | ChatErrorType_fileWrite - | ChatErrorType_fileSend - | ChatErrorType_fileRcvChunk - | ChatErrorType_fileInternal - | ChatErrorType_fileImageType - | ChatErrorType_fileImageSize - | ChatErrorType_fileNotReceived - | ChatErrorType_fileNotApproved - | ChatErrorType_fallbackToSMPProhibited - | ChatErrorType_inlineFileProhibited - | ChatErrorType_invalidForward - | ChatErrorType_invalidChatItemUpdate - | ChatErrorType_invalidChatItemDelete - | ChatErrorType_hasCurrentCall - | ChatErrorType_noCurrentCall - | ChatErrorType_callContact - | ChatErrorType_directMessagesProhibited - | ChatErrorType_agentVersion - | ChatErrorType_agentNoSubResult - | ChatErrorType_commandError - | ChatErrorType_agentCommandError - | ChatErrorType_invalidFileDescription - | ChatErrorType_connectionIncognitoChangeProhibited - | ChatErrorType_connectionUserChangeProhibited - | ChatErrorType_peerChatVRangeIncompatible - | ChatErrorType_relayTestError - | ChatErrorType_internalError - | ChatErrorType_exception -) - -ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "simplexDomainNotReady", "notResolvedLocally", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"] - -ChatFeature = Literal["timedMessages", "fullDelete", "reactions", "voice", "files", "calls", "sessions"] - -class ChatInfo_direct(TypedDict): - type: Literal["direct"] - contact: "Contact" - -class ChatInfo_group(TypedDict): - type: Literal["group"] - groupInfo: "GroupInfo" - groupChatScope: NotRequired["GroupChatScopeInfo"] - -class ChatInfo_local(TypedDict): - type: Literal["local"] - noteFolder: "NoteFolder" - -class ChatInfo_contactRequest(TypedDict): - type: Literal["contactRequest"] - contactRequest: "UserContactRequest" - -class ChatInfo_contactConnection(TypedDict): - type: Literal["contactConnection"] - contactConnection: "PendingContactConnection" - -ChatInfo = ( - ChatInfo_direct - | ChatInfo_group - | ChatInfo_local - | ChatInfo_contactRequest - | ChatInfo_contactConnection -) - -ChatInfo_Tag = Literal["direct", "group", "local", "contactRequest", "contactConnection"] - -class ChatItem(TypedDict): - chatDir: "CIDirection" - meta: "CIMeta" - content: "CIContent" - mentions: dict[str, "CIMention"] - formattedText: NotRequired[list["FormattedText"]] - quotedItem: NotRequired["CIQuote"] - reactions: list["CIReactionCount"] - file: NotRequired["CIFile"] - -# Message deletion result. - -class ChatItemDeletion(TypedDict): - deletedChatItem: "AChatItem" - toChatItem: NotRequired["AChatItem"] - -class ChatListQuery_filters(TypedDict): - type: Literal["filters"] - favorite: bool - unread: bool - -class ChatListQuery_search(TypedDict): - type: Literal["search"] - search: str - -ChatListQuery = ChatListQuery_filters | ChatListQuery_search - -ChatListQuery_Tag = Literal["filters", "search"] - -ChatPeerType = Literal["human", "bot"] - -# Used in API commands. Chat scope can only be passed with groups. - -class ChatRef(TypedDict): - chatType: "ChatType" - chatId: int # int64 - chatScope: NotRequired["GroupChatScope"] - - -def ChatRef_cmd_string(self: ChatRef) -> str: - return ChatType_cmd_string(self['chatType']) + str(self['chatId']) + ((GroupChatScope_cmd_string(self.get('chatScope'))) if self.get('chatScope') is not None else '') - -class ChatSettings(TypedDict): - enableNtfs: "MsgFilter" - sendRcpts: NotRequired[bool] - favorite: bool - -class ChatStats(TypedDict): - unreadCount: int # int - unreadMentions: int # int - reportsCount: int # int - minUnreadItemId: int # int64 - unreadChat: bool - -ChatType = Literal["direct", "group", "local"] - - -def ChatType_cmd_string(self: ChatType) -> str: - return '@' if str(self) == 'direct' else '#' if str(self) == 'group' else '*' if str(self) == 'local' else '' - -class ChatWallpaper(TypedDict): - preset: NotRequired[str] - imageFile: NotRequired[str] - background: NotRequired[str] - tint: NotRequired[str] - scaleType: NotRequired["ChatWallpaperScale"] - scale: NotRequired[float] # double - -ChatWallpaperScale = Literal["fill", "fit", "repeat"] - -class ClientNotice(TypedDict): - ttl: NotRequired[int] # int64 - -Color = Literal["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] - -class CommandError_UNKNOWN(TypedDict): - type: Literal["UNKNOWN"] - -class CommandError_SYNTAX(TypedDict): - type: Literal["SYNTAX"] - -class CommandError_PROHIBITED(TypedDict): - type: Literal["PROHIBITED"] - -class CommandError_NO_AUTH(TypedDict): - type: Literal["NO_AUTH"] - -class CommandError_HAS_AUTH(TypedDict): - type: Literal["HAS_AUTH"] - -class CommandError_NO_ENTITY(TypedDict): - type: Literal["NO_ENTITY"] - -CommandError = ( - CommandError_UNKNOWN - | CommandError_SYNTAX - | CommandError_PROHIBITED - | CommandError_NO_AUTH - | CommandError_HAS_AUTH - | CommandError_NO_ENTITY -) - -CommandError_Tag = Literal["UNKNOWN", "SYNTAX", "PROHIBITED", "NO_AUTH", "HAS_AUTH", "NO_ENTITY"] - -class CommandErrorType_PROHIBITED(TypedDict): - type: Literal["PROHIBITED"] - -class CommandErrorType_SYNTAX(TypedDict): - type: Literal["SYNTAX"] - -class CommandErrorType_NO_CONN(TypedDict): - type: Literal["NO_CONN"] - -class CommandErrorType_SIZE(TypedDict): - type: Literal["SIZE"] - -class CommandErrorType_LARGE(TypedDict): - type: Literal["LARGE"] - -CommandErrorType = ( - CommandErrorType_PROHIBITED - | CommandErrorType_SYNTAX - | CommandErrorType_NO_CONN - | CommandErrorType_SIZE - | CommandErrorType_LARGE -) - -CommandErrorType_Tag = Literal["PROHIBITED", "SYNTAX", "NO_CONN", "SIZE", "LARGE"] - -class CommentsGroupPreference(TypedDict): - enable: "GroupFeatureEnabled" - duration: NotRequired[int] # int - -class ComposedMessage(TypedDict): - fileSource: NotRequired["CryptoFile"] - quotedItemId: NotRequired[int] # int64 - msgContent: "MsgContent" - mentions: dict[str, int] # str : int64 - -class ConnStatus_new(TypedDict): - type: Literal["new"] - -class ConnStatus_prepared(TypedDict): - type: Literal["prepared"] - -class ConnStatus_joined(TypedDict): - type: Literal["joined"] - -class ConnStatus_requested(TypedDict): - type: Literal["requested"] - -class ConnStatus_accepted(TypedDict): - type: Literal["accepted"] - -class ConnStatus_sndReady(TypedDict): - type: Literal["sndReady"] - -class ConnStatus_ready(TypedDict): - type: Literal["ready"] - -class ConnStatus_deleted(TypedDict): - type: Literal["deleted"] - -class ConnStatus_failed(TypedDict): - type: Literal["failed"] - connError: str - -ConnStatus = ( - ConnStatus_new - | ConnStatus_prepared - | ConnStatus_joined - | ConnStatus_requested - | ConnStatus_accepted - | ConnStatus_sndReady - | ConnStatus_ready - | ConnStatus_deleted - | ConnStatus_failed -) - -ConnStatus_Tag = Literal["new", "prepared", "joined", "requested", "accepted", "sndReady", "ready", "deleted", "failed"] - -ConnType = Literal["contact", "member", "user_contact"] - -class Connection(TypedDict): - connId: int # int64 - agentConnId: str - connChatVersion: int # int - peerChatVRange: "VersionRange" - connLevel: int # int - viaContact: NotRequired[int] # int64 - viaUserContactLink: NotRequired[int] # int64 - viaGroupLink: bool - groupLinkId: NotRequired[str] - xContactId: NotRequired[str] - customUserProfileId: NotRequired[int] # int64 - connType: "ConnType" - connStatus: "ConnStatus" - contactConnInitiated: bool - localAlias: str - entityId: NotRequired[int] # int64 - connectionCode: NotRequired["SecurityCode"] - pqSupport: bool - pqEncryption: bool - pqSndEnabled: NotRequired[bool] - pqRcvEnabled: NotRequired[bool] - authErrCounter: int # int - quotaErrCounter: int # int - createdAt: str # ISO-8601 timestamp - -class ConnectionEntity_rcvDirectMsgConnection(TypedDict): - type: Literal["rcvDirectMsgConnection"] - entityConnection: "Connection" - contact: NotRequired["Contact"] - -class ConnectionEntity_rcvGroupMsgConnection(TypedDict): - type: Literal["rcvGroupMsgConnection"] - entityConnection: "Connection" - groupInfo: "GroupInfo" - groupMember: "GroupMember" - -class ConnectionEntity_userContactConnection(TypedDict): - type: Literal["userContactConnection"] - entityConnection: "Connection" - userContact: "UserContact" - -ConnectionEntity = ( - ConnectionEntity_rcvDirectMsgConnection - | ConnectionEntity_rcvGroupMsgConnection - | ConnectionEntity_userContactConnection -) - -ConnectionEntity_Tag = Literal["rcvDirectMsgConnection", "rcvGroupMsgConnection", "userContactConnection"] - -class ConnectionErrorType_NOT_FOUND(TypedDict): - type: Literal["NOT_FOUND"] - -class ConnectionErrorType_DUPLICATE(TypedDict): - type: Literal["DUPLICATE"] - -class ConnectionErrorType_SIMPLEX(TypedDict): - type: Literal["SIMPLEX"] - -class ConnectionErrorType_NOT_ACCEPTED(TypedDict): - type: Literal["NOT_ACCEPTED"] - -class ConnectionErrorType_NOT_AVAILABLE(TypedDict): - type: Literal["NOT_AVAILABLE"] - -ConnectionErrorType = ( - ConnectionErrorType_NOT_FOUND - | ConnectionErrorType_DUPLICATE - | ConnectionErrorType_SIMPLEX - | ConnectionErrorType_NOT_ACCEPTED - | ConnectionErrorType_NOT_AVAILABLE -) - -ConnectionErrorType_Tag = Literal["NOT_FOUND", "DUPLICATE", "SIMPLEX", "NOT_ACCEPTED", "NOT_AVAILABLE"] - -ConnectionMode = Literal["INV", "CON"] - -class ConnectionPlan_invitationLink(TypedDict): - type: Literal["invitationLink"] - invitationLinkPlan: "InvitationLinkPlan" - -class ConnectionPlan_contactAddress(TypedDict): - type: Literal["contactAddress"] - contactAddressPlan: "ContactAddressPlan" - -class ConnectionPlan_groupLink(TypedDict): - type: Literal["groupLink"] - groupLinkPlan: "GroupLinkPlan" - -class ConnectionPlan_error(TypedDict): - type: Literal["error"] - chatError: "ChatError" - -ConnectionPlan = ( - ConnectionPlan_invitationLink - | ConnectionPlan_contactAddress - | ConnectionPlan_groupLink - | ConnectionPlan_error -) - -ConnectionPlan_Tag = Literal["invitationLink", "contactAddress", "groupLink", "error"] - -class Contact(TypedDict): - contactId: int # int64 - localDisplayName: str - profile: "LocalProfile" - activeConn: NotRequired["Connection"] - contactUsed: bool - contactStatus: "ContactStatus" - chatSettings: "ChatSettings" - userPreferences: "Preferences" - mergedPreferences: "ContactUserPreferences" - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - chatTs: NotRequired[str] # ISO-8601 timestamp - preparedContact: NotRequired["PreparedContact"] - contactRequestId: NotRequired[int] # int64 - contactGroupMemberId: NotRequired[int] # int64 - contactGrpInvSent: bool - groupDirectInv: NotRequired["GroupDirectInvitation"] - chatTags: list[int] # int64 - chatItemTTL: NotRequired[int] # int64 - uiThemes: NotRequired["UIThemeEntityOverrides"] - chatDeleted: bool - customData: NotRequired[dict[str, object]] - -class ContactAddressPlan_ok(TypedDict): - type: Literal["ok"] - contactSLinkData_: NotRequired["ContactShortLinkData"] - ownerVerification: NotRequired["OwnerVerification"] - -class ContactAddressPlan_ownLink(TypedDict): - type: Literal["ownLink"] - -class ContactAddressPlan_connectingConfirmReconnect(TypedDict): - type: Literal["connectingConfirmReconnect"] - -class ContactAddressPlan_connectingProhibit(TypedDict): - type: Literal["connectingProhibit"] - contact: "Contact" - -class ContactAddressPlan_known(TypedDict): - type: Literal["known"] - contact: "Contact" - -class ContactAddressPlan_contactViaAddress(TypedDict): - type: Literal["contactViaAddress"] - contact: "Contact" - -ContactAddressPlan = ( - ContactAddressPlan_ok - | ContactAddressPlan_ownLink - | ContactAddressPlan_connectingConfirmReconnect - | ContactAddressPlan_connectingProhibit - | ContactAddressPlan_known - | ContactAddressPlan_contactViaAddress -) - -ContactAddressPlan_Tag = Literal["ok", "ownLink", "connectingConfirmReconnect", "connectingProhibit", "known", "contactViaAddress"] - -class ContactShortLinkData(TypedDict): - profile: "Profile" - message: NotRequired["MsgContent"] - business: bool - localBadge: NotRequired["LocalBadge"] - -ContactStatus = Literal["active", "deleted", "deletedByUser"] - -class ContactUserPref_contact(TypedDict): - type: Literal["contact"] - preference: "SimplePreference" - -class ContactUserPref_user(TypedDict): - type: Literal["user"] - preference: "SimplePreference" - -ContactUserPref = ContactUserPref_contact | ContactUserPref_user - -ContactUserPref_Tag = Literal["contact", "user"] - -class ContactUserPreference(TypedDict): - enabled: "PrefEnabled" - userPreference: "ContactUserPref" - contactPreference: "SimplePreference" - -class ContactUserPreferences(TypedDict): - timedMessages: "ContactUserPreference" - fullDelete: "ContactUserPreference" - reactions: "ContactUserPreference" - voice: "ContactUserPreference" - files: "ContactUserPreference" - calls: "ContactUserPreference" - sessions: "ContactUserPreference" - commands: NotRequired[list["ChatBotCommand"]] - -class CreatedConnLink(TypedDict): - connFullLink: str - connShortLink: NotRequired[str] - - -def CreatedConnLink_cmd_string(self: CreatedConnLink) -> str: - return self['connFullLink'] + ((' ' + self.get('connShortLink')) if self.get('connShortLink') is not None else '') - -class CryptoFile(TypedDict): - filePath: str - cryptoArgs: NotRequired["CryptoFileArgs"] - -class CryptoFileArgs(TypedDict): - fileKey: str - fileNonce: str - -class DroppedMsg(TypedDict): - brokerTs: str # ISO-8601 timestamp - attempts: int # int - -class E2EInfo(TypedDict): - public: NotRequired[bool] - pqEnabled: NotRequired[bool] - -class ErrorType_BLOCK(TypedDict): - type: Literal["BLOCK"] - -class ErrorType_SESSION(TypedDict): - type: Literal["SESSION"] - -class ErrorType_CMD(TypedDict): - type: Literal["CMD"] - cmdErr: "CommandError" - -class ErrorType_PROXY(TypedDict): - type: Literal["PROXY"] - proxyErr: "ProxyError" - -class ErrorType_AUTH(TypedDict): - type: Literal["AUTH"] - -class ErrorType_BLOCKED(TypedDict): - type: Literal["BLOCKED"] - blockInfo: "BlockingInfo" - -class ErrorType_SERVICE(TypedDict): - type: Literal["SERVICE"] - -class ErrorType_CRYPTO(TypedDict): - type: Literal["CRYPTO"] - -class ErrorType_QUOTA(TypedDict): - type: Literal["QUOTA"] - -class ErrorType_STORE(TypedDict): - type: Literal["STORE"] - storeErr: str - -class ErrorType_NO_MSG(TypedDict): - type: Literal["NO_MSG"] - -class ErrorType_LARGE_MSG(TypedDict): - type: Literal["LARGE_MSG"] - -class ErrorType_EXPIRED(TypedDict): - type: Literal["EXPIRED"] - -class ErrorType_INTERNAL(TypedDict): - type: Literal["INTERNAL"] - -class ErrorType_NAME(TypedDict): - type: Literal["NAME"] - nameErr: "NameErrorType" - -class ErrorType_DUPLICATE_(TypedDict): - type: Literal["DUPLICATE_"] - -ErrorType = ( - ErrorType_BLOCK - | ErrorType_SESSION - | ErrorType_CMD - | ErrorType_PROXY - | ErrorType_AUTH - | ErrorType_BLOCKED - | ErrorType_SERVICE - | ErrorType_CRYPTO - | ErrorType_QUOTA - | ErrorType_STORE - | ErrorType_NO_MSG - | ErrorType_LARGE_MSG - | ErrorType_EXPIRED - | ErrorType_INTERNAL - | ErrorType_NAME - | ErrorType_DUPLICATE_ -) - -ErrorType_Tag = Literal["BLOCK", "SESSION", "CMD", "PROXY", "AUTH", "BLOCKED", "SERVICE", "CRYPTO", "QUOTA", "STORE", "NO_MSG", "LARGE_MSG", "EXPIRED", "INTERNAL", "NAME", "DUPLICATE_"] - -FeatureAllowed = Literal["always", "yes", "no"] - -class FileDescr(TypedDict): - fileDescrText: str - fileDescrPartNo: int # int - fileDescrComplete: bool - -class FileError_auth(TypedDict): - type: Literal["auth"] - -class FileError_blocked(TypedDict): - type: Literal["blocked"] - server: str - blockInfo: "BlockingInfo" - -class FileError_noFile(TypedDict): - type: Literal["noFile"] - -class FileError_relay(TypedDict): - type: Literal["relay"] - srvError: "SrvError" - -class FileError_other(TypedDict): - type: Literal["other"] - fileError: str - -FileError = ( - FileError_auth - | FileError_blocked - | FileError_noFile - | FileError_relay - | FileError_other -) - -FileError_Tag = Literal["auth", "blocked", "noFile", "relay", "other"] - -class FileErrorType_NOT_APPROVED(TypedDict): - type: Literal["NOT_APPROVED"] - -class FileErrorType_SIZE(TypedDict): - type: Literal["SIZE"] - -class FileErrorType_REDIRECT(TypedDict): - type: Literal["REDIRECT"] - redirectError: str - -class FileErrorType_FILE_IO(TypedDict): - type: Literal["FILE_IO"] - fileIOError: str - -class FileErrorType_NO_FILE(TypedDict): - type: Literal["NO_FILE"] - -FileErrorType = ( - FileErrorType_NOT_APPROVED - | FileErrorType_SIZE - | FileErrorType_REDIRECT - | FileErrorType_FILE_IO - | FileErrorType_NO_FILE -) - -FileErrorType_Tag = Literal["NOT_APPROVED", "SIZE", "REDIRECT", "FILE_IO", "NO_FILE"] - -class FileInvitation(TypedDict): - fileName: str - fileSize: int # int64 - fileDigest: NotRequired[str] - fileConnReq: NotRequired[str] - fileInline: NotRequired["InlineFileMode"] - fileDescr: NotRequired["FileDescr"] - -FileProtocol = Literal["SMP", "XFTP", "LOCAL"] - -FileStatus = Literal["new", "accepted", "connected", "complete", "cancelled"] - -class FileTransferMeta(TypedDict): - fileId: int # int64 - xftpSndFile: NotRequired["XFTPSndFile"] - xftpRedirectFor: NotRequired[int] # int64 - fileName: str - filePath: str - fileSize: int # int64 - fileInline: NotRequired["InlineFileMode"] - chunkSize: int # int64 - cancelled: bool - -FileType = Literal["normal", "roster"] - -class Format_bold(TypedDict): - type: Literal["bold"] - -class Format_italic(TypedDict): - type: Literal["italic"] - -class Format_strikeThrough(TypedDict): - type: Literal["strikeThrough"] - -class Format_snippet(TypedDict): - type: Literal["snippet"] - -class Format_secret(TypedDict): - type: Literal["secret"] - -class Format_small(TypedDict): - type: Literal["small"] - -class Format_colored(TypedDict): - type: Literal["colored"] - color: "Color" - -class Format_uri(TypedDict): - type: Literal["uri"] - -class Format_hyperLink(TypedDict): - type: Literal["hyperLink"] - showText: NotRequired[str] - linkUri: str - -class Format_simplexLink(TypedDict): - type: Literal["simplexLink"] - showText: NotRequired[str] - linkType: "SimplexLinkType" - simplexUri: str - smpHosts: list[str] # non-empty - -class Format_simplexName(TypedDict): - type: Literal["simplexName"] - nameInfo: "SimplexNameInfo" - -class Format_command(TypedDict): - type: Literal["command"] - commandStr: str - -class Format_mention(TypedDict): - type: Literal["mention"] - memberName: str - -class Format_email(TypedDict): - type: Literal["email"] - -class Format_phone(TypedDict): - type: Literal["phone"] - -Format = ( - Format_bold - | Format_italic - | Format_strikeThrough - | Format_snippet - | Format_secret - | Format_small - | Format_colored - | Format_uri - | Format_hyperLink - | Format_simplexLink - | Format_simplexName - | Format_command - | Format_mention - | Format_email - | Format_phone -) - -Format_Tag = Literal["bold", "italic", "strikeThrough", "snippet", "secret", "small", "colored", "uri", "hyperLink", "simplexLink", "simplexName", "command", "mention", "email", "phone"] - -class FormattedText(TypedDict): - format: NotRequired["Format"] - text: str - -class FullGroupPreferences(TypedDict): - timedMessages: "TimedMessagesGroupPreference" - directMessages: "RoleGroupPreference" - fullDelete: "GroupPreference" - reactions: "GroupPreference" - voice: "RoleGroupPreference" - files: "RoleGroupPreference" - simplexLinks: "RoleGroupPreference" - reports: "GroupPreference" - history: "GroupPreference" - support: "SupportGroupPreference" - sessions: "RoleGroupPreference" - comments: "CommentsGroupPreference" - signMessages: "GroupPreference" - commands: list["ChatBotCommand"] - -class FullPreferences(TypedDict): - timedMessages: "TimedMessagesPreference" - fullDelete: "SimplePreference" - reactions: "SimplePreference" - voice: "SimplePreference" - files: "SimplePreference" - calls: "SimplePreference" - sessions: "SimplePreference" - commands: list["ChatBotCommand"] - -class Group(TypedDict): - groupInfo: "GroupInfo" - members: list["GroupMember"] - -class GroupChatScope_memberSupport(TypedDict): - type: Literal["memberSupport"] - groupMemberId_: NotRequired[int] # int64 - -GroupChatScope = GroupChatScope_memberSupport - -GroupChatScope_Tag = Literal["memberSupport"] - - -def GroupChatScope_cmd_string(self: GroupChatScope) -> str: - return '(_support' + ((':' + str(self.get('groupMemberId_'))) if self.get('groupMemberId_') is not None else '') + ')' # type: ignore[typeddict-item] - -class GroupChatScopeInfo_memberSupport(TypedDict): - type: Literal["memberSupport"] - groupMember_: NotRequired["GroupMember"] - -GroupChatScopeInfo = GroupChatScopeInfo_memberSupport - -GroupChatScopeInfo_Tag = Literal["memberSupport"] - -class GroupDirectInvitation(TypedDict): - groupDirectInvLink: str - fromGroupId_: NotRequired[int] # int64 - fromGroupMemberId_: NotRequired[int] # int64 - fromGroupMemberConnId_: NotRequired[int] # int64 - groupDirectInvStartedConnection: bool - -GroupFeature = Literal["timedMessages", "directMessages", "fullDelete", "reactions", "voice", "files", "simplexLinks", "reports", "history", "support", "sessions", "comments", "signMessages"] - -GroupFeatureEnabled = Literal["on", "off"] - -class GroupInfo(TypedDict): - groupId: int # int64 - useRelays: bool - relayOwnStatus: NotRequired["RelayStatus"] - localDisplayName: str - groupProfile: "GroupProfile" - localAlias: str - businessChat: NotRequired["BusinessChatInfo"] - fullGroupPreferences: "FullGroupPreferences" - membership: "GroupMember" - chatSettings: "ChatSettings" - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - chatTs: NotRequired[str] # ISO-8601 timestamp - userMemberProfileSentAt: NotRequired[str] # ISO-8601 timestamp - preparedGroup: NotRequired["PreparedGroup"] - chatTags: list[int] # int64 - chatItemTTL: NotRequired[int] # int64 - uiThemes: NotRequired["UIThemeEntityOverrides"] - customData: NotRequired[dict[str, object]] - groupSummary: "GroupSummary" - rosterVersion: NotRequired[int] # int64 - membersRequireAttention: int # int - viaGroupLinkUri: NotRequired[str] - groupKeys: NotRequired["GroupKeys"] - groupDomainVerified: NotRequired[bool] - -class GroupKeys(TypedDict): - publicGroupKeys: NotRequired["PublicGroupKeys"] - memberPrivKey: str - -class GroupLink(TypedDict): - userContactLinkId: int # int64 - connLinkContact: "CreatedConnLink" - shortLinkDataSet: bool - shortLinkLargeDataSet: bool - groupLinkId: str - acceptMemberRole: "GroupMemberRole" - -class GroupLinkOwner(TypedDict): - memberId: str - memberKey: str - -class GroupLinkPlan_ok(TypedDict): - type: Literal["ok"] - groupSLinkInfo_: NotRequired["GroupShortLinkInfo"] - groupSLinkData_: NotRequired["GroupShortLinkData"] - ownerVerification: NotRequired["OwnerVerification"] - -class GroupLinkPlan_ownLink(TypedDict): - type: Literal["ownLink"] - groupInfo: "GroupInfo" - -class GroupLinkPlan_connectingConfirmReconnect(TypedDict): - type: Literal["connectingConfirmReconnect"] - -class GroupLinkPlan_connectingProhibit(TypedDict): - type: Literal["connectingProhibit"] - groupInfo_: NotRequired["GroupInfo"] - -class GroupLinkPlan_known(TypedDict): - type: Literal["known"] - groupInfo: "GroupInfo" - groupUpdated: bool - ownerVerification: NotRequired["OwnerVerification"] - linkOwners: list["GroupLinkOwner"] - -class GroupLinkPlan_noRelays(TypedDict): - type: Literal["noRelays"] - groupSLinkData_: NotRequired["GroupShortLinkData"] - -class GroupLinkPlan_updateRequired(TypedDict): - type: Literal["updateRequired"] - groupSLinkData_: NotRequired["GroupShortLinkData"] - -GroupLinkPlan = ( - GroupLinkPlan_ok - | GroupLinkPlan_ownLink - | GroupLinkPlan_connectingConfirmReconnect - | GroupLinkPlan_connectingProhibit - | GroupLinkPlan_known - | GroupLinkPlan_noRelays - | GroupLinkPlan_updateRequired -) - -GroupLinkPlan_Tag = Literal["ok", "ownLink", "connectingConfirmReconnect", "connectingProhibit", "known", "noRelays", "updateRequired"] - -class GroupMember(TypedDict): - groupMemberId: int # int64 - groupId: int # int64 - indexInGroup: int # int64 - memberId: str - memberRole: "GroupMemberRole" - memberCategory: "GroupMemberCategory" - memberStatus: "GroupMemberStatus" - memberSettings: "GroupMemberSettings" - blockedByAdmin: bool - invitedBy: "InvitedBy" - invitedByGroupMemberId: NotRequired[int] # int64 - localDisplayName: str - memberProfile: "LocalProfile" - memberContactId: NotRequired[int] # int64 - memberContactProfileId: int # int64 - activeConn: NotRequired["Connection"] - memberChatVRange: "VersionRange" - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - supportChat: NotRequired["GroupSupportChat"] - memberPubKey: NotRequired[str] - userMemberKeySent: bool - relayLink: NotRequired[str] - memberVerifiedCode: NotRequired["SecurityCode"] - -class GroupMemberAdmission(TypedDict): - review: NotRequired["MemberCriteria"] - -GroupMemberCategory = Literal["user", "invitee", "host", "pre", "post"] - -class GroupMemberRef(TypedDict): - groupMemberId: int # int64 - profile: "Profile" - -GroupMemberRole = Literal["relay", "observer", "author", "member", "moderator", "admin", "owner"] - -class GroupMemberSettings(TypedDict): - showMessages: bool - -GroupMemberStatus = Literal["rejected", "removed", "left", "deleted", "unknown", "invited", "pending_approval", "pending_review", "introduced", "intro-inv", "accepted", "announced", "connected", "complete", "creator"] - -class GroupPreference(TypedDict): - enable: "GroupFeatureEnabled" - -class GroupPreferences(TypedDict): - timedMessages: NotRequired["TimedMessagesGroupPreference"] - directMessages: NotRequired["RoleGroupPreference"] - fullDelete: NotRequired["GroupPreference"] - reactions: NotRequired["GroupPreference"] - voice: NotRequired["RoleGroupPreference"] - files: NotRequired["RoleGroupPreference"] - simplexLinks: NotRequired["RoleGroupPreference"] - reports: NotRequired["GroupPreference"] - history: NotRequired["GroupPreference"] - support: NotRequired["SupportGroupPreference"] - sessions: NotRequired["RoleGroupPreference"] - comments: NotRequired["CommentsGroupPreference"] - signMessages: NotRequired["GroupPreference"] - commands: NotRequired[list["ChatBotCommand"]] - -class GroupProfile(TypedDict): - displayName: str - fullName: str - shortDescr: NotRequired[str] - description: NotRequired[str] - image: NotRequired[str] - publicGroup: NotRequired["PublicGroupProfile"] - groupPreferences: NotRequired["GroupPreferences"] - memberAdmission: NotRequired["GroupMemberAdmission"] - -class GroupRelay(TypedDict): - groupRelayId: int # int64 - groupMemberId: int # int64 - userChatRelay: "UserChatRelay" - relayStatus: "RelayStatus" - relayLink: NotRequired[str] - relayCap: "RelayCapabilities" - -class GroupRootKey_private(TypedDict): - type: Literal["private"] - rootPrivKey: str - -class GroupRootKey_public(TypedDict): - type: Literal["public"] - rootPubKey: str - -GroupRootKey = GroupRootKey_private | GroupRootKey_public - -GroupRootKey_Tag = Literal["private", "public"] - -class GroupShortLinkData(TypedDict): - groupProfile: "GroupProfile" - publicGroupData: NotRequired["PublicGroupData"] - -class GroupShortLinkInfo(TypedDict): - direct: bool - groupRelays: list[str] - publicGroupId: NotRequired[str] - -class GroupSummary(TypedDict): - currentMembers: int # int64 - publicMemberCount: NotRequired[int] # int64 - -class GroupSupportChat(TypedDict): - chatTs: str # ISO-8601 timestamp - unread: int # int64 - memberAttention: int # int64 - mentions: int # int64 - lastMsgFromMemberTs: NotRequired[str] # ISO-8601 timestamp - -GroupType = Literal["channel", "group"] - -HandshakeError = Literal["PARSE", "IDENTITY", "BAD_AUTH", "BAD_SERVICE"] - -InlineFileMode = Literal["offer", "sent"] - -class InvitationLinkPlan_ok(TypedDict): - type: Literal["ok"] - contactSLinkData_: NotRequired["ContactShortLinkData"] - ownerVerification: NotRequired["OwnerVerification"] - -class InvitationLinkPlan_ownLink(TypedDict): - type: Literal["ownLink"] - -class InvitationLinkPlan_connecting(TypedDict): - type: Literal["connecting"] - contact_: NotRequired["Contact"] - -class InvitationLinkPlan_known(TypedDict): - type: Literal["known"] - contact: "Contact" - -InvitationLinkPlan = ( - InvitationLinkPlan_ok - | InvitationLinkPlan_ownLink - | InvitationLinkPlan_connecting - | InvitationLinkPlan_known -) - -InvitationLinkPlan_Tag = Literal["ok", "ownLink", "connecting", "known"] - -class InvitedBy_contact(TypedDict): - type: Literal["contact"] - byContactId: int # int64 - -class InvitedBy_user(TypedDict): - type: Literal["user"] - -class InvitedBy_unknown(TypedDict): - type: Literal["unknown"] - -InvitedBy = InvitedBy_contact | InvitedBy_user | InvitedBy_unknown - -InvitedBy_Tag = Literal["contact", "user", "unknown"] - -class LinkContent_page(TypedDict): - type: Literal["page"] - -class LinkContent_image(TypedDict): - type: Literal["image"] - -class LinkContent_video(TypedDict): - type: Literal["video"] - duration: NotRequired[int] # int - -class LinkContent_unknown(TypedDict): - type: Literal["unknown"] - tag: str - json: dict[str, object] - -LinkContent = LinkContent_page | LinkContent_image | LinkContent_video | LinkContent_unknown - -LinkContent_Tag = Literal["page", "image", "video", "unknown"] - -class LinkOwnerSig(TypedDict): - ownerId: NotRequired[str] - chatBinding: str - ownerSig: str - -class LinkPreview(TypedDict): - uri: str - title: str - description: str - image: str - content: NotRequired["LinkContent"] - -class LocalBadge(TypedDict): - badge: "BadgeInfo" - status: "BadgeStatus" - -class LocalProfile(TypedDict): - profileId: int # int64 - displayName: str - fullName: str - shortDescr: NotRequired[str] - description: NotRequired[str] - image: NotRequired[str] - contactLink: NotRequired[str] - preferences: NotRequired["Preferences"] - peerType: NotRequired["ChatPeerType"] - localBadge: NotRequired["LocalBadge"] - localAlias: str - contactDomain: NotRequired["SimplexDomainClaim"] - contactDomainVerified: NotRequired[bool] - -MemberCriteria = Literal["all"] - -# Connection link sent in a message - only short links are allowed. - -class MsgChatLink_contact(TypedDict): - type: Literal["contact"] - connLink: str - profile: "Profile" - business: bool - -class MsgChatLink_invitation(TypedDict): - type: Literal["invitation"] - invLink: str - profile: "Profile" - -class MsgChatLink_group(TypedDict): - type: Literal["group"] - connLink: str - groupProfile: "GroupProfile" - -MsgChatLink = MsgChatLink_contact | MsgChatLink_invitation | MsgChatLink_group - -MsgChatLink_Tag = Literal["contact", "invitation", "group"] - -class MsgContent_text(TypedDict): - type: Literal["text"] - text: str - -class MsgContent_link(TypedDict): - type: Literal["link"] - text: str - preview: "LinkPreview" - -class MsgContent_image(TypedDict): - type: Literal["image"] - text: str - image: str - -class MsgContent_video(TypedDict): - type: Literal["video"] - text: str - image: str - duration: int # int - -class MsgContent_voice(TypedDict): - type: Literal["voice"] - text: str - duration: int # int - -class MsgContent_file(TypedDict): - type: Literal["file"] - text: str - -class MsgContent_report(TypedDict): - type: Literal["report"] - text: str - reason: "ReportReason" - -class MsgContent_chat(TypedDict): - type: Literal["chat"] - text: str - chatLink: "MsgChatLink" - ownerSig: NotRequired["LinkOwnerSig"] - -class MsgContent_unknown(TypedDict): - type: Literal["unknown"] - tag: str - text: str - json: dict[str, object] - -MsgContent = ( - MsgContent_text - | MsgContent_link - | MsgContent_image - | MsgContent_video - | MsgContent_voice - | MsgContent_file - | MsgContent_report - | MsgContent_chat - | MsgContent_unknown -) - -MsgContent_Tag = Literal["text", "link", "image", "video", "voice", "file", "report", "chat", "unknown"] - -MsgDecryptError = Literal["ratchetHeader", "tooManySkipped", "ratchetEarlier", "other", "ratchetSync"] - -MsgDirection = Literal["rcv", "snd"] - -class MsgErrorType_msgSkipped(TypedDict): - type: Literal["msgSkipped"] - fromMsgId: int # int64 - toMsgId: int # int64 - -class MsgErrorType_msgBadId(TypedDict): - type: Literal["msgBadId"] - msgId: int # int64 - -class MsgErrorType_msgBadHash(TypedDict): - type: Literal["msgBadHash"] - -class MsgErrorType_msgDuplicate(TypedDict): - type: Literal["msgDuplicate"] - -MsgErrorType = ( - MsgErrorType_msgSkipped - | MsgErrorType_msgBadId - | MsgErrorType_msgBadHash - | MsgErrorType_msgDuplicate -) - -MsgErrorType_Tag = Literal["msgSkipped", "msgBadId", "msgBadHash", "msgDuplicate"] - -MsgFilter = Literal["none", "all", "mentions"] - -class MsgReaction_emoji(TypedDict): - type: Literal["emoji"] - emoji: str - -class MsgReaction_unknown(TypedDict): - type: Literal["unknown"] - tag: str - json: dict[str, object] - -MsgReaction = MsgReaction_emoji | MsgReaction_unknown - -MsgReaction_Tag = Literal["emoji", "unknown"] - -MsgReceiptStatus = Literal["ok", "badMsgHash"] - -MsgSigStatus = Literal["verified", "signedNoKey"] - -class MsgVerified_signed(TypedDict): - type: Literal["signed"] - sigStatus: "MsgSigStatus" - -class MsgVerified_sigMissing(TypedDict): - type: Literal["sigMissing"] - -MsgVerified = MsgVerified_signed | MsgVerified_sigMissing - -MsgVerified_Tag = Literal["signed", "sigMissing"] - -class NameErrorType_NO_RESOLVER(TypedDict): - type: Literal["NO_RESOLVER"] - -class NameErrorType_NOT_FOUND(TypedDict): - type: Literal["NOT_FOUND"] - -class NameErrorType_RESOLVER(TypedDict): - type: Literal["RESOLVER"] - resolverErr: str - -NameErrorType = NameErrorType_NO_RESOLVER | NameErrorType_NOT_FOUND | NameErrorType_RESOLVER - -NameErrorType_Tag = Literal["NO_RESOLVER", "NOT_FOUND", "RESOLVER"] - -class NetworkError_connectError(TypedDict): - type: Literal["connectError"] - connectError: str - -class NetworkError_tLSError(TypedDict): - type: Literal["tLSError"] - tlsError: str - -class NetworkError_unknownCAError(TypedDict): - type: Literal["unknownCAError"] - -class NetworkError_failedError(TypedDict): - type: Literal["failedError"] - -class NetworkError_timeoutError(TypedDict): - type: Literal["timeoutError"] - -class NetworkError_subscribeError(TypedDict): - type: Literal["subscribeError"] - subscribeError: str - -NetworkError = ( - NetworkError_connectError - | NetworkError_tLSError - | NetworkError_unknownCAError - | NetworkError_failedError - | NetworkError_timeoutError - | NetworkError_subscribeError -) - -NetworkError_Tag = Literal["connectError", "tLSError", "unknownCAError", "failedError", "timeoutError", "subscribeError"] - -class NewUser(TypedDict): - profile: NotRequired["Profile"] - pastTimestamp: bool - userChatRelay: bool - clientService: bool - -class NoteFolder(TypedDict): - noteFolderId: int # int64 - userId: int # int64 - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - chatTs: str # ISO-8601 timestamp - favorite: bool - unread: bool - -class OwnerVerification_verified(TypedDict): - type: Literal["verified"] - -class OwnerVerification_failed(TypedDict): - type: Literal["failed"] - reason: str - -OwnerVerification = OwnerVerification_verified | OwnerVerification_failed - -OwnerVerification_Tag = Literal["verified", "failed"] - -class PaginationByTime_last(TypedDict): - type: Literal["last"] - count: int # int - -PaginationByTime = PaginationByTime_last - -PaginationByTime_Tag = Literal["last"] - - -def PaginationByTime_cmd_string(self: PaginationByTime) -> str: - return 'count=' + str(self['count']) # type: ignore[typeddict-item] - -class PendingContactConnection(TypedDict): - pccConnId: int # int64 - pccAgentConnId: str - pccConnStatus: "ConnStatus" - viaContactUri: bool - viaUserContactLink: NotRequired[int] # int64 - groupLinkId: NotRequired[str] - customUserProfileId: NotRequired[int] # int64 - connLinkInv: NotRequired["CreatedConnLink"] - localAlias: str - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - -PlanResolveMode = Literal["allGroups", "unknown", "never"] - -class PrefEnabled(TypedDict): - forUser: bool - forContact: bool - -class Preferences(TypedDict): - timedMessages: NotRequired["TimedMessagesPreference"] - fullDelete: NotRequired["SimplePreference"] - reactions: NotRequired["SimplePreference"] - voice: NotRequired["SimplePreference"] - files: NotRequired["SimplePreference"] - calls: NotRequired["SimplePreference"] - sessions: NotRequired["SimplePreference"] - commands: NotRequired[list["ChatBotCommand"]] - -class PreparedContact(TypedDict): - connLinkToConnect: "CreatedConnLink" - uiConnLinkType: "ConnectionMode" - welcomeSharedMsgId: NotRequired[str] - requestSharedMsgId: NotRequired[str] - -class PreparedGroup(TypedDict): - connLinkToConnect: "CreatedConnLink" - connLinkPreparedConnection: bool - connLinkStartedConnection: bool - welcomeSharedMsgId: NotRequired[str] - requestSharedMsgId: NotRequired[str] - -class Profile(TypedDict): - displayName: str - fullName: str - shortDescr: NotRequired[str] - description: NotRequired[str] - image: NotRequired[str] - contactLink: NotRequired[str] - preferences: NotRequired["Preferences"] - peerType: NotRequired["ChatPeerType"] - badge: NotRequired["BadgeProof"] - contactDomain: NotRequired["SimplexDomainClaim"] - -class ProxyClientError_protocolError(TypedDict): - type: Literal["protocolError"] - protocolErr: "ErrorType" - -class ProxyClientError_unexpectedResponse(TypedDict): - type: Literal["unexpectedResponse"] - responseStr: str - -class ProxyClientError_responseError(TypedDict): - type: Literal["responseError"] - responseErr: "ErrorType" - -ProxyClientError = ( - ProxyClientError_protocolError - | ProxyClientError_unexpectedResponse - | ProxyClientError_responseError -) - -ProxyClientError_Tag = Literal["protocolError", "unexpectedResponse", "responseError"] - -class ProxyError_PROTOCOL(TypedDict): - type: Literal["PROTOCOL"] - protocolErr: "ErrorType" - -class ProxyError_BROKER(TypedDict): - type: Literal["BROKER"] - brokerErr: "BrokerErrorType" - -class ProxyError_BASIC_AUTH(TypedDict): - type: Literal["BASIC_AUTH"] - -class ProxyError_NO_SESSION(TypedDict): - type: Literal["NO_SESSION"] - -ProxyError = ProxyError_PROTOCOL | ProxyError_BROKER | ProxyError_BASIC_AUTH | ProxyError_NO_SESSION - -ProxyError_Tag = Literal["PROTOCOL", "BROKER", "BASIC_AUTH", "NO_SESSION"] - -class PublicGroupAccess(TypedDict): - groupWebPage: NotRequired[str] - groupDomainClaim: NotRequired["SimplexDomainClaim"] - domainWebPage: bool - allowEmbedding: bool - -class PublicGroupData(TypedDict): - publicMemberCount: int # int64 - -class PublicGroupKeys(TypedDict): - publicGroupId: str - groupRootKey: "GroupRootKey" - -class PublicGroupProfile(TypedDict): - groupType: "GroupType" - groupLink: str - publicGroupId: str - publicGroupAccess: NotRequired["PublicGroupAccess"] - -class RCErrorType_internal(TypedDict): - type: Literal["internal"] - internalErr: str - -class RCErrorType_identity(TypedDict): - type: Literal["identity"] - -class RCErrorType_noLocalAddress(TypedDict): - type: Literal["noLocalAddress"] - -class RCErrorType_newController(TypedDict): - type: Literal["newController"] - -class RCErrorType_notDiscovered(TypedDict): - type: Literal["notDiscovered"] - -class RCErrorType_tLSStartFailed(TypedDict): - type: Literal["tLSStartFailed"] - -class RCErrorType_exception(TypedDict): - type: Literal["exception"] - exception: str - -class RCErrorType_ctrlAuth(TypedDict): - type: Literal["ctrlAuth"] - -class RCErrorType_ctrlNotFound(TypedDict): - type: Literal["ctrlNotFound"] - -class RCErrorType_ctrlError(TypedDict): - type: Literal["ctrlError"] - ctrlErr: str - -class RCErrorType_invitation(TypedDict): - type: Literal["invitation"] - -class RCErrorType_version(TypedDict): - type: Literal["version"] - -class RCErrorType_encrypt(TypedDict): - type: Literal["encrypt"] - -class RCErrorType_decrypt(TypedDict): - type: Literal["decrypt"] - -class RCErrorType_blockSize(TypedDict): - type: Literal["blockSize"] - -class RCErrorType_syntax(TypedDict): - type: Literal["syntax"] - syntaxErr: str - -RCErrorType = ( - RCErrorType_internal - | RCErrorType_identity - | RCErrorType_noLocalAddress - | RCErrorType_newController - | RCErrorType_notDiscovered - | RCErrorType_tLSStartFailed - | RCErrorType_exception - | RCErrorType_ctrlAuth - | RCErrorType_ctrlNotFound - | RCErrorType_ctrlError - | RCErrorType_invitation - | RCErrorType_version - | RCErrorType_encrypt - | RCErrorType_decrypt - | RCErrorType_blockSize - | RCErrorType_syntax -) - -RCErrorType_Tag = Literal["internal", "identity", "noLocalAddress", "newController", "notDiscovered", "tLSStartFailed", "exception", "ctrlAuth", "ctrlNotFound", "ctrlError", "invitation", "version", "encrypt", "decrypt", "blockSize", "syntax"] - -RatchetSyncState = Literal["ok", "allowed", "required", "started", "agreed"] - -class RcvConnEvent_switchQueue(TypedDict): - type: Literal["switchQueue"] - phase: "SwitchPhase" - -class RcvConnEvent_ratchetSync(TypedDict): - type: Literal["ratchetSync"] - syncStatus: "RatchetSyncState" - -class RcvConnEvent_verificationCodeReset(TypedDict): - type: Literal["verificationCodeReset"] - -class RcvConnEvent_pqEnabled(TypedDict): - type: Literal["pqEnabled"] - enabled: bool - -RcvConnEvent = ( - RcvConnEvent_switchQueue - | RcvConnEvent_ratchetSync - | RcvConnEvent_verificationCodeReset - | RcvConnEvent_pqEnabled -) - -RcvConnEvent_Tag = Literal["switchQueue", "ratchetSync", "verificationCodeReset", "pqEnabled"] - -class RcvDirectEvent_contactDeleted(TypedDict): - type: Literal["contactDeleted"] - -class RcvDirectEvent_profileUpdated(TypedDict): - type: Literal["profileUpdated"] - fromProfile: "Profile" - toProfile: "Profile" - -class RcvDirectEvent_groupInvLinkReceived(TypedDict): - type: Literal["groupInvLinkReceived"] - groupProfile: "GroupProfile" - -RcvDirectEvent = ( - RcvDirectEvent_contactDeleted - | RcvDirectEvent_profileUpdated - | RcvDirectEvent_groupInvLinkReceived -) - -RcvDirectEvent_Tag = Literal["contactDeleted", "profileUpdated", "groupInvLinkReceived"] - -class RcvFileDescr(TypedDict): - fileDescrId: int # int64 - fileDescrText: str - fileDescrPartNo: int # int - fileDescrComplete: bool - -class RcvFileStatus_new(TypedDict): - type: Literal["new"] - -class RcvFileStatus_accepted(TypedDict): - type: Literal["accepted"] - filePath: str - -class RcvFileStatus_connected(TypedDict): - type: Literal["connected"] - filePath: str - -class RcvFileStatus_complete(TypedDict): - type: Literal["complete"] - filePath: str - -class RcvFileStatus_cancelled(TypedDict): - type: Literal["cancelled"] - filePath_: NotRequired[str] - -RcvFileStatus = ( - RcvFileStatus_new - | RcvFileStatus_accepted - | RcvFileStatus_connected - | RcvFileStatus_complete - | RcvFileStatus_cancelled -) - -RcvFileStatus_Tag = Literal["new", "accepted", "connected", "complete", "cancelled"] - -class RcvFileTransfer(TypedDict): - fileId: int # int64 - xftpRcvFile: NotRequired["XFTPRcvFile"] - fileInvitation: "FileInvitation" - fileStatus: "RcvFileStatus" - fileType: "FileType" - rcvFileInline: NotRequired["InlineFileMode"] - senderDisplayName: str - chunkSize: int # int64 - cancelled: bool - grpMemberId: NotRequired[int] # int64 - cryptoArgs: NotRequired["CryptoFileArgs"] - -class RcvGroupEvent_memberAdded(TypedDict): - type: Literal["memberAdded"] - groupMemberId: int # int64 - profile: "Profile" - -class RcvGroupEvent_memberConnected(TypedDict): - type: Literal["memberConnected"] - -class RcvGroupEvent_memberAccepted(TypedDict): - type: Literal["memberAccepted"] - groupMemberId: int # int64 - profile: "Profile" - -class RcvGroupEvent_userAccepted(TypedDict): - type: Literal["userAccepted"] - -class RcvGroupEvent_memberLeft(TypedDict): - type: Literal["memberLeft"] - -class RcvGroupEvent_memberRole(TypedDict): - type: Literal["memberRole"] - groupMemberId: int # int64 - profile: "Profile" - role: "GroupMemberRole" - -class RcvGroupEvent_memberBlocked(TypedDict): - type: Literal["memberBlocked"] - groupMemberId: int # int64 - profile: "Profile" - blocked: bool - -class RcvGroupEvent_userRole(TypedDict): - type: Literal["userRole"] - role: "GroupMemberRole" - -class RcvGroupEvent_memberDeleted(TypedDict): - type: Literal["memberDeleted"] - groupMemberId: int # int64 - profile: "Profile" - -class RcvGroupEvent_userDeleted(TypedDict): - type: Literal["userDeleted"] - -class RcvGroupEvent_groupDeleted(TypedDict): - type: Literal["groupDeleted"] - -class RcvGroupEvent_groupUpdated(TypedDict): - type: Literal["groupUpdated"] - groupProfile: "GroupProfile" - -class RcvGroupEvent_invitedViaGroupLink(TypedDict): - type: Literal["invitedViaGroupLink"] - -class RcvGroupEvent_memberCreatedContact(TypedDict): - type: Literal["memberCreatedContact"] - -class RcvGroupEvent_memberProfileUpdated(TypedDict): - type: Literal["memberProfileUpdated"] - fromProfile: "Profile" - toProfile: "Profile" - -class RcvGroupEvent_newMemberPendingReview(TypedDict): - type: Literal["newMemberPendingReview"] - -class RcvGroupEvent_msgBadSignature(TypedDict): - type: Literal["msgBadSignature"] - -RcvGroupEvent = ( - RcvGroupEvent_memberAdded - | RcvGroupEvent_memberConnected - | RcvGroupEvent_memberAccepted - | RcvGroupEvent_userAccepted - | RcvGroupEvent_memberLeft - | RcvGroupEvent_memberRole - | RcvGroupEvent_memberBlocked - | RcvGroupEvent_userRole - | RcvGroupEvent_memberDeleted - | RcvGroupEvent_userDeleted - | RcvGroupEvent_groupDeleted - | RcvGroupEvent_groupUpdated - | RcvGroupEvent_invitedViaGroupLink - | RcvGroupEvent_memberCreatedContact - | RcvGroupEvent_memberProfileUpdated - | RcvGroupEvent_newMemberPendingReview - | RcvGroupEvent_msgBadSignature -) - -RcvGroupEvent_Tag = Literal["memberAdded", "memberConnected", "memberAccepted", "userAccepted", "memberLeft", "memberRole", "memberBlocked", "userRole", "memberDeleted", "userDeleted", "groupDeleted", "groupUpdated", "invitedViaGroupLink", "memberCreatedContact", "memberProfileUpdated", "newMemberPendingReview", "msgBadSignature"] - -class RcvMsgError_dropped(TypedDict): - type: Literal["dropped"] - attempts: int # int - -class RcvMsgError_parseError(TypedDict): - type: Literal["parseError"] - parseError: str - -RcvMsgError = RcvMsgError_dropped | RcvMsgError_parseError - -RcvMsgError_Tag = Literal["dropped", "parseError"] - -class RelayCapabilities(TypedDict): - webDomain: NotRequired[str] - -class RelayProfile(TypedDict): - displayName: str - fullName: str - shortDescr: NotRequired[str] - image: NotRequired[str] - -RelayStatus = Literal["new", "invited", "accepted", "acknowledgedRoster", "active", "inactive", "rejected"] - -ReportReason = Literal["spam", "content", "community", "profile", "other"] - -class RoleGroupPreference(TypedDict): - enable: "GroupFeatureEnabled" - role: NotRequired["GroupMemberRole"] - -class SMPAgentError_A_MESSAGE(TypedDict): - type: Literal["A_MESSAGE"] - -class SMPAgentError_A_PROHIBITED(TypedDict): - type: Literal["A_PROHIBITED"] - prohibitedErr: str - -class SMPAgentError_A_VERSION(TypedDict): - type: Literal["A_VERSION"] - -class SMPAgentError_A_LINK(TypedDict): - type: Literal["A_LINK"] - linkErr: str - -class SMPAgentError_A_CRYPTO(TypedDict): - type: Literal["A_CRYPTO"] - cryptoErr: "AgentCryptoError" - -class SMPAgentError_A_DUPLICATE(TypedDict): - type: Literal["A_DUPLICATE"] - droppedMsg_: NotRequired["DroppedMsg"] - -class SMPAgentError_A_QUEUE(TypedDict): - type: Literal["A_QUEUE"] - queueErr: str - -SMPAgentError = ( - SMPAgentError_A_MESSAGE - | SMPAgentError_A_PROHIBITED - | SMPAgentError_A_VERSION - | SMPAgentError_A_LINK - | SMPAgentError_A_CRYPTO - | SMPAgentError_A_DUPLICATE - | SMPAgentError_A_QUEUE -) - -SMPAgentError_Tag = Literal["A_MESSAGE", "A_PROHIBITED", "A_VERSION", "A_LINK", "A_CRYPTO", "A_DUPLICATE", "A_QUEUE"] - -class SecurityCode(TypedDict): - securityCode: str - verifiedAt: str # ISO-8601 timestamp - -class SimplePreference(TypedDict): - allow: "FeatureAllowed" - -class SimplexDomain(TypedDict): - nameTLD: "SimplexTLD" - domain: str - subDomain: list[str] - -class SimplexDomainClaim(TypedDict): - domain: str - proof: NotRequired["SimplexDomainProof"] - -class SimplexDomainError_noValidLink(TypedDict): - type: Literal["noValidLink"] - -class SimplexDomainError_unknownDomain(TypedDict): - type: Literal["unknownDomain"] - -SimplexDomainError = SimplexDomainError_noValidLink | SimplexDomainError_unknownDomain - -SimplexDomainError_Tag = Literal["noValidLink", "unknownDomain"] - -class SimplexDomainProof(TypedDict): - linkOwnerId: NotRequired[str] - presHeader: str - signature: str - -SimplexLinkType = Literal["contact", "invitation", "group", "channel", "relay"] - -class SimplexNameInfo(TypedDict): - nameType: "SimplexNameType" - nameDomain: "SimplexDomain" - -SimplexNameType = Literal["publicGroup", "contact"] - -SimplexTLD = Literal["simplex", "testing", "web"] - -SndCIStatusProgress = Literal["partial", "complete"] - -class SndConnEvent_switchQueue(TypedDict): - type: Literal["switchQueue"] - phase: "SwitchPhase" - member: NotRequired["GroupMemberRef"] - -class SndConnEvent_ratchetSync(TypedDict): - type: Literal["ratchetSync"] - syncStatus: "RatchetSyncState" - member: NotRequired["GroupMemberRef"] - -class SndConnEvent_pqEnabled(TypedDict): - type: Literal["pqEnabled"] - enabled: bool - -SndConnEvent = SndConnEvent_switchQueue | SndConnEvent_ratchetSync | SndConnEvent_pqEnabled - -SndConnEvent_Tag = Literal["switchQueue", "ratchetSync", "pqEnabled"] - -class SndError_auth(TypedDict): - type: Literal["auth"] - -class SndError_quota(TypedDict): - type: Literal["quota"] - -class SndError_expired(TypedDict): - type: Literal["expired"] - -class SndError_relay(TypedDict): - type: Literal["relay"] - srvError: "SrvError" - -class SndError_proxy(TypedDict): - type: Literal["proxy"] - proxyServer: str - srvError: "SrvError" - -class SndError_proxyRelay(TypedDict): - type: Literal["proxyRelay"] - proxyServer: str - srvError: "SrvError" - -class SndError_other(TypedDict): - type: Literal["other"] - sndError: str - -SndError = ( - SndError_auth - | SndError_quota - | SndError_expired - | SndError_relay - | SndError_proxy - | SndError_proxyRelay - | SndError_other -) - -SndError_Tag = Literal["auth", "quota", "expired", "relay", "proxy", "proxyRelay", "other"] - -class SndFileTransfer(TypedDict): - fileId: int # int64 - fileName: str - filePath: str - fileSize: int # int64 - chunkSize: int # int64 - recipientDisplayName: str - connId: int # int64 - agentConnId: str - groupMemberId: NotRequired[int] # int64 - fileStatus: "FileStatus" - fileDescrId: NotRequired[int] # int64 - fileInline: NotRequired["InlineFileMode"] - -class SndGroupEvent_memberRole(TypedDict): - type: Literal["memberRole"] - groupMemberId: int # int64 - profile: "Profile" - role: "GroupMemberRole" - -class SndGroupEvent_memberBlocked(TypedDict): - type: Literal["memberBlocked"] - groupMemberId: int # int64 - profile: "Profile" - blocked: bool - -class SndGroupEvent_userRole(TypedDict): - type: Literal["userRole"] - role: "GroupMemberRole" - -class SndGroupEvent_memberDeleted(TypedDict): - type: Literal["memberDeleted"] - groupMemberId: int # int64 - profile: "Profile" - -class SndGroupEvent_userLeft(TypedDict): - type: Literal["userLeft"] - -class SndGroupEvent_groupUpdated(TypedDict): - type: Literal["groupUpdated"] - groupProfile: "GroupProfile" - -class SndGroupEvent_memberAccepted(TypedDict): - type: Literal["memberAccepted"] - groupMemberId: int # int64 - profile: "Profile" - -class SndGroupEvent_userPendingReview(TypedDict): - type: Literal["userPendingReview"] - -SndGroupEvent = ( - SndGroupEvent_memberRole - | SndGroupEvent_memberBlocked - | SndGroupEvent_userRole - | SndGroupEvent_memberDeleted - | SndGroupEvent_userLeft - | SndGroupEvent_groupUpdated - | SndGroupEvent_memberAccepted - | SndGroupEvent_userPendingReview -) - -SndGroupEvent_Tag = Literal["memberRole", "memberBlocked", "userRole", "memberDeleted", "userLeft", "groupUpdated", "memberAccepted", "userPendingReview"] - -class SrvError_host(TypedDict): - type: Literal["host"] - -class SrvError_version(TypedDict): - type: Literal["version"] - -class SrvError_other(TypedDict): - type: Literal["other"] - srvError: str - -SrvError = SrvError_host | SrvError_version | SrvError_other - -SrvError_Tag = Literal["host", "version", "other"] - -class StoreError_duplicateName(TypedDict): - type: Literal["duplicateName"] - -class StoreError_userNotFound(TypedDict): - type: Literal["userNotFound"] - userId: int # int64 - -class StoreError_relayUserNotFound(TypedDict): - type: Literal["relayUserNotFound"] - -class StoreError_userNotFoundByName(TypedDict): - type: Literal["userNotFoundByName"] - contactName: str - -class StoreError_userNotFoundByContactId(TypedDict): - type: Literal["userNotFoundByContactId"] - contactId: int # int64 - -class StoreError_userNotFoundByGroupId(TypedDict): - type: Literal["userNotFoundByGroupId"] - groupId: int # int64 - -class StoreError_userNotFoundByFileId(TypedDict): - type: Literal["userNotFoundByFileId"] - fileId: int # int64 - -class StoreError_userNotFoundByContactRequestId(TypedDict): - type: Literal["userNotFoundByContactRequestId"] - contactRequestId: int # int64 - -class StoreError_contactNotFound(TypedDict): - type: Literal["contactNotFound"] - contactId: int # int64 - -class StoreError_contactNotFoundByName(TypedDict): - type: Literal["contactNotFoundByName"] - contactName: str - -class StoreError_contactNotFoundByMemberId(TypedDict): - type: Literal["contactNotFoundByMemberId"] - groupMemberId: int # int64 - -class StoreError_contactNotReady(TypedDict): - type: Literal["contactNotReady"] - contactName: str - -class StoreError_duplicateContactLink(TypedDict): - type: Literal["duplicateContactLink"] - -class StoreError_userContactLinkNotFound(TypedDict): - type: Literal["userContactLinkNotFound"] - -class StoreError_contactRequestNotFound(TypedDict): - type: Literal["contactRequestNotFound"] - contactRequestId: int # int64 - -class StoreError_contactRequestNotFoundByName(TypedDict): - type: Literal["contactRequestNotFoundByName"] - contactName: str - -class StoreError_invalidContactRequestEntity(TypedDict): - type: Literal["invalidContactRequestEntity"] - contactRequestId: int # int64 - -class StoreError_invalidBusinessChatContactRequest(TypedDict): - type: Literal["invalidBusinessChatContactRequest"] - -class StoreError_groupNotFound(TypedDict): - type: Literal["groupNotFound"] - groupId: int # int64 - -class StoreError_groupNotFoundByName(TypedDict): - type: Literal["groupNotFoundByName"] - groupName: str - -class StoreError_groupMemberNameNotFound(TypedDict): - type: Literal["groupMemberNameNotFound"] - groupId: int # int64 - groupMemberName: str - -class StoreError_groupMemberNotFound(TypedDict): - type: Literal["groupMemberNotFound"] - groupMemberId: int # int64 - -class StoreError_groupMemberNotFoundByIndex(TypedDict): - type: Literal["groupMemberNotFoundByIndex"] - groupMemberIndex: int # int64 - -class StoreError_memberRelationsVectorNotFound(TypedDict): - type: Literal["memberRelationsVectorNotFound"] - groupMemberId: int # int64 - -class StoreError_groupHostMemberNotFound(TypedDict): - type: Literal["groupHostMemberNotFound"] - groupId: int # int64 - -class StoreError_groupMemberNotFoundByMemberId(TypedDict): - type: Literal["groupMemberNotFoundByMemberId"] - memberId: str - -class StoreError_memberContactGroupMemberNotFound(TypedDict): - type: Literal["memberContactGroupMemberNotFound"] - contactId: int # int64 - -class StoreError_invalidMemberRelationUpdate(TypedDict): - type: Literal["invalidMemberRelationUpdate"] - -class StoreError_groupWithoutUser(TypedDict): - type: Literal["groupWithoutUser"] - -class StoreError_duplicateGroupMember(TypedDict): - type: Literal["duplicateGroupMember"] - -class StoreError_duplicateMemberId(TypedDict): - type: Literal["duplicateMemberId"] - -class StoreError_groupAlreadyJoined(TypedDict): - type: Literal["groupAlreadyJoined"] - -class StoreError_groupInvitationNotFound(TypedDict): - type: Literal["groupInvitationNotFound"] - -class StoreError_noteFolderAlreadyExists(TypedDict): - type: Literal["noteFolderAlreadyExists"] - noteFolderId: int # int64 - -class StoreError_noteFolderNotFound(TypedDict): - type: Literal["noteFolderNotFound"] - noteFolderId: int # int64 - -class StoreError_userNoteFolderNotFound(TypedDict): - type: Literal["userNoteFolderNotFound"] - -class StoreError_sndFileNotFound(TypedDict): - type: Literal["sndFileNotFound"] - fileId: int # int64 - -class StoreError_sndFileInvalid(TypedDict): - type: Literal["sndFileInvalid"] - fileId: int # int64 - -class StoreError_rcvFileNotFound(TypedDict): - type: Literal["rcvFileNotFound"] - fileId: int # int64 - -class StoreError_rcvFileDescrNotFound(TypedDict): - type: Literal["rcvFileDescrNotFound"] - fileId: int # int64 - -class StoreError_fileNotFound(TypedDict): - type: Literal["fileNotFound"] - fileId: int # int64 - -class StoreError_rcvFileInvalid(TypedDict): - type: Literal["rcvFileInvalid"] - fileId: int # int64 - -class StoreError_rcvFileInvalidDescrPart(TypedDict): - type: Literal["rcvFileInvalidDescrPart"] - -class StoreError_localFileNoTransfer(TypedDict): - type: Literal["localFileNoTransfer"] - fileId: int # int64 - -class StoreError_sharedMsgIdNotFoundByFileId(TypedDict): - type: Literal["sharedMsgIdNotFoundByFileId"] - fileId: int # int64 - -class StoreError_fileIdNotFoundBySharedMsgId(TypedDict): - type: Literal["fileIdNotFoundBySharedMsgId"] - sharedMsgId: str - -class StoreError_sndFileNotFoundXFTP(TypedDict): - type: Literal["sndFileNotFoundXFTP"] - agentSndFileId: str - -class StoreError_rcvFileNotFoundXFTP(TypedDict): - type: Literal["rcvFileNotFoundXFTP"] - agentRcvFileId: str - -class StoreError_connectionNotFound(TypedDict): - type: Literal["connectionNotFound"] - agentConnId: str - -class StoreError_connectionNotFoundById(TypedDict): - type: Literal["connectionNotFoundById"] - connId: int # int64 - -class StoreError_connectionNotFoundByMemberId(TypedDict): - type: Literal["connectionNotFoundByMemberId"] - groupMemberId: int # int64 - -class StoreError_pendingConnectionNotFound(TypedDict): - type: Literal["pendingConnectionNotFound"] - connId: int # int64 - -class StoreError_uniqueID(TypedDict): - type: Literal["uniqueID"] - -class StoreError_largeMsg(TypedDict): - type: Literal["largeMsg"] - -class StoreError_internalError(TypedDict): - type: Literal["internalError"] - message: str - -class StoreError_dBException(TypedDict): - type: Literal["dBException"] - message: str - -class StoreError_dBBusyError(TypedDict): - type: Literal["dBBusyError"] - message: str - -class StoreError_badChatItem(TypedDict): - type: Literal["badChatItem"] - itemId: int # int64 - itemTs: NotRequired[str] # ISO-8601 timestamp - -class StoreError_chatItemNotFound(TypedDict): - type: Literal["chatItemNotFound"] - itemId: int # int64 - -class StoreError_chatItemNotFoundByText(TypedDict): - type: Literal["chatItemNotFoundByText"] - text: str - -class StoreError_chatItemSharedMsgIdNotFound(TypedDict): - type: Literal["chatItemSharedMsgIdNotFound"] - sharedMsgId: str - -class StoreError_chatItemNotFoundByFileId(TypedDict): - type: Literal["chatItemNotFoundByFileId"] - fileId: int # int64 - -class StoreError_chatItemNotFoundByContactId(TypedDict): - type: Literal["chatItemNotFoundByContactId"] - contactId: int # int64 - -class StoreError_chatItemNotFoundByGroupId(TypedDict): - type: Literal["chatItemNotFoundByGroupId"] - groupId: int # int64 - -class StoreError_profileNotFound(TypedDict): - type: Literal["profileNotFound"] - profileId: int # int64 - -class StoreError_duplicateGroupLink(TypedDict): - type: Literal["duplicateGroupLink"] - groupInfo: "GroupInfo" - -class StoreError_groupLinkNotFound(TypedDict): - type: Literal["groupLinkNotFound"] - groupInfo: "GroupInfo" - -class StoreError_hostMemberIdNotFound(TypedDict): - type: Literal["hostMemberIdNotFound"] - groupId: int # int64 - -class StoreError_contactNotFoundByFileId(TypedDict): - type: Literal["contactNotFoundByFileId"] - fileId: int # int64 - -class StoreError_noGroupSndStatus(TypedDict): - type: Literal["noGroupSndStatus"] - itemId: int # int64 - groupMemberId: int # int64 - -class StoreError_duplicateGroupMessage(TypedDict): - type: Literal["duplicateGroupMessage"] - groupId: int # int64 - sharedMsgId: str - authorGroupMemberId: NotRequired[int] # int64 - forwardedByGroupMemberId: NotRequired[int] # int64 - -class StoreError_remoteHostNotFound(TypedDict): - type: Literal["remoteHostNotFound"] - remoteHostId: int # int64 - -class StoreError_remoteHostUnknown(TypedDict): - type: Literal["remoteHostUnknown"] - -class StoreError_remoteHostDuplicateCA(TypedDict): - type: Literal["remoteHostDuplicateCA"] - -class StoreError_remoteCtrlNotFound(TypedDict): - type: Literal["remoteCtrlNotFound"] - remoteCtrlId: int # int64 - -class StoreError_remoteCtrlDuplicateCA(TypedDict): - type: Literal["remoteCtrlDuplicateCA"] - -class StoreError_prohibitedDeleteUser(TypedDict): - type: Literal["prohibitedDeleteUser"] - userId: int # int64 - contactId: int # int64 - -class StoreError_operatorNotFound(TypedDict): - type: Literal["operatorNotFound"] - serverOperatorId: int # int64 - -class StoreError_usageConditionsNotFound(TypedDict): - type: Literal["usageConditionsNotFound"] - -class StoreError_userChatRelayNotFound(TypedDict): - type: Literal["userChatRelayNotFound"] - chatRelayId: int # int64 - -class StoreError_groupRelayNotFound(TypedDict): - type: Literal["groupRelayNotFound"] - groupRelayId: int # int64 - -class StoreError_groupRelayNotFoundByMemberId(TypedDict): - type: Literal["groupRelayNotFoundByMemberId"] - groupMemberId: int # int64 - -class StoreError_invalidQuote(TypedDict): - type: Literal["invalidQuote"] - -class StoreError_invalidMention(TypedDict): - type: Literal["invalidMention"] - -class StoreError_invalidDeliveryTask(TypedDict): - type: Literal["invalidDeliveryTask"] - taskId: int # int64 - -class StoreError_deliveryTaskNotFound(TypedDict): - type: Literal["deliveryTaskNotFound"] - taskId: int # int64 - -class StoreError_invalidDeliveryJob(TypedDict): - type: Literal["invalidDeliveryJob"] - jobId: int # int64 - -class StoreError_deliveryJobNotFound(TypedDict): - type: Literal["deliveryJobNotFound"] - jobId: int # int64 - -class StoreError_workItemError(TypedDict): - type: Literal["workItemError"] - errContext: str - -StoreError = ( - StoreError_duplicateName - | StoreError_userNotFound - | StoreError_relayUserNotFound - | StoreError_userNotFoundByName - | StoreError_userNotFoundByContactId - | StoreError_userNotFoundByGroupId - | StoreError_userNotFoundByFileId - | StoreError_userNotFoundByContactRequestId - | StoreError_contactNotFound - | StoreError_contactNotFoundByName - | StoreError_contactNotFoundByMemberId - | StoreError_contactNotReady - | StoreError_duplicateContactLink - | StoreError_userContactLinkNotFound - | StoreError_contactRequestNotFound - | StoreError_contactRequestNotFoundByName - | StoreError_invalidContactRequestEntity - | StoreError_invalidBusinessChatContactRequest - | StoreError_groupNotFound - | StoreError_groupNotFoundByName - | StoreError_groupMemberNameNotFound - | StoreError_groupMemberNotFound - | StoreError_groupMemberNotFoundByIndex - | StoreError_memberRelationsVectorNotFound - | StoreError_groupHostMemberNotFound - | StoreError_groupMemberNotFoundByMemberId - | StoreError_memberContactGroupMemberNotFound - | StoreError_invalidMemberRelationUpdate - | StoreError_groupWithoutUser - | StoreError_duplicateGroupMember - | StoreError_duplicateMemberId - | StoreError_groupAlreadyJoined - | StoreError_groupInvitationNotFound - | StoreError_noteFolderAlreadyExists - | StoreError_noteFolderNotFound - | StoreError_userNoteFolderNotFound - | StoreError_sndFileNotFound - | StoreError_sndFileInvalid - | StoreError_rcvFileNotFound - | StoreError_rcvFileDescrNotFound - | StoreError_fileNotFound - | StoreError_rcvFileInvalid - | StoreError_rcvFileInvalidDescrPart - | StoreError_localFileNoTransfer - | StoreError_sharedMsgIdNotFoundByFileId - | StoreError_fileIdNotFoundBySharedMsgId - | StoreError_sndFileNotFoundXFTP - | StoreError_rcvFileNotFoundXFTP - | StoreError_connectionNotFound - | StoreError_connectionNotFoundById - | StoreError_connectionNotFoundByMemberId - | StoreError_pendingConnectionNotFound - | StoreError_uniqueID - | StoreError_largeMsg - | StoreError_internalError - | StoreError_dBException - | StoreError_dBBusyError - | StoreError_badChatItem - | StoreError_chatItemNotFound - | StoreError_chatItemNotFoundByText - | StoreError_chatItemSharedMsgIdNotFound - | StoreError_chatItemNotFoundByFileId - | StoreError_chatItemNotFoundByContactId - | StoreError_chatItemNotFoundByGroupId - | StoreError_profileNotFound - | StoreError_duplicateGroupLink - | StoreError_groupLinkNotFound - | StoreError_hostMemberIdNotFound - | StoreError_contactNotFoundByFileId - | StoreError_noGroupSndStatus - | StoreError_duplicateGroupMessage - | StoreError_remoteHostNotFound - | StoreError_remoteHostUnknown - | StoreError_remoteHostDuplicateCA - | StoreError_remoteCtrlNotFound - | StoreError_remoteCtrlDuplicateCA - | StoreError_prohibitedDeleteUser - | StoreError_operatorNotFound - | StoreError_usageConditionsNotFound - | StoreError_userChatRelayNotFound - | StoreError_groupRelayNotFound - | StoreError_groupRelayNotFoundByMemberId - | StoreError_invalidQuote - | StoreError_invalidMention - | StoreError_invalidDeliveryTask - | StoreError_deliveryTaskNotFound - | StoreError_invalidDeliveryJob - | StoreError_deliveryJobNotFound - | StoreError_workItemError -) - -StoreError_Tag = Literal["duplicateName", "userNotFound", "relayUserNotFound", "userNotFoundByName", "userNotFoundByContactId", "userNotFoundByGroupId", "userNotFoundByFileId", "userNotFoundByContactRequestId", "contactNotFound", "contactNotFoundByName", "contactNotFoundByMemberId", "contactNotReady", "duplicateContactLink", "userContactLinkNotFound", "contactRequestNotFound", "contactRequestNotFoundByName", "invalidContactRequestEntity", "invalidBusinessChatContactRequest", "groupNotFound", "groupNotFoundByName", "groupMemberNameNotFound", "groupMemberNotFound", "groupMemberNotFoundByIndex", "memberRelationsVectorNotFound", "groupHostMemberNotFound", "groupMemberNotFoundByMemberId", "memberContactGroupMemberNotFound", "invalidMemberRelationUpdate", "groupWithoutUser", "duplicateGroupMember", "duplicateMemberId", "groupAlreadyJoined", "groupInvitationNotFound", "noteFolderAlreadyExists", "noteFolderNotFound", "userNoteFolderNotFound", "sndFileNotFound", "sndFileInvalid", "rcvFileNotFound", "rcvFileDescrNotFound", "fileNotFound", "rcvFileInvalid", "rcvFileInvalidDescrPart", "localFileNoTransfer", "sharedMsgIdNotFoundByFileId", "fileIdNotFoundBySharedMsgId", "sndFileNotFoundXFTP", "rcvFileNotFoundXFTP", "connectionNotFound", "connectionNotFoundById", "connectionNotFoundByMemberId", "pendingConnectionNotFound", "uniqueID", "largeMsg", "internalError", "dBException", "dBBusyError", "badChatItem", "chatItemNotFound", "chatItemNotFoundByText", "chatItemSharedMsgIdNotFound", "chatItemNotFoundByFileId", "chatItemNotFoundByContactId", "chatItemNotFoundByGroupId", "profileNotFound", "duplicateGroupLink", "groupLinkNotFound", "hostMemberIdNotFound", "contactNotFoundByFileId", "noGroupSndStatus", "duplicateGroupMessage", "remoteHostNotFound", "remoteHostUnknown", "remoteHostDuplicateCA", "remoteCtrlNotFound", "remoteCtrlDuplicateCA", "prohibitedDeleteUser", "operatorNotFound", "usageConditionsNotFound", "userChatRelayNotFound", "groupRelayNotFound", "groupRelayNotFoundByMemberId", "invalidQuote", "invalidMention", "invalidDeliveryTask", "deliveryTaskNotFound", "invalidDeliveryJob", "deliveryJobNotFound", "workItemError"] - -class SubscriptionStatus_active(TypedDict): - type: Literal["active"] - -class SubscriptionStatus_pending(TypedDict): - type: Literal["pending"] - -class SubscriptionStatus_removed(TypedDict): - type: Literal["removed"] - subError: str - -class SubscriptionStatus_noSub(TypedDict): - type: Literal["noSub"] - -SubscriptionStatus = ( - SubscriptionStatus_active - | SubscriptionStatus_pending - | SubscriptionStatus_removed - | SubscriptionStatus_noSub -) - -SubscriptionStatus_Tag = Literal["active", "pending", "removed", "noSub"] - -class SupportGroupPreference(TypedDict): - enable: "GroupFeatureEnabled" - -SwitchPhase = Literal["started", "confirmed", "secured", "completed"] - -class TimedMessagesGroupPreference(TypedDict): - enable: "GroupFeatureEnabled" - ttl: NotRequired[int] # int - -class TimedMessagesPreference(TypedDict): - allow: "FeatureAllowed" - ttl: NotRequired[int] # int - -class TransportError_badBlock(TypedDict): - type: Literal["badBlock"] - -class TransportError_version(TypedDict): - type: Literal["version"] - -class TransportError_largeMsg(TypedDict): - type: Literal["largeMsg"] - -class TransportError_badSession(TypedDict): - type: Literal["badSession"] - -class TransportError_noServerAuth(TypedDict): - type: Literal["noServerAuth"] - -class TransportError_handshake(TypedDict): - type: Literal["handshake"] - handshakeErr: "HandshakeError" - -TransportError = ( - TransportError_badBlock - | TransportError_version - | TransportError_largeMsg - | TransportError_badSession - | TransportError_noServerAuth - | TransportError_handshake -) - -TransportError_Tag = Literal["badBlock", "version", "largeMsg", "badSession", "noServerAuth", "handshake"] - -UIColorMode = Literal["light", "dark"] - -class UIColors(TypedDict): - accent: NotRequired[str] - accentVariant: NotRequired[str] - secondary: NotRequired[str] - secondaryVariant: NotRequired[str] - background: NotRequired[str] - menus: NotRequired[str] - title: NotRequired[str] - accentVariant2: NotRequired[str] - sentMessage: NotRequired[str] - sentReply: NotRequired[str] - receivedMessage: NotRequired[str] - receivedReply: NotRequired[str] - -class UIThemeEntityOverride(TypedDict): - mode: "UIColorMode" - wallpaper: NotRequired["ChatWallpaper"] - colors: "UIColors" - -class UIThemeEntityOverrides(TypedDict): - light: NotRequired["UIThemeEntityOverride"] - dark: NotRequired["UIThemeEntityOverride"] - -class UpdatedMessage(TypedDict): - msgContent: "MsgContent" - mentions: dict[str, int] # str : int64 - -class User(TypedDict): - userId: int # int64 - agentUserId: int # int64 - userContactId: int # int64 - localDisplayName: str - profile: "LocalProfile" - fullPreferences: "FullPreferences" - activeUser: bool - activeOrder: int # int64 - viewPwdHash: NotRequired["UserPwdHash"] - showNtfs: bool - sendRcptsContacts: bool - sendRcptsSmallGroups: bool - autoAcceptMemberContacts: bool - userMemberProfileUpdatedAt: NotRequired[str] # ISO-8601 timestamp - userChatRelay: bool - clientService: bool - uiThemes: NotRequired["UIThemeEntityOverrides"] - -class UserChatRelay(TypedDict): - chatRelayId: int # int64 - address: str - relayProfile: "RelayProfile" - domains: list[str] - preset: bool - tested: NotRequired[bool] - enabled: bool - deleted: bool - -class UserContact(TypedDict): - userContactLinkId: int # int64 - connReqContact: str - groupId: NotRequired[int] # int64 - -class UserContactLink(TypedDict): - userContactLinkId: int # int64 - connLinkContact: "CreatedConnLink" - shortLinkDataSet: bool - shortLinkLargeDataSet: bool - addressSettings: "AddressSettings" - -class UserContactRequest(TypedDict): - contactRequestId: int # int64 - agentInvitationId: str - contactId_: NotRequired[int] # int64 - businessGroupId_: NotRequired[int] # int64 - userContactLinkId_: NotRequired[int] # int64 - cReqChatVRange: "VersionRange" - localDisplayName: str - profileId: int # int64 - profile: "LocalProfile" - createdAt: str # ISO-8601 timestamp - updatedAt: str # ISO-8601 timestamp - xContactId: NotRequired[str] - pqSupport: bool - welcomeSharedMsgId: NotRequired[str] - requestSharedMsgId: NotRequired[str] - -class UserInfo(TypedDict): - user: "User" - unreadCount: int # int - -class UserProfileUpdateSummary(TypedDict): - updateSuccesses: int # int - updateFailures: int # int - changedContacts: list["Contact"] - -class UserPwdHash(TypedDict): - hash: str - salt: str - -class VersionRange(TypedDict): - minVersion: int # int - maxVersion: int # int - -class XFTPErrorType_BLOCK(TypedDict): - type: Literal["BLOCK"] - -class XFTPErrorType_SESSION(TypedDict): - type: Literal["SESSION"] - -class XFTPErrorType_HANDSHAKE(TypedDict): - type: Literal["HANDSHAKE"] - -class XFTPErrorType_CMD(TypedDict): - type: Literal["CMD"] - cmdErr: "CommandError" - -class XFTPErrorType_AUTH(TypedDict): - type: Literal["AUTH"] - -class XFTPErrorType_BLOCKED(TypedDict): - type: Literal["BLOCKED"] - blockInfo: "BlockingInfo" - -class XFTPErrorType_SIZE(TypedDict): - type: Literal["SIZE"] - -class XFTPErrorType_QUOTA(TypedDict): - type: Literal["QUOTA"] - -class XFTPErrorType_DIGEST(TypedDict): - type: Literal["DIGEST"] - -class XFTPErrorType_CRYPTO(TypedDict): - type: Literal["CRYPTO"] - -class XFTPErrorType_NO_FILE(TypedDict): - type: Literal["NO_FILE"] - -class XFTPErrorType_HAS_FILE(TypedDict): - type: Literal["HAS_FILE"] - -class XFTPErrorType_FILE_IO(TypedDict): - type: Literal["FILE_IO"] - -class XFTPErrorType_TIMEOUT(TypedDict): - type: Literal["TIMEOUT"] - -class XFTPErrorType_INTERNAL(TypedDict): - type: Literal["INTERNAL"] - -class XFTPErrorType_DUPLICATE_(TypedDict): - type: Literal["DUPLICATE_"] - -XFTPErrorType = ( - XFTPErrorType_BLOCK - | XFTPErrorType_SESSION - | XFTPErrorType_HANDSHAKE - | XFTPErrorType_CMD - | XFTPErrorType_AUTH - | XFTPErrorType_BLOCKED - | XFTPErrorType_SIZE - | XFTPErrorType_QUOTA - | XFTPErrorType_DIGEST - | XFTPErrorType_CRYPTO - | XFTPErrorType_NO_FILE - | XFTPErrorType_HAS_FILE - | XFTPErrorType_FILE_IO - | XFTPErrorType_TIMEOUT - | XFTPErrorType_INTERNAL - | XFTPErrorType_DUPLICATE_ -) - -XFTPErrorType_Tag = Literal["BLOCK", "SESSION", "HANDSHAKE", "CMD", "AUTH", "BLOCKED", "SIZE", "QUOTA", "DIGEST", "CRYPTO", "NO_FILE", "HAS_FILE", "FILE_IO", "TIMEOUT", "INTERNAL", "DUPLICATE_"] - -class XFTPRcvFile(TypedDict): - rcvFileDescription: "RcvFileDescr" - agentRcvFileId: NotRequired[str] - agentRcvFileDeleted: bool - userApprovedRelays: bool - -class XFTPSndFile(TypedDict): - agentSndFileId: str - privateSndFileDescr: NotRequired[str] - agentSndFileDeleted: bool - cryptoArgs: NotRequired["CryptoFileArgs"] diff --git a/src/Simplex/Chat/Library/Internal.hs b/src/Simplex/Chat/Library/Internal.hs index d26ee230b3..f61688d681 100644 --- a/src/Simplex/Chat/Library/Internal.hs +++ b/src/Simplex/Chat/Library/Internal.hs @@ -2509,19 +2509,19 @@ sendGroupProfileUpdate user gInfo scope asGroup members withStore' $ \db -> do setMembersKeyStatus db KSSent $ deliveredIds <> keyMemIds forwarded setMembersKeyStatus db KSFailed $ keyMemIds failed - unless (null retriableIds) $ incMembersKeyAttempts db retriableIds + incMembersKeyAttempts db retriableIds forM_ finalErrs $ \(mId, e) -> setMemberKeyStatus db (KSError $ tshow e) mId where keyMemIds = map groupMemberId' . filter memberNeedsKey (deliveredIds, retriableIds, finalErrs) = foldr addResult (foldr addResult ([], [], []) pending) sentTo where addResult :: (GroupMember, a, Either ChatError b) -> ([GroupMemberId], [GroupMemberId], [(GroupMemberId, ChatError)]) -> ([GroupMemberId], [GroupMemberId], [(GroupMemberId, ChatError)]) - addResult (m, _, r) acc@(delivered, retriable, final) + addResult (m@GroupMember {groupMemberId = mId}, _, r) acc@(delivered, retriable, final) | memberNeedsKey m = case r of - Right _ -> (groupMemberId' m : delivered, retriable, final) + Right _ -> (mId : delivered, retriable, final) Left e - | finalError e -> (delivered, retriable, (groupMemberId' m, e) : final) - | otherwise -> (delivered, groupMemberId' m : retriable, final) + | finalError e -> (delivered, retriable, (mId, e) : final) + | otherwise -> (delivered, mId : retriable, final) | otherwise = acc finalError = \case ChatErrorAgent {agentError} -> case agentError of diff --git a/src/Simplex/Chat/Store/Groups.hs b/src/Simplex/Chat/Store/Groups.hs index be31729d1e..217ae74448 100644 --- a/src/Simplex/Chat/Store/Groups.hs +++ b/src/Simplex/Chat/Store/Groups.hs @@ -1721,7 +1721,7 @@ setMembersKeyStatus db status memberIds = unless (null memberIds) $ do #endif incMembersKeyAttempts :: DB.Connection -> [GroupMemberId] -> IO () -incMembersKeyAttempts db memberIds = do +incMembersKeyAttempts db memberIds = unless (null memberIds) $ do currentTs <- getCurrentTime #if defined(dbPostgres) DB.execute