Skip to content

Sage Accounting new components #17575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Jul 10, 2025

Closes #17279

Summary by CodeRabbit

  • New Features

    • Added Sage Accounting integration with actions to create and update contacts, create products, create contact payments, and retrieve ledger accounts.
    • Introduced event sources to emit events when new contact payments, products, or services are created in Sage Accounting.
    • Implemented polling support for incremental event detection.
    • Provided predefined options for credit terms and locales for easier configuration.
  • Chores

    • Updated package version and dependencies for improved compatibility.

Copy link

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

Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Walkthrough

A comprehensive Sage Accounting integration was introduced, including new action modules for creating and updating contacts, products, and contact payments, as well as polling sources for new contact payments, products, and services. Supporting utility and constants modules were added, and the main app file was extensively expanded to provide prop definitions and API methods for CRUD operations and paginated resource listing.

Changes

File(s) Change Summary
components/sage_accounting/actions/create-contact-payment/create-contact-payment.mjs Added action to create a new contact payment in Sage Accounting.
components/sage_accounting/actions/create-contact/create-contact.mjs Added action to create a new contact.
components/sage_accounting/actions/create-product/create-product.mjs Added action to create a new product with dynamic option loading for suppliers and catalog item types.
components/sage_accounting/actions/get-ledger-accounts/get-ledger-accounts.mjs Added action to retrieve paginated ledger accounts with filtering options.
components/sage_accounting/actions/update-contact/update-contact.mjs Added action to update an existing contact.
components/sage_accounting/common/constants.mjs Added constants for credit terms and locale options.
components/sage_accounting/common/utils.mjs Added utility function for optional float parsing.
components/sage_accounting/package.json Updated version, added dependency on @pipedream/platform, and fixed JSON structure.
components/sage_accounting/sage_accounting.app.mjs Major expansion: added prop definitions and methods for Sage Accounting API operations, CRUD, and option loading.
components/sage_accounting/sources/common/polling.mjs Introduced a reusable polling source base for incremental event emission and deduplication.
components/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.mjs Added polling source to emit events for new contact payments.
components/sage_accounting/sources/new-product-created/new-product-created.mjs Added polling source to emit events for new products.
components/sage_accounting/sources/new-service-created/new-service-created.mjs Added polling source to emit events for new services.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant SageAccountingApp
    participant SageAPI

    User->>Action: Trigger (e.g., Create Product)
    Action->>SageAccountingApp: Call createProduct({props})
    SageAccountingApp->>SageAPI: POST /products (with data)
    SageAPI-->>SageAccountingApp: Response (product info)
    SageAccountingApp-->>Action: Return API response
    Action-->>User: Output summary and response
Loading
sequenceDiagram
    participant PollingSource
    participant SageAccountingApp
    participant SageAPI
    participant EventSystem

    PollingSource->>SageAccountingApp: listProducts / listServices / listContactPayments
    SageAccountingApp->>SageAPI: GET /products|/services|/contact_payments
    SageAPI-->>SageAccountingApp: Response (items)
    SageAccountingApp-->>PollingSource: Return items
    PollingSource->>EventSystem: Emit new event(s) for unseen items
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement polling sources: new-contact-payment, new-product, new-service (#17279)
Implement actions: create-contact-payment, update-contact, create-product, create-contact (#17279)
Add supporting utilities, constants, and prop definitions for Sage Accounting integration (#17279)
Implement Sage Accounting app with CRUD and listing methods, dynamic option loading (#17279)

Poem

In burrows deep, I code with glee,
Sage Accounting, now you see!
Contacts, payments, products too—
Polling sources, fresh and new.
With every hop, your data flows,
A rabbit’s touch—how quickly it grows!
🐇✨

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/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.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/sage_accounting/sources/new-service-created/new-service-created.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/sage_accounting/sources/new-product-created/new-product-created.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 79d5429 and 11111eb.

📒 Files selected for processing (3)
  • components/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.mjs (1 hunks)
  • components/sage_accounting/sources/new-product-created/new-product-created.mjs (1 hunks)
  • components/sage_accounting/sources/new-service-created/new-service-created.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/sage_accounting/sources/new-service-created/new-service-created.mjs
  • components/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.mjs
  • components/sage_accounting/sources/new-product-created/new-product-created.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: 1

🧹 Nitpick comments (1)
components/sage_accounting/actions/create-contact-payment/create-contact-payment.mjs (1)

116-116: Consider null safety for totalAmount parsing.

The totalAmount field uses parseFloat directly without null checking, which could cause issues if the value is null or undefined. Other similar fields use optionalParseFloat for safety.

Consider applying this diff for consistency:

-        total_amount: parseFloat(this.totalAmount),
+        total_amount: optionalParseFloat(this.totalAmount),

Or ensure that totalAmount is always required and cannot be null in the prop definition.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8f4598a and 79d5429.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • components/sage_accounting/actions/create-contact-payment/create-contact-payment.mjs (1 hunks)
  • components/sage_accounting/actions/create-contact/create-contact.mjs (1 hunks)
  • components/sage_accounting/actions/create-product/create-product.mjs (1 hunks)
  • components/sage_accounting/actions/get-ledger-accounts/get-ledger-accounts.mjs (1 hunks)
  • components/sage_accounting/actions/update-contact/update-contact.mjs (1 hunks)
  • components/sage_accounting/common/constants.mjs (1 hunks)
  • components/sage_accounting/common/utils.mjs (1 hunks)
  • components/sage_accounting/package.json (2 hunks)
  • components/sage_accounting/sage_accounting.app.mjs (1 hunks)
  • components/sage_accounting/sources/common/polling.mjs (1 hunks)
  • components/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.mjs (1 hunks)
  • components/sage_accounting/sources/new-product-created/new-product-created.mjs (1 hunks)
  • components/sage_accounting/sources/new-service-created/new-service-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
components/sage_accounting/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/sage_accounting/actions/get-ledger-accounts/get-ledger-accounts.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`.
components/sage_accounting/sources/common/polling.mjs (2)
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/sage_accounting/sources/new-service-created/new-service-created.mjs (2)
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/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.mjs (2)
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/sage_accounting/sources/new-product-created/new-product-created.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#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.
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.
components/sage_accounting/actions/create-contact-payment/create-contact-payment.mjs (1)
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".
components/sage_accounting/actions/update-contact/update-contact.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/sage_accounting/actions/create-product/create-product.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`.
components/sage_accounting/actions/create-contact/create-contact.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/sage_accounting/sage_accounting.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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (24)
components/sage_accounting/package.json (2)

3-3: LGTM: Appropriate version bump for new features.

The version increment from 0.0.1 to 0.1.0 follows semantic versioning correctly for the addition of new Sage Accounting integration features.


15-17: LGTM: Valid dependency addition.

The @pipedream/platform dependency is correctly added to support the new integration components and follows the established pattern for Pipedream component dependencies.

components/sage_accounting/common/utils.mjs (1)

1-5: LGTM: Clean utility function implementation.

The function correctly handles conditional parsing of string values to floats while preserving non-string inputs unchanged. The implementation is straightforward and type-safe.

components/sage_accounting/common/constants.mjs (2)

1-26: LGTM: Well-structured credit terms options.

The credit terms options provide comprehensive coverage of business scenarios with clear labels and consistent snake_case values. The structure follows standard label/value pair conventions.


28-53: LGTM: Proper locale options with standard codes.

The locale options use correct ISO language-country codes (en-US, fr-FR, etc.) and cover major languages. The structure is consistent with the credit terms options.

components/sage_accounting/actions/get-ledger-accounts/get-ledger-accounts.mjs (2)

1-34: LGTM: Well-structured action with proper pagination.

The action follows Pipedream conventions with appropriate prop definitions, pagination constraints, and propDefinition usage for consistency across the integration.


35-52: LGTM: Correct API call and summary formatting.

The implementation correctly maps camelCase props to snake_case API parameters and follows the established pattern for summary messages with proper pluralization.

components/sage_accounting/sources/common/polling.mjs (3)

1-14: LGTM: Proper polling source setup.

The component correctly imports platform constants and sets up the required props for a polling source with database persistence and timer interface.


15-45: LGTM: Robust incremental polling implementation.

The polling logic correctly handles deduplication by tracking processed IDs, limits storage growth by capping at 100 IDs, and provides proper maxItems handling for both deploy and run scenarios.


46-55: LGTM: Proper lifecycle methods implementation.

The run method enables unlimited polling while the deploy hook appropriately limits initial emission to 5 items, preventing overwhelming users on first deployment.

components/sage_accounting/actions/create-contact-payment/create-contact-payment.mjs (1)

1-139: Well-structured action with comprehensive prop definitions.

The action follows good patterns with:

  • Proper import statements and metadata
  • Comprehensive prop definitions using the app's propDefinition pattern
  • Consistent snake_case API payload structure
  • Clear success message with response ID
  • Proper error handling context with $
components/sage_accounting/sources/new-service-created/new-service-created.mjs (1)

1-37: Well-implemented polling source with proper fallbacks.

The source follows excellent patterns:

  • Properly extends the common polling module
  • Implements all required methods with appropriate fallbacks
  • Uses Date.parse(service.created_at) || Date.now() for timestamp safety
  • Provides meaningful fallbacks in getItemSummary (description → displayed_as → id)
  • Implements pagination with reasonable page size (100 items)
  • Uses unique deduplication strategy appropriately
components/sage_accounting/sources/new-contact-payment-created/new-contact-payment-created.mjs (2)

25-28: Excellent handling of nested objects and fallbacks.

The getItemSummary method demonstrates good defensive programming:

  • Safely accesses nested contact object with optional chaining
  • Provides multiple fallback options for contact name
  • Handles cases where amount fields might be missing
  • Creates meaningful summary combining contact and amount information

1-39: Consistent and robust polling source implementation.

The source follows the same excellent patterns as other sources in this PR, with proper extension of the common polling module, appropriate fallbacks, and consistent API usage.

components/sage_accounting/sources/new-product-created/new-product-created.mjs (1)

1-37: Consistent implementation following established patterns.

The source maintains excellent consistency with other sources in this PR:

  • Proper extension of common polling module
  • Standard generateMeta implementation with timestamp fallback
  • Appropriate fallbacks in getItemSummary (description → displayed_as → id)
  • Correct API method call with pagination
  • Maintains the same code structure and patterns
components/sage_accounting/actions/create-contact/create-contact.mjs (2)

119-140: Good pattern for reusing prop definitions with custom labels.

The reuse of ledgerAccountId prop definition with custom labels and descriptions for different use cases (sales vs purchase ledger accounts) demonstrates good code reuse while maintaining clarity.


142-175: Robust contact creation with comprehensive field mapping.

The implementation demonstrates excellent practices:

  • Comprehensive data structure covering all contact fields
  • Proper snake_case field naming for API compatibility
  • Meaningful success message with fallbacks (response.name || response.displayed_as)
  • Proper error handling context with $
  • Clean separation of concerns with all logic in the run method
components/sage_accounting/actions/update-contact/update-contact.mjs (2)

11-149: Well-structured props implementation!

The props are properly defined using propDefinitions for consistency, and the optional nature of most fields is appropriate for an update operation.


150-184: Excellent implementation of the update logic!

The run method correctly structures the data payload, properly maps fields to snake_case, and follows best practices for summary messages with appropriate fallback.

components/sage_accounting/actions/create-product/create-product.mjs (3)

52-82: Clarify if tax rate fields are required

The salesTaxRateId and purchaseTaxRateId props don't explicitly specify optional: true or optional: false. Since Pipedream props are optional by default, these will be treated as optional. Please verify if these fields are required by the Sage API and add optional: false if needed.


124-150: Clean implementation of product creation!

The run method properly structures the request payload and follows best practices for summary messages.


83-88: Confirm costPrice as string

Verification against the Sage Accounting API docs shows that cost_price must be provided as a string (e.g. "100.00") to preserve precision. No change is needed—the current definition is correct.

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

9-338: Comprehensive and well-structured prop definitions!

The propDefinitions provide excellent user experience with dynamic option loading, proper validation constraints, and clear descriptions. The consistent use of pagination in async options is a best practice.


368-506: Well-organized API methods with consistent patterns!

The API methods follow a clean and consistent structure. The use of _paginatedRequest for all list operations ensures uniform pagination handling, and the filtered listSuppliers method is a nice convenience helper.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @GTFalcao lgtm! Ready for QA!

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] sage_accounting
2 participants