-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - returnless #17629
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
New Components - returnless #17629
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe changes introduce a comprehensive Returnless app integration, including API methods, dynamic property definitions, utility functions, and several new action and source components. These cover creating and updating return orders, listing sales and return orders, and emitting events for return-related webhook triggers, with robust support for pagination and dynamic options. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action
participant ReturnlessApp
participant ReturnlessAPI
User->>Action: Trigger Create Return Order
Action->>ReturnlessApp: getOrder(orderId)
ReturnlessApp->>ReturnlessAPI: GET /orders/{orderId}
ReturnlessAPI-->>ReturnlessApp: Order details
ReturnlessApp-->>Action: Order details
Action->>ReturnlessApp: createReturnOrderIntent(formId, locale, input, orderNumber)
ReturnlessApp->>ReturnlessAPI: POST /return_order_intents
ReturnlessAPI-->>ReturnlessApp: Intent ID
Action->>ReturnlessApp: createReturnOrder(intentId, customer, items, metadata)
ReturnlessApp->>ReturnlessAPI: POST /return_orders
ReturnlessAPI-->>ReturnlessApp: Return order data
ReturnlessApp-->>Action: Return order data
Action-->>User: Return order summary
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Suggested labels
Poem
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
components/returnless/actions/create-return-order/create-return-order.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/returnless/returnless.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningscomponents/returnless/returnless.app.mjs (4)⏰ 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)
🔇 Additional comments (8)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
🧹 Nitpick comments (5)
components/returnless/package.json (1)
14-17: Minor metadata gaps and dependency-range consideration
- A
licensefield is customary for all published packages.- Consider pinning to the latest exact
@pipedream/platformminor ("3.1.x") or adding an upper bound (<4) to avoid an unexpected v4 breaking change.- Ensure the lockfile (
package-lock.json/pnpm-lock.yaml) is committed afternpm install, so CI reproducibility isn’t affected.Optional diff to add license:
@@ "keywords": [ "pipedream", "returnless" ], + "license": "MIT",components/returnless/common/utils.mjs (1)
1-27: Consider adding circular reference protection.The recursive nature of this function could cause infinite loops or stack overflow with circular references. Consider adding a
WeakSetto track visited objects.Here's a safer implementation:
-export const parseObject = (obj) => { +export const parseObject = (obj, visited = new WeakSet()) => { if (!obj) { return undefined; } if (typeof obj === "string") { try { return JSON.parse(obj); } catch (e) { return obj; } } if (Array.isArray(obj)) { - return obj.map(parseObject); + return obj.map(item => parseObject(item, visited)); } if (typeof obj === "object") { + if (visited.has(obj)) { + return obj; // Return the object as-is to avoid infinite recursion + } + visited.add(obj); return Object.fromEntries( Object.entries(obj).map(([ key, value, ]) => [ key, - parseObject(value), + parseObject(value, visited), ]), ); } return obj; };components/returnless/actions/create-return-order/create-return-order.mjs (1)
108-146: Consider adding error handling for sequential API calls.The
run()method makes multiple sequential API calls without explicit error handling. While Pipedream will catch errors, adding specific error handling could provide better user feedback.Consider adding specific error handling for better user experience:
async run({ $ }) { + try { const { data: order } = await this.returnless.getOrder({ $, orderId: this.orderId, }); const { data: intent } = await this.returnless.createReturnOrderIntent({ $, data: { form_id: this.formId, locale: this.locale, input: this.input, order_number: order.order_number, }, }); const { data: returnOrder } = await this.returnless.createReturnOrder({ $, data: { return_order_intent_id: intent.id, // ... rest of the data }, }); $.export("$summary", `Return order created: ${returnOrder.id}`); return returnOrder; + } catch (error) { + throw new Error(`Failed to create return order: ${error.message}`); + } }components/returnless/returnless.app.mjs (2)
20-25: Remove redundant|| []after map operations.The
|| []fallback is unnecessary since.map()always returns an array, even when called on an empty array.- })) || [], + })),Also applies to: 44-50, 69-75, 95-100, 123-123, 143-148
107-128: Consider adding labels to item options for better UX.Currently, the item IDs are displayed without any descriptive labels, which makes it difficult for users to identify which items they're selecting. Consider including item names or SKUs in the options.
- options: data.map(({ id }) => id) || [], + options: data.map(({ + id: value, + name, + sku + }) => ({ + value, + label: name || sku || value, + })) || [],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
components/returnless/actions/create-return-order/create-return-order.mjs(1 hunks)components/returnless/actions/list-return-orders/list-return-orders.mjs(1 hunks)components/returnless/actions/list-sales-orders/list-sales-orders.mjs(1 hunks)components/returnless/actions/update-return-order-status/update-return-order-status.mjs(1 hunks)components/returnless/common/utils.mjs(1 hunks)components/returnless/package.json(2 hunks)components/returnless/returnless.app.mjs(1 hunks)components/returnless/sources/common/base.mjs(1 hunks)components/returnless/sources/new-return-created/new-return-created.mjs(1 hunks)components/returnless/sources/return-notes-added/return-notes-added.mjs(1 hunks)components/returnless/sources/return-product-marked-received/return-product-marked-received.mjs(1 hunks)components/returnless/sources/return-status-changed/return-status-changed.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
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.
components/returnless/package.json (2)
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.
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: "dir" props in Pipedream components are hidden in the component form and not user-facing, so they don't require labels or descriptions for user clarity.
components/returnless/actions/update-return-order-status/update-return-order-status.mjs (2)
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/returnless/actions/list-return-orders/list-return-orders.mjs (2)
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/returnless/sources/return-notes-added/return-notes-added.mjs (4)
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-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/returnless/sources/return-product-marked-received/return-product-marked-received.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#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.
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.
components/returnless/actions/list-sales-orders/list-sales-orders.mjs (4)
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`.
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#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.
components/returnless/actions/create-return-order/create-return-order.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/returnless/sources/common/base.mjs (4)
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.
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/returnless/sources/return-status-changed/return-status-changed.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#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.
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.
components/returnless/returnless.app.mjs (4)
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.
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/returnless/sources/new-return-created/new-return-created.mjs (4)
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-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.
⏰ 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: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
🔇 Additional comments (14)
components/returnless/package.json (1)
3-3: Semantic-version bump looks correctMoving from
0.0.1→0.1.0matches SemVer semantics for the introduction of new functionality without breaking changes. No concerns here.components/returnless/actions/update-return-order-status/update-return-order-status.mjs (1)
1-36: LGTM! Clean action implementation.The action follows standard Pipedream patterns with proper use of propDefinitions and error handling. The implementation correctly calls the app's API method and returns the expected data structure.
components/returnless/actions/list-return-orders/list-return-orders.mjs (1)
1-63: LGTM! Well-implemented list action with proper filtering.The action follows excellent practices with comprehensive filtering options, proper pagination handling, and correctly formatted summary messages with pluralization logic. The date filtering structure using
gtandltparameters is appropriate for the API.components/returnless/sources/return-notes-added/return-notes-added.mjs (1)
1-22: LGTM! Proper webhook source implementation.The source follows established patterns by extending the common base and implementing the required
getEvents()andgetSummary()methods. The event type and summary message are appropriate for return notes functionality.components/returnless/sources/return-product-marked-received/return-product-marked-received.mjs (1)
1-22: LGTM! Consistent webhook source implementation.The source maintains consistency with other webhook sources by extending the common base and implementing the required methods. The event type and summary message are appropriate for the return product marked received functionality.
components/returnless/sources/return-status-changed/return-status-changed.mjs (1)
1-22: LGTM! Clean webhook source implementation.The implementation correctly extends the common base and properly implements the required abstract methods. The event name format and summary generation look appropriate.
components/returnless/sources/new-return-created/new-return-created.mjs (1)
1-22: LGTM! Consistent webhook source implementation.The implementation follows the same clean pattern as other webhook sources, properly extends the base class, and correctly implements the abstract methods. The "New" prefix is appropriate for this event type.
components/returnless/actions/list-sales-orders/list-sales-orders.mjs (1)
18-31: LGTM! Well-implemented pagination and summary.The action correctly uses the
getPaginatedResourcesmethod and properly handles the summary export with pluralization. The implementation follows established patterns for list actions.components/returnless/sources/common/base.mjs (3)
53-58: LGTM! Correct abstract method pattern.The implementation correctly uses
ConfigurationErrorfor abstract methods that must be implemented by subclasses. This matches the established pattern for base classes in the codebase.
18-37: LGTM! Proper webhook lifecycle management.The activation and deactivation hooks correctly handle webhook creation and deletion, with proper storage of the webhook ID in the database for cleanup.
60-71: LGTM! Appropriate event emission pattern.The run method properly handles HTTP responses, validates the request body, and emits events with generated metadata. The early return for missing data is a good defensive programming practice.
components/returnless/returnless.app.mjs (3)
1-2: LGTM!The axios import from Pipedream platform is correct and follows standard conventions.
163-269: Well-structured API methods implementation.The API methods follow consistent patterns with proper parameter extraction, authentication headers, and appropriate HTTP methods for each operation.
270-297: Confirm Returnless API pagination response formatThe
paginatehelper (and theoptionsmethods forlistReturnOrders/listSalesOrders) assumes each response is an object with{ data: Array, meta: { next_cursor: string } }We couldn’t find tests, fixtures, or docs in the repo to verify this. Please ensure the Returnless API actually returns both a
dataarray and ameta.next_cursorfield—otherwise you’ll need to adjustpaginateor unwrap the response differently.• components/returnless/returnless.app.mjs
–listReturnOrders(opts)
–listSalesOrders(opts)
–async *paginate({ fn, args, max })
components/returnless/actions/create-return-order/create-return-order.mjs
Show resolved
Hide resolved
|
/approve |
Resolves #17435
Summary by CodeRabbit
New Features
Chores