@pipedream/shopify_developer_app 0.10.5 → 0.10.6
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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/send-order-invoice/send-order-invoice.mjs +95 -0
- 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 +1 -1
- 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 +16 -0
- package/package.json +1 -1
- package/shopify_developer_app.app.mjs +3 -0
- package/sources/cart-updated/cart-updated.mjs +1 -1
- package/sources/draft-order-updated/draft-order-updated.mjs +1 -1
- package/sources/inventory-level-updated/inventory-level-updated.mjs +1 -1
- 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 +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-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 +1 -1
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "shopify_developer_app-create-customer",
|
|
5
5
|
name: "Create Customer",
|
|
6
6
|
description: "Create a new customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customercreate)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "shopify_developer_app-create-fulfillment",
|
|
5
5
|
name: "Create Fulfillment",
|
|
6
6
|
description: "Create a fulfillment. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/fulfillmentcreate)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "shopify_developer_app-create-order",
|
|
6
6
|
name: "Create Order",
|
|
7
7
|
description: "Creates a new order. For full order object details [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/ordercreate)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.14",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "shopify_developer_app-get-order",
|
|
7
7
|
name: "Get Order",
|
|
8
8
|
description: "Retrieve an order by specifying the order ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/order)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.13",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "shopify_developer_app-refund-order",
|
|
6
6
|
name: "Refund Order",
|
|
7
7
|
description: "Refund an order. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/refundcreate)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "shopify_developer_app-search-customers",
|
|
5
5
|
name: "Search for Customers",
|
|
6
6
|
description: "Search for a customer or a list of customers. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "shopify_developer_app-search-fulfillment-orders",
|
|
5
5
|
name: "Search for Fulfillment Orders",
|
|
6
6
|
description: "Search for a fulfillment order or a list of fulfillment orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/queries/fulfillmentorders)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "shopify_developer_app-search-orders",
|
|
6
6
|
name: "Search for Orders",
|
|
7
7
|
description: "Search for an order or a list of orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/orders)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.8",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "shopify_developer_app-send-order-invoice",
|
|
6
|
+
name: "Send Order Invoice",
|
|
7
|
+
description: "Sends an invoice for an order. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/OrderInvoiceSend)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
},
|
|
14
|
+
type: "action",
|
|
15
|
+
props: {
|
|
16
|
+
shopify,
|
|
17
|
+
orderId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
shopify,
|
|
20
|
+
"orderId",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
to: {
|
|
24
|
+
type: "string",
|
|
25
|
+
label: "To Email",
|
|
26
|
+
description: "The recipient email address for the invoice",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
from: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "From Email",
|
|
32
|
+
description: "The sender email address. Must be a store or staff account email",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
bcc: {
|
|
36
|
+
type: "string[]",
|
|
37
|
+
label: "BCC Emails",
|
|
38
|
+
description: "Blind carbon copy email addresses. Must be store or staff account emails",
|
|
39
|
+
optional: true,
|
|
40
|
+
},
|
|
41
|
+
subject: {
|
|
42
|
+
type: "string",
|
|
43
|
+
label: "Subject",
|
|
44
|
+
description: "Custom subject line for the invoice email",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
customMessage: {
|
|
48
|
+
type: "string",
|
|
49
|
+
label: "Custom Message",
|
|
50
|
+
description: "Optional custom message to include in the invoice email",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
validateOrderId(orderId) {
|
|
56
|
+
const prefix = "gid://shopify/Order/";
|
|
57
|
+
const value = String(orderId).trim();
|
|
58
|
+
if (value.startsWith(prefix)) {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
if (/^\d+$/.test(value)) {
|
|
62
|
+
return `${prefix}${value}`;
|
|
63
|
+
}
|
|
64
|
+
throw new ConfigurationError(`Invalid order ID: ${orderId}`);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
async run({ $ }) {
|
|
68
|
+
const orderId = this.validateOrderId(this.orderId);
|
|
69
|
+
|
|
70
|
+
const email = {};
|
|
71
|
+
if (this.to) email.to = this.to;
|
|
72
|
+
if (this.from) email.from = this.from;
|
|
73
|
+
if (this.bcc && this.bcc.length > 0) email.bcc = this.bcc;
|
|
74
|
+
if (this.subject) email.subject = this.subject;
|
|
75
|
+
if (this.customMessage) email.customMessage = this.customMessage;
|
|
76
|
+
|
|
77
|
+
const variables = {
|
|
78
|
+
id: orderId,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Only include email object if at least one field is set
|
|
82
|
+
if (Object.keys(email).length > 0) {
|
|
83
|
+
variables.email = email;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const response = await this.shopify.sendOrderInvoice(variables);
|
|
87
|
+
|
|
88
|
+
if (response.orderInvoiceSend.userErrors.length > 0) {
|
|
89
|
+
throw new Error(response.orderInvoiceSend.userErrors[0].message);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
$.export("$summary", `Successfully sent invoice for order ${response.orderInvoiceSend.order.name}`);
|
|
93
|
+
return response;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "shopify_developer_app-update-customer",
|
|
7
7
|
name: "Update Customer",
|
|
8
8
|
description: "Update a existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.14",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: true,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "shopify_developer_app-update-fulfillment-tracking-info",
|
|
5
5
|
name: "Update Fulfillment Tracking Info",
|
|
6
6
|
description: "Update the tracking info for a fulfillment. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/fulfillmenttrackinginfoupdate)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "shopify_developer_app-update-product",
|
|
7
7
|
name: "Update Product",
|
|
8
8
|
description: "Update an existing product. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productupdate)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.14",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: true,
|
|
12
12
|
openWorldHint: true,
|
package/common/mutations.mjs
CHANGED
|
@@ -201,6 +201,21 @@ mutation fulfillmentCreate($fulfillment: FulfillmentInput!, $message: String) {
|
|
|
201
201
|
}
|
|
202
202
|
`;
|
|
203
203
|
|
|
204
|
+
const ORDER_INVOICE_SEND = `
|
|
205
|
+
mutation OrderInvoiceSend($id: ID!, $email: EmailInput) {
|
|
206
|
+
orderInvoiceSend(id: $id, email: $email) {
|
|
207
|
+
order {
|
|
208
|
+
id
|
|
209
|
+
name
|
|
210
|
+
}
|
|
211
|
+
userErrors {
|
|
212
|
+
field
|
|
213
|
+
message
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
`;
|
|
218
|
+
|
|
204
219
|
export default {
|
|
205
220
|
CREATE_ORDER,
|
|
206
221
|
CREATE_CUSTOMER,
|
|
@@ -209,4 +224,5 @@ export default {
|
|
|
209
224
|
REFUND_ORDER,
|
|
210
225
|
UPDATE_FULFILLMENT_TRACKING_INFO,
|
|
211
226
|
CREATE_FULFILLMENT,
|
|
227
|
+
ORDER_INVOICE_SEND,
|
|
212
228
|
};
|
package/package.json
CHANGED
|
@@ -214,5 +214,8 @@ export default {
|
|
|
214
214
|
updateFulfillmentTrackingInfo(variables) {
|
|
215
215
|
return this._makeGraphQlRequest(mutations.UPDATE_FULFILLMENT_TRACKING_INFO, variables);
|
|
216
216
|
},
|
|
217
|
+
sendOrderInvoice(variables) {
|
|
218
|
+
return this._makeGraphQlRequest(mutations.ORDER_INVOICE_SEND, variables);
|
|
219
|
+
},
|
|
217
220
|
},
|
|
218
221
|
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "shopify_developer_app-inventory-level-updated",
|
|
6
6
|
name: "Inventory Level Updated (Instant)",
|
|
7
7
|
description: "Emit new event when an inventory level is updated.",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
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.
|
|
8
|
+
version: "0.0.15",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|