Skip to content

Commit 635194a

Browse files
authored
[ACTIONS] Returnless - new components (#19377)
1 parent 3f73239 commit 635194a

File tree

21 files changed

+570
-12
lines changed

21 files changed

+570
-12
lines changed

components/returnless/actions/create-return-order/create-return-order.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "returnless-create-return-order",
77
name: "Create Return Order",
88
description: "Create a return order. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/1fce50b07484b-creates-a-return-order-from-a-return-order-intent)",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

components/returnless/actions/list-return-orders/list-return-orders.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "returnless-list-return-orders",
55
name: "List Return Orders",
66
description: "Retrieve a list of return orders. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/0640e3c064cdc-list-all-return-orders)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
@@ -25,13 +25,13 @@ export default {
2525
createdAfter: {
2626
type: "string",
2727
label: "Created After",
28-
description: "Only return return-orders that were created after the given date",
28+
description: "Only return return-orders that were created after the given date. Example: `2025-01-01T00:00:00+00:00`",
2929
optional: true,
3030
},
3131
createdBefore: {
3232
type: "string",
3333
label: "Created Before",
34-
description: "Only return return-orders that were created before the given date",
34+
description: "Only return return-orders that were created before the given date. Example: `2025-01-10T00:00:00+00:00`",
3535
optional: true,
3636
},
3737
maxResults: {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import app from "../../returnless.app.mjs";
2+
3+
export default {
4+
key: "returnless-list-return-statuses",
5+
name: "List Return Statuses",
6+
description: "List all return statuses. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/6129c8f41f66f-list-all-return-statuses)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
},
17+
async run({ $ }) {
18+
const response = await this.app.listReturnStatuses({
19+
$,
20+
});
21+
22+
$.export("$summary", `Successfully retrieved ${response?.data?.length} return status(es)`);
23+
return response?.data;
24+
},
25+
};

components/returnless/actions/list-sales-order-items/list-sales-order-items.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "returnless-list-sales-order-items",
55
name: "List Sales Order Items",
66
description: "Retrieve all items from a specific sales order with cursor-based pagination support. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/6b3c26dad0434-list-all-items-of-a-sales-order)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/returnless/actions/list-sales-orders/list-sales-orders.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "returnless-list-sales-orders",
55
name: "List Sales Orders",
66
description: "Retrieve a list of sales orders sorted by creation date, with the most recent sales orders appearing first. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/ce6a0e3d66378-list-all-sales-orders)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import app from "../../returnless.app.mjs";
2+
3+
export default {
4+
key: "returnless-list-shipments-of-return-order",
5+
name: "List Shipments of Return Order",
6+
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)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
returnOrderId: {
17+
propDefinition: [
18+
app,
19+
"returnOrderId",
20+
],
21+
},
22+
maxResults: {
23+
propDefinition: [
24+
app,
25+
"maxResults",
26+
],
27+
},
28+
},
29+
async run({ $ }) {
30+
const resources = await this.app.getPaginatedResources({
31+
fn: this.app.listReturnOrderShipments,
32+
args: {
33+
returnOrderId: this.returnOrderId,
34+
},
35+
max: this.maxResults,
36+
});
37+
38+
$.export("$summary", `Successfully retrieved ${resources.length} shipment(s) for return order ${this.returnOrderId}`);
39+
return resources;
40+
},
41+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import app from "../../returnless.app.mjs";
2+
3+
export default {
4+
key: "returnless-list-shipments",
5+
name: "List Shipments",
6+
description: "List all shipments. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/7daf3fa2c9bf9-list-all-shipments)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
maxResults: {
17+
propDefinition: [
18+
app,
19+
"maxResults",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const resources = await this.app.getPaginatedResources({
25+
fn: this.app.listShipments,
26+
max: this.maxResults,
27+
});
28+
29+
$.export("$summary", `Successfully retrieved ${resources.length} shipment(s)`);
30+
return resources;
31+
},
32+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import app from "../../returnless.app.mjs";
2+
3+
export default {
4+
key: "returnless-list-statuses-of-shipment",
5+
name: "List Statuses of Shipment",
6+
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)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
shipmentId: {
17+
propDefinition: [
18+
app,
19+
"shipmentId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const { data } = await this.app.listShipmentStatuses({
25+
$,
26+
shipmentId: this.shipmentId,
27+
});
28+
29+
$.export("$summary", `Successfully retrieved ${data.length} status(es) for shipment ${this.shipmentId}`);
30+
return data;
31+
},
32+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import app from "../../returnless.app.mjs";
2+
3+
export default {
4+
key: "returnless-retrieve-return-address",
5+
name: "Retrieve Return Address",
6+
description: "Retrieve a return address. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/b702161eed54f-retrieve-a-return-address)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
returnAddressId: {
17+
propDefinition: [
18+
app,
19+
"returnAddressId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const { data } = await this.app.getReturnAddress({
25+
$,
26+
returnAddressId: this.returnAddressId,
27+
});
28+
29+
$.export("$summary", `Successfully retrieved return address ${this.returnAddressId}`);
30+
return data;
31+
},
32+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import app from "../../returnless.app.mjs";
2+
3+
export default {
4+
key: "returnless-retrieve-return-order",
5+
name: "Retrieve Return Order",
6+
description: "Retrieve a return order. [See the documentation](https://docs.returnless.com/docs/api-rest-reference/f670282943eae-retrieve-a-return-order)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
returnOrderId: {
17+
propDefinition: [
18+
app,
19+
"returnOrderId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const { data } = await this.app.getReturnOrder({
25+
$,
26+
returnOrderId: this.returnOrderId,
27+
});
28+
29+
$.export("$summary", `Successfully retrieved return order ${this.returnOrderId}`);
30+
return data;
31+
},
32+
};

0 commit comments

Comments
 (0)