@pipedream/shopify_developer_app 0.2.5 → 0.3.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.
- package/package.json +1 -1
- package/sources/common/webhook.mjs +2 -2
- package/sources/new-cancelled-order/new-cancelled-order.mjs +1 -1
- package/sources/new-customer-created/new-customer-created.mjs +1 -1
- package/sources/new-draft-order/new-draft-order.mjs +1 -1
- package/sources/new-event-emitted/new-event-emitted.mjs +1 -1
- package/sources/new-order-created/new-order-created.mjs +1 -1
- package/sources/new-paid-order/new-paid-order.mjs +1 -1
- package/sources/new-product-created/new-product-created.mjs +1 -1
- package/sources/new-product-updated/new-product-updated.mjs +55 -0
- package/sources/new-product-updated/test-event.mjs +64 -0
- package/sources/new-shipment/new-shipment.mjs +1 -1
- package/sources/new-updated-customer/new-updated-customer.mjs +1 -1
- package/sources/new-updated-order/new-updated-order.mjs +1 -1
package/package.json
CHANGED
|
@@ -12,13 +12,13 @@ export default {
|
|
|
12
12
|
metafieldNamespaces: {
|
|
13
13
|
type: "string[]",
|
|
14
14
|
label: "Metafield Namespaces",
|
|
15
|
-
description: "Array of namespaces for any metafields that should be included with each webhook",
|
|
15
|
+
description: "Array of namespaces for any metafields that should be included with each webhook. Metafield definitions can be found in your store's Settings -> Custom Data. Select a metafield to view its namespace under \"Namespace and key\". For example, if the value is `custom.test_metafield`, the namespace is `custom`.",
|
|
16
16
|
optional: true,
|
|
17
17
|
},
|
|
18
18
|
privateMetafieldNamespaces: {
|
|
19
19
|
type: "string[]",
|
|
20
20
|
label: "Private Metafield Namespaces",
|
|
21
|
-
description: "Array of namespaces for any private metafields that should be included with each webhook",
|
|
21
|
+
description: "Array of namespaces for any private metafields that should be included with each webhook. Metafield definitions can be found in your store's Settings -> Custom Data. Select a metafield to view its namespace under \"Namespace and key\". For example, if the value is `custom.test_metafield`, the namespace is `custom`.",
|
|
22
22
|
optional: true,
|
|
23
23
|
},
|
|
24
24
|
},
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import common from "../common/webhook.mjs";
|
|
2
|
+
import constants from "../common/constants.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-new-product-updated",
|
|
7
|
+
name: "New Product Updated (Instant)",
|
|
8
|
+
description: "Emit new event for each product updated in a store.",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "source",
|
|
11
|
+
dedupe: "unique",
|
|
12
|
+
props: {
|
|
13
|
+
...common.props,
|
|
14
|
+
productType: {
|
|
15
|
+
type: "string",
|
|
16
|
+
label: "Product Type",
|
|
17
|
+
description: "Filter results by product type",
|
|
18
|
+
optional: true,
|
|
19
|
+
},
|
|
20
|
+
tags: {
|
|
21
|
+
type: "string[]",
|
|
22
|
+
label: "Tags",
|
|
23
|
+
description: "Filter results by product tag(s)",
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
...common.methods,
|
|
29
|
+
getTopic() {
|
|
30
|
+
return constants.EVENT_TOPIC.PRODUCTS_UPDATE;
|
|
31
|
+
},
|
|
32
|
+
isRelevant(resource) {
|
|
33
|
+
let relevant = true;
|
|
34
|
+
if (this.productType && resource.product_type !== this.productType) {
|
|
35
|
+
relevant = false;
|
|
36
|
+
}
|
|
37
|
+
if (this.tags?.length) {
|
|
38
|
+
this.tags.forEach((tag) => {
|
|
39
|
+
if (!resource.tags?.includes(tag)) {
|
|
40
|
+
relevant = false;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return relevant;
|
|
45
|
+
},
|
|
46
|
+
generateMeta(resource) {
|
|
47
|
+
const ts = Date.parse(resource.updated_at);
|
|
48
|
+
return {
|
|
49
|
+
id: `${resource.id}-${ts}`,
|
|
50
|
+
summary: `Product Updated ${resource.id}`,
|
|
51
|
+
ts,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"admin_graphql_api_id": "gid://shopify/Product/8416570474776",
|
|
3
|
+
"body_html": null,
|
|
4
|
+
"created_at": "2023-06-30T13:38:03-04:00",
|
|
5
|
+
"handle": "best-product-ever",
|
|
6
|
+
"id": 8416570474776,
|
|
7
|
+
"product_type": "",
|
|
8
|
+
"published_at": "2023-06-30T13:38:03-04:00",
|
|
9
|
+
"template_suffix": null,
|
|
10
|
+
"title": "product",
|
|
11
|
+
"updated_at": "2024-06-18T14:37:58-04:00",
|
|
12
|
+
"vendor": "Testing",
|
|
13
|
+
"status": "active",
|
|
14
|
+
"published_scope": "web",
|
|
15
|
+
"tags": "abc, def",
|
|
16
|
+
"variants": [
|
|
17
|
+
{
|
|
18
|
+
"admin_graphql_api_id": "gid://shopify/ProductVariant/45612961333528",
|
|
19
|
+
"barcode": null,
|
|
20
|
+
"compare_at_price": null,
|
|
21
|
+
"created_at": "2023-06-30T13:38:03-04:00",
|
|
22
|
+
"fulfillment_service": "manual",
|
|
23
|
+
"id": 45612961333528,
|
|
24
|
+
"inventory_management": null,
|
|
25
|
+
"inventory_policy": "deny",
|
|
26
|
+
"position": 1,
|
|
27
|
+
"price": "0.00",
|
|
28
|
+
"product_id": 8416570474776,
|
|
29
|
+
"sku": "",
|
|
30
|
+
"taxable": true,
|
|
31
|
+
"title": "Default Title",
|
|
32
|
+
"updated_at": "2023-10-27T10:08:17-04:00",
|
|
33
|
+
"option1": "Default Title",
|
|
34
|
+
"option2": null,
|
|
35
|
+
"option3": null,
|
|
36
|
+
"grams": 0,
|
|
37
|
+
"image_id": null,
|
|
38
|
+
"weight": 0,
|
|
39
|
+
"weight_unit": "lb",
|
|
40
|
+
"inventory_item_id": 47661178487064,
|
|
41
|
+
"inventory_quantity": 0,
|
|
42
|
+
"old_inventory_quantity": 0,
|
|
43
|
+
"requires_shipping": true
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
"options": [
|
|
47
|
+
{
|
|
48
|
+
"name": "Title",
|
|
49
|
+
"id": 10664239726872,
|
|
50
|
+
"product_id": 8416570474776,
|
|
51
|
+
"position": 1,
|
|
52
|
+
"values": [
|
|
53
|
+
"Default Title",
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"images": [],
|
|
58
|
+
"image": null,
|
|
59
|
+
"variant_ids": [
|
|
60
|
+
{
|
|
61
|
+
"id": 45612961333528
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|