Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/hubspot

src/search-deals.ts

23 lines · 721 B · TypeScript
import { searchStandard, parseSearchInput, type StandardSearchInput } from './wrappers.ts'

/**
 * Search HubSpot deals.
 * @example
 * import searchDeals from 'kody:@kody/hubspot/search-deals'
 * const { items } = await searchDeals({ query: 'acme' })
 */
export async function searchDeals(input: StandardSearchInput = {}) {
	return searchStandard('deals', input)
}

/**
 * Search HubSpot deals.
 * @example
 * import searchDeals from 'kody:@kody/hubspot/search-deals'
 * const result = await searchDeals({ query: 'acme', limit: 10 })
 */
export default async function searchDealsEntrypoint(
	params: StandardSearchInput & Record<string, unknown> = {},
) {
	return searchDeals(parseSearchInput(params, 'search-deals'))
}