Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.2.4",
"version": "0.3.0",
"description": "Pipedream Shopify (Developer App) Components",
"main": "shopify_developer_app.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import common from "../common/webhook.mjs";
import constants from "../common/constants.mjs";

export default {
...common,
key: "shopify_developer_app-new-product-updated",
name: "New Product Updated (Instant)",
description: "Emit new event for each product updated in a store.",
version: "0.0.1",
type: "source",
dedupe: "unique",
props: {
...common.props,
productType: {
type: "string",
label: "Product Type",
description: "Filter results by product type",
optional: true,
},
tags: {
type: "string[]",
label: "Tags",
description: "Filter results by product tag(s)",
optional: true,
},
},
methods: {
...common.methods,
getTopic() {
return constants.EVENT_TOPIC.PRODUCTS_UPDATE;
},
isRelevant(resource) {
let relevant = true;
if (this.productType && resource.product_type !== this.productType) {
relevant = false;
}
if (this.tags?.length) {
this.tags.forEach((tag) => {
if (!resource.tags?.includes(tag)) {
relevant = false;
}
});
}
return relevant;
},
generateMeta(resource) {
const ts = Date.parse(resource.updated_at);
return {
id: `${resource.id}-${ts}`,
summary: `Product Updated ${resource.id}`,
ts,
};
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
export default {
"admin_graphql_api_id": "gid://shopify/Product/8416570474776",
"body_html": null,
"created_at": "2023-06-30T13:38:03-04:00",
"handle": "best-product-ever",
"id": 8416570474776,
"product_type": "",
"published_at": "2023-06-30T13:38:03-04:00",
"template_suffix": null,
"title": "product",
"updated_at": "2024-06-18T14:37:58-04:00",
"vendor": "Testing",
"status": "active",
"published_scope": "web",
"tags": "abc, def",
"variants": [
{
"admin_graphql_api_id": "gid://shopify/ProductVariant/45612961333528",
"barcode": null,
"compare_at_price": null,
"created_at": "2023-06-30T13:38:03-04:00",
"fulfillment_service": "manual",
"id": 45612961333528,
"inventory_management": null,
"inventory_policy": "deny",
"position": 1,
"price": "0.00",
"product_id": 8416570474776,
"sku": "",
"taxable": true,
"title": "Default Title",
"updated_at": "2023-10-27T10:08:17-04:00",
"option1": "Default Title",
"option2": null,
"option3": null,
"grams": 0,
"image_id": null,
"weight": 0,
"weight_unit": "lb",
"inventory_item_id": 47661178487064,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"requires_shipping": true
},
],
"options": [
{
"name": "Title",
"id": 10664239726872,
"product_id": 8416570474776,
"position": 1,
"values": [
"Default Title",
]
}
],
"images": [],
"image": null,
"variant_ids": [
{
"id": 45612961333528
}
]
}