Skip to content

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

Package listing

@kody/hubspot

src/get-deal.ts

23 lines · 642 B · TypeScript
import { getStandard, parseGetInput, type StandardGetInput } from './wrappers.ts'

/**
 * Get one HubSpot deal.
 * @example
 * import getDeal from 'kody:@kody/hubspot/get-deal'
 * const record = await getDeal({ id: '123' })
 */
export async function getDeal(input: StandardGetInput) {
	return getStandard('deals', input)
}

/**
 * Get one HubSpot deal.
 * @example
 * import getDeal from 'kody:@kody/hubspot/get-deal'
 * const record = await getDeal({ id: '123' })
 */
export default async function getDealEntrypoint(
	params: Partial<StandardGetInput> & Record<string, unknown> = {},
) {
	return getDeal(parseGetInput(params, 'get-deal'))
}