Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
24 changes: 20 additions & 4 deletions src/lib/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
})
}

Expand Down Expand Up @@ -263,7 +280,6 @@ const openClientContacts = (): Promise<StatusResponse> => {
.then(event => event as StatusResponse)
}


export {
openClientSettings,
getChats,
Expand Down
Loading