@pipedream/shopify_developer_app 0.8.0 → 0.9.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.
Files changed (64) hide show
  1. package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +1 -1
  2. package/actions/add-tags/add-tags.mjs +1 -1
  3. package/actions/create-article/create-article.mjs +1 -1
  4. package/actions/create-blog/create-blog.mjs +1 -1
  5. package/actions/create-custom-collection/create-custom-collection.mjs +1 -1
  6. package/actions/create-customer/create-customer.mjs +1 -1
  7. package/actions/create-fulfillment/create-fulfillment.mjs +77 -0
  8. package/actions/create-metafield/create-metafield.mjs +1 -1
  9. package/actions/create-metaobject/create-metaobject.mjs +1 -1
  10. package/actions/create-order/create-order.mjs +1 -1
  11. package/actions/create-page/create-page.mjs +1 -1
  12. package/actions/create-product/create-product.mjs +1 -1
  13. package/actions/create-product-variant/create-product-variant.mjs +1 -1
  14. package/actions/create-smart-collection/create-smart-collection.mjs +1 -1
  15. package/actions/delete-article/delete-article.mjs +1 -1
  16. package/actions/delete-blog/delete-blog.mjs +1 -1
  17. package/actions/delete-metafield/delete-metafield.mjs +1 -1
  18. package/actions/delete-page/delete-page.mjs +1 -1
  19. package/actions/get-articles/get-articles.mjs +1 -1
  20. package/actions/get-metafields/get-metafields.mjs +1 -1
  21. package/actions/get-metaobjects/get-metaobjects.mjs +1 -1
  22. package/actions/get-order/get-order.mjs +1 -1
  23. package/actions/get-pages/get-pages.mjs +1 -1
  24. package/actions/refund-order/refund-order.mjs +100 -0
  25. package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +1 -1
  26. package/actions/search-customers/search-customers.mjs +1 -1
  27. package/actions/search-fulfillment-orders/search-fulfillment-orders.mjs +40 -0
  28. package/actions/search-orders/search-orders.mjs +1 -1
  29. package/actions/search-product-variant/search-product-variant.mjs +1 -1
  30. package/actions/search-products/search-products.mjs +1 -1
  31. package/actions/update-article/update-article.mjs +1 -1
  32. package/actions/update-customer/update-customer.mjs +1 -1
  33. package/actions/update-fulfillment-tracking-info/update-fulfillment-tracking-info.mjs +68 -0
  34. package/actions/update-inventory-level/update-inventory-level.mjs +1 -1
  35. package/actions/update-metafield/update-metafield.mjs +1 -1
  36. package/actions/update-metaobject/update-metaobject.mjs +1 -1
  37. package/actions/update-page/update-page.mjs +1 -1
  38. package/actions/update-product/update-product.mjs +1 -1
  39. package/actions/update-product-variant/update-product-variant.mjs +1 -1
  40. package/common/mutations.mjs +88 -0
  41. package/common/queries.mjs +604 -32
  42. package/package.json +1 -1
  43. package/shopify_developer_app.app.mjs +72 -1
  44. package/sources/cart-updated/cart-updated.mjs +25 -0
  45. package/sources/inventory-level-updated/inventory-level-updated.mjs +25 -0
  46. package/sources/new-abandoned-cart/new-abandoned-cart.mjs +1 -1
  47. package/sources/new-article/new-article.mjs +1 -1
  48. package/sources/new-cancelled-order/new-cancelled-order.mjs +1 -1
  49. package/sources/new-cart-created/new-cart-created.mjs +25 -0
  50. package/sources/new-customer-created/new-customer-created.mjs +1 -1
  51. package/sources/new-draft-order/new-draft-order.mjs +1 -1
  52. package/sources/new-event-emitted/new-event-emitted.mjs +1 -1
  53. package/sources/new-fulfillment-event/new-fulfillment-event.mjs +1 -1
  54. package/sources/new-order-created/new-order-created.mjs +1 -1
  55. package/sources/new-order-fulfilled/new-order-fulfilled.mjs +1 -1
  56. package/sources/new-page/new-page.mjs +1 -1
  57. package/sources/new-paid-order/new-paid-order.mjs +1 -1
  58. package/sources/new-product-created/new-product-created.mjs +1 -1
  59. package/sources/new-product-updated/new-product-updated.mjs +1 -1
  60. package/sources/new-refund-created/new-refund-created.mjs +1 -1
  61. package/sources/new-updated-customer/new-updated-customer.mjs +1 -1
  62. package/sources/new-updated-order/new-updated-order.mjs +1 -1
  63. package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +1 -1
  64. package/sources/shop-update/shop-update.mjs +25 -0
@@ -2,7 +2,9 @@ import commonApp from "@pipedream/shopify";
2
2
  import Shopify from "shopify-api-node";
3
3
  import queries from "./common/queries.mjs";
4
4
  import mutations from "./common/mutations.mjs";
5
- import { API_VERSION } from "@pipedream/shopify/common/constants.mjs";
5
+ import {
6
+ API_VERSION, MAX_LIMIT,
7
+ } from "@pipedream/shopify/common/constants.mjs";
6
8
 
7
9
  export default {
8
10
  ...commonApp,
@@ -40,6 +42,60 @@ export default {
40
42
  });
41
43
  },
42
44
  },
45
+ lineItemIds: {
46
+ type: "string[]",
47
+ label: "Line Item IDs",
48
+ description: "An array of line item IDs",
49
+ async options({ orderId }) {
50
+ const order = await this.getOrder({
51
+ id: orderId,
52
+ first: MAX_LIMIT,
53
+ });
54
+ return order.order.lineItems.edges.map(({ node }) => ({
55
+ label: node.title,
56
+ value: node.id,
57
+ }));
58
+ },
59
+ },
60
+ fulfillmentId: {
61
+ type: "string",
62
+ label: "Fulfillment ID",
63
+ description: "The identifier of a fulfillment",
64
+ async options({ orderId }) {
65
+ const order = await this.getOrder({
66
+ id: orderId,
67
+ first: MAX_LIMIT,
68
+ });
69
+ return order.order.fulfillments?.map(({ id }) => id) ?? [];
70
+ },
71
+ },
72
+ fulfillmentOrderId: {
73
+ type: "string",
74
+ label: "Fulfillment Order ID",
75
+ description: "The identifier of a fulfillment order",
76
+ async options({ prevContext }) {
77
+ return this.getPropOptions({
78
+ resourceFn: this.listFulfillmentOrders,
79
+ resourceKeys: [
80
+ "fulfillmentOrders",
81
+ ],
82
+ labelKey: "id",
83
+ prevContext,
84
+ });
85
+ },
86
+ },
87
+ fulfillmentOrderLineItemIds: {
88
+ type: "string[]",
89
+ label: "Fulfillment Order Line Item IDs",
90
+ description: "An array of fulfillment order line item IDs",
91
+ async options({ fulfillmentOrderId }) {
92
+ const fulfillmentOrder = await this.getFulfillmentOrder({
93
+ fulfillmentOrderId,
94
+ first: MAX_LIMIT,
95
+ });
96
+ return fulfillmentOrder.fulfillmentOrder.lineItems.nodes.map(({ id }) => id);
97
+ },
98
+ },
43
99
  firstName: {
44
100
  type: "string",
45
101
  label: "First Name",
@@ -122,6 +178,9 @@ export default {
122
178
  getDraftOrder(variables) {
123
179
  return this._makeGraphQlRequest(queries.GET_DRAFT_ORDER, variables);
124
180
  },
181
+ getFulfillmentOrder(variables) {
182
+ return this._makeGraphQlRequest(queries.GET_FULFILLMENT_ORDER, variables);
183
+ },
125
184
  getCustomer(variables) {
126
185
  return this._makeGraphQlRequest(queries.GET_CUSTOMER, variables);
127
186
  },
@@ -134,14 +193,26 @@ export default {
134
193
  listCustomers(variables) {
135
194
  return this._makeGraphQlRequest(queries.LIST_CUSTOMERS, variables);
136
195
  },
196
+ listFulfillmentOrders(variables) {
197
+ return this._makeGraphQlRequest(queries.LIST_FULFILLMENT_ORDERS, variables);
198
+ },
137
199
  createOrder(variables) {
138
200
  return this._makeGraphQlRequest(mutations.CREATE_ORDER, variables);
139
201
  },
140
202
  createCustomer(variables) {
141
203
  return this._makeGraphQlRequest(mutations.CREATE_CUSTOMER, variables);
142
204
  },
205
+ createFulfillment(variables) {
206
+ return this._makeGraphQlRequest(mutations.CREATE_FULFILLMENT, variables);
207
+ },
143
208
  updateCustomer(variables) {
144
209
  return this._makeGraphQlRequest(mutations.UPDATE_CUSTOMER, variables);
145
210
  },
211
+ refundOrder(variables) {
212
+ return this._makeGraphQlRequest(mutations.REFUND_ORDER, variables);
213
+ },
214
+ updateFulfillmentTrackingInfo(variables) {
215
+ return this._makeGraphQlRequest(mutations.UPDATE_FULFILLMENT_TRACKING_INFO, variables);
216
+ },
146
217
  },
147
218
  };
@@ -0,0 +1,25 @@
1
+ import common from "../common/webhook.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "shopify_developer_app-cart-updated",
6
+ name: "Cart Updated (Instant)",
7
+ description: "Emit new event when a cart is updated.",
8
+ version: "0.0.1",
9
+ type: "source",
10
+ dedupe: "unique",
11
+ methods: {
12
+ ...common.methods,
13
+ getTopic() {
14
+ return "CARTS_UPDATE";
15
+ },
16
+ generateMeta(resource) {
17
+ const ts = Date.parse(resource.updated_at);
18
+ return {
19
+ id: `${resource.id}-${ts}`,
20
+ summary: `Cart Updated ${resource.id}`,
21
+ ts,
22
+ };
23
+ },
24
+ },
25
+ };
@@ -0,0 +1,25 @@
1
+ import common from "../common/webhook.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "shopify_developer_app-inventory-level-updated",
6
+ name: "Inventory Level Updated (Instant)",
7
+ description: "Emit new event when an inventory level is updated.",
8
+ version: "0.0.1",
9
+ type: "source",
10
+ dedupe: "unique",
11
+ methods: {
12
+ ...common.methods,
13
+ getTopic() {
14
+ return "INVENTORY_LEVELS_UPDATE";
15
+ },
16
+ generateMeta(resource) {
17
+ const ts = Date.parse(resource.updated_at);
18
+ return {
19
+ id: `${resource.inventory_item_id}-${ts}`,
20
+ summary: `Inventory Level Updated ${resource.inventory_item_id}`,
21
+ ts,
22
+ };
23
+ },
24
+ },
25
+ };
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-new-abandoned-cart",
14
- version: "0.0.8",
14
+ version: "0.0.10",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-new-article",
14
- version: "0.0.7",
14
+ version: "0.0.9",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Cancelled Order (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event each time a new order is cancelled.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -0,0 +1,25 @@
1
+ import common from "../common/webhook.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "shopify_developer_app-new-cart-created",
6
+ name: "New Cart Created (Instant)",
7
+ description: "Emit new event when a new cart is created.",
8
+ version: "0.0.1",
9
+ type: "source",
10
+ dedupe: "unique",
11
+ methods: {
12
+ ...common.methods,
13
+ getTopic() {
14
+ return "CARTS_CREATE";
15
+ },
16
+ generateMeta(resource) {
17
+ const ts = Date.parse(resource.created_at);
18
+ return {
19
+ id: `${resource.id}-${ts}`,
20
+ summary: `Cart Created ${resource.id}`,
21
+ ts,
22
+ };
23
+ },
24
+ },
25
+ };
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Customer Created (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event for each new customer added to a store.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Draft Order (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event for each new draft order submitted to a store.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -7,7 +7,7 @@ export default {
7
7
  name: "New Event Emitted (Instant)",
8
8
  type: "source",
9
9
  description: "Emit new event for each new Shopify event.",
10
- version: "0.0.12",
10
+ version: "0.0.14",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Fulfillment Event (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event for each new fulfillment event for a store.",
9
- version: "0.0.9",
9
+ version: "0.0.11",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Order Created (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event for each new order submitted to a store.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Order Fulfilled (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event whenever an order is fulfilled.",
9
- version: "0.0.8",
9
+ version: "0.0.10",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-new-page",
14
- version: "0.0.7",
14
+ version: "0.0.9",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Paid Order (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event each time a new order is paid.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Product Created (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event for each product added to a store.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "shopify_developer_app-new-product-updated",
6
6
  name: "New Product Updated (Instant)",
7
7
  description: "Emit new event for each product updated in a store.",
8
- version: "0.0.9",
8
+ version: "0.0.11",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "shopify_developer_app-new-refund-created",
6
6
  name: "New Refund Created (Instant)",
7
7
  description: "Emit new event when a new refund is created.",
8
- version: "0.0.8",
8
+ version: "0.0.10",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  methods: {
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Updated Customer (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event each time a customer's information is updated.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Updated Order (Instant)",
7
7
  type: "source",
8
8
  description: "Emit new event each time an order is updated.",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify);
11
11
  export default {
12
12
  ...others,
13
13
  key: "shopify_developer_app-product-added-to-custom-collection",
14
- version: "0.0.7",
14
+ version: "0.0.9",
15
15
  name,
16
16
  description,
17
17
  type,
@@ -0,0 +1,25 @@
1
+ import common from "../common/webhook.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "shopify_developer_app-shop-update",
6
+ name: "Shop Updated (Instant)",
7
+ description: "Emit new event when a shop is updated.",
8
+ version: "0.0.1",
9
+ type: "source",
10
+ dedupe: "unique",
11
+ methods: {
12
+ ...common.methods,
13
+ getTopic() {
14
+ return "SHOP_UPDATE";
15
+ },
16
+ generateMeta(resource) {
17
+ const ts = Date.parse(resource.updated_at);
18
+ return {
19
+ id: `${resource.id}-${ts}`,
20
+ summary: `Shop Updated ${resource.id}`,
21
+ ts,
22
+ };
23
+ },
24
+ },
25
+ };