@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.
- package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +14 -24
- package/actions/add-tags/add-tags.mjs +14 -7
- package/actions/common/constants.mjs +86 -0
- package/actions/common/metafield-actions.mjs +264 -3
- package/actions/create-article/create-article.mjs +16 -28
- package/actions/create-blog/create-blog.mjs +16 -15
- package/actions/create-custom-collection/create-custom-collection.mjs +14 -28
- package/actions/create-customer/create-customer.mjs +24 -5
- package/actions/create-metafield/create-metafield.mjs +50 -8
- package/actions/create-metaobject/create-metaobject.mjs +14 -19
- package/actions/create-order/create-order.mjs +144 -10
- package/actions/create-page/create-page.mjs +16 -21
- package/actions/create-product/create-product.mjs +14 -61
- package/actions/create-product-variant/create-product-variant.mjs +14 -48
- package/actions/create-smart-collection/create-smart-collection.mjs +14 -19
- package/actions/delete-article/delete-article.mjs +16 -23
- package/actions/delete-blog/delete-blog.mjs +16 -14
- package/actions/delete-metafield/delete-metafield.mjs +41 -8
- package/actions/delete-page/delete-page.mjs +16 -14
- package/actions/get-articles/get-articles.mjs +16 -14
- package/actions/get-metafields/get-metafields.mjs +40 -8
- package/actions/get-metaobjects/get-metaobjects.mjs +14 -18
- package/actions/get-order/get-order.mjs +9 -7
- package/actions/get-pages/get-pages.mjs +16 -8
- package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +14 -14
- package/actions/search-customers/search-customers.mjs +23 -13
- package/actions/search-product-variant/search-product-variant.mjs +14 -30
- package/actions/search-products/search-products.mjs +14 -40
- package/actions/update-article/update-article.mjs +16 -37
- package/actions/update-customer/update-customer.mjs +29 -5
- package/actions/update-inventory-level/update-inventory-level.mjs +14 -28
- package/actions/update-metafield/update-metafield.mjs +18 -15
- package/actions/update-metaobject/update-metaobject.mjs +14 -24
- package/actions/update-page/update-page.mjs +16 -27
- package/actions/update-product/update-product.mjs +96 -37
- package/actions/update-product-variant/update-product-variant.mjs +14 -71
- package/common/mutations.mjs +124 -0
- package/common/queries.mjs +181 -0
- package/common/utils.mjs +40 -0
- package/package.json +2 -2
- package/shopify_developer_app.app.mjs +130 -1
- package/sources/common/webhook.mjs +17 -9
- package/sources/new-abandoned-cart/new-abandoned-cart.mjs +14 -8
- package/sources/new-article/new-article.mjs +15 -9
- package/sources/new-cancelled-order/new-cancelled-order.mjs +4 -5
- package/sources/new-customer-created/new-customer-created.mjs +4 -5
- package/sources/new-draft-order/new-draft-order.mjs +4 -5
- package/sources/new-event-emitted/new-event-emitted.mjs +10 -4
- package/sources/new-fulfillment-event/new-fulfillment-event.mjs +4 -5
- package/sources/new-order-created/new-order-created.mjs +8 -6
- package/sources/new-order-fulfilled/new-order-fulfilled.mjs +4 -5
- package/sources/new-page/new-page.mjs +15 -9
- package/sources/new-paid-order/new-paid-order.mjs +4 -5
- package/sources/new-product-created/new-product-created.mjs +4 -5
- package/sources/new-product-updated/new-product-updated.mjs +4 -5
- package/sources/new-refund-created/new-refund-created.mjs +3 -4
- package/sources/new-updated-customer/new-updated-customer.mjs +4 -5
- package/sources/new-updated-order/new-updated-order.mjs +4 -5
- package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +14 -8
- package/actions/common/metaobjects.mjs +0 -21
- package/common/rest-admin.mjs +0 -97
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import constants from "../common/constants.mjs";
|
|
2
1
|
import common from "../common/webhook-metafields.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
@@ -7,18 +6,18 @@ export default {
|
|
|
7
6
|
name: "New Updated Order (Instant)",
|
|
8
7
|
type: "source",
|
|
9
8
|
description: "Emit new event each time an order is updated.",
|
|
10
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.9",
|
|
11
10
|
dedupe: "unique",
|
|
12
11
|
methods: {
|
|
13
12
|
...common.methods,
|
|
14
13
|
getTopic() {
|
|
15
|
-
return
|
|
14
|
+
return "ORDERS_UPDATED";
|
|
16
15
|
},
|
|
17
16
|
generateMeta(resource) {
|
|
18
|
-
const ts = Date.parse(resource.
|
|
17
|
+
const ts = Date.parse(resource.updatedAt);
|
|
19
18
|
return {
|
|
20
19
|
id: ts,
|
|
21
|
-
summary: `Order Updated ${resource.id}
|
|
20
|
+
summary: `Order Updated ${resource.id}`,
|
|
22
21
|
ts,
|
|
23
22
|
};
|
|
24
23
|
},
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/sources/
|
|
2
|
+
import common from "@pipedream/shopify/sources/collection-updated/collection-updated.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-product-added-to-custom-collection",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
11
|
-
dedupe: "unique",
|
|
14
|
+
version: "0.0.5",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
12
18
|
props: {
|
|
13
19
|
shopify,
|
|
14
|
-
...
|
|
20
|
+
...props,
|
|
15
21
|
},
|
|
16
22
|
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import metaobjects from "@pipedream/shopify/actions/common/metaobjects.mjs";
|
|
2
|
-
import { axios } from "@pipedream/platform";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
...metaobjects,
|
|
6
|
-
methods: {
|
|
7
|
-
...metaobjects.methods,
|
|
8
|
-
async makeGraphQLRequest({
|
|
9
|
-
$ = this, ...args
|
|
10
|
-
}) {
|
|
11
|
-
return axios($, {
|
|
12
|
-
url: `https://${this.shopify.getShopId()}.myshopify.com/admin/api/2024-04/graphql.json`,
|
|
13
|
-
method: "POST",
|
|
14
|
-
headers: {
|
|
15
|
-
"X-Shopify-Access-Token": `${this.shopify.$auth.access_token}`,
|
|
16
|
-
},
|
|
17
|
-
...args,
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
package/common/rest-admin.mjs
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import common from "../shopify_developer_app.app.mjs";
|
|
2
|
-
import restAdmin from "../../shopify/common/rest-admin.mjs";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
...common,
|
|
6
|
-
propDefinitions: {
|
|
7
|
-
...common.propDefinitions,
|
|
8
|
-
bodyHtml: {
|
|
9
|
-
type: "string",
|
|
10
|
-
label: "Body HTML",
|
|
11
|
-
description: "The text content of the page, complete with HTML markup.",
|
|
12
|
-
},
|
|
13
|
-
pageId: {
|
|
14
|
-
type: "string",
|
|
15
|
-
label: "Page ID",
|
|
16
|
-
description: "The unique numeric identifier for the page.",
|
|
17
|
-
async options() {
|
|
18
|
-
const { pages } = await this.listPages();
|
|
19
|
-
return pages.map(({
|
|
20
|
-
id: value, title: label,
|
|
21
|
-
}) => ({
|
|
22
|
-
label,
|
|
23
|
-
value,
|
|
24
|
-
}));
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
blogId: {
|
|
28
|
-
type: "string",
|
|
29
|
-
label: "Blog ID",
|
|
30
|
-
description: "The unique numeric identifier for the blog.",
|
|
31
|
-
async options() {
|
|
32
|
-
const { blogs } = await this.listBlogs();
|
|
33
|
-
return blogs.map(({
|
|
34
|
-
id: value, title: label,
|
|
35
|
-
}) => ({
|
|
36
|
-
label,
|
|
37
|
-
value,
|
|
38
|
-
}));
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
articleId: {
|
|
42
|
-
type: "string",
|
|
43
|
-
label: "Article ID",
|
|
44
|
-
description: "The unique numeric identifier for the article.",
|
|
45
|
-
async options({ blogId }) {
|
|
46
|
-
const { articles } = await this.listBlogArticles({
|
|
47
|
-
blogId,
|
|
48
|
-
});
|
|
49
|
-
return articles.map(({
|
|
50
|
-
id: value, title: label,
|
|
51
|
-
}) => ({
|
|
52
|
-
label,
|
|
53
|
-
value,
|
|
54
|
-
}));
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
orderId: {
|
|
58
|
-
type: "string",
|
|
59
|
-
label: "Order ID",
|
|
60
|
-
description: "The unique numeric identifier for the order.",
|
|
61
|
-
async options() {
|
|
62
|
-
const { orders } = await this.listOrders();
|
|
63
|
-
return orders.map(({
|
|
64
|
-
id: value, name: label,
|
|
65
|
-
}) => ({
|
|
66
|
-
label,
|
|
67
|
-
value,
|
|
68
|
-
}));
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
methods: {
|
|
73
|
-
...common.methods,
|
|
74
|
-
...restAdmin.methods,
|
|
75
|
-
getHeaders(headers) {
|
|
76
|
-
return {
|
|
77
|
-
"Content-Type": "application/json",
|
|
78
|
-
"X-Shopify-Access-Token": this.$auth.access_token,
|
|
79
|
-
...headers,
|
|
80
|
-
};
|
|
81
|
-
},
|
|
82
|
-
listOrders(args = {}) {
|
|
83
|
-
return this.makeRequest({
|
|
84
|
-
path: "/orders",
|
|
85
|
-
...args,
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
getOrder({
|
|
89
|
-
orderId, ...args
|
|
90
|
-
}) {
|
|
91
|
-
return this.makeRequest({
|
|
92
|
-
path: `/orders/${orderId}`,
|
|
93
|
-
...args,
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
};
|