-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - rejoiner #15004
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
New Components - rejoiner #15004
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe pull request introduces comprehensive support for the Rejoiner platform by adding multiple components: a new source for tracking contacts in a list, and actions for adding customers to lists, starting customer journeys, and updating customer profiles. The changes include creating a robust application module with methods for API interactions, defining property definitions, and implementing pagination. The package version has been updated, and a dependency on the Pipedream platform has been added. Changes
Assessment against linked issues
Suggested Labels
Suggested Reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
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: 5
🧹 Nitpick comments (3)
components/rejoiner/sources/new-contact-in-list/new-contact-in-list.mjs (1)
36-48
: Add error handling in therun
methodCurrently, the
run
method does not handle potential errors from API calls. Consider adding try-catch blocks to handle exceptions and prevent the source from crashing in case of network or API errors.Apply this diff to enhance error handling:
async run() { + try { const results = this.rejoiner.paginate({ fn: this.rejoiner.listListContacts, args: { listId: this.listId, }, }); for await (const item of results) { const contact = item.customer; const meta = this.generateMeta(contact); this.$emit(item, meta); } + } catch (error) { + this.$emit( + { + error: error.message, + }, + { + id: Date.now(), + summary: "Error fetching contacts", + ts: Date.now(), + } + ); + } }components/rejoiner/actions/update-customer-profile/update-customer-profile.mjs (1)
3-8
: Consider adding input examples to the component metadataThe component would benefit from having example inputs in its metadata to help users understand the expected format.
Add examples to the component definition:
export default { key: "rejoiner-update-customer-profile", name: "Update Customer Profile", - description: "Updates a customer's profile information. [See the documentation](https://docs.rejoiner.com/reference/update-customer-profile)", + description: "Updates a customer's profile information. [See the documentation](https://docs.rejoiner.com/reference/update-customer-profile)", + examples: [ + { + summary: "Update a customer's name and address", + input: { + email: "[email protected]", + firstName: "John", + lastName: "Doe", + address1: "123 Main St", + city: "Boston", + state: "MA", + postalCode: "02108", + country: "US" + } + } + ], version: "0.0.1", type: "action",components/rejoiner/actions/add-customer-to-list/add-customer-to-list.mjs (1)
3-9
: Add rate limiting information to component metadataSince this component makes API calls that might be subject to rate limits, it would be helpful to document this in the component metadata.
export default { key: "rejoiner-add-customer-to-list", name: "Add Customer to List", description: "Adds a customer to a specific list, or if the customer already exists, will update the record of that customer with the supplied data. [See the documentation](https://docs.rejoiner.com/reference/add-customer-to-list)", + rate_limit: { + timeWindow: 60, + maxRequests: 100 + }, version: "0.0.1", type: "action",
📜 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 (6)
components/rejoiner/actions/add-customer-to-list/add-customer-to-list.mjs
(1 hunks)components/rejoiner/actions/start-journey/start-journey.mjs
(1 hunks)components/rejoiner/actions/update-customer-profile/update-customer-profile.mjs
(1 hunks)components/rejoiner/package.json
(2 hunks)components/rejoiner/rejoiner.app.mjs
(1 hunks)components/rejoiner/sources/new-contact-in-list/new-contact-in-list.mjs
(1 hunks)
🔇 Additional comments (5)
components/rejoiner/rejoiner.app.mjs (3)
6-91
: Property definitions are well-structured and comprehensive
The propDefinitions
include all necessary customer properties with appropriate types, labels, and descriptions.
94-111
: Base URL and request methods are correctly implemented
The _baseUrl
and _makeRequest
methods are properly set up to handle API requests with the correct base URL and headers.
106-106
: Verify the Authorization header format
Ensure that the Authorization
header uses the correct format as specified by the Rejoiner API. Typically, APIs use headers like Authorization: Bearer {token}
. Please confirm that Rejoiner {api_key}
is the expected format.
components/rejoiner/package.json (1)
Line range hint 3-17
: Version update and dependencies are appropriate
The package version has been updated to "0.1.0"
, and the dependencies now include @pipedream/platform
, which is necessary for the components.
components/rejoiner/actions/add-customer-to-list/add-customer-to-list.mjs (1)
1-2
: Verify the rejoiner app implementation
Both components heavily rely on the rejoiner app module. Let's verify its implementation.
✅ Verification successful
The rejoiner app implementation is properly defined and functional
The verification shows that:
- The
addCustomerToList
andupdateCustomerProfile
methods are correctly implemented with proper HTTP methods and endpoints - The app has well-defined prop definitions including:
listId
with async options for list selectionemail
for customer identificationfirstName
for customer details
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check the rejoiner app implementation for required methods and prop definitions
# Check for the required methods
echo "Checking for required methods in rejoiner.app.mjs..."
rg -A 5 "updateCustomerProfile|addCustomerToList" "components/rejoiner/rejoiner.app.mjs"
# Check for prop definitions
echo "Checking for prop definitions in rejoiner.app.mjs..."
rg "propDefinitions" -A 20 "components/rejoiner/rejoiner.app.mjs"
Length of output: 1191
Resolves #14899.
Summary by CodeRabbit
Release Notes
New Features
Updates
Enhancements