Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Nov 19, 2025

WHY

Resolves #11419

Summary by CodeRabbit

  • New Features

    • Add full bill operations: create, update, delete, and list bills
    • Add full vendor operations: create, update, delete, and list vendors
    • Add robust data parsing for complex/JSON-like inputs and improved integration workflows
  • Chores

    • Upgrade Sage Intacct integration package version to 0.1.0

✏️ Tip: You can customize this high-level summary in your review settings.

@jcortes jcortes self-assigned this Nov 19, 2025
@vercel
Copy link

vercel bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 19, 2025 10:32pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 19, 2025 10:32pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

Adds eight Sage Intacct action modules (create/list/update/delete for bills and vendors), a recursive JSON parsing utility, and a rewritten app layer with HTTP client helpers, API methods, and expanded propDefinitions to support the actions.

Changes

Cohort / File(s) Summary
Bill Actions
components/sage_intacct/actions/create-bill/create-bill.mjs, components/sage_intacct/actions/update-bill/update-bill.mjs, components/sage_intacct/actions/delete-bill/delete-bill.mjs, components/sage_intacct/actions/list-bills/list-bills.mjs
New action modules for creating, updating, deleting, and listing bills. Create/update build payloads (fields, dates, currency, lines parsed via utils.parseJson) and call app methods; delete/list delegate to app methods and export summaries.
Vendor Actions
components/sage_intacct/actions/create-vendor/create-vendor.mjs, components/sage_intacct/actions/update-vendor/update-vendor.mjs, components/sage_intacct/actions/delete-vendor/delete-vendor.mjs, components/sage_intacct/actions/list-vendors/list-vendors.mjs
New action modules for creating, updating, deleting, and listing vendors. Create/update map vendor attributes into app calls; delete/list delegate to app methods and export summaries.
Utilities
components/sage_intacct/common/utils.mjs
Adds parseJson(input, maxDepth = 100) that recursively parses JSON-like strings, handles arrays/objects, and prevents infinite recursion via a WeakSet.
App Layer
components/sage_intacct/sage_intacct.app.mjs
Replaces minimal placeholder with full propDefinitions (many bill/vendor fields, async options) and implements HTTP client helpers (getUrl, getHeaders, _makeRequest) plus verb helpers (get/post/patch/delete) and high-level API methods: list/get/create/update/delete for bills and vendors.
Package
components/sage_intacct/package.json
Bumped package version from 0.0.1 to 0.1.0.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant App
    participant IntacctAPI

    User->>Action: Invoke action (e.g., Create/Update Bill or Vendor)
    Action->>Action: Destructure props, build payload, parse lines via utils.parseJson
    Action->>App: Call app.<create|update|list|delete><Bill|Vendor>({ $, ... })
    App->>App: _makeRequest({ path, method, data, headers })
    App->>IntacctAPI: HTTP request (GET/POST/PATCH/DELETE)
    IntacctAPI-->>App: HTTP response
    App-->>Action: Return response
    Action->>Action: $.export("$summary", "Successfully ...")
    Action-->>User: Return response + summary
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas to focus:
    • HTTP client (_makeRequest) — auth/header formation, axios usage, error propagation.
    • API method implementations — path construction and payload shapes for create/update methods.
    • propDefinitions — async option fetchers, types, optional flags, and example correctness.
    • parseJson utility — recursion limits, circular reference handling, edge-case parsing.
    • A sample of action files (one create, one update, one delete) to ensure consistent this-binding and $.export usage.

Suggested reviewers

  • GTFalcao
  • lcaresia

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete, containing only a reference to issue #11419 with no additional implementation details, context, or explanation of changes. Expand the description to explain what Sage Intacct components were added, which features are implemented, and any relevant implementation notes or testing instructions.
Title check ❓ Inconclusive The title is vague and overly generic, describing only the high-level addition of Sage Intacct components without specifying which features or capabilities are being added. Make the title more specific by identifying the primary components added (e.g., bills and vendors CRUD operations) to clarify the scope of changes.
Linked Issues check ❓ Inconclusive The PR implements bills and vendors CRUD operations but lacks several features listed in issue #11419 (journal entries, recall bill, legacy bills API), making it unclear if this is a partial implementation or if additional work is planned. Clarify whether this PR represents a complete implementation of #11419 or a partial implementation, and document any planned follow-up work for missing features.
✅ Passed checks (2 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All changes are directly related to implementing Sage Intacct integration components for bills and vendors management, which align with the linked issue requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sage-intacct-new-components

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 9

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29b168a and 1fd5c3c.

📒 Files selected for processing (10)
  • components/sage_intacct/actions/create-bill/create-bill.mjs (1 hunks)
  • components/sage_intacct/actions/create-vendor/create-vendor.mjs (1 hunks)
  • components/sage_intacct/actions/delete-bill/delete-bill.mjs (1 hunks)
  • components/sage_intacct/actions/delete-vendor/delete-vendor.mjs (1 hunks)
  • components/sage_intacct/actions/list-bills/list-bills.mjs (1 hunks)
  • components/sage_intacct/actions/list-vendors/list-vendors.mjs (1 hunks)
  • components/sage_intacct/actions/update-bill/update-bill.mjs (1 hunks)
  • components/sage_intacct/actions/update-vendor/update-vendor.mjs (1 hunks)
  • components/sage_intacct/common/utils.mjs (1 hunks)
  • components/sage_intacct/sage_intacct.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 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.

Applied to files:

  • components/sage_intacct/sage_intacct.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/sage_intacct/sage_intacct.app.mjs
🧬 Code graph analysis (6)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (2)
components/sage_intacct/actions/create-vendor/create-vendor.mjs (1)
  • response (106-122)
components/sage_intacct/actions/update-bill/update-bill.mjs (1)
  • response (108-124)
components/sage_intacct/actions/update-bill/update-bill.mjs (2)
components/sage_intacct/actions/create-bill/create-bill.mjs (1)
  • response (121-147)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)
  • response (114-131)
components/sage_intacct/actions/create-bill/create-bill.mjs (2)
components/sage_intacct/actions/create-vendor/create-vendor.mjs (1)
  • response (106-122)
components/sage_intacct/actions/update-bill/update-bill.mjs (1)
  • response (108-124)
components/sage_intacct/actions/list-bills/list-bills.mjs (1)
components/sage_intacct/actions/list-vendors/list-vendors.mjs (1)
  • response (20-22)
components/sage_intacct/actions/create-vendor/create-vendor.mjs (3)
components/sage_intacct/actions/create-bill/create-bill.mjs (1)
  • response (121-147)
components/sage_intacct/actions/list-vendors/list-vendors.mjs (1)
  • response (20-22)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)
  • response (114-131)
components/sage_intacct/actions/list-vendors/list-vendors.mjs (3)
components/sage_intacct/actions/create-vendor/create-vendor.mjs (1)
  • response (106-122)
components/sage_intacct/actions/list-bills/list-bills.mjs (1)
  • response (20-22)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)
  • response (114-131)
⏰ 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 (3)
components/sage_intacct/actions/delete-bill/delete-bill.mjs (1)

1-39: Delete Bill action wiring looks correct.

Props, annotations, and the call to app.deleteBill({ $, billKey }) are consistent and minimal, and returning { success: true } with a summary is reasonable for a delete operation.

components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)

1-135: Update Vendor action aligns with partial‑update semantics.

Good reuse of app propDefinitions and a straightforward mapping into data. Given @pipedream/platform’s axios drops undefined fields (so only provided props are sent), this matches the “fields not provided remain unchanged” promise in the description. Based on learnings.

components/sage_intacct/actions/list-bills/list-bills.mjs (1)

1-27: List Bills action is straightforward and consistent.

The action correctly delegates to app.listBills({ $ }), marks itself read‑only, and returns the raw response with a clear summary. This matches the list‑vendors pattern.

@jcortes jcortes force-pushed the sage-intacct-new-components branch from 1fd5c3c to 5c3605b Compare November 19, 2025 22:31
@jcortes jcortes force-pushed the sage-intacct-new-components branch from 5c3605b to 9b60c85 Compare November 19, 2025 22:32
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (9)
components/sage_intacct/common/utils.mjs (1)

1-40: Recursion pattern issue already flagged.

The past review comment correctly identifies that the current recursion through parseJson (line 15) reinitializes the WeakSet and weakens cycle detection across nested JSON strings. The suggested refactor to keep recursion within parse with a depth parameter is the right approach.

components/sage_intacct/actions/list-vendors/list-vendors.mjs (1)

3-26: LGTM: Action structure is correct.

The action metadata, prop wiring, and run implementation cleanly delegate to app.listVendors with a clear summary. This follows the established pattern for list actions.

The past review comment about paging/filtering for large datasets is a valid future enhancement but not a blocker for this initial implementation.

components/sage_intacct/actions/delete-vendor/delete-vendor.mjs (1)

23-38: Consider including vendorKey in response and summary.

The past review comment correctly suggests that including the vendorKey in both the summary (e.g., "Successfully deleted vendor {vendorKey}") and the return value would improve observability and make debugging easier for users.

components/sage_intacct/actions/create-vendor/create-vendor.mjs (1)

14-122: Missing discountPercent for parity with update.

The past review comment correctly identifies that discountPercent is supported in update-vendor but missing here in create-vendor. For consistency and to avoid forcing users to make a follow-up update just to set a discount, consider adding the discountPercent prop and field.

components/sage_intacct/actions/update-bill/update-bill.mjs (1)

15-124: Partial update semantics vs required fields.

The past review comment correctly identifies that the description promises "Any fields not provided remain unchanged", but the action reuses propDefinitions that may be required for create flows. This forces users to supply fields even for partial updates, which weakens the partial update story. Consider explicitly marking fields other than billKey as optional: true and conditionally building the data object to only include defined fields.

components/sage_intacct/actions/create-bill/create-bill.mjs (1)

12-12: Consider setting destructiveHint: true for consistency.

Since this action creates new records in the remote system, marking it as destructive would be consistent with update and delete actions.

Apply this diff:

-    destructiveHint: false,
+    destructiveHint: true,
components/sage_intacct/sage_intacct.app.mjs (3)

7-68: Defensive prevContext handling and explicit limit needed.

The current implementation has two issues:

  1. prevContext: { offset = 0 } will throw if prevContext is undefined
  2. No explicit limit parameter is sent, assuming server default matches DEFAULT_LIMIT

Apply this pattern to both billKey and vendorKey:

-      async options({ prevContext: { offset = 0 } }) {
+      async options({ prevContext } = {}) {
+        const { offset = 0 } = prevContext ?? {};
         const DEFAULT_LIMIT = 100;
         if (offset === null) {
           return [];
         }
         const { data: { "ia::result": bills } } = await this.listBills({
           params: {
             offset,
+            limit: DEFAULT_LIMIT,
           },
         });

93-108: Required dates may constrain update flows.

Both createdDate and dueDate lack optional: true, forcing update actions to collect these values even when users don't intend to change them.

If Intacct supports partial updates, consider:

    createdDate: {
      type: "string",
      label: "Created Date",
      description: "Date the bill was created (YYYY-MM-DD format). Example: `2025-01-01`.",
+     optional: true,
    },
    dueDate: {
      type: "string",
      label: "Due Date",
      description: "Due date for the bill (YYYY-MM-DD format). Example: `2025-01-01`.",
+     optional: true,
    },

272-285: Critical: Use standard OAuth token field.

Line 278 references this.$auth.oauth_token, but Pipedream OAuth2 apps conventionally use this.$auth.oauth_access_token. This will cause 401 errors on every request.

Apply this fix:

-        "Authorization": `Bearer ${this.$auth.oauth_token}`,
+        "Authorization": `Bearer ${this.$auth.oauth_access_token}`,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd5c3c and 9b60c85.

📒 Files selected for processing (11)
  • components/sage_intacct/actions/create-bill/create-bill.mjs (1 hunks)
  • components/sage_intacct/actions/create-vendor/create-vendor.mjs (1 hunks)
  • components/sage_intacct/actions/delete-bill/delete-bill.mjs (1 hunks)
  • components/sage_intacct/actions/delete-vendor/delete-vendor.mjs (1 hunks)
  • components/sage_intacct/actions/list-bills/list-bills.mjs (1 hunks)
  • components/sage_intacct/actions/list-vendors/list-vendors.mjs (1 hunks)
  • components/sage_intacct/actions/update-bill/update-bill.mjs (1 hunks)
  • components/sage_intacct/actions/update-vendor/update-vendor.mjs (1 hunks)
  • components/sage_intacct/common/utils.mjs (1 hunks)
  • components/sage_intacct/package.json (2 hunks)
  • components/sage_intacct/sage_intacct.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

Applied to files:

  • components/sage_intacct/actions/create-vendor/create-vendor.mjs
  • components/sage_intacct/actions/update-bill/update-bill.mjs
  • components/sage_intacct/sage_intacct.app.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 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`.

Applied to files:

  • components/sage_intacct/actions/list-vendors/list-vendors.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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".

Applied to files:

  • components/sage_intacct/actions/create-bill/create-bill.mjs
📚 Learning: 2025-07-01T17:07:48.193Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: For "dir" props in Pipedream components, whether to mark them as optional depends on the action's file I/O behavior - if an action always writes files as output, the "dir" prop should not be marked as optional.

Applied to files:

  • components/sage_intacct/actions/update-bill/update-bill.mjs
  • components/sage_intacct/sage_intacct.app.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 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.

Applied to files:

  • components/sage_intacct/sage_intacct.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/sage_intacct/sage_intacct.app.mjs
🧬 Code graph analysis (6)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (2)
components/sage_intacct/actions/create-vendor/create-vendor.mjs (1)
  • response (106-122)
components/sage_intacct/actions/update-bill/update-bill.mjs (1)
  • response (108-124)
components/sage_intacct/actions/create-vendor/create-vendor.mjs (3)
components/sage_intacct/actions/create-bill/create-bill.mjs (1)
  • response (121-147)
components/sage_intacct/actions/list-vendors/list-vendors.mjs (1)
  • response (20-22)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)
  • response (114-131)
components/sage_intacct/actions/list-vendors/list-vendors.mjs (1)
components/sage_intacct/actions/list-bills/list-bills.mjs (1)
  • response (20-22)
components/sage_intacct/actions/create-bill/create-bill.mjs (1)
components/sage_intacct/actions/update-bill/update-bill.mjs (1)
  • response (108-124)
components/sage_intacct/actions/list-bills/list-bills.mjs (1)
components/sage_intacct/actions/list-vendors/list-vendors.mjs (1)
  • response (20-22)
components/sage_intacct/actions/update-bill/update-bill.mjs (2)
components/sage_intacct/actions/create-bill/create-bill.mjs (1)
  • response (121-147)
components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)
  • response (114-131)
⏰ 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
🔇 Additional comments (5)
components/sage_intacct/package.json (1)

3-3: LGTM: Version bump aligns with new features.

The minor version bump from 0.0.1 to 0.1.0 is appropriate given the substantial new functionality added (multiple CRUD actions for bills and vendors, plus utilities).

components/sage_intacct/actions/update-vendor/update-vendor.mjs (1)

3-136: LGTM: Update vendor implementation is complete.

The action properly maps all vendor fields including discountPercent, correctly constructs the payload, and exports an appropriate summary. The implementation is clean and consistent with the other actions in this PR.

components/sage_intacct/actions/list-bills/list-bills.mjs (1)

1-27: LGTM!

The action structure is clean and follows Pipedream conventions. The metadata correctly marks this as a read-only, non-destructive action, and the implementation properly delegates to app.listBills().

components/sage_intacct/actions/create-bill/create-bill.mjs (1)

102-151: LGTM!

The run method implementation is solid. The conditional vendor and currency nesting is clean, and the utils.parseJson(lines) usage is consistent with the update-bill action pattern.

components/sage_intacct/sage_intacct.app.mjs (1)

1-387: Well-structured API client and prop definitions.

Beyond the issues already flagged in previous comments, the overall implementation is solid:

  • PropDefinitions are comprehensive with clear labels and descriptions
  • HTTP client layer follows standard Pipedream axios patterns
  • API methods cleanly wrap REST endpoints
  • The structure is consistent across bills and vendors operations

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.

Sage Intacct

2 participants