From bfa7ff16ffc6b38004feaf3dc47c3378aeebcdb8 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 17 Nov 2022 14:45:48 +0000 Subject: [PATCH] sdk: fix typescript client (#1380) --- .../simplex-chat-client/typescript/src/client.ts | 2 +- .../simplex-chat-client/typescript/src/response.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/simplex-chat-client/typescript/src/client.ts b/packages/simplex-chat-client/typescript/src/client.ts index 3ed1ed5b68..3efbbd07d1 100644 --- a/packages/simplex-chat-client/typescript/src/client.ts +++ b/packages/simplex-chat-client/typescript/src/client.ts @@ -249,7 +249,7 @@ export class ChatClient { const r = await this.sendChatCommand({type: "showMyAddress"}) switch (r.type) { case "userContactLink": - return r.connReqContact + return r.contactLink.connReqContact default: if (r.type === "chatCmdError" && r.chatError.type === "errorStore" && r.chatError.storeError.type === "userContactLinkNotFound") { return undefined diff --git a/packages/simplex-chat-client/typescript/src/response.ts b/packages/simplex-chat-client/typescript/src/response.ts index 97df1731d6..b5a250f756 100644 --- a/packages/simplex-chat-client/typescript/src/response.ts +++ b/packages/simplex-chat-client/typescript/src/response.ts @@ -280,8 +280,7 @@ export interface CRCmdOk extends CR { export interface CRUserContactLink extends CR { type: "userContactLink" - connReqContact: string - autoAccept: boolean + contactLink: UserContactLink } export interface CRUserContactLinkUpdated extends CR { @@ -913,6 +912,16 @@ interface FileTransferMeta { cancelled: boolean } +interface UserContactLink { + connReqContact: string + autoAccept?: AutoAccept +} + +interface AutoAccept { + acceptIncognito: boolean + autoReply?: MsgContent +} + export interface ChatStats { unreadCount: number minUnreadItemId: number