Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 15, 2025

Resolves #17435

Summary by CodeRabbit

  • New Features

    • Added actions to create return orders, list return orders, list sales orders, and update return order status for Returnless integration.
    • Introduced event sources for new return creation, return notes added, product marked as received, and return status changed, enabling real-time event handling.
    • Implemented comprehensive Returnless app integration with dynamic property loading and API interaction.
    • Added utility for parsing objects and improved package configuration.
  • Chores

    • Updated package version and dependencies.

@vercel
Copy link

vercel bot commented Jul 15, 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 16, 2025 6:26pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 16, 2025 6:26pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 16, 2025 6:26pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 15, 2025

Walkthrough

The changes introduce a comprehensive Returnless app integration, including API methods, dynamic property definitions, utility functions, and several new action and source components. These cover creating and updating return orders, listing sales and return orders, and emitting events for return-related webhook triggers, with robust support for pagination and dynamic options.

Changes

File(s) Change Summary
components/returnless/returnless.app.mjs Expanded from stub to full app: added API methods, propDefinitions, pagination, and CRUD support.
components/returnless/actions/create-return-order/create-return-order.mjs New action: create return order with dynamic item properties and API calls.
components/returnless/actions/list-return-orders/list-return-orders.mjs New action: list return orders with filtering and pagination.
components/returnless/actions/list-sales-orders/list-sales-orders.mjs New action: list sales orders with pagination.
components/returnless/actions/update-return-order-status/update-return-order-status.mjs New action: update return order status.
components/returnless/common/utils.mjs New utility: recursive object parsing function.
components/returnless/sources/common/base.mjs New base source: webhook lifecycle management and event emission logic.
components/returnless/sources/new-return-created/new-return-created.mjs New source: emits event on new return creation.
components/returnless/sources/return-notes-added/return-notes-added.mjs New source: emits event on return note addition.
components/returnless/sources/return-product-marked-received/return-product-marked-received.mjs New source: emits event when a return product is marked as received.
components/returnless/sources/return-status-changed/return-status-changed.mjs New source: emits event on return status change.
components/returnless/package.json Version bump, added @pipedream/platform dependency, fixed JSON structure.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant ReturnlessApp
    participant ReturnlessAPI

    User->>Action: Trigger Create Return Order
    Action->>ReturnlessApp: getOrder(orderId)
    ReturnlessApp->>ReturnlessAPI: GET /orders/{orderId}
    ReturnlessAPI-->>ReturnlessApp: Order details
    ReturnlessApp-->>Action: Order details

    Action->>ReturnlessApp: createReturnOrderIntent(formId, locale, input, orderNumber)
    ReturnlessApp->>ReturnlessAPI: POST /return_order_intents
    ReturnlessAPI-->>ReturnlessApp: Intent ID

    Action->>ReturnlessApp: createReturnOrder(intentId, customer, items, metadata)
    ReturnlessApp->>ReturnlessAPI: POST /return_orders
    ReturnlessAPI-->>ReturnlessApp: Return order data
    ReturnlessApp-->>Action: Return order data
    Action-->>User: Return order summary
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement Returnless app integration with API methods for orders, returns, webhooks, etc. (#17435)
Add sources for: return created/updated, return status changed, return rule triggered, shipping label created (#17435) "Return rule triggered" and "shipping label created" sources are not present.
Add actions for: create/fetch/update/delete returns, manage return rules, generate shipping label, manage webhooks (#17435) No actions for return rules, shipping labels, or webhook management implemented.
Actions for listing/fetching orders and customer integrations (#17435)
Manage return portal settings (#17435) No code for portal settings management found.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of parseObject utility (components/returnless/common/utils.mjs) This utility is not explicitly required by any objective in the linked issue.
Dynamic item-level properties in create-return-order action (components/returnless/actions/create-return-order/create-return-order.mjs) Not specifically mentioned in the objectives, though may be implied for flexibility.

Suggested labels

ai-assisted

Poem

Oh, what a hop through the Returnless land,
With webhooks and actions now close at hand!
Orders and returns, all neat and precise,
Rabbits code fast, no need to think twice.
From status to notes, events leap and bound—
In this patch, new features abound!
🐇✨

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/returnless/actions/create-return-order/create-return-order.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/returnless/returnless.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)


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 662e775 and 89bf4ba.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/returnless/actions/create-return-order/create-return-order.mjs (1 hunks)
  • components/returnless/returnless.app.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/returnless/actions/create-return-order/create-return-order.mjs
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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.
components/returnless/returnless.app.mjs (4)
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.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (8)
components/returnless/returnless.app.mjs (8)

1-5: LGTM! Standard app structure and imports.

The axios import and app structure follow Pipedream conventions correctly.


6-162: Well-structured propDefinitions with consistent pagination pattern.

The propDefinitions implement a consistent pattern for async options with cursor-based pagination. The response structure assumptions (expecting data and meta properties) appear correct for the Returnless API.

A few observations:

  • The fallback || [] ensures graceful handling of undefined responses
  • Non-paginated options (countryId, locale) correctly omit prevContext
  • The cursor handling pattern is consistent across all paginated properties

163-178: Solid API client foundation with proper authentication.

The _baseUrl and _makeRequest methods are well-implemented:

  • API versioning in the base URL (2025-01) is good practice
  • Bearer token authentication is properly configured
  • JSON content type is appropriate for REST APIs
  • Flexible options passing allows for method customization

179-194: Webhook management methods follow REST conventions.

The webhook creation and deletion methods use proper HTTP methods and path patterns. The parameter destructuring for hookId in deleteWebhook is clean and follows good practices.


195-254: Resource retrieval methods are well-structured and consistent.

The methods follow consistent patterns:

  • Single resource getters (getOrder, getForm) use proper path construction
  • List methods follow naming conventions
  • The nested resource pattern in listSalesOrderItems is handled correctly
  • All methods support flexible options passing

255-277: CRUD operations implemented with proper HTTP methods.

The create and update methods correctly use:

  • POST for creation operations (createReturnOrderIntent, createReturnOrder)
  • PATCH for partial updates (updateReturnOrderStatus)
  • Proper path construction with resource IDs

278-305: Efficient pagination implementation with async generator.

The paginate method is well-implemented:

  • Uses async generator for memory-efficient iteration
  • Proper cursor-based pagination handling
  • Max count limit prevents runaway requests
  • Early termination when no data is returned
  • Reasonable per_page size (100)

The response structure assumption (data array, meta.next_cursor) aligns with the API patterns used throughout the file.


306-312: Clean helper method for collecting paginated resources.

The getPaginatedResources method provides a convenient abstraction over the paginate generator, collecting all items into an array. The implementation is clean and follows async iteration patterns correctly.

✨ 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.

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

🧹 Nitpick comments (5)
components/returnless/package.json (1)

14-17: Minor metadata gaps and dependency-range consideration

  1. A license field is customary for all published packages.
  2. Consider pinning to the latest exact @pipedream/platform minor ("3.1.x") or adding an upper bound (<4) to avoid an unexpected v4 breaking change.
  3. Ensure the lockfile (package-lock.json / pnpm-lock.yaml) is committed after npm install, so CI reproducibility isn’t affected.

Optional diff to add license:

@@
   "keywords": [
     "pipedream",
     "returnless"
   ],
+  "license": "MIT",
components/returnless/common/utils.mjs (1)

1-27: Consider adding circular reference protection.

The recursive nature of this function could cause infinite loops or stack overflow with circular references. Consider adding a WeakSet to track visited objects.

Here's a safer implementation:

-export const parseObject = (obj) => {
+export const parseObject = (obj, visited = new WeakSet()) => {
   if (!obj) {
     return undefined;
   }
   if (typeof obj === "string") {
     try {
       return JSON.parse(obj);
     } catch (e) {
       return obj;
     }
   }
   if (Array.isArray(obj)) {
-    return obj.map(parseObject);
+    return obj.map(item => parseObject(item, visited));
   }
   if (typeof obj === "object") {
+    if (visited.has(obj)) {
+      return obj; // Return the object as-is to avoid infinite recursion
+    }
+    visited.add(obj);
     return Object.fromEntries(
       Object.entries(obj).map(([
         key,
         value,
       ]) => [
         key,
-        parseObject(value),
+        parseObject(value, visited),
       ]),
     );
   }
   return obj;
 };
components/returnless/actions/create-return-order/create-return-order.mjs (1)

108-146: Consider adding error handling for sequential API calls.

The run() method makes multiple sequential API calls without explicit error handling. While Pipedream will catch errors, adding specific error handling could provide better user feedback.

Consider adding specific error handling for better user experience:

  async run({ $ }) {
+   try {
      const { data: order } = await this.returnless.getOrder({
        $,
        orderId: this.orderId,
      });
      
      const { data: intent } = await this.returnless.createReturnOrderIntent({
        $,
        data: {
          form_id: this.formId,
          locale: this.locale,
          input: this.input,
          order_number: order.order_number,
        },
      });
      
      const { data: returnOrder } = await this.returnless.createReturnOrder({
        $,
        data: {
          return_order_intent_id: intent.id,
          // ... rest of the data
        },
      });
      
      $.export("$summary", `Return order created: ${returnOrder.id}`);
      return returnOrder;
+   } catch (error) {
+     throw new Error(`Failed to create return order: ${error.message}`);
+   }
  }
components/returnless/returnless.app.mjs (2)

20-25: Remove redundant || [] after map operations.

The || [] fallback is unnecessary since .map() always returns an array, even when called on an empty array.

-          })) || [],
+          })),

Also applies to: 44-50, 69-75, 95-100, 123-123, 143-148


107-128: Consider adding labels to item options for better UX.

Currently, the item IDs are displayed without any descriptive labels, which makes it difficult for users to identify which items they're selecting. Consider including item names or SKUs in the options.

-        options: data.map(({ id }) => id) || [],
+        options: data.map(({ 
+          id: value, 
+          name, 
+          sku 
+        }) => ({
+          value,
+          label: name || sku || value,
+        })) || [],
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between af19436 and 662e775.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • components/returnless/actions/create-return-order/create-return-order.mjs (1 hunks)
  • components/returnless/actions/list-return-orders/list-return-orders.mjs (1 hunks)
  • components/returnless/actions/list-sales-orders/list-sales-orders.mjs (1 hunks)
  • components/returnless/actions/update-return-order-status/update-return-order-status.mjs (1 hunks)
  • components/returnless/common/utils.mjs (1 hunks)
  • components/returnless/package.json (2 hunks)
  • components/returnless/returnless.app.mjs (1 hunks)
  • components/returnless/sources/common/base.mjs (1 hunks)
  • components/returnless/sources/new-return-created/new-return-created.mjs (1 hunks)
  • components/returnless/sources/return-notes-added/return-notes-added.mjs (1 hunks)
  • components/returnless/sources/return-product-marked-received/return-product-marked-received.mjs (1 hunks)
  • components/returnless/sources/return-status-changed/return-status-changed.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
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.
components/returnless/package.json (2)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: "dir" props in Pipedream components are hidden in the component form and not user-facing, so they don't require labels or descriptions for user clarity.
components/returnless/actions/update-return-order-status/update-return-order-status.mjs (2)
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#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`.
components/returnless/actions/list-return-orders/list-return-orders.mjs (2)
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#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`.
components/returnless/sources/return-notes-added/return-notes-added.mjs (4)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
components/returnless/sources/return-product-marked-received/return-product-marked-received.mjs (5)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The `processTimerEvent` method in the `components/salesforce_rest_api/sources/common.mjs` file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.
components/returnless/actions/list-sales-orders/list-sales-orders.mjs (4)
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: 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#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.
components/returnless/actions/create-return-order/create-return-order.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-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#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`.
components/returnless/sources/common/base.mjs (4)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The `processTimerEvent` method in the `components/salesforce_rest_api/sources/common.mjs` file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.
components/returnless/sources/return-status-changed/return-status-changed.mjs (5)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The `processTimerEvent` method in the `components/salesforce_rest_api/sources/common.mjs` file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.
components/returnless/returnless.app.mjs (4)
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.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
components/returnless/sources/new-return-created/new-return-created.mjs (4)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (14)
components/returnless/package.json (1)

3-3: Semantic-version bump looks correct

Moving from 0.0.10.1.0 matches SemVer semantics for the introduction of new functionality without breaking changes. No concerns here.

components/returnless/actions/update-return-order-status/update-return-order-status.mjs (1)

1-36: LGTM! Clean action implementation.

The action follows standard Pipedream patterns with proper use of propDefinitions and error handling. The implementation correctly calls the app's API method and returns the expected data structure.

components/returnless/actions/list-return-orders/list-return-orders.mjs (1)

1-63: LGTM! Well-implemented list action with proper filtering.

The action follows excellent practices with comprehensive filtering options, proper pagination handling, and correctly formatted summary messages with pluralization logic. The date filtering structure using gt and lt parameters is appropriate for the API.

components/returnless/sources/return-notes-added/return-notes-added.mjs (1)

1-22: LGTM! Proper webhook source implementation.

The source follows established patterns by extending the common base and implementing the required getEvents() and getSummary() methods. The event type and summary message are appropriate for return notes functionality.

components/returnless/sources/return-product-marked-received/return-product-marked-received.mjs (1)

1-22: LGTM! Consistent webhook source implementation.

The source maintains consistency with other webhook sources by extending the common base and implementing the required methods. The event type and summary message are appropriate for the return product marked received functionality.

components/returnless/sources/return-status-changed/return-status-changed.mjs (1)

1-22: LGTM! Clean webhook source implementation.

The implementation correctly extends the common base and properly implements the required abstract methods. The event name format and summary generation look appropriate.

components/returnless/sources/new-return-created/new-return-created.mjs (1)

1-22: LGTM! Consistent webhook source implementation.

The implementation follows the same clean pattern as other webhook sources, properly extends the base class, and correctly implements the abstract methods. The "New" prefix is appropriate for this event type.

components/returnless/actions/list-sales-orders/list-sales-orders.mjs (1)

18-31: LGTM! Well-implemented pagination and summary.

The action correctly uses the getPaginatedResources method and properly handles the summary export with pluralization. The implementation follows established patterns for list actions.

components/returnless/sources/common/base.mjs (3)

53-58: LGTM! Correct abstract method pattern.

The implementation correctly uses ConfigurationError for abstract methods that must be implemented by subclasses. This matches the established pattern for base classes in the codebase.


18-37: LGTM! Proper webhook lifecycle management.

The activation and deactivation hooks correctly handle webhook creation and deletion, with proper storage of the webhook ID in the database for cleanup.


60-71: LGTM! Appropriate event emission pattern.

The run method properly handles HTTP responses, validates the request body, and emits events with generated metadata. The early return for missing data is a good defensive programming practice.

components/returnless/returnless.app.mjs (3)

1-2: LGTM!

The axios import from Pipedream platform is correct and follows standard conventions.


163-269: Well-structured API methods implementation.

The API methods follow consistent patterns with proper parameter extraction, authentication headers, and appropriate HTTP methods for each operation.


270-297: Confirm Returnless API pagination response format

The paginate helper (and the options methods for listReturnOrders/listSalesOrders) assumes each response is an object with

{  
  data: Array,  
  meta: { next_cursor: string }  
}  

We couldn’t find tests, fixtures, or docs in the repo to verify this. Please ensure the Returnless API actually returns both a data array and a meta.next_cursor field—otherwise you’ll need to adjust paginate or unwrap the response differently.

• components/returnless/returnless.app.mjs
listReturnOrders(opts)
listSalesOrders(opts)
async *paginate({ fn, args, max })

lcaresia
lcaresia previously approved these changes Jul 15, 2025
@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 2edcb55 into master Jul 17, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-17435 branch July 17, 2025 20:19
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.

Returnless

3 participants