Skip to content

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

Package listing

@kody/hubspot

src/update-ticket.ts

27 lines · 901 B · TypeScript
import { updateStandard, parseUpdateInput, type StandardUpdateInput } from './wrappers.ts'

/**
 * Update a HubSpot ticket. Requires `confirm: true`, or use `dryRun: true`.
 * @example
 * import updateTicket from 'kody:@kody/hubspot/update-ticket'
 * const preview = await updateTicket({
 *   id: '123',
 *   properties: { },
 *   dryRun: true,
 * })
 */
export async function updateTicket(input: StandardUpdateInput) {
	return updateStandard('tickets', input)
}

/**
 * Update a HubSpot ticket. Requires `confirm: true`, or use `dryRun: true`.
 * @example
 * import updateTicket from 'kody:@kody/hubspot/update-ticket'
 * const preview = await updateTicket({ id: '123', properties: {}, dryRun: true })
 */
export default async function updateTicketEntrypoint(
	params: Partial<StandardUpdateInput> & Record<string, unknown> = {},
) {
	return updateTicket(parseUpdateInput(params, 'update-ticket'))
}