@pipedream/shopify_developer_app 0.0.1 → 0.1.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/README.md +31 -0
- package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +32 -0
- package/actions/add-tags/add-tags.mjs +15 -0
- package/actions/common/metafield-actions.mjs +10 -0
- package/actions/common/metaobjects.mjs +21 -0
- package/actions/create-article/create-article.mjs +34 -0
- package/actions/create-blog/create-blog.mjs +21 -0
- package/actions/create-custom-collection/create-custom-collection.mjs +36 -0
- package/actions/create-customer/create-customer.mjs +75 -0
- package/actions/create-metafield/create-metafield.mjs +19 -0
- package/actions/create-metaobject/create-metaobject.mjs +27 -0
- package/actions/create-order/create-order.mjs +26 -0
- package/actions/create-page/create-page.mjs +27 -0
- package/actions/create-product/create-product.mjs +69 -0
- package/actions/create-product-variant/create-product-variant.mjs +49 -0
- package/actions/create-smart-collection/create-smart-collection.mjs +27 -0
- package/actions/delete-article/delete-article.mjs +29 -0
- package/actions/delete-blog/delete-blog.mjs +20 -0
- package/actions/delete-metafield/delete-metafield.mjs +19 -0
- package/actions/delete-page/delete-page.mjs +20 -0
- package/actions/get-articles/get-articles.mjs +20 -0
- package/actions/get-metafields/get-metafields.mjs +19 -0
- package/actions/get-metaobjects/get-metaobjects.mjs +26 -0
- package/actions/get-pages/get-pages.mjs +14 -0
- package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +22 -0
- package/actions/search-customers/search-customers.mjs +27 -0
- package/actions/search-product-variant/search-product-variant.mjs +38 -0
- package/actions/search-products/search-products.mjs +48 -0
- package/actions/update-article/update-article.mjs +43 -0
- package/actions/update-customer/update-customer.mjs +89 -0
- package/actions/update-inventory-level/update-inventory-level.mjs +36 -0
- package/actions/update-metafield/update-metafield.mjs +19 -0
- package/actions/update-metaobject/update-metaobject.mjs +27 -0
- package/actions/update-page/update-page.mjs +33 -0
- package/actions/update-product/update-product.mjs +84 -0
- package/actions/update-product-variant/update-product-variant.mjs +78 -0
- package/common/rest-admin.mjs +69 -0
- package/package.json +6 -5
- package/shopify_developer_app.app.mjs +18 -0
- package/sources/new-abandoned-cart/new-abandoned-cart.mjs +16 -0
- package/sources/new-article/new-article.mjs +16 -0
- package/sources/new-page/new-page.mjs +16 -0
- package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +16 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import metaobjects from "../common/metaobjects.mjs";
|
|
3
|
+
import common from "../../../shopify/actions/get-metaobjects/common.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...metaobjects,
|
|
7
|
+
...common,
|
|
8
|
+
key: "shopify_developer_app-get-metaobjects",
|
|
9
|
+
name: "Get Metaobjects",
|
|
10
|
+
description: "Retrieves a list of metaobjects. [See the documentation](https://shopify.dev/docs/api/admin-graphql/2023-04/queries/metaobjects)",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
props: {
|
|
14
|
+
shopify,
|
|
15
|
+
type: {
|
|
16
|
+
type: "string",
|
|
17
|
+
label: "Type",
|
|
18
|
+
description: "The Metaobject Type",
|
|
19
|
+
async options() {
|
|
20
|
+
const { data: { metaobjectDefinitions: { nodes } } }
|
|
21
|
+
= await this.listMetaobjectDefinitions();
|
|
22
|
+
return nodes?.map(({ type }) => type) || [];
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import app from "../../common/rest-admin.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/get-pages/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-get-pages",
|
|
7
|
+
name: "Get Pages",
|
|
8
|
+
description: "Retrieve a list of all pages. [See The Documentation](https://shopify.dev/docs/api/admin-rest/2023-04/resources/page#get-pages)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
app,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/search-custom-collection-by-name/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-search-custom-collection-by-name",
|
|
7
|
+
name: "Search Custom Collection by Name",
|
|
8
|
+
description: "Search for a custom collection by name/title. [See the documentation](https://shopify.dev/docs/api/admin-rest/2023-01/resources/customcollection#get-custom-collections)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
shopify,
|
|
13
|
+
title: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
shopify,
|
|
16
|
+
"title",
|
|
17
|
+
],
|
|
18
|
+
description: "The name of the custom collection",
|
|
19
|
+
},
|
|
20
|
+
...common.props,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/search-customers/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-search-customers",
|
|
7
|
+
name: "Search for Customers",
|
|
8
|
+
description: "Search for a customer or a list of customers. [See the documentation](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[get]/admin/api/2022-01/customers.json)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
shopify,
|
|
13
|
+
query: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
shopify,
|
|
16
|
+
"query",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
max: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
shopify,
|
|
22
|
+
"max",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
...common.props,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/search-product-variant/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-search-product-variant",
|
|
7
|
+
name: "Search for Product Variant",
|
|
8
|
+
description: "Search for product variants or create one if not found. [See the documentation](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#top)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
shopify,
|
|
13
|
+
productId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
shopify,
|
|
16
|
+
"productId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
productVariantId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
shopify,
|
|
22
|
+
"productVariantId",
|
|
23
|
+
(c) => c,
|
|
24
|
+
],
|
|
25
|
+
description: "ID of the product variant. Takes precedence over **Title**",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
shopify,
|
|
31
|
+
"title",
|
|
32
|
+
],
|
|
33
|
+
description: "The name of the product variant",
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
...common.props,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/search-products/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-search-products",
|
|
7
|
+
name: "Search for Products",
|
|
8
|
+
description: "Search for products. [See the documentation](https://shopify.dev/api/admin-rest/2022-01/resources/product#[get]/admin/api/2022-01/products.json)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
shopify,
|
|
13
|
+
title: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
shopify,
|
|
16
|
+
"title",
|
|
17
|
+
],
|
|
18
|
+
optional: true,
|
|
19
|
+
},
|
|
20
|
+
productIds: {
|
|
21
|
+
propDefinition: [
|
|
22
|
+
shopify,
|
|
23
|
+
"productId",
|
|
24
|
+
],
|
|
25
|
+
type: "string[]",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
collectionId: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
shopify,
|
|
31
|
+
"collectionId",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
productType: {
|
|
35
|
+
propDefinition: [
|
|
36
|
+
shopify,
|
|
37
|
+
"productType",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
vendor: {
|
|
41
|
+
propDefinition: [
|
|
42
|
+
shopify,
|
|
43
|
+
"vendor",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
...common.props,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import app from "../../common/rest-admin.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/update-article/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-update-article",
|
|
7
|
+
name: "Update Article",
|
|
8
|
+
description: "Update a blog article. [See The Documentation](https://shopify.dev/docs/api/admin-rest/2023-04/resources/article#put-blogs-blog-id-articles-article-id)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
app,
|
|
13
|
+
blogId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
app,
|
|
16
|
+
"blogId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
articleId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
app,
|
|
22
|
+
"articleId",
|
|
23
|
+
({ blogId }) => ({
|
|
24
|
+
blogId,
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
description: "The title of the article.",
|
|
30
|
+
propDefinition: [
|
|
31
|
+
app,
|
|
32
|
+
"title",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
bodyHtml: {
|
|
36
|
+
description: "The text content of the article, complete with HTML markup.",
|
|
37
|
+
propDefinition: [
|
|
38
|
+
app,
|
|
39
|
+
"bodyHtml",
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import metafieldActions from "../common/metafield-actions.mjs";
|
|
3
|
+
import common from "../../../shopify/actions/update-customer/common.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...metafieldActions,
|
|
7
|
+
...common,
|
|
8
|
+
key: "shopify_developer_app-update-customer",
|
|
9
|
+
name: "Update Customer",
|
|
10
|
+
description: "Update a existing customer. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[put]/admin/api/2022-01/customers/{customer_id}.json)",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
props: {
|
|
14
|
+
shopify,
|
|
15
|
+
customerId: {
|
|
16
|
+
propDefinition: [
|
|
17
|
+
shopify,
|
|
18
|
+
"customerId",
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
firstName: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
shopify,
|
|
24
|
+
"firstName",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
lastName: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
shopify,
|
|
30
|
+
"lastName",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
email: {
|
|
34
|
+
propDefinition: [
|
|
35
|
+
shopify,
|
|
36
|
+
"email",
|
|
37
|
+
],
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
phone: {
|
|
41
|
+
propDefinition: [
|
|
42
|
+
shopify,
|
|
43
|
+
"phone",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
address: {
|
|
47
|
+
propDefinition: [
|
|
48
|
+
shopify,
|
|
49
|
+
"address",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
company: {
|
|
53
|
+
propDefinition: [
|
|
54
|
+
shopify,
|
|
55
|
+
"company",
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
city: {
|
|
59
|
+
propDefinition: [
|
|
60
|
+
shopify,
|
|
61
|
+
"city",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
province: {
|
|
65
|
+
propDefinition: [
|
|
66
|
+
shopify,
|
|
67
|
+
"province",
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
country: {
|
|
71
|
+
propDefinition: [
|
|
72
|
+
shopify,
|
|
73
|
+
"country",
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
zip: {
|
|
77
|
+
propDefinition: [
|
|
78
|
+
shopify,
|
|
79
|
+
"zip",
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
metafields: {
|
|
83
|
+
propDefinition: [
|
|
84
|
+
shopify,
|
|
85
|
+
"metafields",
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/update-inventory-level/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-update-inventory-level",
|
|
7
|
+
name: "Update Inventory Level",
|
|
8
|
+
description: "Sets the inventory level for an inventory item at a location. [See the documenation](https://shopify.dev/api/admin-rest/2022-01/resources/inventorylevel#[post]/admin/api/2022-01/inventory_levels/set.json)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
shopify,
|
|
13
|
+
locationId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
shopify,
|
|
16
|
+
"locationId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
productId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
shopify,
|
|
22
|
+
"productId",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
inventoryItemId: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
shopify,
|
|
28
|
+
"inventoryItemId",
|
|
29
|
+
(c) => ({
|
|
30
|
+
productId: c.productId,
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
...common.props,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import metafieldActions from "../common/metafield-actions.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/update-metafield/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-update-metafield",
|
|
7
|
+
name: "Update Metafield",
|
|
8
|
+
description: "Updates a metafield belonging to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#put-blogs-blog-id-metafields-metafield-id)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
...metafieldActions.props,
|
|
13
|
+
...common.props,
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
...metafieldActions.methods,
|
|
17
|
+
...common.methods,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import metaobjects from "../common/metaobjects.mjs";
|
|
3
|
+
import common from "../../../shopify/actions/update-metaobject/common.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...metaobjects,
|
|
7
|
+
...common,
|
|
8
|
+
key: "shopify_developer_app-update-metaobject",
|
|
9
|
+
name: "Update Metaobject",
|
|
10
|
+
description: "Updates a metaobject. [See the documentation](https://shopify.dev/docs/api/admin-graphql/2023-04/mutations/metaobjectUpdate)",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
props: {
|
|
14
|
+
shopify,
|
|
15
|
+
type: {
|
|
16
|
+
type: "string",
|
|
17
|
+
label: "Type",
|
|
18
|
+
description: "The Metaobject Type",
|
|
19
|
+
async options() {
|
|
20
|
+
const { data: { metaobjectDefinitions: { nodes } } }
|
|
21
|
+
= await this.listMetaobjectDefinitions();
|
|
22
|
+
return nodes?.map(({ type }) => type) || [];
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
...common.props,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import app from "../../common/rest-admin.mjs";
|
|
2
|
+
import common from "../../../shopify/actions/update-page/common.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "shopify_developer_app-update-page",
|
|
7
|
+
name: "Update Page",
|
|
8
|
+
description: "Update an existing page. [See The Documentation](https://shopify.dev/docs/api/admin-rest/2023-04/resources/page#put-pages-page-id)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
app,
|
|
13
|
+
pageId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
app,
|
|
16
|
+
"pageId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
title: {
|
|
20
|
+
description: "The title of the page.",
|
|
21
|
+
propDefinition: [
|
|
22
|
+
app,
|
|
23
|
+
"title",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
bodyHtml: {
|
|
27
|
+
propDefinition: [
|
|
28
|
+
app,
|
|
29
|
+
"bodyHtml",
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import metafieldActions from "../common/metafield-actions.mjs";
|
|
3
|
+
import common from "../../../shopify/actions/update-product/common.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...common,
|
|
7
|
+
...metafieldActions,
|
|
8
|
+
key: "shopify_developer_app-update-product",
|
|
9
|
+
name: "Update Product",
|
|
10
|
+
description: "Update an existing product. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product#[put]/admin/api/2022-01/products/{product_id}.json)",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
props: {
|
|
14
|
+
shopify,
|
|
15
|
+
productId: {
|
|
16
|
+
propDefinition: [
|
|
17
|
+
shopify,
|
|
18
|
+
"productId",
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
title: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
shopify,
|
|
24
|
+
"title",
|
|
25
|
+
],
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
productDescription: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
shopify,
|
|
31
|
+
"productDescription",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
vendor: {
|
|
35
|
+
propDefinition: [
|
|
36
|
+
shopify,
|
|
37
|
+
"vendor",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
productType: {
|
|
41
|
+
propDefinition: [
|
|
42
|
+
shopify,
|
|
43
|
+
"productType",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
status: {
|
|
47
|
+
propDefinition: [
|
|
48
|
+
shopify,
|
|
49
|
+
"status",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
images: {
|
|
53
|
+
propDefinition: [
|
|
54
|
+
shopify,
|
|
55
|
+
"images",
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
options: {
|
|
59
|
+
propDefinition: [
|
|
60
|
+
shopify,
|
|
61
|
+
"options",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
variants: {
|
|
65
|
+
propDefinition: [
|
|
66
|
+
shopify,
|
|
67
|
+
"variants",
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
tags: {
|
|
71
|
+
propDefinition: [
|
|
72
|
+
shopify,
|
|
73
|
+
"tags",
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
metafields: {
|
|
77
|
+
propDefinition: [
|
|
78
|
+
shopify,
|
|
79
|
+
"metafields",
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
...common.props,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import metafieldActions from "../common/metafield-actions.mjs";
|
|
3
|
+
import common from "../../../shopify/actions/update-product-variant/common.mjs";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...common,
|
|
7
|
+
...metafieldActions,
|
|
8
|
+
key: "shopify_developer_app-update-product-variant",
|
|
9
|
+
name: "Update Product Variant",
|
|
10
|
+
description: "Update an existing product variant. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#[put]/admin/api/2022-01/variants/{variant_id}.json)",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
props: {
|
|
14
|
+
shopify,
|
|
15
|
+
productId: {
|
|
16
|
+
propDefinition: [
|
|
17
|
+
shopify,
|
|
18
|
+
"productId",
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
productVariantId: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
shopify,
|
|
24
|
+
"productVariantId",
|
|
25
|
+
(c) => c,
|
|
26
|
+
],
|
|
27
|
+
description: `${shopify.propDefinitions.productVariantId.description}
|
|
28
|
+
Option displayed here as the title of the product variant`,
|
|
29
|
+
},
|
|
30
|
+
option: {
|
|
31
|
+
propDefinition: [
|
|
32
|
+
shopify,
|
|
33
|
+
"option",
|
|
34
|
+
],
|
|
35
|
+
optional: true,
|
|
36
|
+
},
|
|
37
|
+
price: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
shopify,
|
|
40
|
+
"price",
|
|
41
|
+
],
|
|
42
|
+
description: "The price of the product variant",
|
|
43
|
+
},
|
|
44
|
+
imageId: {
|
|
45
|
+
propDefinition: [
|
|
46
|
+
shopify,
|
|
47
|
+
"imageId",
|
|
48
|
+
(c) => c,
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
metafields: {
|
|
52
|
+
propDefinition: [
|
|
53
|
+
shopify,
|
|
54
|
+
"metafields",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
sku: {
|
|
58
|
+
propDefinition: [
|
|
59
|
+
shopify,
|
|
60
|
+
"sku",
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
countryCodeOfOrigin: {
|
|
64
|
+
propDefinition: [
|
|
65
|
+
shopify,
|
|
66
|
+
"country",
|
|
67
|
+
],
|
|
68
|
+
description: "The country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of where the item came from",
|
|
69
|
+
},
|
|
70
|
+
harmonizedSystemCode: {
|
|
71
|
+
type: "integer",
|
|
72
|
+
label: "Harmonized System Code",
|
|
73
|
+
description: "The general [harmonized system](https://en.wikipedia.org/wiki/Harmonized_System) code for the inventory item",
|
|
74
|
+
optional: true,
|
|
75
|
+
},
|
|
76
|
+
...common.props,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
...common.methods,
|
|
60
|
+
...restAdmin.methods,
|
|
61
|
+
getHeaders(headers) {
|
|
62
|
+
return {
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
"X-Shopify-Access-Token": this.$auth.access_token,
|
|
65
|
+
...headers,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/shopify_developer_app",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Pipedream Shopify (Developer App) Components",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "shopify_developer_app.app.mjs",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"pipedream",
|
|
8
8
|
"shopify_developer_app"
|
|
9
9
|
],
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
10
|
"homepage": "https://pipedream.com/apps/shopify_developer_app",
|
|
14
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
15
12
|
"publishConfig": {
|
|
16
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^1.5.1",
|
|
17
|
+
"shopify-api-node": "^3.12.5"
|
|
17
18
|
}
|
|
18
19
|
}
|