-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[ACTIONS] Returnless - new components #19377
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
jcortes
wants to merge
2
commits into
master
Choose a base branch
from
returnless-new-components
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
Changes from all commits
Commits
Show all changes
2 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
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
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
32 changes: 32 additions & 0 deletions
32
components/returnless/actions/list-return-statuses/list-return-statuses.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,32 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-list-return-statuses", | ||
| name: "List Return Statuses", | ||
| description: "List all return statuses. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/6129c8f41f66f-list-all-return-statuses)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| app, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const resources = await this.app.listReturnStatuses({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${resources.length} return status(es)`); | ||
| return resources.data; | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
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
42 changes: 42 additions & 0 deletions
42
...ents/returnless/actions/list-shipments-of-return-order/list-shipments-of-return-order.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,42 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-list-shipments-of-return-order", | ||
| name: "List Shipments of Return Order", | ||
| description: "List all shipments of a return order. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/1e0748fdd876f-list-all-shipments-of-a-return-order)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| returnOrderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "returnOrderId", | ||
| ], | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| app, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const resources = await this.app.getPaginatedResources({ | ||
| fn: this.app.listReturnOrderShipments, | ||
| args: { | ||
| returnOrderId: this.returnOrderId, | ||
| }, | ||
| max: this.maxResults, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${resources.length} shipment(s) for return order ${this.returnOrderId}`); | ||
| return resources; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/list-shipments/list-shipments.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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-list-shipments", | ||
| name: "List Shipments", | ||
| description: "List all shipments. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/7daf3fa2c9bf9-list-all-shipments)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| app, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const resources = await this.app.getPaginatedResources({ | ||
| fn: this.app.listShipments, | ||
| max: this.maxResults, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${resources.length} shipment(s)`); | ||
| return resources; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/list-statuses-of-shipment/list-statuses-of-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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-list-statuses-of-shipment", | ||
| name: "List Statuses of Shipment", | ||
| description: "List all statuses of a shipment. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/e274dab430bb7-list-all-statuses-of-a-shipment)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| shipmentId: { | ||
| propDefinition: [ | ||
| app, | ||
| "shipmentId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { data } = await this.app.listShipmentStatuses({ | ||
| $, | ||
| shipmentId: this.shipmentId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${data.length} status(es) for shipment ${this.shipmentId}`); | ||
| return data; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/retrieve-return-address/retrieve-return-address.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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-retrieve-return-address", | ||
| name: "Retrieve Return Address", | ||
| description: "Retrieve a return address. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/b702161eed54f-retrieve-a-return-address)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| returnAddressId: { | ||
| propDefinition: [ | ||
| app, | ||
| "returnAddressId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { data } = await this.app.getReturnAddress({ | ||
| $, | ||
| returnAddressId: this.returnAddressId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved return address ${this.returnAddressId}`); | ||
| return data; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/retrieve-return-order/retrieve-return-order.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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-retrieve-return-order", | ||
| name: "Retrieve Return Order", | ||
| description: "Retrieve a return order. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/f670282943eae-retrieve-a-return-order)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| returnOrderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "returnOrderId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { data } = await this.app.getReturnOrder({ | ||
| $, | ||
| returnOrderId: this.returnOrderId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved return order ${this.returnOrderId}`); | ||
| return data; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/retrieve-return-status/retrieve-return-status.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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-retrieve-return-status", | ||
| name: "Retrieve Return Status", | ||
| description: "Retrieve a return status. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/ba30f75e2c5fd-retrieve-a-return-status)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| returnStatusId: { | ||
| propDefinition: [ | ||
| app, | ||
| "returnStatusId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { data } = await this.app.getReturnStatus({ | ||
| $, | ||
| returnStatusId: this.returnStatusId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved return status ${this.returnStatusId}`); | ||
| return data; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/retrieve-sales-order/retrieve-sales-order.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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-retrieve-sales-order", | ||
| name: "Retrieve Sales Order", | ||
| description: "Retrieve a sales order. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/4a6a8fe812c44-retrieve-a-sales-order)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { data } = await this.app.getOrder({ | ||
| $, | ||
| orderId: this.orderId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved sales order ${this.orderId}`); | ||
| return data; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/returnless/actions/retrieve-shipment/retrieve-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,33 @@ | ||
| import app from "../../returnless.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "returnless-retrieve-shipment", | ||
| name: "Retrieve Shipment", | ||
| description: "Retrieve a shipment. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/8add0ab769032-retrieve-a-shipment)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| idempotentHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| shipmentId: { | ||
| propDefinition: [ | ||
| app, | ||
| "shipmentId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { data } = await this.app.getShipment({ | ||
| $, | ||
| shipmentId: this.shipmentId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved shipment ${this.shipmentId}`); | ||
| return data; | ||
| }, | ||
| }; |
Oops, something went wrong.
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.
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.
Are the
idempotentHintannotations meant to be included?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.
I'll remove it