sdk: fix typescript client (#1380)

This commit is contained in:
Evgeny Poberezkin 2022-11-17 14:45:48 +00:00 committed by GitHub
parent 5c2b70a214
commit bfa7ff16ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -249,7 +249,7 @@ export class ChatClient {
const r = await this.sendChatCommand({type: "showMyAddress"}) const r = await this.sendChatCommand({type: "showMyAddress"})
switch (r.type) { switch (r.type) {
case "userContactLink": case "userContactLink":
return r.connReqContact return r.contactLink.connReqContact
default: default:
if (r.type === "chatCmdError" && r.chatError.type === "errorStore" && r.chatError.storeError.type === "userContactLinkNotFound") { if (r.type === "chatCmdError" && r.chatError.type === "errorStore" && r.chatError.storeError.type === "userContactLinkNotFound") {
return undefined return undefined

View file

@ -280,8 +280,7 @@ export interface CRCmdOk extends CR {
export interface CRUserContactLink extends CR { export interface CRUserContactLink extends CR {
type: "userContactLink" type: "userContactLink"
connReqContact: string contactLink: UserContactLink
autoAccept: boolean
} }
export interface CRUserContactLinkUpdated extends CR { export interface CRUserContactLinkUpdated extends CR {
@ -913,6 +912,16 @@ interface FileTransferMeta {
cancelled: boolean cancelled: boolean
} }
interface UserContactLink {
connReqContact: string
autoAccept?: AutoAccept
}
interface AutoAccept {
acceptIncognito: boolean
autoReply?: MsgContent
}
export interface ChatStats { export interface ChatStats {
unreadCount: number unreadCount: number
minUnreadItemId: number minUnreadItemId: number