-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New Components - easyship #16818
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?
New Components - easyship #16818
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update introduces a new Easyship integration, including a redesigned app definition with API methods, two actions (create and find shipment), and three instant event sources for webhooks (shipping label created, tracking status updated, warehouse state updated). It also adds a common webhook base module, test event data modules, and updates package metadata and dependencies. Legacy files were removed. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EasyshipAction
participant EasyshipApp
participant EasyshipAPI
User->>EasyshipAction: Trigger "Create Shipment"
EasyshipAction->>EasyshipApp: createShipment(payload)
EasyshipApp->>EasyshipAPI: POST /shipments
EasyshipAPI-->>EasyshipApp: Shipment created response
EasyshipApp-->>EasyshipAction: Return shipment data
EasyshipAction-->>User: Summary with shipment ID
User->>EasyshipAction: Trigger "Find Shipment"
EasyshipAction->>EasyshipApp: getShipment(shipmentId)
EasyshipApp->>EasyshipAPI: GET /shipments/{id}
EasyshipAPI-->>EasyshipApp: Shipment details
EasyshipApp-->>EasyshipAction: Return shipment details
EasyshipAction-->>User: Summary with shipment info
EasyshipAPI-->>EasyshipApp: Webhook event (e.g., shipment_label_created)
EasyshipApp->>WebhookSource: Forward event
WebhookSource->>WebhookSource: Process event and emit with metadata
Assessment against linked issues
Suggested labels
Suggested reviewers
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/easyship/actions/create-shipment/create-shipment.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/easyship/sources/common/base.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/easyship/easyship.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 Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ 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: 7
🧹 Nitpick comments (3)
components/easyship/easyship.app.mjs (1)
24-24
: Consider making API version configurable.The API version is hardcoded to "2023-01" which may become outdated over time. Consider making this configurable or adding a comment about version management strategy.
_baseUrl() { - return "https://public-api.easyship.com/2023-01"; + return `https://public-api.easyship.com/${this.$auth.api_version || "2023-01"}`; },components/easyship/sources/warehouse-state-updated/test-event.mjs (1)
1-10
: LGTM! Well-structured test event.The test event structure is comprehensive and follows standard webhook event patterns. The use of consistent test identifiers (ESTEST00000, #100001) across the integration is good practice.
Consider documenting the possible values for
warehouse_state
field to ensure test coverage.components/easyship/actions/create-shipment/create-shipment.mjs (1)
29-29
: Fix typo in descriptionMissing space in "originaddress".
Apply this diff:
- description: "The company or organization at the originaddress", + description: "The company or organization at the origin address",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (13)
components/easyship/.gitignore
(0 hunks)components/easyship/actions/create-shipment/create-shipment.mjs
(1 hunks)components/easyship/actions/find-shipment/find-shipment.mjs
(1 hunks)components/easyship/app/easyship.app.ts
(0 hunks)components/easyship/easyship.app.mjs
(1 hunks)components/easyship/package.json
(1 hunks)components/easyship/sources/common/base.mjs
(1 hunks)components/easyship/sources/new-shipping-label-created/new-shipping-label-created.mjs
(1 hunks)components/easyship/sources/new-shipping-label-created/test-event.mjs
(1 hunks)components/easyship/sources/tracking-status-updated/test-event.mjs
(1 hunks)components/easyship/sources/tracking-status-updated/tracking-status-updated.mjs
(1 hunks)components/easyship/sources/warehouse-state-updated/test-event.mjs
(1 hunks)components/easyship/sources/warehouse-state-updated/warehouse-state-updated.mjs
(1 hunks)
💤 Files with no reviewable changes (2)
- components/easyship/.gitignore
- components/easyship/app/easyship.app.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (10)
components/easyship/easyship.app.mjs (1)
11-19
:✅ Verification successful
Verify shipmentId property mapping.
Ensure that
shipment.easyship_shipment_id
is the correct field name returned by the Easyship API for shipment IDs.
🏁 Script executed:
#!/bin/bash # Description: Verify the shipmentId field mapping in other Easyship integration files # Expected: Find usage of easyship_shipment_id to confirm the field name rg -A 3 -B 3 "easyship_shipment_id" --type js --type tsLength of output: 55
🏁 Script executed:
#!/bin/bash # Broad search for `easyship_shipment_id` across all file types rg -n "easyship_shipment_id" . # Locate the implementation of `listShipments` to inspect the API response mapping rg -n "listShipments" -n .Length of output: 1256
Shipment ID mapping confirmed
Verified that
easyship_shipment_id
is the correct field name returned by the Easyship API (used in test fixtures, thecreate-shipment
action summary, and directly exposed bylistShipments
). No changes required.components/easyship/package.json (1)
3-17
: LGTM! Package configuration properly updated.The package configuration changes are well-structured:
- Appropriate version bump to 0.1.0 for new features
- Correct main entry point update
- Proper dependency declaration for @pipedream/platform
- Clean removal of dist-related configuration
components/easyship/sources/tracking-status-updated/test-event.mjs (1)
1-15
: LGTM! Comprehensive test event structure.The test event provides excellent coverage of tracking status fields including origin/destination, status, tracking number, and tracking URL. The consistent use of test identifiers across all test events in this integration is well-planned.
components/easyship/sources/new-shipping-label-created/new-shipping-label-created.mjs (1)
1-19
: LGTM! Clean and consistent implementation.The source component follows the established pattern correctly:
- Proper imports and base extension
- Consistent naming convention for the key
- Appropriate metadata (version, type, dedupe strategy)
- Clean method override for event type specification
The implementation is minimal and focused, which is appropriate for a webhook source component.
components/easyship/sources/tracking-status-updated/tracking-status-updated.mjs (1)
1-19
: LGTM! Excellent consistency with other source components.This component maintains the same clean structure as the shipping label source:
- Consistent import pattern and base extension
- Logical key naming following the established convention
- Appropriate event type specification for tracking status changes
- Proper use of sampleEmit for testing purposes
The consistency across source components will make the codebase easier to maintain.
components/easyship/sources/new-shipping-label-created/test-event.mjs (1)
1-13
:✅ Verification successful
Verify event type format consistency.
The test event structure is comprehensive and realistic. However, there's a potential discrepancy in event type formats:
- Test event uses:
"shipment.label.created"
(with dots)- Source component returns:
"shipment_label_created"
(with underscores)Please verify this is intentional and represents the correct mapping between Easyship's webhook payload format and Pipedream's internal event type handling.
🏁 Script executed:
#!/bin/bash # Description: Check if other source components have similar event type format differences # Expected: Find pattern of dot vs underscore usage in event types echo "Checking event types in source components:" rg -A 2 -B 2 "getEventType|event_type" --type js echo -e "\nChecking for similar patterns in other integrations:" fd -e mjs -e js | xargs rg -l "event_type.*\." | head -5Length of output: 553
🏁 Script executed:
#!/bin/bash # Search for getEventType implementation in the Easyship integration rg -n "getEventType" | grep -i components/easyshipLength of output: 448
🏁 Script executed:
#!/bin/bash echo "Inspecting getEventType in new-shipping-label-created source:" rg -C3 "getEventType" components/easyship/sources/new-shipping-label-created/new-shipping-label-created.mjs echo -e "\nInspecting base.mjs around this.getEventType usage:" rg -C3 "this.getEventType" components/easyship/sources/common/base.mjsLength of output: 726
🏁 Script executed:
#!/bin/bash echo "Checking event_type in easyship test-event files:" fd -e mjs components/easyship/sources -g "test-event.mjs" | while read f; do echo "$f:" rg -n '"event_type"' "$f" doneLength of output: 277
🏁 Script executed:
#!/bin/bash echo "Finding all test-event.mjs files and their event_type fields:" fd -g 'test-event.mjs' -e mjs | while read f; do echo "File: $f" rg -n '"event_type"' "$f" doneLength of output: 91872
Event type formats are correct: external vs internal
The test event’s
event_type: "shipment.label.created"
reflects the actual Easyship webhook payload format (dot-delimited), whereasgetEventType()
returns"shipment_label_created"
(underscore-delimited) for Pipedream’s internal subscription. This separation between external payload format and internal event naming is intentional and consistent with other integrations—no changes required.components/easyship/sources/warehouse-state-updated/warehouse-state-updated.mjs (1)
1-19
: LGTM! Perfect consistency maintained across all source components.This component completes the set of Easyship source components with the same excellent pattern:
- Consistent structure and imports
- Logical key and event type naming
- Proper extension of common base functionality
- Clean and minimal implementation
The consistency across all three source components (shipping label, tracking status, warehouse state) demonstrates good architectural planning and will facilitate easy maintenance and future extensions.
components/easyship/sources/common/base.mjs (1)
58-64
: Good webhook response patternExcellent implementation of the webhook pattern - responding immediately with 200 status before processing the event data. This prevents webhook timeouts and ensures reliable delivery.
components/easyship/actions/find-shipment/find-shipment.mjs (1)
1-26
: Well-implemented actionClean and straightforward implementation following Pipedream best practices. Good use of propDefinition and proper summary export.
components/easyship/actions/create-shipment/create-shipment.mjs (1)
110-158
: Excellent dynamic property implementationWell-designed dynamic property generation based on the number of parcels. The async loading of category options is properly implemented.
components/easyship/actions/create-shipment/create-shipment.mjs
Outdated
Show resolved
Hide resolved
components/easyship/actions/create-shipment/create-shipment.mjs
Outdated
Show resolved
Hide resolved
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 @michelle0927, LGTM! Ready for QA!
Resolves #13239
Summary by CodeRabbit
New Features
Chores