@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.
- package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +1 -1
- package/actions/add-tags/add-tags.mjs +1 -1
- package/actions/create-article/create-article.mjs +1 -1
- package/actions/create-blog/create-blog.mjs +1 -1
- package/actions/create-custom-collection/create-custom-collection.mjs +1 -1
- package/actions/create-customer/create-customer.mjs +1 -1
- package/actions/create-fulfillment/create-fulfillment.mjs +77 -0
- package/actions/create-metafield/create-metafield.mjs +1 -1
- package/actions/create-metaobject/create-metaobject.mjs +1 -1
- package/actions/create-order/create-order.mjs +1 -1
- package/actions/create-page/create-page.mjs +1 -1
- package/actions/create-product/create-product.mjs +1 -1
- package/actions/create-product-variant/create-product-variant.mjs +1 -1
- package/actions/create-smart-collection/create-smart-collection.mjs +1 -1
- package/actions/delete-article/delete-article.mjs +1 -1
- package/actions/delete-blog/delete-blog.mjs +1 -1
- package/actions/delete-metafield/delete-metafield.mjs +1 -1
- package/actions/delete-page/delete-page.mjs +1 -1
- package/actions/get-articles/get-articles.mjs +1 -1
- package/actions/get-metafields/get-metafields.mjs +1 -1
- package/actions/get-metaobjects/get-metaobjects.mjs +1 -1
- package/actions/get-order/get-order.mjs +1 -1
- package/actions/get-pages/get-pages.mjs +1 -1
- package/actions/refund-order/refund-order.mjs +100 -0
- package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +1 -1
- package/actions/search-customers/search-customers.mjs +1 -1
- package/actions/search-fulfillment-orders/search-fulfillment-orders.mjs +40 -0
- package/actions/search-orders/search-orders.mjs +1 -1
- package/actions/search-product-variant/search-product-variant.mjs +1 -1
- package/actions/search-products/search-products.mjs +1 -1
- package/actions/update-article/update-article.mjs +1 -1
- package/actions/update-customer/update-customer.mjs +1 -1
- package/actions/update-fulfillment-tracking-info/update-fulfillment-tracking-info.mjs +68 -0
- package/actions/update-inventory-level/update-inventory-level.mjs +1 -1
- package/actions/update-metafield/update-metafield.mjs +1 -1
- package/actions/update-metaobject/update-metaobject.mjs +1 -1
- package/actions/update-page/update-page.mjs +1 -1
- package/actions/update-product/update-product.mjs +1 -1
- package/actions/update-product-variant/update-product-variant.mjs +1 -1
- package/common/mutations.mjs +88 -0
- package/common/queries.mjs +604 -32
- package/package.json +1 -1
- package/shopify_developer_app.app.mjs +72 -1
- package/sources/cart-updated/cart-updated.mjs +25 -0
- package/sources/inventory-level-updated/inventory-level-updated.mjs +25 -0
- package/sources/new-abandoned-cart/new-abandoned-cart.mjs +1 -1
- package/sources/new-article/new-article.mjs +1 -1
- package/sources/new-cancelled-order/new-cancelled-order.mjs +1 -1
- package/sources/new-cart-created/new-cart-created.mjs +25 -0
- 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-fulfillment-event/new-fulfillment-event.mjs +1 -1
- package/sources/new-order-created/new-order-created.mjs +1 -1
- package/sources/new-order-fulfilled/new-order-fulfilled.mjs +1 -1
- package/sources/new-page/new-page.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 +1 -1
- package/sources/new-refund-created/new-refund-created.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/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +1 -1
- 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 {
|
|
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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -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.
|
|
8
|
+
version: "0.0.11",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -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
|
+
};
|