@pipedream/shopify_developer_app 0.6.4 → 0.7.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 (61) hide show
  1. package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +14 -24
  2. package/actions/add-tags/add-tags.mjs +14 -7
  3. package/actions/common/constants.mjs +86 -0
  4. package/actions/common/metafield-actions.mjs +264 -3
  5. package/actions/create-article/create-article.mjs +16 -28
  6. package/actions/create-blog/create-blog.mjs +16 -15
  7. package/actions/create-custom-collection/create-custom-collection.mjs +14 -28
  8. package/actions/create-customer/create-customer.mjs +24 -5
  9. package/actions/create-metafield/create-metafield.mjs +50 -8
  10. package/actions/create-metaobject/create-metaobject.mjs +14 -19
  11. package/actions/create-order/create-order.mjs +144 -10
  12. package/actions/create-page/create-page.mjs +16 -21
  13. package/actions/create-product/create-product.mjs +14 -61
  14. package/actions/create-product-variant/create-product-variant.mjs +14 -48
  15. package/actions/create-smart-collection/create-smart-collection.mjs +14 -19
  16. package/actions/delete-article/delete-article.mjs +16 -23
  17. package/actions/delete-blog/delete-blog.mjs +16 -14
  18. package/actions/delete-metafield/delete-metafield.mjs +41 -8
  19. package/actions/delete-page/delete-page.mjs +16 -14
  20. package/actions/get-articles/get-articles.mjs +16 -14
  21. package/actions/get-metafields/get-metafields.mjs +40 -8
  22. package/actions/get-metaobjects/get-metaobjects.mjs +14 -18
  23. package/actions/get-order/get-order.mjs +9 -7
  24. package/actions/get-pages/get-pages.mjs +16 -8
  25. package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +14 -14
  26. package/actions/search-customers/search-customers.mjs +23 -13
  27. package/actions/search-product-variant/search-product-variant.mjs +14 -30
  28. package/actions/search-products/search-products.mjs +14 -40
  29. package/actions/update-article/update-article.mjs +16 -37
  30. package/actions/update-customer/update-customer.mjs +29 -5
  31. package/actions/update-inventory-level/update-inventory-level.mjs +14 -28
  32. package/actions/update-metafield/update-metafield.mjs +18 -15
  33. package/actions/update-metaobject/update-metaobject.mjs +14 -24
  34. package/actions/update-page/update-page.mjs +16 -27
  35. package/actions/update-product/update-product.mjs +96 -37
  36. package/actions/update-product-variant/update-product-variant.mjs +14 -71
  37. package/common/mutations.mjs +124 -0
  38. package/common/queries.mjs +181 -0
  39. package/common/utils.mjs +40 -0
  40. package/package.json +2 -2
  41. package/shopify_developer_app.app.mjs +130 -1
  42. package/sources/common/webhook.mjs +17 -9
  43. package/sources/new-abandoned-cart/new-abandoned-cart.mjs +14 -8
  44. package/sources/new-article/new-article.mjs +15 -9
  45. package/sources/new-cancelled-order/new-cancelled-order.mjs +4 -5
  46. package/sources/new-customer-created/new-customer-created.mjs +4 -5
  47. package/sources/new-draft-order/new-draft-order.mjs +4 -5
  48. package/sources/new-event-emitted/new-event-emitted.mjs +10 -4
  49. package/sources/new-fulfillment-event/new-fulfillment-event.mjs +4 -5
  50. package/sources/new-order-created/new-order-created.mjs +8 -6
  51. package/sources/new-order-fulfilled/new-order-fulfilled.mjs +4 -5
  52. package/sources/new-page/new-page.mjs +15 -9
  53. package/sources/new-paid-order/new-paid-order.mjs +4 -5
  54. package/sources/new-product-created/new-product-created.mjs +4 -5
  55. package/sources/new-product-updated/new-product-updated.mjs +4 -5
  56. package/sources/new-refund-created/new-refund-created.mjs +3 -4
  57. package/sources/new-updated-customer/new-updated-customer.mjs +4 -5
  58. package/sources/new-updated-order/new-updated-order.mjs +4 -5
  59. package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +14 -8
  60. package/actions/common/metaobjects.mjs +0 -21
  61. package/common/rest-admin.mjs +0 -97
@@ -1,19 +1,51 @@
1
1
  import metafieldActions from "../common/metafield-actions.mjs";
2
- import common from "@pipedream/shopify/actions/get-metafields/common.mjs";
2
+ import common from "@pipedream/shopify/actions/get-metafields/get-metafields.mjs";
3
+ import shopify from "../../shopify_developer_app.app.mjs";
4
+
5
+ const {
6
+ name, description, type,
7
+ } = common;
3
8
 
4
9
  export default {
5
- ...common,
6
10
  key: "shopify_developer_app-get-metafields",
7
- name: "Get Metafields",
8
- description: "Retrieves a list of metafields that belong to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#get-metafields?metafield[owner-id]=382285388&metafield[owner-resource]=blog)",
9
- version: "0.0.5",
10
- type: "action",
11
+ version: "0.0.6",
12
+ name,
13
+ description,
14
+ type,
11
15
  props: {
16
+ shopify,
12
17
  ...metafieldActions.props,
13
- ...common.props,
18
+ namespace: {
19
+ type: "string[]",
20
+ label: "Namespace",
21
+ description: "Filter results by namespace",
22
+ optional: true,
23
+ },
24
+ key: {
25
+ type: "string[]",
26
+ label: "Key",
27
+ description: "Filter results by key",
28
+ optional: true,
29
+ },
14
30
  },
15
31
  methods: {
16
32
  ...metafieldActions.methods,
17
- ...common.methods,
33
+ },
34
+ async additionalProps() {
35
+ return this.getOwnerIdProp(this.ownerResource);
36
+ },
37
+ async run({ $ }) {
38
+ let response = await this.listMetafields(this.ownerResource, this.ownerId);
39
+
40
+ if (this.namespace?.length > 0) {
41
+ response = response.filter((field) => this.namespace.includes(field.namespace));
42
+ }
43
+
44
+ if (this.key?.length > 0) {
45
+ response = response.filter((field) => this.key.includes(field.key));
46
+ }
47
+
48
+ $.export("$summary", `Found ${response.length} metafield(s) for object with ID ${this.ownerId}`);
49
+ return response;
18
50
  },
19
51
  };
@@ -1,26 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import metaobjects from "../common/metaobjects.mjs";
3
- import common from "@pipedream/shopify/actions/get-metaobjects/common.mjs";
2
+ import common from "@pipedream/shopify/actions/get-metaobjects/get-metaobjects.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
4
10
 
5
11
  export default {
6
- ...metaobjects,
7
- ...common,
12
+ ...others,
8
13
  key: "shopify_developer_app-get-metaobjects",
9
- name: "Get Metaobjects",
10
- description: "Retrieves a list of metaobjects. [See the documentation](https://shopify.dev/docs/api/admin-graphql/2023-04/queries/metaobjects)",
11
- version: "0.0.5",
12
- type: "action",
14
+ version: "0.0.6",
15
+ name,
16
+ description,
17
+ type,
13
18
  props: {
14
19
  shopify,
15
- type: {
16
- type: "string",
17
- label: "Type",
18
- description: "The Metaobject Type",
19
- async options() {
20
- const { data: { metaobjectDefinitions: { nodes } } }
21
- = await this.listMetaobjectDefinitions();
22
- return nodes?.map(({ type }) => type) || [];
23
- },
24
- },
20
+ ...props,
25
21
  },
26
22
  };
@@ -1,23 +1,25 @@
1
- import app from "../../common/rest-admin.mjs";
1
+ import shopify from "../../shopify_developer_app.app.mjs";
2
+ import { MAX_LIMIT } from "@pipedream/shopify/common/constants.mjs";
2
3
 
3
4
  export default {
4
5
  key: "shopify_developer_app-get-order",
5
6
  name: "Get Order",
6
- description: "Retrieve an order by specifying the order ID. [See The Documentation](https://shopify.dev/docs/api/admin-rest/2024-10/resources/order#get-orders)",
7
- version: "0.0.2",
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.3",
8
9
  type: "action",
9
10
  props: {
10
- app,
11
+ shopify,
11
12
  orderId: {
12
13
  propDefinition: [
13
- app,
14
+ shopify,
14
15
  "orderId",
15
16
  ],
16
17
  },
17
18
  },
18
19
  async run({ $ }) {
19
- const response = await this.app.getOrder({
20
- orderId: this.orderId,
20
+ const response = await this.shopify.getOrder({
21
+ id: this.orderId,
22
+ first: MAX_LIMIT,
21
23
  });
22
24
  $.export("$summary", `Successfully retrieved order with ID: ${this.orderId}`);
23
25
  return response;
@@ -1,14 +1,22 @@
1
- import app from "../../common/rest-admin.mjs";
2
- import common from "@pipedream/shopify/actions/get-pages/common.mjs";
1
+ import shopify from "../../shopify_developer_app.app.mjs";
2
+ import common from "@pipedream/shopify/actions/get-pages/get-pages.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
3
10
 
4
11
  export default {
5
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-get-pages",
7
- name: "Get Pages",
8
- description: "Retrieve a list of all pages. [See The Documentation](https://shopify.dev/docs/api/admin-rest/2023-04/resources/page#get-pages)",
9
- version: "0.0.6",
10
- type: "action",
14
+ version: "0.0.7",
15
+ name,
16
+ description,
17
+ type,
11
18
  props: {
12
- app,
19
+ shopify,
20
+ ...props,
13
21
  },
14
22
  };
@@ -1,22 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import common from "@pipedream/shopify/actions/search-custom-collection-by-name/common.mjs";
2
+ import common from "@pipedream/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
3
10
 
4
11
  export default {
5
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-search-custom-collection-by-name",
7
- name: "Search Custom Collection by Name",
8
- description: "Search for a custom collection by name/title. [See the documentation](https://shopify.dev/docs/api/admin-rest/2023-01/resources/customcollection#get-custom-collections)",
9
- version: "0.0.4",
10
- type: "action",
14
+ version: "0.0.5",
15
+ name,
16
+ description,
17
+ type,
11
18
  props: {
12
19
  shopify,
13
- title: {
14
- propDefinition: [
15
- shopify,
16
- "title",
17
- ],
18
- description: "The name of the custom collection",
19
- },
20
- ...common.props,
20
+ ...props,
21
21
  },
22
22
  };
@@ -1,27 +1,37 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import common from "@pipedream/shopify/actions/search-customers/common.mjs";
3
2
 
4
3
  export default {
5
- ...common,
6
4
  key: "shopify_developer_app-search-customers",
7
5
  name: "Search for Customers",
8
- description: "Search for a customer or a list of customers. [See the documentation](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[get]/admin/api/2022-01/customers.json)",
9
- version: "0.0.4",
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.5",
10
8
  type: "action",
11
9
  props: {
12
10
  shopify,
13
11
  query: {
14
- propDefinition: [
15
- shopify,
16
- "query",
17
- ],
12
+ type: "string",
13
+ label: "Query",
14
+ description: "The search query",
18
15
  },
19
16
  max: {
20
- propDefinition: [
21
- shopify,
22
- "max",
23
- ],
17
+ type: "integer",
18
+ label: "Max Records",
19
+ description: "Optionally limit the maximum number of records to return. Leave blank to retrieve all records.",
20
+ optional: true,
24
21
  },
25
- ...common.props,
22
+ },
23
+ async run({ $ }) {
24
+ const response = await this.shopify.getPaginated({
25
+ resourceFn: this.shopify.listCustomers,
26
+ resourceKeys: [
27
+ "customers",
28
+ ],
29
+ variables: {
30
+ query: this.query,
31
+ },
32
+ max: this.max,
33
+ });
34
+ $.export("$summary", `Found ${response.length} customer(s)`);
35
+ return response;
26
36
  },
27
37
  };
@@ -1,38 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import common from "@pipedream/shopify/actions/search-product-variant/common.mjs";
2
+ import common from "@pipedream/shopify/actions/search-product-variant/search-product-variant.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
3
10
 
4
11
  export default {
5
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-search-product-variant",
7
- name: "Search for Product Variant",
8
- description: "Search for product variants or create one if not found. [See the documentation](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#top)",
9
- version: "0.0.4",
10
- type: "action",
14
+ version: "0.0.5",
15
+ name,
16
+ description,
17
+ type,
11
18
  props: {
12
19
  shopify,
13
- productId: {
14
- propDefinition: [
15
- shopify,
16
- "productId",
17
- ],
18
- },
19
- productVariantId: {
20
- propDefinition: [
21
- shopify,
22
- "productVariantId",
23
- (c) => c,
24
- ],
25
- description: "ID of the product variant. Takes precedence over **Title**",
26
- optional: true,
27
- },
28
- title: {
29
- propDefinition: [
30
- shopify,
31
- "title",
32
- ],
33
- description: "The name of the product variant",
34
- optional: true,
35
- },
36
- ...common.props,
20
+ ...props,
37
21
  },
38
22
  };
@@ -1,48 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import common from "@pipedream/shopify/actions/search-products/common.mjs";
2
+ import common from "@pipedream/shopify/actions/search-products/search-products.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
3
10
 
4
11
  export default {
5
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-search-products",
7
- name: "Search for Products",
8
- description: "Search for products. [See the documentation](https://shopify.dev/api/admin-rest/2022-01/resources/product#[get]/admin/api/2022-01/products.json)",
9
- version: "0.0.4",
10
- type: "action",
14
+ version: "0.0.5",
15
+ name,
16
+ description,
17
+ type,
11
18
  props: {
12
19
  shopify,
13
- title: {
14
- propDefinition: [
15
- shopify,
16
- "title",
17
- ],
18
- optional: true,
19
- },
20
- productIds: {
21
- propDefinition: [
22
- shopify,
23
- "productId",
24
- ],
25
- type: "string[]",
26
- optional: true,
27
- },
28
- collectionId: {
29
- propDefinition: [
30
- shopify,
31
- "collectionId",
32
- ],
33
- },
34
- productType: {
35
- propDefinition: [
36
- shopify,
37
- "productType",
38
- ],
39
- },
40
- vendor: {
41
- propDefinition: [
42
- shopify,
43
- "vendor",
44
- ],
45
- },
46
- ...common.props,
20
+ ...props,
47
21
  },
48
22
  };
@@ -1,43 +1,22 @@
1
- import app from "../../common/rest-admin.mjs";
2
- import common from "@pipedream/shopify/actions/update-article/common.mjs";
1
+ import shopify from "../../shopify_developer_app.app.mjs";
2
+ import common from "@pipedream/shopify/actions/update-article/update-article.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
3
10
 
4
11
  export default {
5
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-update-article",
7
- name: "Update Article",
8
- description: "Update a blog article. [See The Documentation](https://shopify.dev/docs/api/admin-rest/2023-04/resources/article#put-blogs-blog-id-articles-article-id)",
9
- version: "0.0.6",
10
- type: "action",
14
+ version: "0.0.7",
15
+ name,
16
+ description,
17
+ type,
11
18
  props: {
12
- app,
13
- blogId: {
14
- propDefinition: [
15
- app,
16
- "blogId",
17
- ],
18
- },
19
- articleId: {
20
- propDefinition: [
21
- app,
22
- "articleId",
23
- ({ blogId }) => ({
24
- blogId,
25
- }),
26
- ],
27
- },
28
- title: {
29
- description: "The title of the article.",
30
- propDefinition: [
31
- app,
32
- "title",
33
- ],
34
- },
35
- bodyHtml: {
36
- description: "The text content of the article, complete with HTML markup.",
37
- propDefinition: [
38
- app,
39
- "bodyHtml",
40
- ],
41
- },
19
+ shopify,
20
+ ...props,
42
21
  },
43
22
  };
@@ -1,14 +1,12 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import metafieldActions from "../common/metafield-actions.mjs";
3
- import common from "@pipedream/shopify/actions/update-customer/common.mjs";
2
+ import common from "../common/metafield-actions.mjs";
4
3
 
5
4
  export default {
6
- ...metafieldActions,
7
5
  ...common,
8
6
  key: "shopify_developer_app-update-customer",
9
7
  name: "Update Customer",
10
- description: "Update a existing customer. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[put]/admin/api/2022-01/customers/{customer_id}.json)",
11
- version: "0.0.5",
8
+ description: "Update a existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)",
9
+ version: "0.0.6",
12
10
  type: "action",
13
11
  props: {
14
12
  shopify,
@@ -86,4 +84,30 @@ export default {
86
84
  ],
87
85
  },
88
86
  },
87
+ async run({ $ }) {
88
+ const metafields = await this.createMetafieldsArray(this.metafields, this.customerId, "customer");
89
+
90
+ const response = await this.shopify.updateCustomer({
91
+ input: {
92
+ id: this.customerId,
93
+ firstName: this.firstName,
94
+ lastName: this.lastName,
95
+ email: this.email,
96
+ phone: this.phone,
97
+ addresses: [
98
+ {
99
+ address1: this.address,
100
+ company: this.company,
101
+ city: this.city,
102
+ province: this.province,
103
+ country: this.country,
104
+ zip: this.zip,
105
+ },
106
+ ],
107
+ metafields,
108
+ },
109
+ });
110
+ $.export("$summary", `Updated customer \`${response.customerUpdate.customer.email || response.customerUpdate.customer.firstName}\` with ID \`${response.customerUpdate.customer.id}\``);
111
+ return response;
112
+ },
89
113
  };
@@ -1,36 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import common from "@pipedream/shopify/actions/update-inventory-level/common.mjs";
2
+ import common from "@pipedream/shopify/actions/update-inventory-level/update-inventory-level.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
3
10
 
4
11
  export default {
5
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-update-inventory-level",
7
- name: "Update Inventory Level",
8
- description: "Sets the inventory level for an inventory item at a location. [See the documenation](https://shopify.dev/api/admin-rest/2022-01/resources/inventorylevel#[post]/admin/api/2022-01/inventory_levels/set.json)",
9
- version: "0.0.4",
10
- type: "action",
14
+ version: "0.0.5",
15
+ name,
16
+ description,
17
+ type,
11
18
  props: {
12
19
  shopify,
13
- locationId: {
14
- propDefinition: [
15
- shopify,
16
- "locationId",
17
- ],
18
- },
19
- productId: {
20
- propDefinition: [
21
- shopify,
22
- "productId",
23
- ],
24
- },
25
- inventoryItemId: {
26
- propDefinition: [
27
- shopify,
28
- "inventoryItemId",
29
- (c) => ({
30
- productId: c.productId,
31
- }),
32
- ],
33
- },
34
- ...common.props,
20
+ ...props,
35
21
  },
36
22
  };
@@ -1,17 +1,21 @@
1
1
  import metafieldActions from "../common/metafield-actions.mjs";
2
- import common from "@pipedream/shopify/actions/update-metafield/common.mjs";
3
- import shopify from "@pipedream/shopify/shopify.app.mjs";
2
+ import common from "@pipedream/shopify/actions/update-metafield/update-metafield.mjs";
3
+ import shopify from "../../shopify_developer_app.app.mjs";
4
+
5
+ const {
6
+ name, description, type, ...others
7
+ } = common;
4
8
 
5
9
  export default {
6
- ...common,
10
+ ...others,
7
11
  key: "shopify_developer_app-update-metafield",
8
- name: "Update Metafield",
9
- description: "Updates a metafield belonging to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#put-blogs-blog-id-metafields-metafield-id)",
10
- version: "0.0.5",
11
- type: "action",
12
+ version: "0.0.6",
13
+ name,
14
+ description,
15
+ type,
12
16
  props: {
17
+ shopify,
13
18
  ...metafieldActions.props,
14
- ...common.props,
15
19
  },
16
20
  async additionalProps() {
17
21
  const props = await this.getOwnerIdProp(this.ownerResource);
@@ -31,15 +35,10 @@ export default {
31
35
  },
32
36
  methods: {
33
37
  ...metafieldActions.methods,
34
- ...common.methods,
35
38
  async getOwnerIdProp(ownerResource) {
36
39
  const resources = {
37
40
  product: shopify.propDefinitions.productId,
38
41
  variants: shopify.propDefinitions.productVariantId,
39
- product_image: {
40
- ...shopify.propDefinitions.imageId,
41
- optional: false,
42
- },
43
42
  customer: shopify.propDefinitions.customerId,
44
43
  collection: {
45
44
  ...shopify.propDefinitions.collectionId,
@@ -49,12 +48,16 @@ export default {
49
48
  article: shopify.propDefinitions.articleId,
50
49
  page: shopify.propDefinitions.pageId,
51
50
  order: shopify.propDefinitions.orderId,
52
- draft_order: shopify.propDefinitions.draftOrderId,
51
+ draftOrder: {
52
+ type: "string",
53
+ label: "Draft Order ID",
54
+ description: "The identifier of a draft order",
55
+ },
53
56
  };
54
57
 
55
58
  const props = {};
56
59
 
57
- if (ownerResource === "variants" || ownerResource === "product_image") {
60
+ if (ownerResource === "variants") {
58
61
  props.productId = resources.product;
59
62
  }
60
63
  if (ownerResource === "article") {
@@ -1,32 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import metaobjects from "../common/metaobjects.mjs";
3
- import common from "@pipedream/shopify/actions/update-metaobject/common.mjs";
2
+ import common from "@pipedream/shopify/actions/update-metaobject/update-metaobject.mjs";
3
+
4
+ import { adjustPropDefinitions } from "../../common/utils.mjs";
5
+
6
+ const {
7
+ name, description, type, ...others
8
+ } = common;
9
+ const props = adjustPropDefinitions(others.props, shopify);
4
10
 
5
11
  export default {
6
- ...metaobjects,
7
- ...common,
12
+ ...others,
8
13
  key: "shopify_developer_app-update-metaobject",
9
- name: "Update Metaobject",
10
- description: "Updates a metaobject. [See the documentation](https://shopify.dev/docs/api/admin-graphql/2023-04/mutations/metaobjectUpdate)",
11
- version: "0.0.7",
12
- type: "action",
13
- methods: {
14
- ...metaobjects.methods,
15
- ...common.methods,
16
- },
14
+ version: "0.0.8",
15
+ name,
16
+ description,
17
+ type,
17
18
  props: {
18
19
  shopify,
19
- type: {
20
- type: "string",
21
- label: "Type",
22
- description: "The Metaobject Type",
23
- async options() {
24
- const { data: { metaobjectDefinitions: { nodes } } }
25
- = await this.listMetaobjectDefinitions();
26
- return nodes?.map(({ type }) => type) || [];
27
- },
28
- reloadProps: true,
29
- },
30
- ...common.props,
20
+ ...props,
31
21
  },
32
22
  };