Skip to content

Conversation

@lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Jun 30, 2025

WHY

Summary by CodeRabbit

  • New Features

    • Added a new integration for Plecto, enabling users to create new registration records directly from the platform.
    • Users can now select data sources and members dynamically when creating registrations, with options fetched from Plecto.
    • Additional optional fields (external ID, date, custom fields) are available when creating a registration.
  • Chores

    • Updated internal configuration by removing obsolete files and adjusting version control settings for the Plecto integration.
    • Updated package version and entry point for the Plecto integration.

@lcaresia lcaresia self-assigned this Jun 30, 2025
@vercel
Copy link

vercel bot commented Jun 30, 2025

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jul 1, 2025 1:32pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 1, 2025 1:32pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 1, 2025 1:32pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 30, 2025

Walkthrough

A new Plecto integration is introduced, featuring an app definition with dynamic property fetching and API methods for managing registrations, data sources, and members. An action for creating a registration is added. The legacy TypeScript app file and a directory-specific .gitignore are removed, consolidating the integration under a new module structure.

Changes

File(s) Change Summary
components/plecto/.gitignore Removed .gitignore, so .js, .mjs, and dist files are no longer ignored in this directory.
components/plecto/app/plecto.app.ts Deleted legacy TypeScript Plecto app definition.
components/plecto/plecto.app.mjs Added new Plecto app module with dynamic prop definitions and API interaction methods for registrations, etc.
components/plecto/actions/create-registration/create-registration.mjs Added new action module to create a registration in Plecto using the new app module and dynamic props.
components/plecto/package.json Updated package version to 0.1.0, changed main entry point, and removed "files" field specifying "dist" directory.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CreateRegistrationAction
    participant PlectoApp
    participant PlectoAPI

    User->>CreateRegistrationAction: Provide registration details
    CreateRegistrationAction->>PlectoApp: Call createRegistration with details
    PlectoApp->>PlectoAPI: POST /registrations with data
    PlectoAPI-->>PlectoApp: Respond with registration ID
    PlectoApp-->>CreateRegistrationAction: Return registration ID
    CreateRegistrationAction-->>User: Show summary with registration ID
Loading

Poem

In the garden of code, new seeds are sown,
Plecto’s roots deepen, its features have grown.
Old leaves swept away, new branches appear,
Registrations blossom—success draws near!
With every fresh hop, integrations delight,
The rabbit codes onward, through day and through night.
🥕✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/plecto/actions/create-registration/create-registration.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/plecto/plecto.app.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lcaresia lcaresia linked an issue Jun 30, 2025 that may be closed by this pull request
GTFalcao
GTFalcao previously approved these changes Jun 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df8a3b7 and c1541a4.

📒 Files selected for processing (4)
  • components/plecto/.gitignore (0 hunks)
  • components/plecto/actions/create-registration/create-registration.mjs (1 hunks)
  • components/plecto/app/plecto.app.ts (0 hunks)
  • components/plecto/plecto.app.mjs (1 hunks)
💤 Files with no reviewable changes (2)
  • components/plecto/.gitignore
  • components/plecto/app/plecto.app.ts
🧰 Additional context used
🧠 Learnings (2)
components/plecto/plecto.app.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: The Salesloft API list endpoints (listPeople, listCadences, listUsers, listAccounts) return arrays directly in the response body, not wrapped in a metadata object with a nested data property. The _makeRequest method correctly returns response.data which contains the arrays that can be mapped over directly in propDefinitions.
components/plecto/actions/create-registration/create-registration.mjs (3)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (7)
components/plecto/plecto.app.mjs (4)

61-63: LGTM!

The base URL method is correctly implemented.


64-80: LGTM!

The generic request method is well-structured with proper authentication setup using basic auth.


82-100: LGTM!

The API methods are correctly implemented with appropriate HTTP methods and endpoints.


11-19: Verify Plecto API response structure

We need to confirm that getDataSources() and getMembers() indeed return a top-level array of objects, not a wrapped object (e.g. { data: […] }). The unauthenticated curl tests returned non-JSON HTML/error, so please:

• Authenticate and fetch a sample JSON response for both endpoints.
• If the response is an array, no code change is needed.
• If the response is wrapped in a data property, update each options() to:

- const response = await this.getDataSources();
- return response.map(({ uuid, title }) => ({ value: uuid, label: title }));
+ const { data } = await this.getDataSources();
+ return data.map(({ uuid, title }) => ({ value: uuid, label: title }));

Repeat for getMembers() (lines 25–33).

components/plecto/actions/create-registration/create-registration.mjs (3)

3-8: LGTM!

The action metadata is properly structured with appropriate key, name, description, version, and type.


9-47: LGTM!

The prop definitions correctly reference the app's propDefinitions, ensuring consistency and reusability.


60-60: LGTM!

The summary message format is correct and follows the established pattern from the learnings.

Comment on lines +25 to +33
async options() {
const response = await this.getMembers();
return response.map(({
uuid, name,
}) => ({
value: uuid,
label: name,
}));
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling to the options() function.

Similar to the dataSource prop, this async options function needs error handling.

 async options() {
-  const response = await this.getMembers();
-  return response.map(({
-    uuid, name,
-  }) => ({
-    value: uuid,
-    label: name,
-  }));
+  try {
+    const response = await this.getMembers();
+    return response.map(({
+      uuid, name,
+    }) => ({
+      value: uuid,
+      label: name,
+    }));
+  } catch (error) {
+    console.error("Failed to fetch members:", error);
+    return [];
+  }
 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async options() {
const response = await this.getMembers();
return response.map(({
uuid, name,
}) => ({
value: uuid,
label: name,
}));
},
async options() {
try {
const response = await this.getMembers();
return response.map(({
uuid, name,
}) => ({
value: uuid,
label: name,
}));
} catch (error) {
console.error("Failed to fetch members:", error);
return [];
}
},
🤖 Prompt for AI Agents
In components/plecto/plecto.app.mjs around lines 25 to 33, the async options()
function lacks error handling which can cause unhandled promise rejections. Wrap
the await call to this.getMembers() in a try-catch block, and in the catch block
handle or log the error appropriately. Ensure the function returns a sensible
default or empty array if an error occurs to maintain stability.

Comment on lines +11 to +19
async options() {
const response = await this.getDataSources();
return response.map(({
uuid, title,
}) => ({
value: uuid,
label: title,
}));
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling to the options() function.

The async options function lacks error handling, which could cause the UI to break if the API request fails.

 async options() {
-  const response = await this.getDataSources();
-  return response.map(({
-    uuid, title,
-  }) => ({
-    value: uuid,
-    label: title,
-  }));
+  try {
+    const response = await this.getDataSources();
+    return response.map(({
+      uuid, title,
+    }) => ({
+      value: uuid,
+      label: title,
+    }));
+  } catch (error) {
+    console.error("Failed to fetch data sources:", error);
+    return [];
+  }
 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async options() {
const response = await this.getDataSources();
return response.map(({
uuid, title,
}) => ({
value: uuid,
label: title,
}));
},
async options() {
try {
const response = await this.getDataSources();
return response.map(({
uuid, title,
}) => ({
value: uuid,
label: title,
}));
} catch (error) {
console.error("Failed to fetch data sources:", error);
return [];
}
},
🤖 Prompt for AI Agents
In components/plecto/plecto.app.mjs around lines 11 to 19, the async options()
function does not handle errors from the getDataSources() call, risking UI
breakage on failure. Add a try-catch block around the await
this.getDataSources() call to catch any errors, and handle them gracefully by
returning an empty array or a fallback value. This will prevent unhandled
promise rejections and keep the UI stable if the API request fails.

Comment on lines 51 to 58
data: {
"data_source": this.dataSource,
"member": this.member,
"external_id": this.externalId,
"date": this.date,
"Product Name": this.productName,
"Units Sold": this.unitsSold,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent field naming in the data object.

The data object uses inconsistent naming conventions - some fields use snake_case while others use title case. This could cause API errors if the Plecto API expects consistent formatting.

Please verify the expected field format from the Plecto API documentation and apply consistent naming:

 data: {
   "data_source": this.dataSource,
   "member": this.member,
   "external_id": this.externalId,
   "date": this.date,
-  "Product Name": this.productName,
-  "Units Sold": this.unitsSold,
+  "product_name": this.productName,
+  "units_sold": this.unitsSold,
 },

OR if the API expects title case for custom fields:

 data: {
-  "data_source": this.dataSource,
-  "member": this.member,
-  "external_id": this.externalId,
-  "date": this.date,
+  "Data Source": this.dataSource,
+  "Member": this.member,
+  "External ID": this.externalId,
+  "Date": this.date,
   "Product Name": this.productName,
   "Units Sold": this.unitsSold,
 },

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In components/plecto/actions/create-registration/create-registration.mjs around
lines 51 to 58, the data object has inconsistent field naming with a mix of
snake_case and title case. Check the Plecto API documentation to confirm the
expected naming convention for these fields. Then, update all keys in the data
object to use a consistent format, either all snake_case or all title case,
matching the API requirements to prevent errors.

💡 Verification agent

🧩 Analysis chain

Verify the Plecto API registration endpoint data format.

Please confirm the expected field names and structure for the registration creation endpoint to ensure the data mapping is correct.


🌐 Web query:

What are the required and optional fields for creating a registration in the Plecto API? What is the expected field naming convention (snake_case vs title case)?

💡 Result:

To create a registration in the Plecto API, certain fields are required while others are optional. The expected naming convention for fields is snake_case (all lowercase with underscores between words).

Required Fields in Plecto Registration

The following fields are required for creating a registration through the Plecto API:

  • data_source: The UUID of the Plecto data source to which you are adding the registration. This is mandatory for identifying where the registration will be stored[1][2].
  • Value: If your data source includes a custom field named "Value," this key must be present in the POST request. This is commonly the main metric or data point you are recording, but could vary if your data source uses a different custom field name[1].
  • external_id: A unique ID for the registration. This is used to identify and, if needed, update or deduplicate registrations in Plecto[2][5].
  • member_api_provider and member_api_id: These fields identify the employee related to the registration. They are required to link the data to a specific member in Plecto[2].
    • member_name: Often included for human-readable identification of the member, but the documentation implies it's not strictly mandatory if you have the provider and ID[2].

Optional Fields

  • date: The primary date of the registration in ISO 8601 format (e.g., "2022-12-31T10:22:55"). If not specified, Plecto will automatically use the current date and time at registration creation[1][2].
  • Custom fields: Any additional fields you have defined in your Plecto data source can be added. These fields must match the names and types as configured in your Plecto dashboard[2][5].

Field Naming Convention

Plecto uses snake_case for all field names in its API. This means all letters are lowercase and words are separated by underscores (e.g., "data_source", "external_id")[2][3]. This convention matches standard API practices for clarity and consistency, and no field names should be in Title Case or CamelCase.

"Here's a list of field names, types and descriptions that make up Plecto's API data model:"
| data_source | string (UUID) |
| date | ISO 8601 with timestamp |
| member_api_provider | string |
| member_api_id | string |
| member_name | string |
| external_id | string |
| | |[2]

Example Registration Payload

{
  "data_source": "your-data-source-uuid",
  "external_id": "unique-registration-id",
  "member_api_provider": "your-system-name",
  "member_api_id": "employee-id-in-your-system",
  "member_name": "Employee Name",
  "date": "2025-06-30T18:00:00",
  "Value": 100,
  "custom_field_1": "custom_value"
}

Summary:

  • Always use snake_case for field names.
  • Required: data_source, external_id, member_api_provider, member_api_id, and typically a metric field (e.g., Value).
  • Optional: date, member_name, and any custom fields defined in your data source[1][2].

Citations:


Ensure Plecto API registration payload uses correct snake_case fields

Please update the payload to match Plecto’s snake_case naming convention and include the required member identifiers:

• Replace the single "member" key with the two required fields:
member_api_provider (e.g. your system name)
member_api_id (the user’s ID in your system)
• Convert custom field names from Title Case/with spaces to snake_case, matching your data‐source definitions (e.g. "product_name", "units_sold").
• Confirm you still include the required metric field (often "Value" or your custom equivalent) if that isn’t one of these custom fields.

Proposed snippet:

   data: {
-    "data_source": this.dataSource,
-    "member": this.member,
-    "external_id": this.externalId,
-    "date": this.date,
-    "Product Name": this.productName,
-    "Units Sold": this.unitsSold,
+    data_source:          this.dataSource,
+    external_id:          this.externalId,
+    member_api_provider:  this.memberApiProvider,
+    member_api_id:        this.memberApiId,
+    date:                 this.date,
+    product_name:         this.productName,
+    units_sold:           this.unitsSold,
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
data: {
"data_source": this.dataSource,
"member": this.member,
"external_id": this.externalId,
"date": this.date,
"Product Name": this.productName,
"Units Sold": this.unitsSold,
},
data: {
data_source: this.dataSource,
external_id: this.externalId,
member_api_provider: this.memberApiProvider,
member_api_id: this.memberApiId,
date: this.date,
product_name: this.productName,
units_sold: this.unitsSold,
},
🤖 Prompt for AI Agents
In components/plecto/actions/create-registration/create-registration.mjs around
lines 51 to 58, the payload uses incorrect field names and structure for the
Plecto API. Replace the single "member" key with "member_api_provider" and
"member_api_id" to include required member identifiers. Change custom field
names from Title Case with spaces to snake_case, such as "product_name" and
"units_sold". Also, verify that the payload includes the required metric field
like "value" if it is not already present among these fields.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (3)
components/plecto/actions/create-registration/create-registration.mjs (1)

49-56: Fix API payload structure based on Plecto documentation.

Based on previous verification of the Plecto API documentation, the payload structure needs corrections:

  1. The member field should be split into member_api_provider and member_api_id as required by the API
  2. All fields should use consistent snake_case naming
  3. Custom fields from customFields could introduce inconsistent naming

The current implementation will likely fail with the Plecto API. Update the payload structure:

 data: {
-  "data_source": this.dataSource,
-  "member": this.member,
-  "external_id": this.externalId,
-  "date": this.date,
+  data_source: this.dataSource,
+  member_api_provider: this.memberApiProvider,
+  member_api_id: this.memberApiId,
+  external_id: this.externalId,
+  date: this.date,
   ...customFields,
 },

You'll also need to update the prop definitions in the app file to support memberApiProvider and memberApiId instead of the single member prop.

components/plecto/plecto.app.mjs (2)

11-19: Add error handling to prevent UI breakage.

The async options function lacks error handling, which could cause the UI to break if the API request fails.

 async options() {
+  try {
     const response = await this.getDataSources();
     return response.map(({
       uuid, title,
     }) => ({
       value: uuid,
       label: title,
     }));
+  } catch (error) {
+    console.error("Failed to fetch data sources:", error);
+    return [];
+  }
 },

25-33: Add error handling to prevent UI breakage.

Similar to the dataSource prop, this async options function needs error handling.

 async options() {
+  try {
     const response = await this.getMembers();
     return response.map(({
       uuid, name,
     }) => ({
       value: uuid,
       label: name,
     }));
+  } catch (error) {
+    console.error("Failed to fetch members:", error);
+    return [];
+  }
 },
🧹 Nitpick comments (2)
components/plecto/plecto.app.mjs (2)

58-74: Add response data extraction to _makeRequest method.

The method should extract the response data to match typical Pipedream patterns and handle different response structures:

 async _makeRequest(opts = {}) {
   const {
     $ = this,
     path,
     auth,
     ...otherOpts
   } = opts;
-  return axios($, {
+  const response = await axios($, {
     ...otherOpts,
     url: this._baseUrl() + path,
     auth: {
       username: `${this.$auth.username}`,
       password: `${this.$auth.password}`,
       ...auth,
     },
   });
+  return response.data || response;
 },

83-94: Consider adding pagination support for list methods.

The Plecto API likely supports pagination for list endpoints. Consider adding pagination parameters:

 async getDataSources(args = {}) {
   return this._makeRequest({
     path: "/datasources/",
+    params: {
+      limit: args.limit || 100,
+      offset: args.offset || 0,
+      ...args.params,
+    },
     ...args,
   });
 },
 async getMembers(args = {}) {
   return this._makeRequest({
     path: "/members/",
+    params: {
+      limit: args.limit || 100, 
+      offset: args.offset || 0,
+      ...args.params,
+    },
     ...args,
   });
 },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1541a4 and 9058588.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/plecto/actions/create-registration/create-registration.mjs (1 hunks)
  • components/plecto/package.json (1 hunks)
  • components/plecto/plecto.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/plecto/package.json
🧰 Additional context used
🧠 Learnings (2)
components/plecto/plecto.app.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: The Salesloft API list endpoints (listPeople, listCadences, listUsers, listAccounts) return arrays directly in the response body, not wrapped in a metadata object with a nested data property. The _makeRequest method correctly returns response.data which contains the arrays that can be mapped over directly in propDefinitions.
components/plecto/actions/create-registration/create-registration.mjs (4)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/plecto/actions/create-registration/create-registration.mjs (3)

1-41: Action structure and props look well-defined.

The action follows standard Pipedream patterns with proper prop definitions and version management.


43-45: JSON parsing logic is correct.

Good defensive programming to handle both string and object inputs for customFields.


57-58: Summary message format follows best practices.

The success message format is consistent with Pipedream conventions and includes relevant identifying information.

Comment on lines +21 to +34
member: {
type: "string",
label: "Member",
description: "ID of the member associated with this registration",
async options() {
const response = await this.getMembers();
return response.map(({
uuid, name,
}) => ({
value: uuid,
label: name,
}));
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update member prop to support Plecto API requirements.

Based on the Plecto API documentation, member identification requires separate member_api_provider and member_api_id fields rather than a single member field.

Consider splitting this into two separate props:

-    member: {
-      type: "string",
-      label: "Member",
-      description: "ID of the member associated with this registration",
-      async options() {
-        const response = await this.getMembers();
-        return response.map(({
-          uuid, name,
-        }) => ({
-          value: uuid,
-          label: name,
-        }));
-      },
-    },
+    memberApiProvider: {
+      type: "string",
+      label: "Member API Provider",
+      description: "The system name that provides the member ID",
+    },
+    memberApiId: {
+      type: "string",
+      label: "Member API ID", 
+      description: "The member's ID in your system",
+    },

Or keep the existing structure but update the action to map the selected member UUID to the required API format.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
member: {
type: "string",
label: "Member",
description: "ID of the member associated with this registration",
async options() {
const response = await this.getMembers();
return response.map(({
uuid, name,
}) => ({
value: uuid,
label: name,
}));
},
},
memberApiProvider: {
type: "string",
label: "Member API Provider",
description: "The system name that provides the member ID",
},
memberApiId: {
type: "string",
label: "Member API ID",
description: "The member's ID in your system",
},
🤖 Prompt for AI Agents
In components/plecto/plecto.app.mjs around lines 21 to 34, the member property
currently uses a single field for member identification, but the Plecto API
requires separate fields for member_api_provider and member_api_id. To fix this,
either split the member property into two separate properties named
member_api_provider and member_api_id with appropriate types and options, or
update the existing member property and the related action logic to map the
selected member UUID into the required API format that includes both provider
and ID fields.

Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @lcaresia, LGTM! Ready for QA!

@lcaresia lcaresia merged commit 2846097 into master Jul 2, 2025
11 checks passed
@lcaresia lcaresia deleted the issue-13237 branch July 2, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Components] plecto

5 participants