import { createStandard, parseCreateInput, type StandardCreateInput } from './wrappers.ts'
/**
* Create a HubSpot deal. Requires `confirm: true`, or use `dryRun: true`.
* @example
* import createDeal from 'kody:@kody/hubspot/create-deal'
* const preview = await createDeal({
* properties: { dealname: 'Acme renewal', amount: '12000' },
* dryRun: true,
* })
*/
export async function createDeal(input: StandardCreateInput) {
return createStandard('deals', input)
}
/**
* Create a HubSpot deal. Requires `confirm: true`, or use `dryRun: true`.
* @example
* import createDeal from 'kody:@kody/hubspot/create-deal'
* const preview = await createDeal({
* properties: { dealname: 'Acme renewal' },
* dryRun: true,
* })
*/
export default async function createDealEntrypoint(
params: Partial<StandardCreateInput> & Record<string, unknown> = {},
) {
return createDeal(parseCreateInput(params, 'create-deal'))
}