diff --git a/package.json b/package.json index ccf87da..2ac4323 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@expressms/smartapp-sdk", - "version": "1.14.0-alpha.8", + "version": "1.14.0-alpha.9", "description": "Smartapp SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/src/index.ts b/src/index.ts index f042ef5..4766942 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ export * from './lib/client' -export * from './lib/client/file' export * from './lib/contacts' export * from './lib/helpers/helpers' export * from './lib/logging' diff --git a/src/lib/client/index.ts b/src/lib/client/index.ts index 3d31f1d..5f68ab2 100644 --- a/src/lib/client/index.ts +++ b/src/lib/client/index.ts @@ -15,6 +15,7 @@ import { } from '../../types' export * from './events' export * from './storage' +export * from './file' const openClientSettings = () => { return bridge?.sendClientEvent({ @@ -247,6 +248,22 @@ const hideRecievedData = (): Promise => { .then(event => event as StatusResponse) } +/** + * Open contacts page on client + * @returns Promise that'll be fullfilled + */ +const openClientContacts = (): Promise => { + if (!bridge) return Promise.reject(ERROR_CODES.NO_BRIDGE) + + return bridge + .sendClientEvent({ + method: METHODS.OPEN_CLIENT_CONTACTS, + params: {}, + }) + .then(event => event as StatusResponse) +} + + export { openClientSettings, getChats, @@ -264,4 +281,5 @@ export { getAppVisibility, getSmartAppList, hideRecievedData, + openClientContacts, } diff --git a/src/types/bridge.ts b/src/types/bridge.ts index 1a80501..d3ede31 100644 --- a/src/types/bridge.ts +++ b/src/types/bridge.ts @@ -57,6 +57,7 @@ export enum METHODS { HIDE_RECV_DATA = 'hide_recv_data', GET_EXPRESS_DISK_AUTH_CODE = 'get_express_disk_auth_code', GET_NFC_STATUS = 'get_nfc_status', + OPEN_CLIENT_CONTACTS = 'open_client_contacts', } export enum STATUS {