Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 9, 2025

Resolves #15955

Summary by CodeRabbit

  • New Features

    • Added actions to the Amazon Selling Partner integration for checking FBA inventory levels, fetching orders by date range, generating sales and inventory reports, retrieving order details, listing inbound shipments, optimizing product pricing, and retrieving sales performance reports.
    • Introduced event sources to emit events for new inbound FBA shipments and new order creation.
    • Enhanced the app with dynamic property selection, comprehensive API support, and robust pagination for large datasets.
  • Chores

    • Updated package dependencies and versioning for improved compatibility and stability.

@vercel
Copy link

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 9, 2025

Walkthrough

This update introduces a comprehensive Amazon Selling Partner integration, including a fully implemented app client, multiple actions for order, inventory, pricing, and report management, and two polling-based event sources for new orders and inbound shipments. Supporting modules and configuration updates enable robust API interaction and event-driven workflows.

Changes

File(s) Change Summary
components/amazon_selling_partner/amazon_selling_partner.app.mjs Implements full Amazon Selling Partner API client with prop definitions, endpoint methods, and pagination utilities.
components/amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.mjs Adds action to fetch FBA inventory summaries.
components/amazon_selling_partner/actions/fetch-orders-by-date-range/fetch-orders-by-date-range.mjs Adds action to fetch orders by date range and filters.
components/amazon_selling_partner/actions/generate-sales-inventory-reports/generate-sales-inventory-reports.mjs Adds action to generate sales and inventory reports.
components/amazon_selling_partner/actions/get-order-details/get-order-details.mjs Adds action to fetch detailed information for a specific order.
components/amazon_selling_partner/actions/list-inbound-shipments/list-inbound-shipments.mjs Adds action to list inbound shipments to FBA.
components/amazon_selling_partner/actions/optimize-product-pricing/optimize-product-pricing.mjs Adds action to retrieve competitive product pricing data.
components/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.mjs Adds action to fetch sales performance reports.
components/amazon_selling_partner/sources/common/base.mjs Introduces a reusable polling base for Amazon sources with timestamp persistence.
components/amazon_selling_partner/sources/new-inbound-shipment-to-fba-created/new-inbound-shipment-to-fba-created.mjs Adds source to emit events for new inbound FBA shipments.
components/amazon_selling_partner/sources/new-order-created/new-order-created.mjs Adds source to emit events for newly created orders.
components/amazon_selling_partner/package.json Bumps version to 0.1.0 and adds @pipedream/platform dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AmazonSellingPartnerApp
    participant AmazonAPI

    User->>AmazonSellingPartnerApp: Trigger action (e.g., Fetch Orders)
    AmazonSellingPartnerApp->>AmazonAPI: Make authenticated API request
    AmazonAPI-->>AmazonSellingPartnerApp: Return data (orders, inventory, etc.)
    AmazonSellingPartnerApp-->>User: Return processed results

    Note over AmazonSellingPartnerApp,AmazonAPI: For sources, polling is performed periodically, and new events are emitted when new data is detected.
Loading

Assessment against linked issues

Objective Addressed Explanation
When Amazon order is placed, make a contact and invoice (don't send) in Moneybird with correct VAT code. (#15955) No Moneybird integration or logic for creating contacts/invoices is present in these changes.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Implementation of Amazon Selling Partner app, actions, and sources (multiple files) These changes provide Amazon integration but do not address Moneybird integration or the described workflow.
Addition of polling sources for Amazon events (sources/new-order-created.mjs, sources/new-inbound-shipment-to-fba-created.mjs) No logic connects Amazon events to Moneybird actions as required by the issue.

Poem

A rabbit hopped through Seller land,
Fetching orders, stocks on hand.
Reports and prices, all in tow,
With every hop, new data flows!
But Moneybird, alas, not here—
Perhaps next time, it will appear!
🐇✨

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/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.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 b912f29 and ea30ae3.

📒 Files selected for processing (1)
  • components/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.mjs
⏰ 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). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
✨ 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: 6

🧹 Nitpick comments (2)
components/amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.mjs (1)

29-34: Consider adding validation for SKU limit

The description mentions "up to 50 SKUs" but there's no validation to enforce this Amazon API constraint.

Consider adding validation:

   sellerSkus: {
     type: "string[]",
     label: "Seller SKUs",
     description: "A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.",
     optional: true,
+    max: 50,
   },
components/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.mjs (1)

96-96: Improve summary message specificity.

The summary message is generic. Consider making it more informative based on the retrieved data or parameters used.

Consider a more specific summary:

-   $.export("$summary", "Fetched sales performance reports");
+   $.export("$summary", `Fetched sales performance reports for ${this.granularity} granularity`);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f91bab and b912f29.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • components/amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.mjs (1 hunks)
  • components/amazon_selling_partner/actions/fetch-orders-by-date-range/fetch-orders-by-date-range.mjs (1 hunks)
  • components/amazon_selling_partner/actions/generate-sales-inventory-reports/generate-sales-inventory-reports.mjs (1 hunks)
  • components/amazon_selling_partner/actions/get-order-details/get-order-details.mjs (1 hunks)
  • components/amazon_selling_partner/actions/list-inbound-shipments/list-inbound-shipments.mjs (1 hunks)
  • components/amazon_selling_partner/actions/optimize-product-pricing/optimize-product-pricing.mjs (1 hunks)
  • components/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.mjs (1 hunks)
  • components/amazon_selling_partner/amazon_selling_partner.app.mjs (1 hunks)
  • components/amazon_selling_partner/package.json (2 hunks)
  • components/amazon_selling_partner/sources/common/base.mjs (1 hunks)
  • components/amazon_selling_partner/sources/new-inbound-shipment-to-fba-created/new-inbound-shipment-to-fba-created.mjs (1 hunks)
  • components/amazon_selling_partner/sources/new-order-created/new-order-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
components/amazon_selling_partner/package.json (1)
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.
components/amazon_selling_partner/actions/fetch-orders-by-date-range/fetch-orders-by-date-range.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/amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.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/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.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/amazon_selling_partner/actions/optimize-product-pricing/optimize-product-pricing.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/amazon_selling_partner/actions/generate-sales-inventory-reports/generate-sales-inventory-reports.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/amazon_selling_partner/sources/common/base.mjs (1)
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/amazon_selling_partner/sources/new-inbound-shipment-to-fba-created/new-inbound-shipment-to-fba-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.
components/amazon_selling_partner/sources/new-order-created/new-order-created.mjs (4)
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#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.
components/amazon_selling_partner/actions/get-order-details/get-order-details.mjs (2)
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`.
components/amazon_selling_partner/amazon_selling_partner.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.
⏰ 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: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (17)
components/amazon_selling_partner/package.json (2)

3-3: LGTM: Version bump appropriate for new functionality

The version increment from 0.0.1 to 0.1.0 is appropriate given the comprehensive Amazon Selling Partner integration being added.


15-17: LGTM: Legitimate dependency addition

The @pipedream/platform dependency is correctly added and required for the new actions and sources in this integration.

components/amazon_selling_partner/actions/get-order-details/get-order-details.mjs (2)

17-25: LGTM: Proper prop dependency configuration

The amazonOrderId prop correctly depends on marketplaceId for dynamic validation or selection, which is the expected pattern for Amazon Selling Partner API integration.


27-34: LGTM: Correct API call and summary export

The getOrder method call and summary export format follow the expected patterns based on the learnings about proper summary message formatting.

components/amazon_selling_partner/actions/fetch-orders-by-date-range/fetch-orders-by-date-range.mjs (1)

47-62: LGTM: Correct API call and summary formatting

The listOrders method call with proper parameter mapping and summary export format follow the expected patterns.

components/amazon_selling_partner/actions/list-inbound-shipments/list-inbound-shipments.mjs (1)

36-53: LGTM: Correct pagination and parameter handling

The use of getPaginatedResources with proper resource key and the array joining for ShipmentStatusList parameter are implemented correctly. The summary export format is also appropriate.

components/amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.mjs (1)

36-54: LGTM: Correct API call and summary formatting

The getInventorySummaries method call with proper parameter mapping and the summary export with correct singular/plural handling are implemented correctly.

components/amazon_selling_partner/sources/common/base.mjs (1)

1-29: LGTM! Well-structured base module.

The base module provides a solid foundation for Amazon Selling Partner sources with appropriate defaults and shared functionality. The timestamp management methods follow expected patterns for polling sources.

components/amazon_selling_partner/actions/optimize-product-pricing/optimize-product-pricing.mjs (2)

47-49: LGTM! Correct conditional parameter mapping.

The conditional logic correctly maps the values array to either "Asins" or "Skus" parameter based on the itemType, and properly formats the array as a comma-separated string.


53-55: Good conditional summary export.

The conditional summary export based on the presence of product data is a good practice, ensuring the summary is only shown when relevant data is retrieved.

components/amazon_selling_partner/actions/generate-sales-inventory-reports/generate-sales-inventory-reports.mjs (2)

50-65: LGTM! Correct pagination and parameter handling.

The pagination implementation using getPaginatedResources is correct, with proper parameter formatting (arrays to comma-separated strings) and the appropriate hasPayload: false setting.


66-68: Good summary message with proper pluralization.

The summary message correctly handles pluralization and provides meaningful information about the number of reports retrieved.

components/amazon_selling_partner/sources/new-order-created/new-order-created.mjs (2)

13-19: LGTM! Proper metadata generation.

The generateMeta method correctly creates event metadata with a unique ID, descriptive summary, and proper timestamp parsing from the order's purchase date.


21-47: LGTM! Correct timestamp management and event emission.

The implementation properly:

  • Retrieves the last processed timestamp
  • Fetches new orders using pagination
  • Tracks the maximum timestamp from processed orders
  • Emits events with generated metadata
  • Updates the stored timestamp

The logic handles edge cases correctly (empty results, timestamp comparison).

components/amazon_selling_partner/sources/new-inbound-shipment-to-fba-created/new-inbound-shipment-to-fba-created.mjs (1)

1-11: Component setup looks good!

The source component is properly configured with appropriate naming conventions, documentation link, and dedupe strategy.

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

131-166: Well-designed pagination implementation!

The async generator pattern efficiently handles large datasets, and the dual token support (NextToken/nextToken) properly handles API inconsistencies.


76-76: Verify OAuth token expiration handling

I didn’t find any refresh-token logic in components/amazon_selling_partner/amazon_selling_partner.app.mjs—only:

  • Line 76:
    "x-amz-access-token": this.$auth.oauth_access_token

By contrast, other components (Trello, SmugMug, Google Calendar) reference this.$auth.oauth_refresh_token.

• Please confirm whether Pipedream’s platform automatically refreshes tokens for the Amazon Selling Partner API.
• If not, implement refresh logic—e.g. include refresh_token: this.$auth.oauth_refresh_token in your auth config and renew the access token before making requests.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

There's one issue in the code to be fixed; since it doesn't impact functionality I'll move the issue forward

Comment on lines +150 to +153
if (payload?.NextToken) {
params.NextToken = payload.NextToken;
hasMore = true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This block of code seems duplicated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks duplicated, but it's not. :) Some endpoints use NextToken (capitalized), and some use nextToken (not capitalized), so I wanted to allow for either one.

        hasMore = false;
        if (payload?.NextToken) {
          params.NextToken = payload.NextToken;
          hasMore = true;
        }
        if (payload?.nextToken) {
          params.nextToken = payload.nextToken;
          hasMore = true;
        }

Copy link
Collaborator

@GTFalcao GTFalcao Jul 10, 2025

Choose a reason for hiding this comment

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

Ah I see the casing difference now that you pointed it out - makes sense!

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 6075bbd into master Jul 10, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-15955 branch July 10, 2025 17:51
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.

Moneybird and Amazon Seller

3 participants