-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Components] Sage Intacct new components #19136
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
📒 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 dropsundefinedfields (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.
1fd5c3c to
5c3605b
Compare
5c3605b to
9b60c85
Compare
There was a problem hiding this 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 theWeakSetand weakens cycle detection across nested JSON strings. The suggested refactor to keep recursion withinparsewith 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
runimplementation cleanly delegate toapp.listVendorswith 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
vendorKeyin 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: MissingdiscountPercentfor parity with update.The past review comment correctly identifies that
discountPercentis supported inupdate-vendorbut missing here increate-vendor. For consistency and to avoid forcing users to make a follow-up update just to set a discount, consider adding thediscountPercentprop 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
billKeyasoptional: trueand conditionally building thedataobject to only include defined fields.components/sage_intacct/actions/create-bill/create-bill.mjs (1)
12-12: Consider settingdestructiveHint: truefor 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:
prevContext: { offset = 0 }will throw ifprevContextis undefined- No explicit
limitparameter is sent, assuming server default matchesDEFAULT_LIMITApply this pattern to both
billKeyandvendorKey:- 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
createdDateanddueDatelackoptional: 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 usethis.$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
📒 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.mjscomponents/sage_intacct/actions/update-bill/update-bill.mjscomponents/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.mjscomponents/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
WHY
Resolves #11419
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.