From b4417b04be74f08bcad5cc9fda21a7aef31a57c0 Mon Sep 17 00:00:00 2001 From: Ivan Kudinov Date: Wed, 24 Jun 2026 16:01:56 +0300 Subject: [PATCH] CCS-113131 add search_fields in search corp phonebook request --- package.json | 2 +- src/lib/client/index.ts | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ecda07c..91dd645 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@expressms/smartapp-sdk", - "version": "1.14.0-alpha.10", + "version": "1.14.0-alpha.11", "description": "Smartapp SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/src/lib/client/index.ts b/src/lib/client/index.ts index 5f68ab2..737880d 100644 --- a/src/lib/client/index.ts +++ b/src/lib/client/index.ts @@ -31,10 +31,27 @@ const getChats = ({ filter = null }: { filter: string | null }) => { }) } -const searchCorporatePhonebook = ({ filter = null, exactMatch }: { filter: string | null; exactMatch?: boolean }) => { - return bridge?.sendClientEvent({ +/** + * Search corporate users on server and local cache. + * @param filter Query string + * @param exactMatch Determine fuzzyness of search results + * @param searchFields Fields to search, available: public_name, name, company, company_position, office, department, manager, description, ad_login, email + * @returns Promise that'll be fullfilled with search results, otherwise rejected with reason + */ +const searchCorporatePhonebook = ({ + filter = null, + exactMatch, + searchFields = undefined, +}: { + filter: string | null + exactMatch?: boolean + searchFields?: string[] +}) => { + if (!bridge) return Promise.reject(ERROR_CODES.NO_BRIDGE) + + return bridge.sendClientEvent({ method: METHODS.SEARCH_CORPORATE_PHONEBOOK, - params: { filter, exactMatch }, + params: { filter, exactMatch, searchFields }, }) } @@ -263,7 +280,6 @@ const openClientContacts = (): Promise => { .then(event => event as StatusResponse) } - export { openClientSettings, getChats,