@pipedream/shopify_developer_app 0.4.0 → 0.4.1
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.
- package/actions/common/metafield-actions.mjs +1 -1
- package/actions/create-metafield/create-metafield.mjs +1 -1
- package/actions/delete-metafield/delete-metafield.mjs +1 -1
- package/actions/get-metafields/get-metafields.mjs +1 -1
- package/actions/update-customer/update-customer.mjs +1 -1
- package/actions/update-metafield/update-metafield.mjs +59 -1
- package/actions/update-product/update-product.mjs +1 -1
- package/actions/update-product-variant/update-product-variant.mjs +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "shopify_developer_app-create-metafield",
|
|
7
7
|
name: "Create Metafield",
|
|
8
8
|
description: "Creates a metafield belonging to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#post-blogs-blog-id-metafields)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...metafieldActions.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "shopify_developer_app-delete-metafield",
|
|
7
7
|
name: "Delete Metafield",
|
|
8
8
|
description: "Deletes a metafield belonging to a resource. [See the documentation](https://shopify.dev/docs/api/admin-rest/2023-01/resources/metafield#delete-blogs-blog-id-metafields-metafield-id)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...metafieldActions.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "shopify_developer_app-get-metafields",
|
|
7
7
|
name: "Get Metafields",
|
|
8
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.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...metafieldActions.props,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "shopify_developer_app-update-customer",
|
|
9
9
|
name: "Update Customer",
|
|
10
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.
|
|
11
|
+
version: "0.0.4",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
shopify,
|
|
@@ -1,19 +1,77 @@
|
|
|
1
1
|
import metafieldActions from "../common/metafield-actions.mjs";
|
|
2
2
|
import common from "../../../shopify/actions/update-metafield/common.mjs";
|
|
3
|
+
import shopify from "../../../shopify/shopify.app.mjs";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
...common,
|
|
6
7
|
key: "shopify_developer_app-update-metafield",
|
|
7
8
|
name: "Update Metafield",
|
|
8
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)",
|
|
9
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
10
11
|
type: "action",
|
|
11
12
|
props: {
|
|
12
13
|
...metafieldActions.props,
|
|
13
14
|
...common.props,
|
|
14
15
|
},
|
|
16
|
+
async additionalProps() {
|
|
17
|
+
const props = await this.getOwnerIdProp(this.ownerResource);
|
|
18
|
+
|
|
19
|
+
props.metafieldId = {
|
|
20
|
+
type: "string",
|
|
21
|
+
label: "Metafield ID",
|
|
22
|
+
description: "The metafield to update",
|
|
23
|
+
};
|
|
24
|
+
props.value = {
|
|
25
|
+
type: "string",
|
|
26
|
+
label: "Value",
|
|
27
|
+
description: "The data to store in the metafield",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return props;
|
|
31
|
+
},
|
|
15
32
|
methods: {
|
|
16
33
|
...metafieldActions.methods,
|
|
17
34
|
...common.methods,
|
|
35
|
+
async getOwnerIdProp(ownerResource) {
|
|
36
|
+
const resources = {
|
|
37
|
+
product: shopify.propDefinitions.productId,
|
|
38
|
+
variants: shopify.propDefinitions.productVariantId,
|
|
39
|
+
product_image: {
|
|
40
|
+
...shopify.propDefinitions.imageId,
|
|
41
|
+
optional: false,
|
|
42
|
+
},
|
|
43
|
+
customer: shopify.propDefinitions.customerId,
|
|
44
|
+
collection: {
|
|
45
|
+
...shopify.propDefinitions.collectionId,
|
|
46
|
+
optional: false,
|
|
47
|
+
},
|
|
48
|
+
blog: shopify.propDefinitions.blogId,
|
|
49
|
+
article: shopify.propDefinitions.articleId,
|
|
50
|
+
page: shopify.propDefinitions.pageId,
|
|
51
|
+
order: shopify.propDefinitions.orderId,
|
|
52
|
+
draft_order: shopify.propDefinitions.draftOrderId,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const props = {};
|
|
56
|
+
|
|
57
|
+
if (ownerResource === "variants" || ownerResource === "product_image") {
|
|
58
|
+
props.productId = resources.product;
|
|
59
|
+
}
|
|
60
|
+
if (ownerResource === "article") {
|
|
61
|
+
props.blogId = resources.blog;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Object.values(resources).forEach((resource) => {
|
|
65
|
+
delete resource.options;
|
|
66
|
+
});
|
|
67
|
+
Object.values(props).forEach((prop) => {
|
|
68
|
+
delete prop.options;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
...props,
|
|
73
|
+
ownerId: resources[ownerResource],
|
|
74
|
+
};
|
|
75
|
+
},
|
|
18
76
|
},
|
|
19
77
|
};
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "shopify_developer_app-update-product",
|
|
9
9
|
name: "Update Product",
|
|
10
10
|
description: "Update an existing product. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product#[put]/admin/api/2022-01/products/{product_id}.json)",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.4",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
shopify,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "shopify_developer_app-update-product-variant",
|
|
9
9
|
name: "Update Product Variant",
|
|
10
10
|
description: "Update an existing product variant. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#[put]/admin/api/2022-01/variants/{variant_id}.json)",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
shopify,
|