Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import metafieldActions from "../../../shopify/actions/common/metafield-actions.
export default {
...metafieldActions,
props: {
...metafieldActions.props,
shopify,
...metafieldActions.props,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "shopify_developer_app-create-metafield",
name: "Create Metafield",
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)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
...metafieldActions.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "shopify_developer_app-delete-metafield",
name: "Delete Metafield",
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)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
...metafieldActions.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "shopify_developer_app-get-metafields",
name: "Get Metafields",
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)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
...metafieldActions.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "shopify_developer_app-update-customer",
name: "Update Customer",
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)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
shopify,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,77 @@
import metafieldActions from "../common/metafield-actions.mjs";
import common from "../../../shopify/actions/update-metafield/common.mjs";
import shopify from "../../../shopify/shopify.app.mjs";

export default {
...common,
key: "shopify_developer_app-update-metafield",
name: "Update Metafield",
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)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
...metafieldActions.props,
...common.props,
},
async additionalProps() {
const props = await this.getOwnerIdProp(this.ownerResource);

props.metafieldId = {
type: "string",
label: "Metafield ID",
description: "The metafield to update",
};
props.value = {
type: "string",
label: "Value",
description: "The data to store in the metafield",
};

return props;
},
methods: {
...metafieldActions.methods,
...common.methods,
async getOwnerIdProp(ownerResource) {
const resources = {
product: shopify.propDefinitions.productId,
variants: shopify.propDefinitions.productVariantId,
product_image: {
...shopify.propDefinitions.imageId,
optional: false,
},
customer: shopify.propDefinitions.customerId,
collection: {
...shopify.propDefinitions.collectionId,
optional: false,
},
blog: shopify.propDefinitions.blogId,
article: shopify.propDefinitions.articleId,
page: shopify.propDefinitions.pageId,
order: shopify.propDefinitions.orderId,
draft_order: shopify.propDefinitions.draftOrderId,
};

const props = {};

if (ownerResource === "variants" || ownerResource === "product_image") {
props.productId = resources.product;
}
if (ownerResource === "article") {
props.blogId = resources.blog;
}

Object.values(resources).forEach((resource) => {
delete resource.options;
});
Object.values(props).forEach((prop) => {
delete prop.options;
});

return {
...props,
ownerId: resources[ownerResource],
};
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "shopify_developer_app-update-product-variant",
name: "Update Product Variant",
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)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
shopify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "shopify_developer_app-update-product",
name: "Update Product",
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)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
shopify,
Expand Down
2 changes: 1 addition & 1 deletion components/shopify_developer_app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/shopify_developer_app",
"version": "0.4.0",
"version": "0.4.1",
"description": "Pipedream Shopify (Developer App) Components",
"main": "shopify_developer_app.app.mjs",
"keywords": [
Expand Down
Loading