← Public packages
@kody/hubspot
Read HubSpot contacts, companies, deals, and tickets, with dry-run writes and generic CRM object reads.
src/create-company.ts
29 lines · 961 B · TypeScriptimport { createStandard, parseCreateInput, type StandardCreateInput } from './wrappers.ts'
/**
* Create a HubSpot company. Requires `confirm: true`, or use `dryRun: true`.
* @example
* import createCompany from 'kody:@kody/hubspot/create-company'
* const preview = await createCompany({
* properties: { name: 'Acme Inc', domain: 'acme.example' },
* dryRun: true,
* })
*/
export async function createCompany(input: StandardCreateInput) {
return createStandard('companies', input)
}
/**
* Create a HubSpot company. Requires `confirm: true`, or use `dryRun: true`.
* @example
* import createCompany from 'kody:@kody/hubspot/create-company'
* const preview = await createCompany({
* properties: { name: 'Acme Inc' },
* dryRun: true,
* })
*/
export default async function createCompanyEntrypoint(
params: Partial<StandardCreateInput> & Record<string, unknown> = {},
) {
return createCompany(parseCreateInput(params, 'create-company'))
}