-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[FEATURE] Hubspot - New form submission improvement #15993
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe pull request primarily updates version numbers across many HubSpot action and source modules without affecting their functionality. Two files introduce new functionality: a new method Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HubSpotApp
participant API
User ->> HubSpotApp: Call getFormDefinition({ formId, opts })
HubSpotApp ->> API: makeRequest(GET /forms/{formId}, opts)
API -->> HubSpotApp: Response (form definition)
HubSpotApp -->> User: Return form definition
sequenceDiagram
participant NFS as NewFormSubmission
participant Resource as ResourceFn
participant Evt as EventEmitter
loop While more pages exist
NFS ->> Resource: Call resourceFn(pagination params)
Resource -->> NFS: Return results with pagination info
NFS ->> NFS: Process results and update 'after' timestamp
end
NFS ->> Evt: Emit event for each valid submission
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/hubspot/actions/create-associations/create-associations.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/hubspot/actions/create-communication/create-communication.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
4339c0d
to
a5bfb7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
components/hubspot/actions/get-file-public-url/get-file-public-url.mjs (1)
31-35
:⚠️ Potential issueEnhance error handling when looking up files.
Currently, the code directly accesses
file.id
without checking iffile
is defined. If no file matches the provided URL, this could result in a runtime error. Consider refactoring as shown below to ensure that you check for the existence offile
before accessing its property:- const file = files.find(({ url }) => url === fileUrl ); - const fileId = file.id; - if (!fileId) { - throw new Error(`File not found at ${fileUrl}`); - } + const file = files.find(({ url }) => url === fileUrl ); + if (!file) { + throw new Error(`File not found at ${fileUrl}`); + } + const fileId = file.id;This change prevents potential crashes caused by attempting to access properties on an undefined object.
🧹 Nitpick comments (1)
components/hubspot/sources/new-form-submission/new-form-submission.mjs (1)
32-32
: Replace delete operator with undefined assignment.The static analysis tool correctly flags a performance concern with the delete operator.
- delete params.after; + params.after = undefined;This change maintains the same behavior while avoiding the performance impact of property deletion.
🧰 Tools
🪛 Biome (1.9.4)
[error] 32-32: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (50)
components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs
(1 hunks)components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs
(1 hunks)components/hubspot/actions/create-associations/create-associations.mjs
(1 hunks)components/hubspot/actions/create-communication/create-communication.mjs
(1 hunks)components/hubspot/actions/create-company/create-company.mjs
(1 hunks)components/hubspot/actions/create-custom-object/create-custom-object.mjs
(1 hunks)components/hubspot/actions/create-deal/create-deal.mjs
(1 hunks)components/hubspot/actions/create-engagement/create-engagement.mjs
(1 hunks)components/hubspot/actions/create-lead/create-lead.mjs
(1 hunks)components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs
(1 hunks)components/hubspot/actions/create-ticket/create-ticket.mjs
(1 hunks)components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs
(1 hunks)components/hubspot/actions/get-company/get-company.mjs
(1 hunks)components/hubspot/actions/get-contact/get-contact.mjs
(1 hunks)components/hubspot/actions/get-deal/get-deal.mjs
(1 hunks)components/hubspot/actions/get-file-public-url/get-file-public-url.mjs
(1 hunks)components/hubspot/actions/search-crm/search-crm.mjs
(1 hunks)components/hubspot/actions/update-company/update-company.mjs
(1 hunks)components/hubspot/actions/update-contact/update-contact.mjs
(1 hunks)components/hubspot/actions/update-custom-object/update-custom-object.mjs
(1 hunks)components/hubspot/actions/update-deal/update-deal.mjs
(1 hunks)components/hubspot/actions/update-lead/update-lead.mjs
(1 hunks)components/hubspot/common/constants.mjs
(1 hunks)components/hubspot/hubspot.app.mjs
(1 hunks)components/hubspot/package.json
(1 hunks)components/hubspot/sources/delete-blog-article/delete-blog-article.mjs
(1 hunks)components/hubspot/sources/new-company-property-change/new-company-property-change.mjs
(1 hunks)components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs
(1 hunks)components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs
(1 hunks)components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
(1 hunks)components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs
(1 hunks)components/hubspot/sources/new-email-event/new-email-event.mjs
(1 hunks)components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs
(1 hunks)components/hubspot/sources/new-engagement/new-engagement.mjs
(1 hunks)components/hubspot/sources/new-event/new-event.mjs
(1 hunks)components/hubspot/sources/new-form-submission/new-form-submission.mjs
(2 hunks)components/hubspot/sources/new-form-submission/test-event.mjs
(1 hunks)components/hubspot/sources/new-note/new-note.mjs
(1 hunks)components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs
(1 hunks)components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs
(1 hunks)components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
(1 hunks)components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs
(1 hunks)components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs
(1 hunks)components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs
(1 hunks)components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs
(1 hunks)components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs
(1 hunks)components/hubspot/sources/new-social-media-message/new-social-media-message.mjs
(1 hunks)components/hubspot/sources/new-task/new-task.mjs
(1 hunks)components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs
(1 hunks)components/hubspot/sources/new-ticket/new-ticket.mjs
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
components/hubspot/sources/new-form-submission/new-form-submission.mjs
[error] 32-32: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (52)
components/hubspot/package.json (1)
3-3
: Version Bump Verification
The package version has been updated to "1.0.2", which is consistent with the coordinated version bump effort across multiple HubSpot modules. Make sure that any related tooling or release procedures are updated accordingly.components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs (1)
12-12
: Module Version Update
The version property has been updated to "0.0.7". This change is consistent with similar version bumps across other HubSpot sources. Ensure that any external integrations or documentation referencing the previous version are updated to reflect the new version.components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs (1)
12-12
: Module Version Update
The version has been incremented to "0.0.7". This update aligns with the broader versioning strategy observed in this PR. No functionality changes are introduced, so please confirm that downstream consumers of this module are aware of the new version.components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs (1)
10-10
: Module Version Increment
The version has been changed from "0.0.24" to "0.0.25". This minor version bump is consistent with the other HubSpot components. Ensure that any documentation or version-dependent logic is updated if necessary.components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs (1)
10-10
: Module Version Update & Pagination Enhancement
The version property is now set to "0.0.7". Additionally, theprocessResults
method leverages the newpaginate
functionality (binding the appropriate HubSpot API call for blog posts) to manage pagination. This is in line with the broader improvements introduced in this PR.components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs (1)
10-10
: Version Update ConfirmationThe version has been updated to
"0.0.9"
, which is consistent with the overall version increment strategy. Ensure the release notes mention any improvements (if applicable) related to the Hubspot form submission improvements.components/hubspot/sources/new-note/new-note.mjs (1)
11-11
: Version Bump VerifiedThe version change from the prior release to
"1.0.1"
is appropriate. No functional logic has been affected.components/hubspot/sources/delete-blog-article/delete-blog-article.mjs (1)
9-9
: Consistent Version IncrementThe version update to
"0.0.20"
accurately reflects the coordinated versioning effort. The changes do not impact functionality, so this update is straightforward.components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs (1)
9-9
: Version Update is on TargetThe version number has been incremented to
"0.0.20"
, aligning with the standardized version updates across the project. No issues detected.components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs (1)
12-12
: Version Bump ConfirmedThe version has been correctly incremented to
"0.0.7"
, ensuring consistency with the rest of the HubSpot modules. All functionality remains intact.components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs (1)
12-12
: Version Number Update Approved.
The version has been updated from "0.0.6" to "0.0.7". This is a straightforward update that does not affect any functionality.components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs (1)
10-10
: Version Number Update Approved.
The version is incremented to "0.0.20" from the previous release ("0.0.19"), which aligns with the coordinated version bumps across HubSpot modules.components/hubspot/sources/new-task/new-task.mjs (1)
11-11
: Version Number Update Approved.
The version is updated from "1.0.0" to "1.0.1". This minor version bump has no impact on functionality and maintains consistency in the module’s versioning.components/hubspot/sources/new-event/new-event.mjs (1)
11-11
: Version Number Update Approved.
The version is increased to "0.0.24". This update reflects a routine version increment without modifying the underlying functionality or control flow.components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs (1)
9-9
: Version Number Update Approved.
The version has been incremented from "0.0.4" to "0.0.5", indicating a minor update while keeping functionality intact.components/hubspot/sources/new-social-media-message/new-social-media-message.mjs (1)
9-9
: Version Update ConsistencyThe version field has been updated to
"0.0.20"
. This change is purely semantic and maintains consistency with the coordinated version bump across components, without altering any behavior.components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs (1)
12-12
: Version Update AccuracyThe version has been incremented to
"0.0.7"
, which appears consistent with our overall versioning scheme. No functionality is affected.components/hubspot/sources/new-ticket/new-ticket.mjs (1)
12-12
: Ticket Source Version BumpUpdating the version to
"0.0.20"
is a straightforward change that aligns with similar updates in other components. The change does not impact functionality.components/hubspot/sources/new-engagement/new-engagement.mjs (1)
11-11
: Engagement Source Version UpdateThe version change to
"0.0.25"
is correctly applied. This update is purely for version tracking and does not affect the logic or behavior of the file.components/hubspot/sources/new-email-event/new-email-event.mjs (1)
11-11
: Email Event Version IncrementThe new version
"0.0.23"
is applied consistently with other component updates. As this is solely a version change, functionality remains intact.components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs (1)
10-10
: Version update looks good.The version has been properly incremented from "0.0.14" to "0.0.15", following semantic versioning principles.
components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs (1)
10-10
: Version update looks good.The version has been properly incremented from "0.0.13" to "0.0.14", following semantic versioning principles.
components/hubspot/sources/new-company-property-change/new-company-property-change.mjs (1)
10-10
: Version update looks good.The version has been properly incremented from "0.0.12" to "0.0.13", following semantic versioning principles.
components/hubspot/actions/get-deal/get-deal.mjs (1)
9-9
: Version update looks good.The version has been properly incremented from "0.0.14" to "0.0.15", following semantic versioning principles.
components/hubspot/common/constants.mjs (1)
25-25
:✅ Verification successful
New API path constant added correctly.
The addition of the
MARKETINGV3
constant to theAPI_PATH
object is appropriate for accessing HubSpot's Marketing V3 API. This will enable API calls to the "/marketing/v3" endpoint.
🏁 Script executed:
#!/bin/bash # Let's check if this new constant is being used in the PR or related files # First, check for direct references to MARKETINGV3 in the codebase echo "Searching for direct references to MARKETINGV3..." rg -n "MARKETINGV3" --type js --type mjs # Also check for references to "/marketing/v3" in case it's used directly echo "Searching for direct string references to /marketing/v3..." rg -n '"/marketing/v3"' --type js --type mjsLength of output: 379
Below is an updated shell script that correctly searches both JavaScript and ECMAScript module files by using glob patterns instead of the unrecognized file type flag:
API Path Constant Verified: MARKETINGV3 Added Correctly
The new
MARKETINGV3
constant incomponents/hubspot/common/constants.mjs
(line 25) has been added as intended for accessing HubSpot’s Marketing V3 API. The revised verification script (above) now correctly searches both.js
and.mjs
files. No issues were identified concerning the addition.
🏁 Script executed:
#!/bin/bash echo "Searching for direct references to MARKETINGV3 using globs..." rg -n "MARKETINGV3" -g "*.js" -g "*.mjs" echo "Searching for direct string references to /marketing/v3 using globs..." rg -n '"/marketing/v3"' -g "*.js" -g "*.mjs"Length of output: 717
API Path Constant Verified: 'MARKETINGV3' is used correctly
The new
MARKETINGV3
constant incomponents/hubspot/common/constants.mjs
has been confirmed to be correctly added for accessing HubSpot’s Marketing V3 API. It's properly referenced in the codebase (notably incomponents/hubspot/hubspot.app.mjs
at line 719), and no discrepancies were found.components/hubspot/actions/get-company/get-company.mjs (1)
9-9
: Version Bump Confirmed
The version update to"0.0.15"
is consistent with the coordinated versioning effort across HubSpot actions. No functional changes are introduced.components/hubspot/actions/get-contact/get-contact.mjs (1)
9-9
: Version Update Noted
Updating the version to"0.0.15"
aligns with our systematic version increments. The module’s logic and structure remain unchanged.components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs (1)
7-7
: Module Version Increment
The version bump to"0.0.15"
is applied as expected. There are no changes to functionality; this update ensures consistency with other HubSpot action modules.components/hubspot/actions/update-contact/update-contact.mjs (1)
10-10
: Version Bump Confirmation
The version has been updated to"0.0.16"
. This change is solely a version increment and does not affect the underlying logic. Ensure downstream integrations are aware of the update.components/hubspot/actions/create-company/create-company.mjs (1)
9-9
: Version Upgrade Verified
The version update to"0.0.19"
is correctly applied. This maintains our consistent release strategy across modules without altering functionality.components/hubspot/actions/create-ticket/create-ticket.mjs (1)
9-9
: Version update for consistency.The version field has been updated to
"0.0.10"
, which aligns with the overall versioning strategy used across HubSpot components.components/hubspot/actions/update-deal/update-deal.mjs (1)
10-10
: Version increment applied.The version has been updated to
"0.0.6"
in this module, ensuring consistency across the HubSpot action components.components/hubspot/actions/create-lead/create-lead.mjs (1)
12-12
: Version update for module consistency.The version field is now
"0.0.7"
, which maintains alignment with the overall versioning approach across the different HubSpot modules.components/hubspot/actions/create-deal/create-deal.mjs (1)
9-9
: Version increment for consistency.The version field has been updated to
"0.0.19"
, keeping the module in sync with other similar components in this release.components/hubspot/actions/update-lead/update-lead.mjs (1)
10-10
: Version update adjustment.The version has been bumped to
"0.0.7"
, ensuring that this module’s version is consistent with the updated release strategy.components/hubspot/actions/create-custom-object/create-custom-object.mjs (1)
9-9
: Version number updated to 1.0.1.This version bump is consistent with the other HubSpot modules. Please ensure that any related documentation or changelogs are updated accordingly.
components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs (1)
7-7
: Version number updated to 0.0.15.The update aligns with our coordinated versioning strategy across similar modules. No further action is needed.
components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs (1)
9-9
: Version number updated to 0.0.17.This update is in line with our overall versioning approach. Ensure that components depending on this module are updated as required.
components/hubspot/actions/update-company/update-company.mjs (1)
10-10
: Version number updated to 0.0.15.The version change is handled correctly and maintains consistency with similar modules in the project.
components/hubspot/actions/get-file-public-url/get-file-public-url.mjs (1)
7-7
: Version number updated to 0.0.15.The version update is consistent with the other actions. No issues here.
components/hubspot/actions/create-communication/create-communication.mjs (1)
11-11
: Version Update – Create Communication Action
The version property is updated from"0.0.7"
to"0.0.8"
. This bump appears to be a routine version update with no changes to the functionality or logic. Please ensure that the related documentation and any downstream consumers are aware of the version change.components/hubspot/actions/create-associations/create-associations.mjs (1)
8-8
: Version Update – Create Associations Action
The module’s version has been incremented to"1.0.1"
. Since this update does not alter any operational logic and follows the common versioning pattern, it is approved as is.components/hubspot/actions/search-crm/search-crm.mjs (1)
19-19
: Version Update – Search CRM Action
The version update to"1.0.1"
is straightforward and in line with similar changes across the codebase. There are no code logic modifications; the update strictly serves version management.components/hubspot/actions/update-custom-object/update-custom-object.mjs (1)
9-9
: Version Update – Update Custom Object Action
The version has been bumped to"1.0.1"
. As the change is isolated to versioning without affecting the custom object update logic, it is consistent with the project’s versioning strategy. Please verify that any external documentation referencing this action reflects the new version if applicable.components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs (1)
10-10
: Version Update – New Ticket Property Change Source
The version is updated from"0.0.13"
to"0.0.14"
. This update does not impact the event generation or processing logic. It is advisable to ensure that any integrations or consumers that depend on event metadata are informed of this upgrade.components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs (1)
7-7
: Version increment looks good.The version has been bumped from "0.0.11" to "0.0.12" which follows semantic versioning for minor changes.
components/hubspot/actions/create-engagement/create-engagement.mjs (1)
12-12
: Version increment looks good.The version has been bumped from "0.0.17" to "0.0.18" which follows semantic versioning for minor changes.
components/hubspot/hubspot.app.mjs (1)
715-723
: New method for retrieving form definitions looks good.The
getFormDefinition
method is properly implemented and follows the established patterns in the codebase. It makes a request to the HubSpot Marketing API to retrieve form definition details using the providedformId
. This method will enhance the form submission functionality by allowing access to detailed form metadata.components/hubspot/sources/new-form-submission/test-event.mjs (1)
10-11
: Form metadata enrichment looks good.The addition of the
form
property provides comprehensive metadata about forms, including field definitions, configuration settings, and display options. This enhancement will improve the developer experience by providing complete form context when working with form submissions.components/hubspot/sources/new-form-submission/new-form-submission.mjs (3)
9-9
: Version updated for new functionality.Version has been incremented from 0.0.24 to 0.0.25, which is appropriate when adding new functionality.
90-95
: Integration of the paginate method looks good.The updated
processResults
method properly integrates the new pagination functionality, mapping over each form and passing the correct parameters to the paginate method.
40-42
:✅ Verification successful
Fetching form definitions enriches event data.
The integration with
getFormDefinition
is a valuable enhancement that provides complete form metadata along with the submission data.
🏁 Script executed:
#!/bin/bash # Verify the implementation and availability of the getFormDefinition method rg -A 5 "getFormDefinition" components/hubspot/Length of output: 1042
Form definition fetching confirmed; no changes required.
The verification confirmed that:
- The method
getFormDefinition
is defined in components/hubspot/hubspot.app.mjs and correctly invoked in components/hubspot/sources/new-form-submission/new-form-submission.mjs.- Enriching event data with complete form metadata is implemented as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
WHY
Resolves #15961
Summary by CodeRabbit
New Features
Chores