-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Fedex - new components #19385
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
Open
michelle0927
wants to merge
3
commits into
master
Choose a base branch
from
issue-19335
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fedex - new components #19385
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
components/fedex/actions/track-by-reference/track-by-reference.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import fedex from "../../fedex.app.mjs"; | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| key: "fedex-track-by-reference", | ||
| name: "Track by Reference", | ||
| description: "Tracks a package by reference number. [See the documentation](https://developer.fedex.com/api/en-us/catalog/track/v1/docs.html#operation/Track%20by%20References)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| fedex, | ||
| value: { | ||
| type: "string", | ||
| label: "Reference Value", | ||
| description: "The reference value to track", | ||
| }, | ||
| accountNumber: { | ||
| type: "string", | ||
| label: "Account Number", | ||
| description: "The shipper's account number. Either `accountNumber` or `destinationPostalCode` and `destinationCountryCode` must be provided.", | ||
| optional: true, | ||
| }, | ||
| destinationPostalCode: { | ||
| type: "string", | ||
| label: "Destination Postal Code", | ||
| description: "The postal code of the destination. Either `accountNumber` or `destinationPostalCode` and `destinationCountryCode` must be provided.", | ||
| optional: true, | ||
| }, | ||
| destinationCountryCode: { | ||
| type: "string", | ||
| label: "Destination Country Code", | ||
| description: "The country code of the destination. Either `accountNumber` or `destinationPostalCode` and `destinationCountryCode` must be provided.", | ||
| optional: true, | ||
| }, | ||
| shipDateBegin: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "shipDateBegin", | ||
| ], | ||
| }, | ||
| shipDateEnd: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "shipDateEnd", | ||
| ], | ||
| }, | ||
| includeDetailedScans: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "includeDetailedScans", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (!this.accountNumber && (!this.destinationPostalCode || !this.destinationCountryCode)) { | ||
| throw new ConfigurationError("Either `accountNumber` or `destinationPostalCode` and `destinationCountryCode` must be provided."); | ||
| } | ||
| const response = await this.fedex.trackByReference({ | ||
| $, | ||
| data: { | ||
| referencesInformation: { | ||
| value: this.value, | ||
| accountNumber: this.accountNumber, | ||
| destinationPostalCode: this.destinationPostalCode, | ||
| destinationCountryCode: this.destinationCountryCode, | ||
| shipDateBegin: this.shipDateBegin, | ||
| shipDateEnd: this.shipDateEnd, | ||
| }, | ||
| includeDetailedScans: this.includeDetailedScans, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Tracking information for ${this.value} retrieved successfully`); | ||
| return response; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import fedex from "../../fedex.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fedex-track-by-tcn", | ||
| name: "Track by TCN", | ||
| description: "Tracks a package by transportation control number. [See the documentation](https://developer.fedex.com/api/en-us/catalog/track/v1/docs.html#operation/f1f9080e8452d9ac903f562a2d2626d0)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| fedex, | ||
| value: { | ||
| type: "string", | ||
| label: "Transportation Control Number", | ||
| description: "The transportation control number to track", | ||
| }, | ||
| shipDateBegin: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "shipDateBegin", | ||
| ], | ||
| }, | ||
| shipDateEnd: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "shipDateEnd", | ||
| ], | ||
| }, | ||
| includeDetailedScans: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "includeDetailedScans", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.fedex.trackByTrackingControlNumber({ | ||
| $, | ||
| data: { | ||
| tcnInfo: { | ||
| value: this.value, | ||
| shipDateBegin: this.shipDateBegin, | ||
| shipDateEnd: this.shipDateEnd, | ||
| }, | ||
| includeDetailedScans: this.includeDetailedScans, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Tracking information for ${this.value} retrieved successfully`); | ||
| return response; | ||
| }, | ||
| }; |
46 changes: 46 additions & 0 deletions
46
components/fedex/actions/track-by-tracking-number/track-by-tracking-number.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import fedex from "../../fedex.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fedex-track-by-tracking-number", | ||
| name: "Track by Tracking Number", | ||
| description: "Tracks a package by tracking number. [See the documentation](https://developer.fedex.com/api/en-us/catalog/track/v1/docs.html#operation/Track%20by%20Tracking%20Number)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| fedex, | ||
| trackingNumber: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "trackingNumber", | ||
| ], | ||
| }, | ||
| includeDetailedScans: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "includeDetailedScans", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.fedex.trackByTrackingNumber({ | ||
| $, | ||
| data: { | ||
| trackingInfo: [ | ||
| { | ||
| trackingNumberInfo: { | ||
| trackingNumber: this.trackingNumber, | ||
| }, | ||
| }, | ||
| ], | ||
| includeDetailedScans: this.includeDetailedScans, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Tracking information for ${this.trackingNumber} retrieved successfully`); | ||
| return response; | ||
| }, | ||
| }; |
55 changes: 55 additions & 0 deletions
55
components/fedex/actions/track-multi-piece-shipment/track-multi-piece-shipment.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import fedex from "../../fedex.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fedex-track-multi-piece-shipment", | ||
| name: "Track Multi-Piece Shipment", | ||
| description: "Tracks a multi-piece shipment. [See the documentation](https://developer.fedex.com/api/en-us/catalog/track/v1/docs.html#operation/Track%20Multiple%20Piece%20Shipment)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| fedex, | ||
| associatedType: { | ||
| type: "string", | ||
| label: "Associated Type", | ||
| description: "The associated shipment type, such as MPS, Group MPS, or an outbound shipment which is linked to a return shipment", | ||
| options: [ | ||
| "OUTBOUND_LINK_TO_RETURN", | ||
| "STANDARD_MPS", | ||
| "GROUP_MPS", | ||
| ], | ||
| }, | ||
| trackingNumber: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "trackingNumber", | ||
| ], | ||
| }, | ||
| includeDetailedScans: { | ||
| propDefinition: [ | ||
| fedex, | ||
| "includeDetailedScans", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.fedex.trackMultiplePieceShipment({ | ||
| $, | ||
| data: { | ||
| associatedType: this.associatedType, | ||
| masterTrackingNumberInfo: { | ||
| trackingNumberInfo: { | ||
| trackingNumber: this.trackingNumber, | ||
| }, | ||
| }, | ||
| includeDetailedScans: this.includeDetailedScans, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Tracking information for ${this.trackingNumber} retrieved successfully`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.