Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update "@hubspot/api-client" from 6.0.1 to 12.0.1 CAL-[5029] #18670

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

joeauyeung
Copy link
Contributor

What does this PR do?

  • Updates SDK version in preparation of adding more features to our Hubspot integration

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

@graphite-app graphite-app bot requested review from a team January 15, 2025 02:53
@keithwillcode keithwillcode added consumer core area: core, team members only labels Jan 15, 2025
Copy link

graphite-app bot commented Jan 15, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (01/15/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add foundation team as reviewer" took an action on this PR • (01/15/25)

1 reviewer was added to this PR based on Keith Williams's automation.

@dosubot dosubot bot added crm-apps area: crm apps, salesforce, hubspot, close.com, sendgrid ⬆️ dependencies Pull requests that update a dependency file labels Jan 15, 2025
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 3:00am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 3:00am

@@ -1,4 +1,4 @@
import * as hubspot from "@hubspot/api-client";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's import specifically what we need

@@ -38,7 +39,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!client_id) return res.status(400).json({ message: "HubSpot client id missing." });
if (!client_secret) return res.status(400).json({ message: "HubSpot client secret missing." });

const hubspotToken: HubspotToken = await hubspotClient.oauth.tokensApi.createToken(
const hubspotToken: HubspotToken = await oauth.tokensApi.create(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change in method from .createToken() to create()

hs_meeting_end_time: new Date(event.endTime).toISOString(),
hs_meeting_outcome: "SCHEDULED",
},
associations: contacts.reduce((associations, contact) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making a separate call to associate a meeting with a contact, we can do it in one call. It'll actually throw a type error if we don't.

@@ -227,7 +229,7 @@ export default class HubspotCalendarService implements CRM {
return contacts.map((contact) => {
return {
id: contact.id,
email: contact.properties.email,
email: contact.properties.email || "",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emails are required for contacts so not sure why it's throwing a string | null type here.

@joeauyeung joeauyeung changed the title chore: Update "@hubspot/api-client" from 6.0.1 to 12.0.1 chore: Update "@hubspot/api-client" from 6.0.1 to 12.0.1 CAL-[5029] Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only crm-apps area: crm apps, salesforce, hubspot, close.com, sendgrid ⬆️ dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants