Skip to content

Commit 77c2091

Browse files
authored
Merging pull request #17797
* new components * pnpm-lock.yaml * versions * updates
1 parent 494f4c6 commit 77c2091

File tree

65 files changed

+646
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+646
-56
lines changed

components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
1111
export default {
1212
...others,
1313
key: "shopify_developer_app-add-product-to-custom-collection",
14-
version: "0.0.8",
14+
version: "0.0.9",
1515
name,
1616
description,
1717
type,

components/shopify_developer_app/actions/add-tags/add-tags.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
1111
export default {
1212
...others,
1313
key: "shopify_developer_app-add-tags",
14-
version: "0.0.8",
14+
version: "0.0.9",
1515
name,
1616
description,
1717
type,

components/shopify_developer_app/actions/create-article/create-article.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
1111
export default {
1212
...others,
1313
key: "shopify_developer_app-create-article",
14-
version: "0.0.10",
14+
version: "0.0.11",
1515
name,
1616
description,
1717
type,

components/shopify_developer_app/actions/create-blog/create-blog.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
1111
export default {
1212
...others,
1313
key: "shopify_developer_app-create-blog",
14-
version: "0.0.10",
14+
version: "0.0.11",
1515
name,
1616
description,
1717
type,

components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
1111
export default {
1212
...others,
1313
key: "shopify_developer_app-create-custom-collection",
14-
version: "0.0.8",
14+
version: "0.0.9",
1515
name,
1616
description,
1717
type,

components/shopify_developer_app/actions/create-customer/create-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "shopify_developer_app-create-customer",
55
name: "Create Customer",
66
description: "Create a new customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customercreate)",
7-
version: "0.0.8",
7+
version: "0.0.9",
88
type: "action",
99
props: {
1010
shopify,
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import shopify from "../../shopify_developer_app.app.mjs";
2+
3+
export default {
4+
key: "shopify_developer_app-create-fulfillment",
5+
name: "Create Fulfillment",
6+
description: "Create a fulfillment. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/fulfillmentcreate)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
shopify,
11+
fulfillmentOrderId: {
12+
propDefinition: [
13+
shopify,
14+
"fulfillmentOrderId",
15+
],
16+
},
17+
fulfillmentOrderLineItemIds: {
18+
propDefinition: [
19+
shopify,
20+
"fulfillmentOrderLineItemIds",
21+
(c) => ({
22+
fulfillmentOrderId: c.fulfillmentOrderId,
23+
}),
24+
],
25+
reloadProps: true,
26+
},
27+
notifyCustomer: {
28+
type: "boolean",
29+
label: "Notify Customer",
30+
description: "Whether to notify the customer",
31+
optional: true,
32+
},
33+
message: {
34+
type: "string",
35+
label: "Message",
36+
description: "An optional message for the fulfillment request.",
37+
optional: true,
38+
},
39+
},
40+
async additionalProps() {
41+
const props = {};
42+
if (!this.fulfillmentOrderLineItemIds) {
43+
return props;
44+
}
45+
46+
for (const id of this.fulfillmentOrderLineItemIds) {
47+
props[`quantity_${id}`] = {
48+
type: "integer",
49+
label: `Quantity for Line Item - ${id}`,
50+
description: "The quantity of the line item to fulfill",
51+
};
52+
}
53+
return props;
54+
},
55+
async run({ $ }) {
56+
const fulfillment = await this.shopify.createFulfillment({
57+
fulfillment: {
58+
lineItemsByFulfillmentOrder: [
59+
{
60+
fulfillmentOrderId: this.fulfillmentOrderId,
61+
fulfillmentOrderLineItems: this.fulfillmentOrderLineItemIds.map((id) => ({
62+
id,
63+
quantity: this[`quantity_${id}`],
64+
})),
65+
},
66+
],
67+
notifyCustomer: this.notifyCustomer,
68+
},
69+
message: this.message,
70+
});
71+
if (fulfillment.fulfillmentCreate.userErrors.length > 0) {
72+
throw new Error(fulfillment.fulfillmentCreate.userErrors[0].message);
73+
}
74+
$.export("$summary", `Created fulfillment with ID: ${fulfillment.fulfillmentCreate.fulfillment.id}`);
75+
return fulfillment;
76+
},
77+
};

components/shopify_developer_app/actions/create-metafield/create-metafield.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const {
1010
export default {
1111
...others,
1212
key: "shopify_developer_app-create-metafield",
13-
version: "0.0.9",
13+
version: "0.0.10",
1414
name,
1515
description,
1616
type,

components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
1111
export default {
1212
...others,
1313
key: "shopify_developer_app-create-metaobject",
14-
version: "0.0.10",
14+
version: "0.0.11",
1515
name,
1616
description,
1717
type,

components/shopify_developer_app/actions/create-order/create-order.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "shopify_developer_app-create-order",
66
name: "Create Order",
77
description: "Creates a new order. For full order object details [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/ordercreate)",
8-
version: "0.0.8",
8+
version: "0.0.9",
99
type: "action",
1010
props: {
1111
shopify,

0 commit comments

Comments
 (0)