-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[ACTIONS] Netsuite - new components #19363
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 a full NetSuite integration: app-level REST client and CRUD helpers for invoices and sales orders, ten new action modules (create/get/list/update/delete), utilities for safe JSON parsing, validation constants, pagination support, and expanded propDefinitions for dynamic UI selection. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 inconclusive)
✅ Passed checks (3 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 |
80e4f15 to
a4e6ce2
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: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/netsuite/package.json (1)
3-15: Add trailing newline to fix eslint eol-last failureVersion bump to
0.1.0looks appropriate, and the minimal manifest avoids unnecessary dependencies (consistent with not adding Node built-ins as deps, based on learnings). The remaining issue is the eslint error about a missing newline at end of file.Add a trailing newline after the closing brace to satisfy
eol-lastand unblock the checks:- } -} + } +} +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
components/netsuite/actions/create-invoice/create-invoice.mjs(1 hunks)components/netsuite/actions/create-sales-order/create-sales-order.mjs(1 hunks)components/netsuite/actions/delete-invoice/delete-invoice.mjs(1 hunks)components/netsuite/actions/delete-sales-order/delete-sales-order.mjs(1 hunks)components/netsuite/actions/get-invoice/get-invoice.mjs(1 hunks)components/netsuite/actions/get-sales-order/get-sales-order.mjs(1 hunks)components/netsuite/actions/list-invoices/list-invoices.mjs(1 hunks)components/netsuite/actions/list-sales-orders/list-sales-orders.mjs(1 hunks)components/netsuite/actions/update-invoice/update-invoice.mjs(1 hunks)components/netsuite/actions/update-sales-order/update-sales-order.mjs(1 hunks)components/netsuite/common/constants.mjs(1 hunks)components/netsuite/common/utils.mjs(1 hunks)components/netsuite/netsuite.app.mjs(1 hunks)components/netsuite/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 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/netsuite/actions/create-sales-order/create-sales-order.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/netsuite/netsuite.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: 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.
Applied to files:
components/netsuite/netsuite.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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.
Applied to files:
components/netsuite/package.json
🧬 Code graph analysis (5)
components/netsuite/actions/list-sales-orders/list-sales-orders.mjs (2)
components/netsuite/actions/list-invoices/list-invoices.mjs (2)
items(40-40)paginator(41-50)components/netsuite/netsuite.app.mjs (1)
items(303-303)
components/netsuite/actions/get-invoice/get-invoice.mjs (8)
components/netsuite/actions/create-invoice/create-invoice.mjs (1)
response(119-147)components/netsuite/actions/create-sales-order/create-sales-order.mjs (1)
response(95-123)components/netsuite/actions/delete-invoice/delete-invoice.mjs (1)
response(30-33)components/netsuite/actions/delete-sales-order/delete-sales-order.mjs (1)
response(30-33)components/netsuite/actions/get-sales-order/get-sales-order.mjs (1)
response(51-59)components/netsuite/actions/update-invoice/update-invoice.mjs (1)
response(135-167)components/netsuite/actions/update-sales-order/update-sales-order.mjs (1)
response(110-142)components/netsuite/netsuite.app.mjs (1)
response(294-301)
components/netsuite/actions/update-sales-order/update-sales-order.mjs (3)
components/netsuite/actions/create-sales-order/create-sales-order.mjs (1)
response(95-123)components/netsuite/actions/update-invoice/update-invoice.mjs (1)
response(135-167)components/netsuite/netsuite.app.mjs (2)
response(294-301)items(303-303)
components/netsuite/actions/delete-sales-order/delete-sales-order.mjs (1)
components/netsuite/actions/delete-invoice/delete-invoice.mjs (1)
response(30-33)
components/netsuite/actions/create-invoice/create-invoice.mjs (4)
components/netsuite/actions/create-sales-order/create-sales-order.mjs (1)
response(95-123)components/netsuite/actions/update-invoice/update-invoice.mjs (1)
response(135-167)components/netsuite/actions/update-sales-order/update-sales-order.mjs (1)
response(110-142)components/netsuite/netsuite.app.mjs (2)
response(294-301)items(303-303)
🪛 GitHub Actions: Pull Request Checks
components/netsuite/package.json
[error] 15-15: eslint: Newline required at end of file but not found. (eol-last) during 'pnpm exec eslint ...'
⏰ 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). (1)
- GitHub Check: pnpm publish
🔇 Additional comments (8)
components/netsuite/common/constants.mjs (1)
1-7: Validation constants look goodThe
VALIDATION_OPTIONSmap is clear and aligns well with how the actions configure validation behavior. No changes needed here.components/netsuite/actions/delete-sales-order/delete-sales-order.mjs (1)
1-37: Delete Sales Order action is consistent and straightforwardThe action wiring (props, annotations, and
runimplementation) is consistent with the existing delete-invoice pattern and correctly delegates toapp.deleteSalesOrder, emitting a clear summary.No issues from a correctness or API-shape standpoint.
components/netsuite/actions/get-invoice/get-invoice.mjs (1)
1-64: Get Invoice action matches established patternProps, annotations, and the
rundelegation toapp.getInvoice(including optional params and summary) are consistent with the corresponding get-sales-order action and look correct.No changes needed here.
components/netsuite/actions/update-invoice/update-invoice.mjs (1)
1-172: Update Invoice action wiring and payload construction look correctThe props schema, validation headers, query params (
replace,replaceSelectedFields), and conditional assembly of thedatapayload (entity, subsidiary, items, memo, otherRefNum, additionalFields) are all consistent with the related create/update actions and NetSuite expectations.The only caveat is that this action relies on
utils.parseJsonforitemsandadditionalFields; once the depth/cycle handling in that utility is corrected (see comment incomponents/netsuite/common/utils.mjs), this action should behave as intended.components/netsuite/actions/create-sales-order/create-sales-order.mjs (1)
1-128: Create Sales Order action is well-structured and consistentThe action metadata, prop definitions, and
runimplementation align with the create-invoice pattern and correctly delegate toapp.createSalesOrderwith validation headers and a properly assembled payload (including parseditemsandadditionalFields).The name "Create Sales Order" correctly reflects the behavior, which is good alignment with prior feedback on action naming. Aside from the shared
parseJsonutility concerns already noted, this action looks solid.components/netsuite/actions/list-invoices/list-invoices.mjs (1)
1-61: List Invoices action correctly leverages pagination helperThe action uses
app.paginatein the same way as the list-sales-orders action, with appropriate conditional search params and a clear summary message. Thefor awaitaccumulation intoitemsand return value are straightforward and correct.No changes needed here.
components/netsuite/actions/create-invoice/create-invoice.mjs (1)
104-147: Create‑invoice action wiring looks correct and consistentThe
createInvoicecall uses the same flattened options shape ascreateSalesOrder/updateInvoice, so$, validation headers,replace, and the payload (including parseditemsandadditionalFields) will be forwarded correctly to_makeRequest. This action is structurally sound once the shared app helpers are fixed.components/netsuite/actions/update-sales-order/update-sales-order.mjs (1)
110-141: The review comment identifies a critical issue regarding argument handling in theupdateSalesOrdercall, but this cannot be verified without access to thenetsuite.app.mjsimplementation. The claim that headers, params, and data are being ignored requires examining the actual function signature and how it processes theoptsparameter. Manual code inspection of the app file is necessary to confirm whether the suggested nestedoptsstructure or an app-level fix is required.
a4e6ce2 to
50cf166
Compare
luancazarine
left a 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.
Hi @jcortes, I just added a small suggestion, but I'll move it to Ready for QA anyway
50cf166 to
cfb811a
Compare
WHY
Resolves #7478
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.