-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[ACTIONS] picqer - new components #19383
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
|
WalkthroughThis pull request introduces eight new Picqer action modules for order management, extends the Picqer app with new propDefinitions and 10 API methods, and bumps the component package version to 0.2.0. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25–35 minutes
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 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 |
e937b01 to
d5b79f1
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: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
components/picqer/actions/add-order-tags/add-order-tags.mjs(1 hunks)components/picqer/actions/add-product-to-order/add-product-to-order.mjs(1 hunks)components/picqer/actions/cancel-order/cancel-order.mjs(1 hunks)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs(1 hunks)components/picqer/actions/get-order-comments/get-order-comments.mjs(1 hunks)components/picqer/actions/get-order-tags/get-order-tags.mjs(1 hunks)components/picqer/actions/pause-order/pause-order.mjs(1 hunks)components/picqer/actions/process-order/process-order.mjs(1 hunks)components/picqer/package.json(1 hunks)components/picqer/picqer.app.mjs(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/picqer/package.json
🧬 Code graph analysis (6)
components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (6)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
response(59-69)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/pause-order/pause-order.mjs (1)
response(29-35)components/picqer/actions/process-order/process-order.mjs (1)
response(24-27)
components/picqer/actions/add-product-to-order/add-product-to-order.mjs (6)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
response(29-32)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/pause-order/pause-order.mjs (1)
response(29-35)components/picqer/actions/process-order/process-order.mjs (1)
response(24-27)
components/picqer/actions/pause-order/pause-order.mjs (6)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
response(59-69)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
response(29-32)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/process-order/process-order.mjs (1)
response(24-27)
components/picqer/actions/add-order-tags/add-order-tags.mjs (6)
components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
response(59-69)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
response(29-32)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/pause-order/pause-order.mjs (1)
response(29-35)components/picqer/actions/process-order/process-order.mjs (1)
response(24-27)
components/picqer/actions/process-order/process-order.mjs (6)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
response(59-69)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
response(29-32)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/pause-order/pause-order.mjs (1)
response(29-35)
components/picqer/actions/get-order-tags/get-order-tags.mjs (6)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
response(59-69)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
response(29-32)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/pause-order/pause-order.mjs (1)
response(29-35)components/picqer/actions/process-order/process-order.mjs (1)
response(24-27)
⏰ 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: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (10)
components/picqer/package.json (1)
3-3: LGTM!Version bump to 0.2.0 is appropriate for the addition of new action modules. Dependencies remain unchanged.
components/picqer/actions/pause-order/pause-order.mjs (1)
1-40: LGTM!The action is well-implemented with appropriate annotations and consistent structure. The
reasonprop being required is a good design choice for audit trail purposes.components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
1-41: LGTM!Clean implementation following established patterns. The mapping of
tagIdprop toidtagin the API payload is correctly handled.components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
1-31: LGTM!The action is well-structured with correct annotations (
readOnlyHint: truefor a GET operation). The implementation follows the established Pipedream action pattern consistently with other similar actions in this component (search-orders, get-order-tags), which all assume array responses for their summary messages.components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
1-37: LGTM!The action is well-structured and follows the established pattern. The status filter for "expected" orders in the
orderIdprop (line 22) correctly constrains the selection to orders that can be changed to concept status, aligning with the Picqer API requirements.components/picqer/picqer.app.mjs (3)
15-22: LGTM!Good enhancement to the
orderIdoptions. Addingparamssupport allows actions to filter orders by status (e.g., "expected", "concept"), which is used effectively in the new actions likechange-order-to-conceptandadd-product-to-order.
303-338: LGTM!The new
tagIdandproductIdpropDefinitions follow the established pattern with pagination support. The label formatting for products (${productcode} - ${name}) provides good user clarity.
492-573: LGTM!All new API methods follow a consistent pattern with
_makeRequestand correctly implement the Picqer API endpoints:
processOrder,pauseOrder,changeOrderToConcept: POST operations for order lifecyclecancelOrder: DELETE operationgetOrderTags,getOrderComments: GET operationsaddOrderTags,addProductToOrder: POST operationslistTags,listProducts: GET operations for propDefinition optionsThe methods align with the PR objectives from issue #19333.
components/picqer/actions/process-order/process-order.mjs (1)
1-32: LGTM!The action is well-implemented. The description appropriately notes that processing occurs asynchronously in the background after the response is received, which sets correct user expectations.
components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
16-26: LGTM!The
orderIdprop correctly filters to "concept" status, ensuring only editable orders are available for product addition, matching the constraint described in the action description.
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: 2
♻️ Duplicate comments (2)
components/picqer/actions/cancel-order/cancel-order.mjs (1)
29-47: Align summary message and return value with other actions.Two consistency issues:
- The summary message doesn't include the
orderId, unlike other actions in this PR (e.g.,change-order-to-conceptincludes it).- Returns a hardcoded
{ success: true }instead of the API response, which differs from the pattern used in other actions.Apply this diff to align with other actions:
+ const response = await app.cancelOrder({ - await app.cancelOrder({ $, orderId, params: { force, }, }); - $.export("$summary", "Successfully canceled order"); - return { - success: true, - }; + $.export("$summary", `Successfully canceled order ${orderId}`); + return response;components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
1-31: LGTM with one caveat.The action implementation follows the established Picqer action pattern correctly. The defensive check concern on line 29 was already flagged in a previous review.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (20)
components/picqer/actions/add-order-comment/add-order-comment.mjs(1 hunks)components/picqer/actions/add-order-tags/add-order-tags.mjs(1 hunks)components/picqer/actions/add-product-to-order/add-product-to-order.mjs(1 hunks)components/picqer/actions/add-return-comment/add-return-comment.mjs(1 hunks)components/picqer/actions/cancel-order/cancel-order.mjs(1 hunks)components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs(1 hunks)components/picqer/actions/create-order/create-order.mjs(1 hunks)components/picqer/actions/get-customer/get-customer.mjs(1 hunks)components/picqer/actions/get-order-comments/get-order-comments.mjs(1 hunks)components/picqer/actions/get-order-tags/get-order-tags.mjs(1 hunks)components/picqer/actions/get-order/get-order.mjs(1 hunks)components/picqer/actions/get-picklist/get-picklist.mjs(1 hunks)components/picqer/actions/get-status-per-order-line/get-status-per-order-line.mjs(1 hunks)components/picqer/actions/pause-order/pause-order.mjs(1 hunks)components/picqer/actions/process-order/process-order.mjs(1 hunks)components/picqer/actions/search-orders/search-orders.mjs(1 hunks)components/picqer/actions/update-order/update-order.mjs(1 hunks)components/picqer/package.json(1 hunks)components/picqer/picqer.app.mjs(3 hunks)components/picqer/sources/new-event-instant/new-event-instant.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 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/picqer/actions/add-product-to-order/add-product-to-order.mjs
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/picqer/sources/new-event-instant/new-event-instant.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 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`.
Applied to files:
components/picqer/actions/get-order-tags/get-order-tags.mjscomponents/picqer/actions/cancel-order/cancel-order.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/picqer/package.json
🧬 Code graph analysis (4)
components/picqer/actions/get-order-comments/get-order-comments.mjs (8)
components/picqer/actions/add-order-comment/add-order-comment.mjs (1)
response(42-50)components/picqer/actions/get-customer/get-customer.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/get-order/get-order.mjs (1)
response(24-27)components/picqer/actions/get-picklist/get-picklist.mjs (1)
response(24-27)components/picqer/actions/get-status-per-order-line/get-status-per-order-line.mjs (1)
response(25-28)components/picqer/actions/search-orders/search-orders.mjs (1)
response(92-107)components/picqer/actions/update-order/update-order.mjs (1)
response(314-356)
components/picqer/actions/add-product-to-order/add-product-to-order.mjs (5)
components/picqer/actions/add-order-comment/add-order-comment.mjs (1)
response(42-50)components/picqer/actions/create-order/create-order.mjs (1)
response(322-364)components/picqer/actions/get-customer/get-customer.mjs (1)
response(24-27)components/picqer/actions/get-order-tags/get-order-tags.mjs (1)
response(24-27)components/picqer/actions/update-order/update-order.mjs (1)
response(314-356)
components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (2)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/get-order/get-order.mjs (1)
response(24-27)
components/picqer/actions/get-order-tags/get-order-tags.mjs (4)
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
response(30-36)components/picqer/actions/create-order/create-order.mjs (1)
response(322-364)components/picqer/actions/get-order-comments/get-order-comments.mjs (1)
response(24-27)components/picqer/actions/get-order/get-order.mjs (1)
response(24-27)
⏰ 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: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (15)
components/picqer/actions/process-order/process-order.mjs (2)
1-32: All 7 action modules mentioned in the AI summary have been verified to exist in the PR: add-order-tags, add-product-to-order, cancel-order, change-order-to-concept, get-order-comments, get-order-tags, and pause-order. No action required.Likely an incorrect or invalid review comment.
8-12: ThedestructiveHint: falseannotation is correct. In the picqer component,destructiveHint: trueis reserved for operations that modify order fields (likeupdate-order), whiledestructiveHint: falseis appropriate for state-transition operations likeprocess-orderthat finalize orders without directly modifying their fields. The action appropriately reflects the distinction between field mutation and workflow progression.Likely an incorrect or invalid review comment.
components/picqer/actions/add-product-to-order/add-product-to-order.mjs (1)
58-69: LGTM! The implementation correctly relies on platform behavior.The data object includes optional fields directly without filtering undefined values. This is correct because Pipedream's axios implementation automatically excludes undefined values from HTTP requests.
Based on learnings, there's no need to manually check for truthiness before including properties in request payloads.
components/picqer/actions/change-order-to-concept/change-order-to-concept.mjs (1)
1-37: LGTM!The action follows the standard pattern correctly. The orderId is properly constrained to "expected" status, which makes sense for an operation that converts expected orders back to concept status. The summary message includes the order ID and the response is returned appropriately.
components/picqer/package.json (1)
3-3: LGTM!The version bump from 0.1.0 to 0.2.0 appropriately reflects the addition of new action components in this PR.
components/picqer/sources/new-event-instant/new-event-instant.mjs (1)
10-10: LGTM!The version bump from 0.0.1 to 0.0.2 is a routine update with no functional changes.
components/picqer/actions/get-customer/get-customer.mjs (1)
7-7: LGTM!The version bump from 0.0.2 to 0.0.3 is a routine update with no functional changes.
components/picqer/actions/get-picklist/get-picklist.mjs (1)
7-7: LGTM!The version bump from 0.0.2 to 0.0.3 is a routine update with no functional changes.
components/picqer/actions/add-order-tags/add-order-tags.mjs (1)
1-41: LGTM!The action follows the standard pattern correctly. Props are properly defined using propDefinitions, the run method cleanly invokes the app method with appropriate parameters, and the summary message includes the order ID. The response is returned appropriately.
components/picqer/actions/pause-order/pause-order.mjs (2)
1-39: Implementation looks good overall.The action follows the established Picqer action pattern. Annotations correctly indicate this is not read-only and not destructive (pausing is reversible). The API call structure is consistent with other actions.
22-26: No change needed —reasonis required by the Picqer API.The Picqer API documentation specifies that
reasonis a required parameter for the pause order endpoint. The current implementation correctly omitsoptional: true, ensuring users provide the required field.Likely an incorrect or invalid review comment.
components/picqer/picqer.app.mjs (4)
15-22: Nice enhancement toorderIdoptions.Adding the
paramsspread allows callers to pass additional filters when fetching order options, improving flexibility without breaking existing usage.
303-338: New propDefinitions look good.Both
tagIdandproductIdfollow the established pattern with proper pagination and label/value mapping. The product label format${productcode} - ${name}provides good user context.
492-573: New API methods are well-structured.All 10 new methods follow the established pattern consistently:
- Proper HTTP methods (POST for actions, DELETE for cancel, GET implicit for reads)
- Correct endpoint paths matching Picqer API documentation
- Consistent parameter destructuring with
{ orderId, ...opts }Coverage check against PR objectives:
- ✅ Process order:
processOrder(POST/orders/{orderId}/process)- ✅ Pause order:
pauseOrder(POST/orders/{orderId}/pause)- ✅ Change to concept:
changeOrderToConcept(POST/orders/{orderId}/change-to-concept)- ✅ Cancel order:
cancelOrder(DELETE/orders/{orderId})- ✅ Get order tags:
getOrderTags(GET/orders/{orderId}/tags)- ✅ Add order tags:
addOrderTags(POST/orders/{orderId}/tags)- ✅ Add product to order:
addProductToOrder(POST/orders/{orderId}/products)- ✅ Get order comments:
getOrderComments(GET/orders/{orderId}/comments)
519-527: Verify force cancel support.PR objectives mention a "Force cancel" endpoint:
DELETE /api/v1/orders/{idorder}?force=true. The currentcancelOrdermethod doesn't explicitly support theforcequery parameter. However, since...optsis spread, callers can passparams: { force: true }if needed.Consider documenting this capability or adding explicit support if force-cancel is a common use case.
WHY
Resolves #19333
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.