@pipedream/shopify_developer_app 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +1 -1
  2. package/actions/add-tags/add-tags.mjs +1 -1
  3. package/actions/create-article/create-article.mjs +1 -1
  4. package/actions/create-blog/create-blog.mjs +1 -1
  5. package/actions/create-custom-collection/create-custom-collection.mjs +1 -1
  6. package/actions/create-customer/create-customer.mjs +6 -1
  7. package/actions/create-fulfillment/create-fulfillment.mjs +82 -0
  8. package/actions/create-metafield/create-metafield.mjs +1 -1
  9. package/actions/create-metaobject/create-metaobject.mjs +1 -1
  10. package/actions/create-order/create-order.mjs +7 -2
  11. package/actions/create-page/create-page.mjs +1 -1
  12. package/actions/create-product/create-product.mjs +1 -1
  13. package/actions/create-product-variant/create-product-variant.mjs +1 -1
  14. package/actions/create-smart-collection/create-smart-collection.mjs +1 -1
  15. package/actions/delete-article/delete-article.mjs +1 -1
  16. package/actions/delete-blog/delete-blog.mjs +1 -1
  17. package/actions/delete-metafield/delete-metafield.mjs +1 -1
  18. package/actions/delete-page/delete-page.mjs +1 -1
  19. package/actions/get-articles/get-articles.mjs +1 -1
  20. package/actions/get-metafields/get-metafields.mjs +1 -1
  21. package/actions/get-metaobjects/get-metaobjects.mjs +1 -1
  22. package/actions/get-order/get-order.mjs +7 -2
  23. package/actions/get-pages/get-pages.mjs +1 -1
  24. package/actions/refund-order/refund-order.mjs +105 -0
  25. package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +1 -1
  26. package/actions/search-customers/search-customers.mjs +6 -1
  27. package/actions/search-fulfillment-orders/search-fulfillment-orders.mjs +45 -0
  28. package/actions/search-orders/search-orders.mjs +6 -1
  29. package/actions/search-product-variant/search-product-variant.mjs +1 -1
  30. package/actions/search-products/search-products.mjs +1 -1
  31. package/actions/update-article/update-article.mjs +1 -1
  32. package/actions/update-customer/update-customer.mjs +6 -1
  33. package/actions/update-fulfillment-tracking-info/update-fulfillment-tracking-info.mjs +73 -0
  34. package/actions/update-inventory-level/update-inventory-level.mjs +1 -1
  35. package/actions/update-metafield/update-metafield.mjs +1 -1
  36. package/actions/update-metaobject/update-metaobject.mjs +1 -1
  37. package/actions/update-page/update-page.mjs +1 -1
  38. package/actions/update-product/update-product.mjs +6 -1
  39. package/actions/update-product-variant/update-product-variant.mjs +1 -1
  40. package/common/mutations.mjs +88 -0
  41. package/common/queries.mjs +47 -0
  42. package/package.json +2 -2
  43. package/shopify_developer_app.app.mjs +72 -1
  44. package/sources/cart-updated/cart-updated.mjs +25 -0
  45. package/sources/draft-order-updated/draft-order-updated.mjs +26 -0
  46. package/sources/draft-order-updated/test-event.mjs +147 -0
  47. package/sources/inventory-level-updated/inventory-level-updated.mjs +25 -0
  48. package/sources/new-abandoned-cart/new-abandoned-cart.mjs +1 -1
  49. package/sources/new-article/new-article.mjs +1 -1
  50. package/sources/new-cancelled-order/new-cancelled-order.mjs +1 -1
  51. package/sources/new-cart-created/new-cart-created.mjs +25 -0
  52. package/sources/new-customer-created/new-customer-created.mjs +1 -1
  53. package/sources/new-draft-order/new-draft-order.mjs +1 -1
  54. package/sources/new-event-emitted/new-event-emitted.mjs +1 -1
  55. package/sources/new-fulfillment-event/new-fulfillment-event.mjs +1 -1
  56. package/sources/new-order-created/new-order-created.mjs +1 -1
  57. package/sources/new-order-fulfilled/new-order-fulfilled.mjs +1 -1
  58. package/sources/new-page/new-page.mjs +1 -1
  59. package/sources/new-paid-order/new-paid-order.mjs +1 -1
  60. package/sources/new-product-created/new-product-created.mjs +1 -1
  61. package/sources/new-product-updated/new-product-updated.mjs +1 -1
  62. package/sources/new-refund-created/new-refund-created.mjs +1 -1
  63. package/sources/new-updated-customer/new-updated-customer.mjs +1 -1
  64. package/sources/new-updated-order/new-updated-order.mjs +1 -1
  65. package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +1 -1
  66. package/sources/shop-update/shop-update.mjs +25 -0
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-add-product-to-custom-collection",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-add-tags",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-article",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-blog",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-custom-collection",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "shopify_developer_app-create-customer",
5
5
  name: "Create Customer",
6
6
  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.10",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  shopify,
@@ -0,0 +1,82 @@
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.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ shopify,
16
+ fulfillmentOrderId: {
17
+ propDefinition: [
18
+ shopify,
19
+ "fulfillmentOrderId",
20
+ ],
21
+ },
22
+ fulfillmentOrderLineItemIds: {
23
+ propDefinition: [
24
+ shopify,
25
+ "fulfillmentOrderLineItemIds",
26
+ (c) => ({
27
+ fulfillmentOrderId: c.fulfillmentOrderId,
28
+ }),
29
+ ],
30
+ reloadProps: true,
31
+ },
32
+ notifyCustomer: {
33
+ type: "boolean",
34
+ label: "Notify Customer",
35
+ description: "Whether to notify the customer",
36
+ optional: true,
37
+ },
38
+ message: {
39
+ type: "string",
40
+ label: "Message",
41
+ description: "An optional message for the fulfillment request.",
42
+ optional: true,
43
+ },
44
+ },
45
+ async additionalProps() {
46
+ const props = {};
47
+ if (!this.fulfillmentOrderLineItemIds) {
48
+ return props;
49
+ }
50
+
51
+ for (const id of this.fulfillmentOrderLineItemIds) {
52
+ props[`quantity_${id}`] = {
53
+ type: "integer",
54
+ label: `Quantity for Line Item - ${id}`,
55
+ description: "The quantity of the line item to fulfill",
56
+ };
57
+ }
58
+ return props;
59
+ },
60
+ async run({ $ }) {
61
+ const fulfillment = await this.shopify.createFulfillment({
62
+ fulfillment: {
63
+ lineItemsByFulfillmentOrder: [
64
+ {
65
+ fulfillmentOrderId: this.fulfillmentOrderId,
66
+ fulfillmentOrderLineItems: this.fulfillmentOrderLineItemIds.map((id) => ({
67
+ id,
68
+ quantity: this[`quantity_${id}`],
69
+ })),
70
+ },
71
+ ],
72
+ notifyCustomer: this.notifyCustomer,
73
+ },
74
+ message: this.message,
75
+ });
76
+ if (fulfillment.fulfillmentCreate.userErrors.length > 0) {
77
+ throw new Error(fulfillment.fulfillmentCreate.userErrors[0].message);
78
+ }
79
+ $.export("$summary", `Created fulfillment with ID: ${fulfillment.fulfillmentCreate.fulfillment.id}`);
80
+ return fulfillment;
81
+ },
82
+ };
@@ -10,7 +10,7 @@ const {
10
10
  export default {
11
11
  ...others,
12
12
  key: "shopify_developer_app-create-metafield",
13
- version: "0.0.9",
13
+ version: "0.0.11",
14
14
  name,
15
15
  description,
16
16
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-metaobject",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -1,11 +1,16 @@
1
- import shopify from "../../shopify_developer_app.app.mjs";
2
1
  import utils from "@pipedream/shopify/common/utils.mjs";
2
+ import shopify from "../../shopify_developer_app.app.mjs";
3
3
 
4
4
  export default {
5
5
  key: "shopify_developer_app-create-order",
6
6
  name: "Create Order",
7
7
  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.11",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  shopify,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-page",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-product",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-product-variant",
14
- version: "0.0.9",
14
+ version: "0.0.11",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-create-smart-collection",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-delete-article",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-delete-blog",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -9,7 +9,7 @@ const {
9
9
  export default {
10
10
  ...others,
11
11
  key: "shopify_developer_app-delete-metafield",
12
- version: "0.0.9",
12
+ version: "0.0.11",
13
13
  name,
14
14
  description,
15
15
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-delete-page",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-get-articles",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -8,7 +8,7 @@ const {
8
8
 
9
9
  export default {
10
10
  key: "shopify_developer_app-get-metafields",
11
- version: "0.0.9",
11
+ version: "0.0.11",
12
12
  name,
13
13
  description,
14
14
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-get-metaobjects",
14
- version: "0.0.9",
14
+ version: "0.0.11",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -1,11 +1,16 @@
1
- import shopify from "../../shopify_developer_app.app.mjs";
2
1
  import { MAX_LIMIT } from "@pipedream/shopify/common/constants.mjs";
2
+ import shopify from "../../shopify_developer_app.app.mjs";
3
3
 
4
4
  export default {
5
5
  key: "shopify_developer_app-get-order",
6
6
  name: "Get Order",
7
7
  description: "Retrieve an order by specifying the order ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/order)",
8
- version: "0.0.6",
8
+ version: "0.0.9",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  shopify,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-get-pages",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -0,0 +1,105 @@
1
+ import { MAX_LIMIT } from "@pipedream/shopify/common/constants.mjs";
2
+ import shopify from "../../shopify_developer_app.app.mjs";
3
+
4
+ export default {
5
+ key: "shopify_developer_app-refund-order",
6
+ name: "Refund Order",
7
+ description: "Refund an order. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/refundcreate)",
8
+ version: "0.0.3",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
14
+ type: "action",
15
+ props: {
16
+ shopify,
17
+ orderId: {
18
+ propDefinition: [
19
+ shopify,
20
+ "orderId",
21
+ ],
22
+ },
23
+ note: {
24
+ type: "string",
25
+ label: "Note",
26
+ description: "An optional note that's attached to the refund",
27
+ optional: true,
28
+ },
29
+ lineItemIds: {
30
+ propDefinition: [
31
+ shopify,
32
+ "lineItemIds",
33
+ (c) => ({
34
+ orderId: c.orderId,
35
+ }),
36
+ ],
37
+ reloadProps: true,
38
+ },
39
+ },
40
+ async additionalProps() {
41
+ const props = {};
42
+ if (!this.lineItemIds) {
43
+ return props;
44
+ }
45
+ const order = await this.shopify.getOrder({
46
+ id: this.orderId,
47
+ first: MAX_LIMIT,
48
+ });
49
+ for (const id of this.lineItemIds) {
50
+ const lineItem = order.order.lineItems.edges.find((item) => item.node.id === id);
51
+ props[`quantity_${id}`] = {
52
+ type: "integer",
53
+ label: `Quantity for line item - ${lineItem.node.title}`,
54
+ description: "The quantity of the line item to refund",
55
+ };
56
+ props[`restockType_${id}`] = {
57
+ type: "string",
58
+ label: `Restock type for line item - ${lineItem.node.title}`,
59
+ description: "The restock type for the line item",
60
+ options: [
61
+ "CANCEL",
62
+ "NO_RESTOCK",
63
+ "RETURN",
64
+ ],
65
+ default: "RETURN",
66
+ };
67
+ props[`locationId_${id}`] = {
68
+ type: "string",
69
+ label: `Location ID for line item - ${lineItem.node.title}`,
70
+ description: "The location ID for the line item",
71
+ options: async ({ prevContext }) => {
72
+ return this.shopify.getPropOptions({
73
+ resourceFn: this.shopify.listLocations,
74
+ resourceKeys: [
75
+ "locations",
76
+ ],
77
+ labelKey: "name",
78
+ prevContext,
79
+ });
80
+ },
81
+ };
82
+ }
83
+ return props;
84
+ },
85
+ async run({ $ }) {
86
+ const response = await this.shopify.refundOrder({
87
+ input: {
88
+ note: this.note,
89
+ orderId: this.orderId,
90
+ refundLineItems: this.lineItemIds.map((id) => ({
91
+ lineItemId: id,
92
+ quantity: this[`quantity_${id}`],
93
+ locationId: this[`locationId_${id}`],
94
+ restockType: this[`restockType_${id}`],
95
+ })),
96
+ },
97
+ });
98
+
99
+ if (response.refundCreate.userErrors.length > 0) {
100
+ throw new Error(response.refundCreate.userErrors[0].message);
101
+ }
102
+ $.export("$summary", `Refunded order with ID: ${this.orderId}`);
103
+ return response;
104
+ },
105
+ };
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-search-custom-collection-by-name",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "shopify_developer_app-search-customers",
5
5
  name: "Search for Customers",
6
6
  description: "Search for a customer or a list of customers. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers)",
7
- version: "0.0.8",
7
+ version: "0.0.10",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  shopify,
@@ -0,0 +1,45 @@
1
+ import shopify from "../../shopify_developer_app.app.mjs";
2
+
3
+ export default {
4
+ key: "shopify_developer_app-search-fulfillment-orders",
5
+ name: "Search for Fulfillment Orders",
6
+ description: "Search for a fulfillment order or a list of fulfillment orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/queries/fulfillmentorders)",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ shopify,
16
+ query: {
17
+ type: "string",
18
+ label: "Query",
19
+ description: "A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).",
20
+ optional: true,
21
+ },
22
+ max: {
23
+ type: "integer",
24
+ label: "Max Records",
25
+ description: "Optionally limit the maximum number of records to return. Leave blank to retrieve all records.",
26
+ optional: true,
27
+ },
28
+ },
29
+ async run({ $ }) {
30
+ const orders = await this.shopify.getPaginated({
31
+ resourceFn: this.shopify.listFulfillmentOrders,
32
+ resourceKeys: [
33
+ "fulfillmentOrders",
34
+ ],
35
+ variables: {
36
+ query: this.query,
37
+ },
38
+ max: this.max,
39
+ });
40
+ $.export("$summary", `Found ${orders.length} fulfillment order${orders.length === 1
41
+ ? ""
42
+ : "s"}`);
43
+ return orders;
44
+ },
45
+ };
@@ -4,7 +4,12 @@ export default {
4
4
  key: "shopify_developer_app-search-orders",
5
5
  name: "Search for Orders",
6
6
  description: "Search for an order or a list of orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/orders)",
7
- version: "0.0.2",
7
+ version: "0.0.4",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  shopify,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-search-product-variant",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-search-products",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-update-article",
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -6,7 +6,12 @@ export default {
6
6
  key: "shopify_developer_app-update-customer",
7
7
  name: "Update Customer",
8
8
  description: "Update a existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)",
9
- version: "0.0.9",
9
+ version: "0.0.11",
10
+ annotations: {
11
+ destructiveHint: true,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  type: "action",
11
16
  props: {
12
17
  shopify,
@@ -0,0 +1,73 @@
1
+ import shopify from "../../shopify_developer_app.app.mjs";
2
+
3
+ export default {
4
+ key: "shopify_developer_app-update-fulfillment-tracking-info",
5
+ name: "Update Fulfillment Tracking Info",
6
+ description: "Update the tracking info for a fulfillment. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/fulfillmenttrackinginfoupdate)",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ shopify,
16
+ orderId: {
17
+ propDefinition: [
18
+ shopify,
19
+ "orderId",
20
+ ],
21
+ },
22
+ fulfillmentId: {
23
+ propDefinition: [
24
+ shopify,
25
+ "fulfillmentId",
26
+ (c) => ({
27
+ orderId: c.orderId,
28
+ }),
29
+ ],
30
+ },
31
+ company: {
32
+ type: "string",
33
+ label: "Company",
34
+ description: "The name of the tracking company",
35
+ optional: true,
36
+ },
37
+ number: {
38
+ type: "string",
39
+ label: "Tracking Number",
40
+ description: "The tracking number for the fulfillment",
41
+ optional: true,
42
+ },
43
+ url: {
44
+ type: "string",
45
+ label: "Tracking URL",
46
+ description: "The URL for the tracking information",
47
+ optional: true,
48
+ },
49
+ notifyCustomer: {
50
+ type: "boolean",
51
+ label: "Notify Customer",
52
+ description: "Whether to notify the customer",
53
+ optional: true,
54
+ },
55
+ },
56
+ async run({ $ }) {
57
+ const response = await this.shopify.updateFulfillmentTrackingInfo({
58
+ fulfillmentId: this.fulfillmentId,
59
+ trackingInfoInput: {
60
+ company: this.company,
61
+ number: this.number,
62
+ url: this.url,
63
+ },
64
+ notifyCustomer: this.notifyCustomer,
65
+ });
66
+
67
+ if (response.fulfillmentTrackingInfoUpdate.userErrors.length > 0) {
68
+ throw new Error(response.fulfillmentTrackingInfoUpdate.userErrors[0].message);
69
+ }
70
+ $.export("$summary", `Updated fulfillment tracking info for fulfillment with ID: ${this.fulfillmentId}`);
71
+ return response;
72
+ },
73
+ };
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-update-inventory-level",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -9,7 +9,7 @@ const {
9
9
  export default {
10
10
  ...others,
11
11
  key: "shopify_developer_app-update-metafield",
12
- version: "0.0.9",
12
+ version: "0.0.11",
13
13
  name,
14
14
  description,
15
15
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-update-metaobject",
14
- version: "0.0.11",
14
+ version: "0.0.13",
15
15
  name,
16
16
  description,
17
17
  type,