@pipedream/shopify_developer_app 0.6.4 → 0.7.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.
Files changed (61) hide show
  1. package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +14 -24
  2. package/actions/add-tags/add-tags.mjs +14 -7
  3. package/actions/common/constants.mjs +86 -0
  4. package/actions/common/metafield-actions.mjs +264 -3
  5. package/actions/create-article/create-article.mjs +16 -28
  6. package/actions/create-blog/create-blog.mjs +16 -15
  7. package/actions/create-custom-collection/create-custom-collection.mjs +14 -28
  8. package/actions/create-customer/create-customer.mjs +27 -5
  9. package/actions/create-metafield/create-metafield.mjs +50 -8
  10. package/actions/create-metaobject/create-metaobject.mjs +14 -19
  11. package/actions/create-order/create-order.mjs +147 -10
  12. package/actions/create-page/create-page.mjs +16 -21
  13. package/actions/create-product/create-product.mjs +14 -61
  14. package/actions/create-product-variant/create-product-variant.mjs +14 -48
  15. package/actions/create-smart-collection/create-smart-collection.mjs +14 -19
  16. package/actions/delete-article/delete-article.mjs +16 -23
  17. package/actions/delete-blog/delete-blog.mjs +16 -14
  18. package/actions/delete-metafield/delete-metafield.mjs +41 -8
  19. package/actions/delete-page/delete-page.mjs +16 -14
  20. package/actions/get-articles/get-articles.mjs +16 -14
  21. package/actions/get-metafields/get-metafields.mjs +40 -8
  22. package/actions/get-metaobjects/get-metaobjects.mjs +14 -18
  23. package/actions/get-order/get-order.mjs +9 -7
  24. package/actions/get-pages/get-pages.mjs +16 -8
  25. package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +14 -14
  26. package/actions/search-customers/search-customers.mjs +23 -13
  27. package/actions/search-product-variant/search-product-variant.mjs +14 -30
  28. package/actions/search-products/search-products.mjs +14 -40
  29. package/actions/update-article/update-article.mjs +16 -37
  30. package/actions/update-customer/update-customer.mjs +32 -5
  31. package/actions/update-inventory-level/update-inventory-level.mjs +14 -28
  32. package/actions/update-metafield/update-metafield.mjs +18 -15
  33. package/actions/update-metaobject/update-metaobject.mjs +14 -24
  34. package/actions/update-page/update-page.mjs +16 -27
  35. package/actions/update-product/update-product.mjs +92 -41
  36. package/actions/update-product-variant/update-product-variant.mjs +14 -71
  37. package/common/mutations.mjs +124 -0
  38. package/common/queries.mjs +181 -0
  39. package/common/utils.mjs +40 -0
  40. package/package.json +2 -2
  41. package/shopify_developer_app.app.mjs +130 -1
  42. package/sources/common/webhook.mjs +17 -9
  43. package/sources/new-abandoned-cart/new-abandoned-cart.mjs +14 -8
  44. package/sources/new-article/new-article.mjs +15 -9
  45. package/sources/new-cancelled-order/new-cancelled-order.mjs +3 -4
  46. package/sources/new-customer-created/new-customer-created.mjs +3 -4
  47. package/sources/new-draft-order/new-draft-order.mjs +3 -4
  48. package/sources/new-event-emitted/new-event-emitted.mjs +10 -4
  49. package/sources/new-fulfillment-event/new-fulfillment-event.mjs +3 -4
  50. package/sources/new-order-created/new-order-created.mjs +3 -13
  51. package/sources/new-order-fulfilled/new-order-fulfilled.mjs +3 -4
  52. package/sources/new-page/new-page.mjs +15 -9
  53. package/sources/new-paid-order/new-paid-order.mjs +3 -4
  54. package/sources/new-product-created/new-product-created.mjs +3 -4
  55. package/sources/new-product-updated/new-product-updated.mjs +3 -4
  56. package/sources/new-refund-created/new-refund-created.mjs +2 -3
  57. package/sources/new-updated-customer/new-updated-customer.mjs +3 -4
  58. package/sources/new-updated-order/new-updated-order.mjs +3 -4
  59. package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +15 -9
  60. package/actions/common/metaobjects.mjs +0 -21
  61. package/common/rest-admin.mjs +0 -97
@@ -1,16 +1,22 @@
1
1
  import shopify from "../../shopify_developer_app.app.mjs";
2
- import common from "@pipedream/shopify/sources/product-added-to-custom-collection/common.mjs";
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
- ...common,
12
+ ...others,
6
13
  key: "shopify_developer_app-product-added-to-custom-collection",
7
- name: "New product added to custom collection",
8
- description: "Emit new event each time a product is added to a custom collection.",
9
- version: "0.0.4",
10
- type: "source",
11
- dedupe: "unique",
14
+ version: "0.0.6",
15
+ name,
16
+ description,
17
+ type,
12
18
  props: {
13
- shopify,
14
- ...common.props,
19
+ app: shopify,
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
- };
@@ -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
- };