update typescript client (#2427)
* update typescript client * update bot * fix bot
This commit is contained in:
parent
88059a2cc5
commit
a2de9a3846
@ -17,7 +17,7 @@ async function run() {
|
|||||||
const address = (await chat.apiGetUserAddress()) || (await chat.apiCreateUserAddress())
|
const address = (await chat.apiGetUserAddress()) || (await chat.apiCreateUserAddress())
|
||||||
console.log(`Bot address: ${address}`)
|
console.log(`Bot address: ${address}`)
|
||||||
// enables automatic acceptance of contact connections
|
// enables automatic acceptance of contact connections
|
||||||
await chat.addressAutoAccept(true)
|
await chat.enableAddressAutoAccept()
|
||||||
await processMessages(chat)
|
await processMessages(chat)
|
||||||
|
|
||||||
async function processMessages(chat) {
|
async function processMessages(chat) {
|
||||||
@ -40,14 +40,11 @@ async function run() {
|
|||||||
const {chatInfo} = resp.chatItem
|
const {chatInfo} = resp.chatItem
|
||||||
if (chatInfo.type !== ChatInfoType.Direct) continue
|
if (chatInfo.type !== ChatInfoType.Direct) continue
|
||||||
const msg = ciContentText(resp.chatItem.chatItem.content)
|
const msg = ciContentText(resp.chatItem.chatItem.content)
|
||||||
let reply
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
const n = +msg
|
const n = +msg
|
||||||
reply = typeof n === "number" ? `${n} * ${n} = ${n * n}` : `${n} is not a number`
|
const reply = typeof n === "number" && !isNaN(n) ? `${n} * ${n} = ${n * n}` : `this is not a number`
|
||||||
} else {
|
await chat.apiSendTextMessage(ChatType.Direct, chatInfo.contact.contactId, reply)
|
||||||
reply = "no message text"
|
|
||||||
}
|
}
|
||||||
await chat.apiSendTextMessage(ChatType.Direct, chatInfo.contact.contactId, reply)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "simplex-chat",
|
"name": "simplex-chat",
|
||||||
"version": "0.1.1",
|
"version": "0.2.0",
|
||||||
"description": "SimpleX Chat client",
|
"description": "SimpleX Chat client",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.5.1",
|
"@types/jest": "^27.5.1",
|
||||||
"@types/node": "^17.0.24",
|
"@types/node": "^18.11.18",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
||||||
"@typescript-eslint/parser": "^5.23.0",
|
"@typescript-eslint/parser": "^5.23.0",
|
||||||
"eslint": "^8.15.0",
|
"eslint": "^8.15.0",
|
||||||
@ -48,7 +48,7 @@
|
|||||||
"rollup": "^2.72.1",
|
"rollup": "^2.72.1",
|
||||||
"ts-jest": "^28.0.2",
|
"ts-jest": "^28.0.2",
|
||||||
"ts-node": "^10.7.0",
|
"ts-node": "^10.7.0",
|
||||||
"typescript": "^4.6.3"
|
"typescript": "^4.9.3"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
@ -105,8 +105,8 @@ export class ChatClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async apiCreateActiveUser(profile: CC.Profile): Promise<CR.User> {
|
async apiCreateActiveUser(profile?: Profile, sameServers = true, pastTimestamp = false): Promise<CR.User> {
|
||||||
const r = await this.sendChatCommand({type: "createActiveUser", profile})
|
const r = await this.sendChatCommand({type: "createActiveUser", profile, sameServers, pastTimestamp})
|
||||||
if (r.type === "activeUser") return r.user
|
if (r.type === "activeUser") return r.user
|
||||||
throw new ChatCommandError("unexpected response", r)
|
throw new ChatCommandError("unexpected response", r)
|
||||||
}
|
}
|
||||||
@ -129,15 +129,22 @@ export class ChatClient {
|
|||||||
return this.okChatCommand({type: "setIncognito", incognito})
|
return this.okChatCommand({type: "setIncognito", incognito})
|
||||||
}
|
}
|
||||||
|
|
||||||
async addressAutoAccept(autoAccept: boolean, autoReply: CC.MsgContent): Promise<void> {
|
async enableAddressAutoAccept(acceptIncognito = false, autoReply?: CC.MsgContent): Promise<void> {
|
||||||
const r = await this.sendChatCommand({type: "addressAutoAccept", autoAccept, autoReply})
|
const r = await this.sendChatCommand({type: "addressAutoAccept", autoAccept: {acceptIncognito, autoReply}})
|
||||||
if (r.type !== "userContactLinkUpdated") {
|
if (r.type !== "userContactLinkUpdated") {
|
||||||
throw new ChatCommandError("error changing user contact address mode", r)
|
throw new ChatCommandError("error changing user contact address mode", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async apiGetChats(): Promise<CR.Chat[]> {
|
async disableAddressAutoAccept(): Promise<void> {
|
||||||
const r = await this.sendChatCommand({type: "apiGetChats"})
|
const r = await this.sendChatCommand({type: "addressAutoAccept"})
|
||||||
|
if (r.type !== "userContactLinkUpdated") {
|
||||||
|
throw new ChatCommandError("error changing user contact address mode", r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async apiGetChats(userId: number): Promise<CR.Chat[]> {
|
||||||
|
const r = await this.sendChatCommand({type: "apiGetChats", userId})
|
||||||
if (r.type === "apiChats") return r.chats
|
if (r.type === "apiChats") return r.chats
|
||||||
throw new ChatCommandError("error loading chats", r)
|
throw new ChatCommandError("error loading chats", r)
|
||||||
}
|
}
|
||||||
@ -169,9 +176,14 @@ export class ChatClient {
|
|||||||
throw new ChatCommandError("error updating chat item", r)
|
throw new ChatCommandError("error updating chat item", r)
|
||||||
}
|
}
|
||||||
|
|
||||||
async apiDeleteChatItem(chatType: ChatType, chatId: number, chatItemId: number, deleteMode: CC.DeleteMode): Promise<CR.ChatItem> {
|
async apiDeleteChatItem(
|
||||||
|
chatType: ChatType,
|
||||||
|
chatId: number,
|
||||||
|
chatItemId: number,
|
||||||
|
deleteMode: CC.DeleteMode
|
||||||
|
): Promise<CR.ChatItem | undefined> {
|
||||||
const r = await this.sendChatCommand({type: "apiDeleteChatItem", chatType, chatId, chatItemId, deleteMode})
|
const r = await this.sendChatCommand({type: "apiDeleteChatItem", chatType, chatId, chatItemId, deleteMode})
|
||||||
if (r.type === "chatItemDeleted") return r.toChatItem.chatItem
|
if (r.type === "chatItemDeleted") return r.toChatItem?.chatItem
|
||||||
throw new ChatCommandError("error deleting chat item", r)
|
throw new ChatCommandError("error deleting chat item", r)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,8 +227,8 @@ export class ChatClient {
|
|||||||
throw new ChatCommandError("error clearing chat", r)
|
throw new ChatCommandError("error clearing chat", r)
|
||||||
}
|
}
|
||||||
|
|
||||||
async apiUpdateProfile(profile: CC.Profile): Promise<CC.Profile | undefined> {
|
async apiUpdateProfile(userId: number, profile: CC.Profile): Promise<CC.Profile | undefined> {
|
||||||
const r = await this.sendChatCommand({type: "apiUpdateProfile", profile})
|
const r = await this.sendChatCommand({type: "apiUpdateProfile", userId, profile})
|
||||||
switch (r.type) {
|
switch (r.type) {
|
||||||
case "userProfileNoChange":
|
case "userProfileNoChange":
|
||||||
return undefined
|
return undefined
|
||||||
|
@ -1,9 +1,18 @@
|
|||||||
export type ChatCommand =
|
export type ChatCommand =
|
||||||
| ShowActiveUser
|
| ShowActiveUser
|
||||||
| CreateActiveUser
|
| CreateActiveUser
|
||||||
|
| ListUsers
|
||||||
|
| APISetActiveUser
|
||||||
|
| APIHideUser
|
||||||
|
| APIUnhideUser
|
||||||
|
| APIMuteUser
|
||||||
|
| APIUnmuteUser
|
||||||
|
| APIDeleteUser
|
||||||
| StartChat
|
| StartChat
|
||||||
| APIStopChat
|
| APIStopChat
|
||||||
|
| SetTempFolder
|
||||||
| SetFilesFolder
|
| SetFilesFolder
|
||||||
|
| APISetXFTPConfig
|
||||||
| SetIncognito
|
| SetIncognito
|
||||||
| APIExportArchive
|
| APIExportArchive
|
||||||
| APIImportArchive
|
| APIImportArchive
|
||||||
@ -13,6 +22,7 @@ export type ChatCommand =
|
|||||||
| APISendMessage
|
| APISendMessage
|
||||||
| APIUpdateChatItem
|
| APIUpdateChatItem
|
||||||
| APIDeleteChatItem
|
| APIDeleteChatItem
|
||||||
|
| APIDeleteMemberChatItem
|
||||||
| APIChatRead
|
| APIChatRead
|
||||||
| APIDeleteChat
|
| APIDeleteChat
|
||||||
| APIClearChat
|
| APIClearChat
|
||||||
@ -28,17 +38,31 @@ export type ChatCommand =
|
|||||||
| APILeaveGroup
|
| APILeaveGroup
|
||||||
| APIListMembers
|
| APIListMembers
|
||||||
| APIUpdateGroupProfile
|
| APIUpdateGroupProfile
|
||||||
| GetUserSMPServers
|
| APICreateGroupLink
|
||||||
| SetUserSMPServers
|
| APIGroupLinkMemberRole
|
||||||
|
| APIDeleteGroupLink
|
||||||
|
| APIGetGroupLink
|
||||||
|
| APIGetUserProtoServers
|
||||||
|
| APISetUserProtoServers
|
||||||
| APIContactInfo
|
| APIContactInfo
|
||||||
| APIGroupMemberInfo
|
| APIGroupMemberInfo
|
||||||
|
| APIGetContactCode
|
||||||
|
| APIGetGroupMemberCode
|
||||||
|
| APIVerifyContact
|
||||||
|
| APIVerifyGroupMember
|
||||||
| AddContact
|
| AddContact
|
||||||
| Connect
|
| Connect
|
||||||
| ConnectSimplex
|
| ConnectSimplex
|
||||||
| CreateMyAddress
|
| CreateMyAddress
|
||||||
| DeleteMyAddress
|
| DeleteMyAddress
|
||||||
| ShowMyAddress
|
| ShowMyAddress
|
||||||
|
| SetProfileAddress
|
||||||
| AddressAutoAccept
|
| AddressAutoAccept
|
||||||
|
| APICreateMyAddress
|
||||||
|
| APIDeleteMyAddress
|
||||||
|
| APIShowMyAddress
|
||||||
|
| APISetProfileAddress
|
||||||
|
| APIAddressAutoAccept
|
||||||
| ReceiveFile
|
| ReceiveFile
|
||||||
| CancelFile
|
| CancelFile
|
||||||
| FileStatus
|
| FileStatus
|
||||||
@ -64,6 +88,8 @@ export type ChatCommand =
|
|||||||
// APIMemberRole -- not implemented
|
// APIMemberRole -- not implemented
|
||||||
// ListContacts
|
// ListContacts
|
||||||
// ListGroups
|
// ListGroups
|
||||||
|
// APISetChatItemTTL
|
||||||
|
// APIGetChatItemTTL
|
||||||
// APISetNetworkConfig
|
// APISetNetworkConfig
|
||||||
// APIGetNetworkConfig
|
// APIGetNetworkConfig
|
||||||
// APISetChatSettings
|
// APISetChatSettings
|
||||||
@ -74,9 +100,19 @@ export type ChatCommand =
|
|||||||
type ChatCommandTag =
|
type ChatCommandTag =
|
||||||
| "showActiveUser"
|
| "showActiveUser"
|
||||||
| "createActiveUser"
|
| "createActiveUser"
|
||||||
|
| "listUsers"
|
||||||
|
| "apiSetActiveUser"
|
||||||
|
| "setActiveUser"
|
||||||
|
| "apiHideUser"
|
||||||
|
| "apiUnhideUser"
|
||||||
|
| "apiMuteUser"
|
||||||
|
| "apiUnmuteUser"
|
||||||
|
| "apiDeleteUser"
|
||||||
| "startChat"
|
| "startChat"
|
||||||
| "apiStopChat"
|
| "apiStopChat"
|
||||||
|
| "setTempFolder"
|
||||||
| "setFilesFolder"
|
| "setFilesFolder"
|
||||||
|
| "apiSetXFTPConfig"
|
||||||
| "setIncognito"
|
| "setIncognito"
|
||||||
| "apiExportArchive"
|
| "apiExportArchive"
|
||||||
| "apiImportArchive"
|
| "apiImportArchive"
|
||||||
@ -86,6 +122,7 @@ type ChatCommandTag =
|
|||||||
| "apiSendMessage"
|
| "apiSendMessage"
|
||||||
| "apiUpdateChatItem"
|
| "apiUpdateChatItem"
|
||||||
| "apiDeleteChatItem"
|
| "apiDeleteChatItem"
|
||||||
|
| "apiDeleteMemberChatItem"
|
||||||
| "apiChatRead"
|
| "apiChatRead"
|
||||||
| "apiDeleteChat"
|
| "apiDeleteChat"
|
||||||
| "apiClearChat"
|
| "apiClearChat"
|
||||||
@ -101,17 +138,31 @@ type ChatCommandTag =
|
|||||||
| "apiLeaveGroup"
|
| "apiLeaveGroup"
|
||||||
| "apiListMembers"
|
| "apiListMembers"
|
||||||
| "apiUpdateGroupProfile"
|
| "apiUpdateGroupProfile"
|
||||||
| "getUserSMPServers"
|
| "apiCreateGroupLink"
|
||||||
| "setUserSMPServers"
|
| "apiGroupLinkMemberRole"
|
||||||
|
| "apiDeleteGroupLink"
|
||||||
|
| "apiGetGroupLink"
|
||||||
|
| "apiGetUserProtoServers"
|
||||||
|
| "apiSetUserProtoServers"
|
||||||
| "apiContactInfo"
|
| "apiContactInfo"
|
||||||
| "apiGroupMemberInfo"
|
| "apiGroupMemberInfo"
|
||||||
|
| "apiGetContactCode"
|
||||||
|
| "apiGetGroupMemberCode"
|
||||||
|
| "apiVerifyContact"
|
||||||
|
| "apiVerifyGroupMember"
|
||||||
| "addContact"
|
| "addContact"
|
||||||
| "connect"
|
| "connect"
|
||||||
| "connectSimplex"
|
| "connectSimplex"
|
||||||
| "createMyAddress"
|
| "createMyAddress"
|
||||||
| "deleteMyAddress"
|
| "deleteMyAddress"
|
||||||
| "showMyAddress"
|
| "showMyAddress"
|
||||||
|
| "setProfileAddress"
|
||||||
| "addressAutoAccept"
|
| "addressAutoAccept"
|
||||||
|
| "apiCreateMyAddress"
|
||||||
|
| "apiDeleteMyAddress"
|
||||||
|
| "apiShowMyAddress"
|
||||||
|
| "apiSetProfileAddress"
|
||||||
|
| "apiAddressAutoAccept"
|
||||||
| "receiveFile"
|
| "receiveFile"
|
||||||
| "cancelFile"
|
| "cancelFile"
|
||||||
| "fileStatus"
|
| "fileStatus"
|
||||||
@ -126,24 +177,80 @@ export interface ShowActiveUser extends IChatCommand {
|
|||||||
|
|
||||||
export interface CreateActiveUser extends IChatCommand {
|
export interface CreateActiveUser extends IChatCommand {
|
||||||
type: "createActiveUser"
|
type: "createActiveUser"
|
||||||
profile: Profile
|
profile?: Profile
|
||||||
|
sameServers: boolean
|
||||||
|
pastTimestamp: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ListUsers extends IChatCommand {
|
||||||
|
type: "listUsers"
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APISetActiveUser extends IChatCommand {
|
||||||
|
type: "apiSetActiveUser"
|
||||||
|
userId: number
|
||||||
|
viewPwd?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIHideUser extends IChatCommand {
|
||||||
|
type: "apiHideUser"
|
||||||
|
userId: number
|
||||||
|
viewPwd: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIUnhideUser extends IChatCommand {
|
||||||
|
type: "apiUnhideUser"
|
||||||
|
userId: number
|
||||||
|
viewPwd: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIMuteUser extends IChatCommand {
|
||||||
|
type: "apiMuteUser"
|
||||||
|
userId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIUnmuteUser extends IChatCommand {
|
||||||
|
type: "apiUnmuteUser"
|
||||||
|
userId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIDeleteUser extends IChatCommand {
|
||||||
|
type: "apiDeleteUser"
|
||||||
|
userId: number
|
||||||
|
delSMPQueues: boolean
|
||||||
|
viewPwd?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StartChat extends IChatCommand {
|
export interface StartChat extends IChatCommand {
|
||||||
type: "startChat"
|
type: "startChat"
|
||||||
subscribeConnections?: boolean
|
subscribeConnections?: boolean
|
||||||
expireChatItems?: boolean
|
enableExpireChatItems?: boolean
|
||||||
|
startXFTPWorkers?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface APIStopChat extends IChatCommand {
|
export interface APIStopChat extends IChatCommand {
|
||||||
type: "apiStopChat"
|
type: "apiStopChat"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SetTempFolder extends IChatCommand {
|
||||||
|
type: "setTempFolder"
|
||||||
|
tempFolder: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface SetFilesFolder extends IChatCommand {
|
export interface SetFilesFolder extends IChatCommand {
|
||||||
type: "setFilesFolder"
|
type: "setFilesFolder"
|
||||||
filePath: string
|
filePath: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface APISetXFTPConfig extends IChatCommand {
|
||||||
|
type: "apiSetXFTPConfig"
|
||||||
|
config?: XFTPFileConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface XFTPFileConfig {
|
||||||
|
minFileSize: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface SetIncognito extends IChatCommand {
|
export interface SetIncognito extends IChatCommand {
|
||||||
type: "setIncognito"
|
type: "setIncognito"
|
||||||
incognito: boolean
|
incognito: boolean
|
||||||
@ -165,6 +272,7 @@ export interface APIDeleteStorage extends IChatCommand {
|
|||||||
|
|
||||||
export interface APIGetChats extends IChatCommand {
|
export interface APIGetChats extends IChatCommand {
|
||||||
type: "apiGetChats"
|
type: "apiGetChats"
|
||||||
|
userId: number
|
||||||
pendingConnections?: boolean
|
pendingConnections?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,6 +313,13 @@ export interface APIDeleteChatItem extends IChatCommand {
|
|||||||
deleteMode: DeleteMode
|
deleteMode: DeleteMode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface APIDeleteMemberChatItem extends IChatCommand {
|
||||||
|
type: "apiDeleteMemberChatItem"
|
||||||
|
groupId: number
|
||||||
|
groupMemberId: number
|
||||||
|
itemId: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface APIChatRead extends IChatCommand {
|
export interface APIChatRead extends IChatCommand {
|
||||||
type: "apiChatRead"
|
type: "apiChatRead"
|
||||||
chatType: ChatType
|
chatType: ChatType
|
||||||
@ -241,6 +356,7 @@ export interface APIRejectContact extends IChatCommand {
|
|||||||
|
|
||||||
export interface APIUpdateProfile extends IChatCommand {
|
export interface APIUpdateProfile extends IChatCommand {
|
||||||
type: "apiUpdateProfile"
|
type: "apiUpdateProfile"
|
||||||
|
userId: number
|
||||||
profile: Profile
|
profile: Profile
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,13 +410,51 @@ export interface APIUpdateGroupProfile extends IChatCommand {
|
|||||||
groupProfile: GroupProfile
|
groupProfile: GroupProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GetUserSMPServers extends IChatCommand {
|
export interface APICreateGroupLink extends IChatCommand {
|
||||||
type: "getUserSMPServers"
|
type: "apiCreateGroupLink"
|
||||||
|
groupId: number
|
||||||
|
memberRole: GroupMemberRole
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SetUserSMPServers extends IChatCommand {
|
export interface APIGroupLinkMemberRole extends IChatCommand {
|
||||||
type: "setUserSMPServers"
|
type: "apiGroupLinkMemberRole"
|
||||||
servers: [string]
|
groupId: number
|
||||||
|
memberRole: GroupMemberRole
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIDeleteGroupLink extends IChatCommand {
|
||||||
|
type: "apiDeleteGroupLink"
|
||||||
|
groupId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIGetGroupLink extends IChatCommand {
|
||||||
|
type: "apiGetGroupLink"
|
||||||
|
groupId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIGetUserProtoServers extends IChatCommand {
|
||||||
|
type: "apiGetUserProtoServers"
|
||||||
|
userId: number
|
||||||
|
serverProtocol: ServerProtocol
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APISetUserProtoServers extends IChatCommand {
|
||||||
|
type: "apiSetUserProtoServers"
|
||||||
|
userId: number
|
||||||
|
serverProtocol: ServerProtocol
|
||||||
|
servers: ServerCfg[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ServerCfg {
|
||||||
|
server: string
|
||||||
|
preset: boolean
|
||||||
|
tested?: boolean
|
||||||
|
enabled: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ServerProtocol {
|
||||||
|
SMP = "smp",
|
||||||
|
XFTP = "xftp",
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface APIContactInfo extends IChatCommand {
|
export interface APIContactInfo extends IChatCommand {
|
||||||
@ -314,6 +468,30 @@ export interface APIGroupMemberInfo extends IChatCommand {
|
|||||||
memberId: number
|
memberId: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface APIGetContactCode extends IChatCommand {
|
||||||
|
type: "apiGetContactCode"
|
||||||
|
contactId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIGetGroupMemberCode extends IChatCommand {
|
||||||
|
type: "apiGetGroupMemberCode"
|
||||||
|
groupId: number
|
||||||
|
groupMemberId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIVerifyContact extends IChatCommand {
|
||||||
|
type: "apiVerifyContact"
|
||||||
|
contactId: number
|
||||||
|
connectionCode: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIVerifyGroupMember extends IChatCommand {
|
||||||
|
type: "apiVerifyGroupMember"
|
||||||
|
groupId: number
|
||||||
|
groupMemberId: number
|
||||||
|
connectionCode: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface AddContact extends IChatCommand {
|
export interface AddContact extends IChatCommand {
|
||||||
type: "addContact"
|
type: "addContact"
|
||||||
}
|
}
|
||||||
@ -339,9 +517,45 @@ export interface ShowMyAddress extends IChatCommand {
|
|||||||
type: "showMyAddress"
|
type: "showMyAddress"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SetProfileAddress extends IChatCommand {
|
||||||
|
type: "setProfileAddress"
|
||||||
|
includeInProfile: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export interface AddressAutoAccept extends IChatCommand {
|
export interface AddressAutoAccept extends IChatCommand {
|
||||||
type: "addressAutoAccept"
|
type: "addressAutoAccept"
|
||||||
autoAccept: boolean
|
autoAccept?: AutoAccept
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APICreateMyAddress extends IChatCommand {
|
||||||
|
type: "apiCreateMyAddress"
|
||||||
|
userId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIDeleteMyAddress extends IChatCommand {
|
||||||
|
type: "apiDeleteMyAddress"
|
||||||
|
userId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIShowMyAddress extends IChatCommand {
|
||||||
|
type: "apiShowMyAddress"
|
||||||
|
userId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APISetProfileAddress extends IChatCommand {
|
||||||
|
type: "apiSetProfileAddress"
|
||||||
|
userId: number
|
||||||
|
includeInProfile: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface APIAddressAutoAccept extends IChatCommand {
|
||||||
|
type: "apiAddressAutoAccept"
|
||||||
|
userId: number
|
||||||
|
autoAccept?: AutoAccept
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AutoAccept {
|
||||||
|
acceptIncognito: boolean
|
||||||
autoReply?: MsgContent
|
autoReply?: MsgContent
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,10 +575,28 @@ export interface FileStatus extends IChatCommand {
|
|||||||
fileId: number
|
fileId: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface NewUser {
|
||||||
|
profile?: Profile
|
||||||
|
sameServers: boolean
|
||||||
|
pastTimestamp: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export interface Profile {
|
export interface Profile {
|
||||||
displayName: string
|
displayName: string
|
||||||
fullName: string // can be empty string
|
fullName: string // can be empty string
|
||||||
image?: string
|
image?: string
|
||||||
|
contactLink?: string
|
||||||
|
// preferences?: Preferences
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LocalProfile {
|
||||||
|
profileId: number
|
||||||
|
displayName: string
|
||||||
|
fullName: string
|
||||||
|
image?: string
|
||||||
|
contactLink?: string
|
||||||
|
// preferences?: Preferences
|
||||||
|
localAlias: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ChatType {
|
export enum ChatType {
|
||||||
@ -449,16 +681,36 @@ export function cmdString(cmd: ChatCommand): string {
|
|||||||
switch (cmd.type) {
|
switch (cmd.type) {
|
||||||
case "showActiveUser":
|
case "showActiveUser":
|
||||||
return "/u"
|
return "/u"
|
||||||
case "createActiveUser":
|
case "createActiveUser": {
|
||||||
return `/create user ${JSON.stringify(cmd.profile)}`
|
const user: NewUser = {profile: cmd.profile, sameServers: cmd.sameServers, pastTimestamp: cmd.pastTimestamp}
|
||||||
|
return `/_create user ${JSON.stringify(user)}`
|
||||||
|
}
|
||||||
|
case "listUsers":
|
||||||
|
return `/users`
|
||||||
|
case "apiSetActiveUser":
|
||||||
|
return `/_user ${cmd.userId}${maybeJSON(cmd.viewPwd)}`
|
||||||
|
case "apiHideUser":
|
||||||
|
return `/_hide user ${cmd.userId} ${JSON.stringify(cmd.viewPwd)}`
|
||||||
|
case "apiUnhideUser":
|
||||||
|
return `/_unhide user ${cmd.userId} ${JSON.stringify(cmd.viewPwd)}`
|
||||||
|
case "apiMuteUser":
|
||||||
|
return `/_mute user ${cmd.userId}`
|
||||||
|
case "apiUnmuteUser":
|
||||||
|
return `/_unmute user ${cmd.userId}`
|
||||||
|
case "apiDeleteUser":
|
||||||
|
return `/_delete user ${cmd.userId} del_smp=${onOff(cmd.delSMPQueues)}${maybeJSON(cmd.viewPwd)}`
|
||||||
case "startChat":
|
case "startChat":
|
||||||
return `/_start subscribe=${cmd.subscribeConnections ? "on" : "off"} expire=${cmd.expireChatItems ? "on" : "off"}`
|
return `/_start subscribe=${cmd.subscribeConnections ? "on" : "off"} expire=${cmd.enableExpireChatItems ? "on" : "off"}`
|
||||||
case "apiStopChat":
|
case "apiStopChat":
|
||||||
return "/_stop"
|
return "/_stop"
|
||||||
|
case "setTempFolder":
|
||||||
|
return `/_temp_folder ${cmd.tempFolder}`
|
||||||
case "setFilesFolder":
|
case "setFilesFolder":
|
||||||
return `/_files_folder ${cmd.filePath}`
|
return `/_files_folder ${cmd.filePath}`
|
||||||
|
case "apiSetXFTPConfig":
|
||||||
|
return `/_xftp ${onOff(cmd.config)}${maybeJSON(cmd.config)}`
|
||||||
case "setIncognito":
|
case "setIncognito":
|
||||||
return `/incognito ${cmd.incognito ? "on" : "off"}`
|
return `/incognito ${onOff(cmd.incognito)}`
|
||||||
case "apiExportArchive":
|
case "apiExportArchive":
|
||||||
return `/_db export ${JSON.stringify(cmd.config)}`
|
return `/_db export ${JSON.stringify(cmd.config)}`
|
||||||
case "apiImportArchive":
|
case "apiImportArchive":
|
||||||
@ -466,7 +718,7 @@ export function cmdString(cmd: ChatCommand): string {
|
|||||||
case "apiDeleteStorage":
|
case "apiDeleteStorage":
|
||||||
return "/_db delete"
|
return "/_db delete"
|
||||||
case "apiGetChats":
|
case "apiGetChats":
|
||||||
return `/_get chats pcc=${cmd.pendingConnections ? "on" : "off"}`
|
return `/_get chats pcc=${onOff(cmd.pendingConnections)}`
|
||||||
case "apiGetChat":
|
case "apiGetChat":
|
||||||
return `/_get chat ${cmd.chatType}${cmd.chatId}${paginationStr(cmd.pagination)}`
|
return `/_get chat ${cmd.chatType}${cmd.chatId}${paginationStr(cmd.pagination)}`
|
||||||
case "apiSendMessage":
|
case "apiSendMessage":
|
||||||
@ -475,6 +727,8 @@ export function cmdString(cmd: ChatCommand): string {
|
|||||||
return `/_update item ${cmd.chatType}${cmd.chatId} ${cmd.chatItemId} json ${JSON.stringify(cmd.msgContent)}`
|
return `/_update item ${cmd.chatType}${cmd.chatId} ${cmd.chatItemId} json ${JSON.stringify(cmd.msgContent)}`
|
||||||
case "apiDeleteChatItem":
|
case "apiDeleteChatItem":
|
||||||
return `/_delete item ${cmd.chatType}${cmd.chatId} ${cmd.chatItemId} ${cmd.deleteMode}`
|
return `/_delete item ${cmd.chatType}${cmd.chatId} ${cmd.chatItemId} ${cmd.deleteMode}`
|
||||||
|
case "apiDeleteMemberChatItem":
|
||||||
|
return `/_delete member item #${cmd.groupId} ${cmd.groupMemberId} ${cmd.itemId}`
|
||||||
case "apiChatRead": {
|
case "apiChatRead": {
|
||||||
const itemRange = cmd.itemRange ? ` from=${cmd.itemRange.fromItem} to=${cmd.itemRange.toItem}` : ""
|
const itemRange = cmd.itemRange ? ` from=${cmd.itemRange.fromItem} to=${cmd.itemRange.toItem}` : ""
|
||||||
return `/_read chat ${cmd.chatType}${cmd.chatId}${itemRange}`
|
return `/_read chat ${cmd.chatType}${cmd.chatId}${itemRange}`
|
||||||
@ -488,7 +742,7 @@ export function cmdString(cmd: ChatCommand): string {
|
|||||||
case "apiRejectContact":
|
case "apiRejectContact":
|
||||||
return `/_reject ${cmd.contactReqId}`
|
return `/_reject ${cmd.contactReqId}`
|
||||||
case "apiUpdateProfile":
|
case "apiUpdateProfile":
|
||||||
return `/_profile ${JSON.stringify(cmd.profile)}`
|
return `/_profile ${cmd.userId} ${JSON.stringify(cmd.profile)}`
|
||||||
case "apiSetContactAlias":
|
case "apiSetContactAlias":
|
||||||
return `/_set alias @${cmd.contactId} ${cmd.localAlias.trim()}`
|
return `/_set alias @${cmd.contactId} ${cmd.localAlias.trim()}`
|
||||||
case "apiParseMarkdown":
|
case "apiParseMarkdown":
|
||||||
@ -507,14 +761,30 @@ export function cmdString(cmd: ChatCommand): string {
|
|||||||
return `/_members #${cmd.groupId}`
|
return `/_members #${cmd.groupId}`
|
||||||
case "apiUpdateGroupProfile":
|
case "apiUpdateGroupProfile":
|
||||||
return `/_group_profile #${cmd.groupId} ${JSON.stringify(cmd.groupProfile)}`
|
return `/_group_profile #${cmd.groupId} ${JSON.stringify(cmd.groupProfile)}`
|
||||||
case "getUserSMPServers":
|
case "apiCreateGroupLink":
|
||||||
return "/smp_servers"
|
return `/_create link #${cmd.groupId} ${cmd.memberRole}`
|
||||||
case "setUserSMPServers":
|
case "apiGroupLinkMemberRole":
|
||||||
return `/smp_servers ${cmd.servers.join(",") || "default"}`
|
return `/_set link role #${cmd.groupId} ${cmd.memberRole}`
|
||||||
|
case "apiDeleteGroupLink":
|
||||||
|
return `/_delete link #${cmd.groupId}`
|
||||||
|
case "apiGetGroupLink":
|
||||||
|
return `/_get link #${cmd.groupId}`
|
||||||
|
case "apiGetUserProtoServers":
|
||||||
|
return `/_servers ${cmd.userId} ${cmd.serverProtocol}`
|
||||||
|
case "apiSetUserProtoServers":
|
||||||
|
return `/_servers ${cmd.userId} ${cmd.serverProtocol} ${JSON.stringify({servers: cmd.servers})}`
|
||||||
case "apiContactInfo":
|
case "apiContactInfo":
|
||||||
return `/_info @${cmd.contactId}`
|
return `/_info @${cmd.contactId}`
|
||||||
case "apiGroupMemberInfo":
|
case "apiGroupMemberInfo":
|
||||||
return `/_info #${cmd.groupId} ${cmd.memberId}`
|
return `/_info #${cmd.groupId} ${cmd.memberId}`
|
||||||
|
case "apiGetContactCode":
|
||||||
|
return `/_get code @${cmd.contactId}`
|
||||||
|
case "apiGetGroupMemberCode":
|
||||||
|
return `/_get code #${cmd.groupId} ${cmd.groupMemberId}`
|
||||||
|
case "apiVerifyContact":
|
||||||
|
return `/_verify code @${cmd.contactId}${maybe(cmd.connectionCode)}`
|
||||||
|
case "apiVerifyGroupMember":
|
||||||
|
return `/_verify code #${cmd.groupId} ${cmd.groupMemberId}${maybe(cmd.connectionCode)}`
|
||||||
case "addContact":
|
case "addContact":
|
||||||
return "/connect"
|
return "/connect"
|
||||||
case "connect":
|
case "connect":
|
||||||
@ -527,8 +797,20 @@ export function cmdString(cmd: ChatCommand): string {
|
|||||||
return "/delete_address"
|
return "/delete_address"
|
||||||
case "showMyAddress":
|
case "showMyAddress":
|
||||||
return "/show_address"
|
return "/show_address"
|
||||||
|
case "setProfileAddress":
|
||||||
|
return `/profile_address ${onOff(cmd.includeInProfile)}`
|
||||||
case "addressAutoAccept":
|
case "addressAutoAccept":
|
||||||
return `/auto_accept ${cmd.autoAccept ? "on" : "off"}${cmd.autoReply ? " " + JSON.stringify(cmd.autoReply) : ""}`
|
return `/auto_accept ${autoAcceptStr(cmd.autoAccept)}`
|
||||||
|
case "apiCreateMyAddress":
|
||||||
|
return `/_address ${cmd.userId}`
|
||||||
|
case "apiDeleteMyAddress":
|
||||||
|
return `/_delete_address ${cmd.userId}`
|
||||||
|
case "apiShowMyAddress":
|
||||||
|
return `/_show_address ${cmd.userId}`
|
||||||
|
case "apiSetProfileAddress":
|
||||||
|
return `/_profile_address ${cmd.userId} ${onOff(cmd.includeInProfile)}`
|
||||||
|
case "apiAddressAutoAccept":
|
||||||
|
return `/_auto_accept ${cmd.userId} ${autoAcceptStr(cmd.autoAccept)}`
|
||||||
case "receiveFile":
|
case "receiveFile":
|
||||||
return `/freceive ${cmd.fileId}${cmd.filePath ? " " + cmd.filePath : ""}`
|
return `/freceive ${cmd.fileId}${cmd.filePath ? " " + cmd.filePath : ""}`
|
||||||
case "cancelFile":
|
case "cancelFile":
|
||||||
@ -542,3 +824,21 @@ function paginationStr(cp: ChatPagination): string {
|
|||||||
const base = "after" in cp ? ` after=${cp.after}` : "before" in cp ? ` before=${cp.before}` : ""
|
const base = "after" in cp ? ` after=${cp.after}` : "before" in cp ? ` before=${cp.before}` : ""
|
||||||
return base + ` count=${cp.count}`
|
return base + ` count=${cp.count}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function maybe<T>(value: T | undefined): string {
|
||||||
|
return value ? ` ${value}` : ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function maybeJSON<T>(value: T | undefined): string {
|
||||||
|
return value ? ` json ${JSON.stringify(value)}` : ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function onOff<T>(value: T | undefined): string {
|
||||||
|
return value ? "on" : "off"
|
||||||
|
}
|
||||||
|
|
||||||
|
function autoAcceptStr(autoAccept: AutoAccept | undefined): string {
|
||||||
|
if (!autoAccept) return "off"
|
||||||
|
const msg = autoAccept.autoReply
|
||||||
|
return "on" + (autoAccept.acceptIncognito ? " incognito=on" : "") + (msg ? " json " + JSON.stringify(msg) : "")
|
||||||
|
}
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
import {ChatItemId, MsgContent, DeleteMode, Profile, GroupMemberRole} from "./command"
|
import {ChatItemId, MsgContent, DeleteMode, Profile, GroupMemberRole, LocalProfile, ServerProtocol, ServerCfg} from "./command"
|
||||||
|
|
||||||
export type ChatResponse =
|
export type ChatResponse =
|
||||||
| CRActiveUser
|
| CRActiveUser
|
||||||
|
| CRUsersList
|
||||||
| CRChatStarted
|
| CRChatStarted
|
||||||
| CRChatRunning
|
| CRChatRunning
|
||||||
| CRChatStopped
|
| CRChatStopped
|
||||||
| CRApiChats
|
| CRApiChats
|
||||||
| CRApiChat
|
| CRApiChat
|
||||||
| CRApiParsedMarkdown
|
| CRApiParsedMarkdown
|
||||||
| CRUserSMPServers
|
| CRUserProtoServers
|
||||||
| CRContactInfo
|
| CRContactInfo
|
||||||
| CRGroupMemberInfo
|
| CRGroupMemberInfo
|
||||||
| CRNewChatItem
|
| CRNewChatItem
|
||||||
@ -40,8 +41,6 @@ export type ChatResponse =
|
|||||||
| CRContactConnecting
|
| CRContactConnecting
|
||||||
| CRContactConnected
|
| CRContactConnected
|
||||||
| CRContactAnotherClient
|
| CRContactAnotherClient
|
||||||
| CRContactDisconnected
|
|
||||||
| CRContactSubscribed
|
|
||||||
| CRContactSubError
|
| CRContactSubError
|
||||||
| CRContactSubSummary
|
| CRContactSubSummary
|
||||||
| CRContactsDisconnected
|
| CRContactsDisconnected
|
||||||
@ -101,13 +100,14 @@ export type ChatResponse =
|
|||||||
|
|
||||||
type ChatResponseTag =
|
type ChatResponseTag =
|
||||||
| "activeUser"
|
| "activeUser"
|
||||||
|
| "usersList"
|
||||||
| "chatStarted"
|
| "chatStarted"
|
||||||
| "chatRunning"
|
| "chatRunning"
|
||||||
| "chatStopped"
|
| "chatStopped"
|
||||||
| "apiChats"
|
| "apiChats"
|
||||||
| "apiChat"
|
| "apiChat"
|
||||||
| "apiParsedMarkdown"
|
| "apiParsedMarkdown"
|
||||||
| "userSMPServers"
|
| "userProtoServers"
|
||||||
| "contactInfo"
|
| "contactInfo"
|
||||||
| "groupMemberInfo"
|
| "groupMemberInfo"
|
||||||
| "newChatItem"
|
| "newChatItem"
|
||||||
@ -139,8 +139,6 @@ type ChatResponseTag =
|
|||||||
| "contactConnecting"
|
| "contactConnecting"
|
||||||
| "contactConnected"
|
| "contactConnected"
|
||||||
| "contactAnotherClient"
|
| "contactAnotherClient"
|
||||||
| "contactDisconnected"
|
|
||||||
| "contactSubscribed"
|
|
||||||
| "contactSubError"
|
| "contactSubError"
|
||||||
| "contactSubSummary"
|
| "contactSubSummary"
|
||||||
| "contactsDisconnected"
|
| "contactsDisconnected"
|
||||||
@ -202,6 +200,11 @@ export interface CRActiveUser extends CR {
|
|||||||
user: User
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CRUsersList extends CR {
|
||||||
|
type: "usersList"
|
||||||
|
users: UserInfo[]
|
||||||
|
}
|
||||||
|
|
||||||
export interface CRChatStarted extends CR {
|
export interface CRChatStarted extends CR {
|
||||||
type: "chatStarted"
|
type: "chatStarted"
|
||||||
}
|
}
|
||||||
@ -216,11 +219,13 @@ export interface CRChatStopped extends CR {
|
|||||||
|
|
||||||
export interface CRApiChats extends CR {
|
export interface CRApiChats extends CR {
|
||||||
type: "apiChats"
|
type: "apiChats"
|
||||||
|
user: User
|
||||||
chats: Chat[]
|
chats: Chat[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRApiChat extends CR {
|
export interface CRApiChat extends CR {
|
||||||
type: "apiChat"
|
type: "apiChat"
|
||||||
|
user: User
|
||||||
chat: Chat
|
chat: Chat
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,13 +234,15 @@ export interface CRApiParsedMarkdown extends CR {
|
|||||||
formattedText?: FormattedText[]
|
formattedText?: FormattedText[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserSMPServers extends CR {
|
export interface CRUserProtoServers extends CR {
|
||||||
type: "userSMPServers"
|
type: "userProtoServers"
|
||||||
smpServers: string[]
|
user: User
|
||||||
|
servers: UserProtoServers
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactInfo extends CR {
|
export interface CRContactInfo extends CR {
|
||||||
type: "contactInfo"
|
type: "contactInfo"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
connectionStats: ConnectionStats
|
connectionStats: ConnectionStats
|
||||||
customUserProfile?: Profile
|
customUserProfile?: Profile
|
||||||
@ -243,6 +250,7 @@ export interface CRContactInfo extends CR {
|
|||||||
|
|
||||||
export interface CRGroupMemberInfo extends CR {
|
export interface CRGroupMemberInfo extends CR {
|
||||||
type: "groupMemberInfo"
|
type: "groupMemberInfo"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
connectionStats_?: ConnectionStats
|
connectionStats_?: ConnectionStats
|
||||||
@ -250,21 +258,25 @@ export interface CRGroupMemberInfo extends CR {
|
|||||||
|
|
||||||
export interface CRNewChatItem extends CR {
|
export interface CRNewChatItem extends CR {
|
||||||
type: "newChatItem"
|
type: "newChatItem"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRChatItemStatusUpdated extends CR {
|
export interface CRChatItemStatusUpdated extends CR {
|
||||||
type: "chatItemStatusUpdated"
|
type: "chatItemStatusUpdated"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRChatItemUpdated extends CR {
|
export interface CRChatItemUpdated extends CR {
|
||||||
type: "chatItemUpdated"
|
type: "chatItemUpdated"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRChatItemDeleted extends CR {
|
export interface CRChatItemDeleted extends CR {
|
||||||
type: "chatItemDeleted"
|
type: "chatItemDeleted"
|
||||||
|
user: User
|
||||||
deletedChatItem: AChatItem
|
deletedChatItem: AChatItem
|
||||||
toChatItem?: AChatItem
|
toChatItem?: AChatItem
|
||||||
byUser: boolean
|
byUser: boolean
|
||||||
@ -272,20 +284,24 @@ export interface CRChatItemDeleted extends CR {
|
|||||||
|
|
||||||
export interface CRMsgIntegrityError extends CR {
|
export interface CRMsgIntegrityError extends CR {
|
||||||
type: "msgIntegrityError"
|
type: "msgIntegrityError"
|
||||||
|
user: User
|
||||||
msgError: MsgErrorType
|
msgError: MsgErrorType
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRCmdOk extends CR {
|
export interface CRCmdOk extends CR {
|
||||||
type: "cmdOk"
|
type: "cmdOk"
|
||||||
|
user_?: User
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserContactLink extends CR {
|
export interface CRUserContactLink extends CR {
|
||||||
type: "userContactLink"
|
type: "userContactLink"
|
||||||
|
user: User
|
||||||
contactLink: UserContactLink
|
contactLink: UserContactLink
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserContactLinkUpdated extends CR {
|
export interface CRUserContactLinkUpdated extends CR {
|
||||||
type: "userContactLinkUpdated"
|
type: "userContactLinkUpdated"
|
||||||
|
user: User
|
||||||
connReqContact: string
|
connReqContact: string
|
||||||
autoAccept: boolean
|
autoAccept: boolean
|
||||||
autoReply?: MsgContent
|
autoReply?: MsgContent
|
||||||
@ -293,138 +309,153 @@ export interface CRUserContactLinkUpdated extends CR {
|
|||||||
|
|
||||||
export interface CRContactRequestRejected extends CR {
|
export interface CRContactRequestRejected extends CR {
|
||||||
type: "contactRequestRejected"
|
type: "contactRequestRejected"
|
||||||
|
user: User
|
||||||
contactRequest: UserContactRequest
|
contactRequest: UserContactRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserProfile extends CR {
|
export interface CRUserProfile extends CR {
|
||||||
type: "userProfile"
|
type: "userProfile"
|
||||||
|
user: User
|
||||||
profile: Profile
|
profile: Profile
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserProfileNoChange extends CR {
|
export interface CRUserProfileNoChange extends CR {
|
||||||
type: "userProfileNoChange"
|
type: "userProfileNoChange"
|
||||||
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserProfileUpdated extends CR {
|
export interface CRUserProfileUpdated extends CR {
|
||||||
type: "userProfileUpdated"
|
type: "userProfileUpdated"
|
||||||
|
user: User
|
||||||
fromProfile: Profile
|
fromProfile: Profile
|
||||||
toProfile: Profile
|
toProfile: Profile
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactAliasUpdated extends CR {
|
export interface CRContactAliasUpdated extends CR {
|
||||||
type: "contactAliasUpdated"
|
type: "contactAliasUpdated"
|
||||||
|
user: User
|
||||||
toContact: Contact
|
toContact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRInvitation extends CR {
|
export interface CRInvitation extends CR {
|
||||||
type: "invitation"
|
type: "invitation"
|
||||||
|
user: User
|
||||||
connReqInvitation: string
|
connReqInvitation: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSentConfirmation extends CR {
|
export interface CRSentConfirmation extends CR {
|
||||||
type: "sentConfirmation"
|
type: "sentConfirmation"
|
||||||
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSentInvitation extends CR {
|
export interface CRSentInvitation extends CR {
|
||||||
type: "sentInvitation"
|
type: "sentInvitation"
|
||||||
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactUpdated extends CR {
|
export interface CRContactUpdated extends CR {
|
||||||
type: "contactUpdated"
|
type: "contactUpdated"
|
||||||
|
user: User
|
||||||
fromContact: Contact
|
fromContact: Contact
|
||||||
toContact: Contact
|
toContact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactsMerged extends CR {
|
export interface CRContactsMerged extends CR {
|
||||||
type: "contactsMerged"
|
type: "contactsMerged"
|
||||||
|
user: User
|
||||||
intoContact: Contact
|
intoContact: Contact
|
||||||
mergedContact: Contact
|
mergedContact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactDeleted extends CR {
|
export interface CRContactDeleted extends CR {
|
||||||
type: "contactDeleted"
|
type: "contactDeleted"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRChatCleared extends CR {
|
export interface CRChatCleared extends CR {
|
||||||
type: "chatCleared"
|
type: "chatCleared"
|
||||||
|
user: User
|
||||||
chatInfo: ChatInfo
|
chatInfo: ChatInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserContactLinkCreated extends CR {
|
export interface CRUserContactLinkCreated extends CR {
|
||||||
type: "userContactLinkCreated"
|
type: "userContactLinkCreated"
|
||||||
|
user: User
|
||||||
connReqContact: string
|
connReqContact: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserContactLinkDeleted extends CR {
|
export interface CRUserContactLinkDeleted extends CR {
|
||||||
type: "userContactLinkDeleted"
|
type: "userContactLinkDeleted"
|
||||||
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRReceivedContactRequest extends CR {
|
export interface CRReceivedContactRequest extends CR {
|
||||||
type: "receivedContactRequest"
|
type: "receivedContactRequest"
|
||||||
|
user: User
|
||||||
contactRequest: UserContactRequest
|
contactRequest: UserContactRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRAcceptingContactRequest extends CR {
|
export interface CRAcceptingContactRequest extends CR {
|
||||||
type: "acceptingContactRequest"
|
type: "acceptingContactRequest"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactAlreadyExists extends CR {
|
export interface CRContactAlreadyExists extends CR {
|
||||||
type: "contactAlreadyExists"
|
type: "contactAlreadyExists"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactRequestAlreadyAccepted extends CR {
|
export interface CRContactRequestAlreadyAccepted extends CR {
|
||||||
type: "contactRequestAlreadyAccepted"
|
type: "contactRequestAlreadyAccepted"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactConnecting extends CR {
|
export interface CRContactConnecting extends CR {
|
||||||
type: "contactConnecting"
|
type: "contactConnecting"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactConnected extends CR {
|
export interface CRContactConnected extends CR {
|
||||||
type: "contactConnected"
|
type: "contactConnected"
|
||||||
contact: Contact
|
contact: Contact
|
||||||
|
user: User
|
||||||
userCustomProfile?: Profile
|
userCustomProfile?: Profile
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactAnotherClient extends CR {
|
export interface CRContactAnotherClient extends CR {
|
||||||
type: "contactAnotherClient"
|
type: "contactAnotherClient"
|
||||||
contact: Contact
|
user: User
|
||||||
}
|
|
||||||
|
|
||||||
export interface CRContactDisconnected extends CR {
|
|
||||||
type: "contactDisconnected"
|
|
||||||
contact: Contact
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CRContactSubscribed extends CR {
|
|
||||||
type: "contactSubscribed"
|
|
||||||
contact: Contact
|
contact: Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactSubError extends CR {
|
export interface CRContactSubError extends CR {
|
||||||
type: "contactSubError"
|
type: "contactSubError"
|
||||||
|
user: User
|
||||||
contact: Contact
|
contact: Contact
|
||||||
chatError: ChatError
|
chatError: ChatError
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactSubSummary extends CR {
|
export interface CRContactSubSummary extends CR {
|
||||||
type: "contactSubSummary"
|
type: "contactSubSummary"
|
||||||
|
user: User
|
||||||
contactSubscriptions: ContactSubStatus[]
|
contactSubscriptions: ContactSubStatus[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactsDisconnected extends CR {
|
export interface CRContactsDisconnected extends CR {
|
||||||
type: "contactsDisconnected"
|
type: "contactsDisconnected"
|
||||||
|
user: User
|
||||||
server: string
|
server: string
|
||||||
contactRefs: ContactRef[]
|
contactRefs: ContactRef[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactsSubscribed extends CR {
|
export interface CRContactsSubscribed extends CR {
|
||||||
type: "contactsSubscribed"
|
type: "contactsSubscribed"
|
||||||
|
user: User
|
||||||
server: string
|
server: string
|
||||||
contactRefs: ContactRef[]
|
contactRefs: ContactRef[]
|
||||||
}
|
}
|
||||||
@ -443,11 +474,13 @@ export interface CRHostDisconnected extends CR {
|
|||||||
|
|
||||||
export interface CRGroupEmpty extends CR {
|
export interface CRGroupEmpty extends CR {
|
||||||
type: "groupEmpty"
|
type: "groupEmpty"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRMemberSubError extends CR {
|
export interface CRMemberSubError extends CR {
|
||||||
type: "memberSubError"
|
type: "memberSubError"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
chatError: ChatError
|
chatError: ChatError
|
||||||
@ -455,70 +488,83 @@ export interface CRMemberSubError extends CR {
|
|||||||
|
|
||||||
export interface CRMemberSubSummary extends CR {
|
export interface CRMemberSubSummary extends CR {
|
||||||
type: "memberSubSummary"
|
type: "memberSubSummary"
|
||||||
|
user: User
|
||||||
memberSubscriptions: MemberSubStatus[]
|
memberSubscriptions: MemberSubStatus[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupSubscribed extends CR {
|
export interface CRGroupSubscribed extends CR {
|
||||||
type: "groupSubscribed"
|
type: "groupSubscribed"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileAccepted extends CR {
|
export interface CRRcvFileAccepted extends CR {
|
||||||
type: "rcvFileAccepted"
|
type: "rcvFileAccepted"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileAcceptedSndCancelled extends CR {
|
export interface CRRcvFileAcceptedSndCancelled extends CR {
|
||||||
type: "rcvFileAcceptedSndCancelled"
|
type: "rcvFileAcceptedSndCancelled"
|
||||||
|
user: User
|
||||||
rcvFileTransfer: RcvFileTransfer
|
rcvFileTransfer: RcvFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileStart extends CR {
|
export interface CRRcvFileStart extends CR {
|
||||||
type: "rcvFileStart"
|
type: "rcvFileStart"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileComplete extends CR {
|
export interface CRRcvFileComplete extends CR {
|
||||||
type: "rcvFileComplete"
|
type: "rcvFileComplete"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileCancelled extends CR {
|
export interface CRRcvFileCancelled extends CR {
|
||||||
type: "rcvFileCancelled"
|
type: "rcvFileCancelled"
|
||||||
|
user: User
|
||||||
rcvFileTransfer: RcvFileTransfer
|
rcvFileTransfer: RcvFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileSndCancelled extends CR {
|
export interface CRRcvFileSndCancelled extends CR {
|
||||||
type: "rcvFileSndCancelled"
|
type: "rcvFileSndCancelled"
|
||||||
|
user: User
|
||||||
rcvFileTransfer: RcvFileTransfer
|
rcvFileTransfer: RcvFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSndFileStart extends CR {
|
export interface CRSndFileStart extends CR {
|
||||||
type: "sndFileStart"
|
type: "sndFileStart"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
sndFileTransfer: SndFileTransfer
|
sndFileTransfer: SndFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSndFileComplete extends CR {
|
export interface CRSndFileComplete extends CR {
|
||||||
type: "sndFileComplete"
|
type: "sndFileComplete"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
sndFileTransfer: SndFileTransfer
|
sndFileTransfer: SndFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSndFileCancelled extends CR {
|
export interface CRSndFileCancelled extends CR {
|
||||||
type: "sndFileCancelled"
|
type: "sndFileCancelled"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
sndFileTransfer: SndFileTransfer
|
sndFileTransfer: SndFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSndFileRcvCancelled extends CR {
|
export interface CRSndFileRcvCancelled extends CR {
|
||||||
type: "sndFileRcvCancelled"
|
type: "sndFileRcvCancelled"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
sndFileTransfer: SndFileTransfer
|
sndFileTransfer: SndFileTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSndGroupFileCancelled extends CR {
|
export interface CRSndGroupFileCancelled extends CR {
|
||||||
type: "sndGroupFileCancelled"
|
type: "sndGroupFileCancelled"
|
||||||
|
user: User
|
||||||
chatItem: AChatItem
|
chatItem: AChatItem
|
||||||
fileTransferMeta: FileTransferMeta
|
fileTransferMeta: FileTransferMeta
|
||||||
sndFileTransfers: SndFileTransfer[]
|
sndFileTransfers: SndFileTransfer[]
|
||||||
@ -526,45 +572,53 @@ export interface CRSndGroupFileCancelled extends CR {
|
|||||||
|
|
||||||
export interface CRSndFileSubError extends CR {
|
export interface CRSndFileSubError extends CR {
|
||||||
type: "sndFileSubError"
|
type: "sndFileSubError"
|
||||||
|
user: User
|
||||||
sndFileTransfer: SndFileTransfer
|
sndFileTransfer: SndFileTransfer
|
||||||
chatError: ChatError
|
chatError: ChatError
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRRcvFileSubError extends CR {
|
export interface CRRcvFileSubError extends CR {
|
||||||
type: "rcvFileSubError"
|
type: "rcvFileSubError"
|
||||||
|
user: User
|
||||||
rcvFileTransfer: RcvFileTransfer
|
rcvFileTransfer: RcvFileTransfer
|
||||||
chatError: ChatError
|
chatError: ChatError
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRPendingSubSummary extends CR {
|
export interface CRPendingSubSummary extends CR {
|
||||||
type: "pendingSubSummary"
|
type: "pendingSubSummary"
|
||||||
|
user: User
|
||||||
pendingSubStatus: PendingSubStatus[]
|
pendingSubStatus: PendingSubStatus[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupCreated extends CR {
|
export interface CRGroupCreated extends CR {
|
||||||
type: "groupCreated"
|
type: "groupCreated"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupMembers extends CR {
|
export interface CRGroupMembers extends CR {
|
||||||
type: "groupMembers"
|
type: "groupMembers"
|
||||||
|
user: User
|
||||||
group: Group
|
group: Group
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserAcceptedGroupSent extends CR {
|
export interface CRUserAcceptedGroupSent extends CR {
|
||||||
type: "userAcceptedGroupSent"
|
type: "userAcceptedGroupSent"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
hostContact?: Contact // included when joining group via group link
|
hostContact?: Contact // included when joining group via group link
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRUserDeletedMember extends CR {
|
export interface CRUserDeletedMember extends CR {
|
||||||
type: "userDeletedMember"
|
type: "userDeletedMember"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRSentGroupInvitation extends CR {
|
export interface CRSentGroupInvitation extends CR {
|
||||||
type: "sentGroupInvitation"
|
type: "sentGroupInvitation"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
contact: Contact
|
contact: Contact
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
@ -572,21 +626,25 @@ export interface CRSentGroupInvitation extends CR {
|
|||||||
|
|
||||||
export interface CRLeftMemberUser extends CR {
|
export interface CRLeftMemberUser extends CR {
|
||||||
type: "leftMemberUser"
|
type: "leftMemberUser"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupDeletedUser extends CR {
|
export interface CRGroupDeletedUser extends CR {
|
||||||
type: "groupDeletedUser"
|
type: "groupDeletedUser"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupInvitation extends CR {
|
export interface CRGroupInvitation extends CR {
|
||||||
type: "groupInvitation"
|
type: "groupInvitation"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRReceivedGroupInvitation extends CR {
|
export interface CRReceivedGroupInvitation extends CR {
|
||||||
type: "receivedGroupInvitation"
|
type: "receivedGroupInvitation"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
contact: Contact
|
contact: Contact
|
||||||
memberRole: GroupMemberRole
|
memberRole: GroupMemberRole
|
||||||
@ -594,18 +652,21 @@ export interface CRReceivedGroupInvitation extends CR {
|
|||||||
|
|
||||||
export interface CRUserJoinedGroup extends CR {
|
export interface CRUserJoinedGroup extends CR {
|
||||||
type: "userJoinedGroup"
|
type: "userJoinedGroup"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
hostMember: GroupMember
|
hostMember: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRJoinedGroupMember extends CR {
|
export interface CRJoinedGroupMember extends CR {
|
||||||
type: "joinedGroupMember"
|
type: "joinedGroupMember"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRJoinedGroupMemberConnecting extends CR {
|
export interface CRJoinedGroupMemberConnecting extends CR {
|
||||||
type: "joinedGroupMemberConnecting"
|
type: "joinedGroupMemberConnecting"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
hostMember: GroupMember
|
hostMember: GroupMember
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
@ -613,12 +674,14 @@ export interface CRJoinedGroupMemberConnecting extends CR {
|
|||||||
|
|
||||||
export interface CRConnectedToGroupMember extends CR {
|
export interface CRConnectedToGroupMember extends CR {
|
||||||
type: "connectedToGroupMember"
|
type: "connectedToGroupMember"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRDeletedMember extends CR {
|
export interface CRDeletedMember extends CR {
|
||||||
type: "deletedMember"
|
type: "deletedMember"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
byMember: GroupMember
|
byMember: GroupMember
|
||||||
deletedMember: GroupMember
|
deletedMember: GroupMember
|
||||||
@ -626,29 +689,34 @@ export interface CRDeletedMember extends CR {
|
|||||||
|
|
||||||
export interface CRDeletedMemberUser extends CR {
|
export interface CRDeletedMemberUser extends CR {
|
||||||
type: "deletedMemberUser"
|
type: "deletedMemberUser"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRLeftMember extends CR {
|
export interface CRLeftMember extends CR {
|
||||||
type: "leftMember"
|
type: "leftMember"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupRemoved extends CR {
|
export interface CRGroupRemoved extends CR {
|
||||||
type: "groupRemoved"
|
type: "groupRemoved"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupDeleted extends CR {
|
export interface CRGroupDeleted extends CR {
|
||||||
type: "groupDeleted"
|
type: "groupDeleted"
|
||||||
|
user: User
|
||||||
groupInfo: GroupInfo
|
groupInfo: GroupInfo
|
||||||
member: GroupMember
|
member: GroupMember
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRGroupUpdated extends CR {
|
export interface CRGroupUpdated extends CR {
|
||||||
type: "groupUpdated"
|
type: "groupUpdated"
|
||||||
|
user: User
|
||||||
fromGroup: GroupInfo
|
fromGroup: GroupInfo
|
||||||
toGroup: GroupInfo
|
toGroup: GroupInfo
|
||||||
member_?: GroupMember
|
member_?: GroupMember
|
||||||
@ -665,36 +733,51 @@ export interface CRUserContactLinkSubError extends CR {
|
|||||||
|
|
||||||
export interface CRNewContactConnection extends CR {
|
export interface CRNewContactConnection extends CR {
|
||||||
type: "newContactConnection"
|
type: "newContactConnection"
|
||||||
|
user: User
|
||||||
connection: PendingContactConnection
|
connection: PendingContactConnection
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRContactConnectionDeleted extends CR {
|
export interface CRContactConnectionDeleted extends CR {
|
||||||
type: "contactConnectionDeleted"
|
type: "contactConnectionDeleted"
|
||||||
|
user: User
|
||||||
connection: PendingContactConnection
|
connection: PendingContactConnection
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRMessageError extends CR {
|
export interface CRMessageError extends CR {
|
||||||
type: "messageError"
|
type: "messageError"
|
||||||
|
user: User
|
||||||
severity: string
|
severity: string
|
||||||
errorMessage: string
|
errorMessage: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRChatCmdError extends CR {
|
export interface CRChatCmdError extends CR {
|
||||||
type: "chatCmdError"
|
type: "chatCmdError"
|
||||||
|
user_?: User
|
||||||
chatError: ChatError
|
chatError: ChatError
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CRChatError extends CR {
|
export interface CRChatError extends CR {
|
||||||
type: "chatError"
|
type: "chatError"
|
||||||
|
user_?: User
|
||||||
chatError: ChatError
|
chatError: ChatError
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
userId: number
|
userId: number
|
||||||
|
agentUserId: string
|
||||||
userContactId: number
|
userContactId: number
|
||||||
localDisplayName: string
|
localDisplayName: string
|
||||||
profile: Profile
|
profile: LocalProfile
|
||||||
|
// fullPreferences :: FullPreferences
|
||||||
activeUser: boolean
|
activeUser: boolean
|
||||||
|
viewPwdHash: string
|
||||||
|
showNtfs: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserProtoServers {
|
||||||
|
serverProtocol: ServerProtocol
|
||||||
|
protoServers: ServerCfg[]
|
||||||
|
presetServers: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Chat {
|
export interface Chat {
|
||||||
@ -730,6 +813,16 @@ interface CInfoContactRequest extends IChatInfo {
|
|||||||
contactRequest: UserContactRequest
|
contactRequest: UserContactRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UserPwdHash {
|
||||||
|
hash: string
|
||||||
|
salt: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UserInfo {
|
||||||
|
user: User
|
||||||
|
unreadCount: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface Contact {
|
export interface Contact {
|
||||||
contactId: number
|
contactId: number
|
||||||
localDisplayName: string
|
localDisplayName: string
|
||||||
|
Loading…
Reference in New Issue
Block a user