@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.
- package/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +14 -24
- package/actions/add-tags/add-tags.mjs +14 -7
- package/actions/common/constants.mjs +86 -0
- package/actions/common/metafield-actions.mjs +264 -3
- package/actions/create-article/create-article.mjs +16 -28
- package/actions/create-blog/create-blog.mjs +16 -15
- package/actions/create-custom-collection/create-custom-collection.mjs +14 -28
- package/actions/create-customer/create-customer.mjs +27 -5
- package/actions/create-metafield/create-metafield.mjs +50 -8
- package/actions/create-metaobject/create-metaobject.mjs +14 -19
- package/actions/create-order/create-order.mjs +147 -10
- package/actions/create-page/create-page.mjs +16 -21
- package/actions/create-product/create-product.mjs +14 -61
- package/actions/create-product-variant/create-product-variant.mjs +14 -48
- package/actions/create-smart-collection/create-smart-collection.mjs +14 -19
- package/actions/delete-article/delete-article.mjs +16 -23
- package/actions/delete-blog/delete-blog.mjs +16 -14
- package/actions/delete-metafield/delete-metafield.mjs +41 -8
- package/actions/delete-page/delete-page.mjs +16 -14
- package/actions/get-articles/get-articles.mjs +16 -14
- package/actions/get-metafields/get-metafields.mjs +40 -8
- package/actions/get-metaobjects/get-metaobjects.mjs +14 -18
- package/actions/get-order/get-order.mjs +9 -7
- package/actions/get-pages/get-pages.mjs +16 -8
- package/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +14 -14
- package/actions/search-customers/search-customers.mjs +23 -13
- package/actions/search-product-variant/search-product-variant.mjs +14 -30
- package/actions/search-products/search-products.mjs +14 -40
- package/actions/update-article/update-article.mjs +16 -37
- package/actions/update-customer/update-customer.mjs +32 -5
- package/actions/update-inventory-level/update-inventory-level.mjs +14 -28
- package/actions/update-metafield/update-metafield.mjs +18 -15
- package/actions/update-metaobject/update-metaobject.mjs +14 -24
- package/actions/update-page/update-page.mjs +16 -27
- package/actions/update-product/update-product.mjs +92 -41
- package/actions/update-product-variant/update-product-variant.mjs +14 -71
- package/common/mutations.mjs +124 -0
- package/common/queries.mjs +181 -0
- package/common/utils.mjs +40 -0
- package/package.json +2 -2
- package/shopify_developer_app.app.mjs +130 -1
- package/sources/common/webhook.mjs +17 -9
- package/sources/new-abandoned-cart/new-abandoned-cart.mjs +14 -8
- package/sources/new-article/new-article.mjs +15 -9
- package/sources/new-cancelled-order/new-cancelled-order.mjs +3 -4
- package/sources/new-customer-created/new-customer-created.mjs +3 -4
- package/sources/new-draft-order/new-draft-order.mjs +3 -4
- package/sources/new-event-emitted/new-event-emitted.mjs +10 -4
- package/sources/new-fulfillment-event/new-fulfillment-event.mjs +3 -4
- package/sources/new-order-created/new-order-created.mjs +3 -13
- package/sources/new-order-fulfilled/new-order-fulfilled.mjs +3 -4
- package/sources/new-page/new-page.mjs +15 -9
- package/sources/new-paid-order/new-paid-order.mjs +3 -4
- package/sources/new-product-created/new-product-created.mjs +3 -4
- package/sources/new-product-updated/new-product-updated.mjs +3 -4
- package/sources/new-refund-created/new-refund-created.mjs +2 -3
- package/sources/new-updated-customer/new-updated-customer.mjs +3 -4
- package/sources/new-updated-order/new-updated-order.mjs +3 -4
- package/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +15 -9
- package/actions/common/metaobjects.mjs +0 -21
- package/common/rest-admin.mjs +0 -97
|
@@ -1,19 +1,51 @@
|
|
|
1
1
|
import metafieldActions from "../common/metafield-actions.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/get-metafields/
|
|
2
|
+
import common from "@pipedream/shopify/actions/get-metafields/get-metafields.mjs";
|
|
3
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
name, description, type,
|
|
7
|
+
} = common;
|
|
3
8
|
|
|
4
9
|
export default {
|
|
5
|
-
...common,
|
|
6
10
|
key: "shopify_developer_app-get-metafields",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
11
|
+
version: "0.0.7",
|
|
12
|
+
name,
|
|
13
|
+
description,
|
|
14
|
+
type,
|
|
11
15
|
props: {
|
|
16
|
+
shopify,
|
|
12
17
|
...metafieldActions.props,
|
|
13
|
-
|
|
18
|
+
namespace: {
|
|
19
|
+
type: "string[]",
|
|
20
|
+
label: "Namespace",
|
|
21
|
+
description: "Filter results by namespace",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
key: {
|
|
25
|
+
type: "string[]",
|
|
26
|
+
label: "Key",
|
|
27
|
+
description: "Filter results by key",
|
|
28
|
+
optional: true,
|
|
29
|
+
},
|
|
14
30
|
},
|
|
15
31
|
methods: {
|
|
16
32
|
...metafieldActions.methods,
|
|
17
|
-
|
|
33
|
+
},
|
|
34
|
+
async additionalProps() {
|
|
35
|
+
return this.getOwnerIdProp(this.ownerResource);
|
|
36
|
+
},
|
|
37
|
+
async run({ $ }) {
|
|
38
|
+
let response = await this.listMetafields(this.ownerResource, this.ownerId);
|
|
39
|
+
|
|
40
|
+
if (this.namespace?.length > 0) {
|
|
41
|
+
response = response.filter((field) => this.namespace.includes(field.namespace));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (this.key?.length > 0) {
|
|
45
|
+
response = response.filter((field) => this.key.includes(field.key));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
$.export("$summary", `Found ${response.length} metafield(s) for object with ID ${this.ownerId}`);
|
|
49
|
+
return response;
|
|
18
50
|
},
|
|
19
51
|
};
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import common from "@pipedream/shopify/actions/get-metaobjects/get-metaobjects.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);
|
|
4
10
|
|
|
5
11
|
export default {
|
|
6
|
-
...
|
|
7
|
-
...common,
|
|
12
|
+
...others,
|
|
8
13
|
key: "shopify_developer_app-get-metaobjects",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type
|
|
14
|
+
version: "0.0.7",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
13
18
|
props: {
|
|
14
19
|
shopify,
|
|
15
|
-
|
|
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
|
-
},
|
|
20
|
+
...props,
|
|
25
21
|
},
|
|
26
22
|
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import { MAX_LIMIT } from "@pipedream/shopify/common/constants.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "shopify_developer_app-get-order",
|
|
5
6
|
name: "Get Order",
|
|
6
|
-
description: "Retrieve an order by specifying the order ID. [See
|
|
7
|
-
version: "0.0.
|
|
7
|
+
description: "Retrieve an order by specifying the order ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/order)",
|
|
8
|
+
version: "0.0.4",
|
|
8
9
|
type: "action",
|
|
9
10
|
props: {
|
|
10
|
-
|
|
11
|
+
shopify,
|
|
11
12
|
orderId: {
|
|
12
13
|
propDefinition: [
|
|
13
|
-
|
|
14
|
+
shopify,
|
|
14
15
|
"orderId",
|
|
15
16
|
],
|
|
16
17
|
},
|
|
17
18
|
},
|
|
18
19
|
async run({ $ }) {
|
|
19
|
-
const response = await this.
|
|
20
|
-
|
|
20
|
+
const response = await this.shopify.getOrder({
|
|
21
|
+
id: this.orderId,
|
|
22
|
+
first: MAX_LIMIT,
|
|
21
23
|
});
|
|
22
24
|
$.export("$summary", `Successfully retrieved order with ID: ${this.orderId}`);
|
|
23
25
|
return response;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import common from "@pipedream/shopify/actions/get-pages/
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "@pipedream/shopify/actions/get-pages/get-pages.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-get-pages",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
14
|
+
version: "0.0.8",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
11
18
|
props: {
|
|
12
|
-
|
|
19
|
+
shopify,
|
|
20
|
+
...props,
|
|
13
21
|
},
|
|
14
22
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/search-custom-collection-by-name/
|
|
2
|
+
import common from "@pipedream/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-search-custom-collection-by-name",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
14
|
+
version: "0.0.6",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
11
18
|
props: {
|
|
12
19
|
shopify,
|
|
13
|
-
|
|
14
|
-
propDefinition: [
|
|
15
|
-
shopify,
|
|
16
|
-
"title",
|
|
17
|
-
],
|
|
18
|
-
description: "The name of the custom collection",
|
|
19
|
-
},
|
|
20
|
-
...common.props,
|
|
20
|
+
...props,
|
|
21
21
|
},
|
|
22
22
|
};
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/search-customers/common.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
|
-
...common,
|
|
6
4
|
key: "shopify_developer_app-search-customers",
|
|
7
5
|
name: "Search for Customers",
|
|
8
|
-
description: "Search for a customer or a list of customers. [See the documentation](https://shopify.dev/api/admin-
|
|
9
|
-
version: "0.0.
|
|
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.6",
|
|
10
8
|
type: "action",
|
|
11
9
|
props: {
|
|
12
10
|
shopify,
|
|
13
11
|
query: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
],
|
|
12
|
+
type: "string",
|
|
13
|
+
label: "Query",
|
|
14
|
+
description: "The search query",
|
|
18
15
|
},
|
|
19
16
|
max: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Max Records",
|
|
19
|
+
description: "Optionally limit the maximum number of records to return. Leave blank to retrieve all records.",
|
|
20
|
+
optional: true,
|
|
24
21
|
},
|
|
25
|
-
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
const response = await this.shopify.getPaginated({
|
|
25
|
+
resourceFn: this.shopify.listCustomers,
|
|
26
|
+
resourceKeys: [
|
|
27
|
+
"customers",
|
|
28
|
+
],
|
|
29
|
+
variables: {
|
|
30
|
+
query: this.query,
|
|
31
|
+
},
|
|
32
|
+
max: this.max,
|
|
33
|
+
});
|
|
34
|
+
$.export("$summary", `Found ${response.length} customer(s)`);
|
|
35
|
+
return response;
|
|
26
36
|
},
|
|
27
37
|
};
|
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/search-product-variant/
|
|
2
|
+
import common from "@pipedream/shopify/actions/search-product-variant/search-product-variant.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-search-product-variant",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
14
|
+
version: "0.0.6",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
11
18
|
props: {
|
|
12
19
|
shopify,
|
|
13
|
-
|
|
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,
|
|
20
|
+
...props,
|
|
37
21
|
},
|
|
38
22
|
};
|
|
@@ -1,48 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/search-products/
|
|
2
|
+
import common from "@pipedream/shopify/actions/search-products/search-products.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-search-products",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
14
|
+
version: "0.0.6",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
11
18
|
props: {
|
|
12
19
|
shopify,
|
|
13
|
-
|
|
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,
|
|
20
|
+
...props,
|
|
47
21
|
},
|
|
48
22
|
};
|
|
@@ -1,43 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import common from "@pipedream/shopify/actions/update-article/
|
|
1
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
+
import common from "@pipedream/shopify/actions/update-article/update-article.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-update-article",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
14
|
+
version: "0.0.8",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
11
18
|
props: {
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
},
|
|
19
|
+
shopify,
|
|
20
|
+
...props,
|
|
42
21
|
},
|
|
43
22
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import
|
|
3
|
-
import common from "@pipedream/shopify/actions/update-customer/common.mjs";
|
|
2
|
+
import common from "../common/metafield-actions.mjs";
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
|
-
...metafieldActions,
|
|
7
5
|
...common,
|
|
8
6
|
key: "shopify_developer_app-update-customer",
|
|
9
7
|
name: "Update Customer",
|
|
10
|
-
description: "Update a existing customer. [See the
|
|
11
|
-
version: "0.0.
|
|
8
|
+
description: "Update a existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)",
|
|
9
|
+
version: "0.0.7",
|
|
12
10
|
type: "action",
|
|
13
11
|
props: {
|
|
14
12
|
shopify,
|
|
@@ -86,4 +84,33 @@ export default {
|
|
|
86
84
|
],
|
|
87
85
|
},
|
|
88
86
|
},
|
|
87
|
+
async run({ $ }) {
|
|
88
|
+
const metafields = await this.createMetafieldsArray(this.metafields, this.customerId, "customer");
|
|
89
|
+
|
|
90
|
+
const response = await this.shopify.updateCustomer({
|
|
91
|
+
input: {
|
|
92
|
+
id: this.customerId,
|
|
93
|
+
firstName: this.firstName,
|
|
94
|
+
lastName: this.lastName,
|
|
95
|
+
email: this.email,
|
|
96
|
+
phone: this.phone,
|
|
97
|
+
addresses: [
|
|
98
|
+
{
|
|
99
|
+
address1: this.address,
|
|
100
|
+
company: this.company,
|
|
101
|
+
city: this.city,
|
|
102
|
+
province: this.province,
|
|
103
|
+
country: this.country,
|
|
104
|
+
zip: this.zip,
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
metafields,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
if (response.customerUpdate.userErrors.length > 0) {
|
|
111
|
+
throw new Error(response.customerUpdate.userErrors[0].message);
|
|
112
|
+
}
|
|
113
|
+
$.export("$summary", `Updated customer \`${response.customerUpdate.customer.email || response.customerUpdate.customer.firstName}\` with ID \`${response.customerUpdate.customer.id}\``);
|
|
114
|
+
return response;
|
|
115
|
+
},
|
|
89
116
|
};
|
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/update-inventory-level/
|
|
2
|
+
import common from "@pipedream/shopify/actions/update-inventory-level/update-inventory-level.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
|
-
...
|
|
12
|
+
...others,
|
|
6
13
|
key: "shopify_developer_app-update-inventory-level",
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
14
|
+
version: "0.0.6",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
11
18
|
props: {
|
|
12
19
|
shopify,
|
|
13
|
-
|
|
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,
|
|
20
|
+
...props,
|
|
35
21
|
},
|
|
36
22
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import metafieldActions from "../common/metafield-actions.mjs";
|
|
2
|
-
import common from "@pipedream/shopify/actions/update-metafield/
|
|
3
|
-
import shopify from "
|
|
2
|
+
import common from "@pipedream/shopify/actions/update-metafield/update-metafield.mjs";
|
|
3
|
+
import shopify from "../../shopify_developer_app.app.mjs";
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
name, description, type, ...others
|
|
7
|
+
} = common;
|
|
4
8
|
|
|
5
9
|
export default {
|
|
6
|
-
...
|
|
10
|
+
...others,
|
|
7
11
|
key: "shopify_developer_app-update-metafield",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type
|
|
12
|
+
version: "0.0.7",
|
|
13
|
+
name,
|
|
14
|
+
description,
|
|
15
|
+
type,
|
|
12
16
|
props: {
|
|
17
|
+
shopify,
|
|
13
18
|
...metafieldActions.props,
|
|
14
|
-
...common.props,
|
|
15
19
|
},
|
|
16
20
|
async additionalProps() {
|
|
17
21
|
const props = await this.getOwnerIdProp(this.ownerResource);
|
|
@@ -31,15 +35,10 @@ export default {
|
|
|
31
35
|
},
|
|
32
36
|
methods: {
|
|
33
37
|
...metafieldActions.methods,
|
|
34
|
-
...common.methods,
|
|
35
38
|
async getOwnerIdProp(ownerResource) {
|
|
36
39
|
const resources = {
|
|
37
40
|
product: shopify.propDefinitions.productId,
|
|
38
41
|
variants: shopify.propDefinitions.productVariantId,
|
|
39
|
-
product_image: {
|
|
40
|
-
...shopify.propDefinitions.imageId,
|
|
41
|
-
optional: false,
|
|
42
|
-
},
|
|
43
42
|
customer: shopify.propDefinitions.customerId,
|
|
44
43
|
collection: {
|
|
45
44
|
...shopify.propDefinitions.collectionId,
|
|
@@ -49,12 +48,16 @@ export default {
|
|
|
49
48
|
article: shopify.propDefinitions.articleId,
|
|
50
49
|
page: shopify.propDefinitions.pageId,
|
|
51
50
|
order: shopify.propDefinitions.orderId,
|
|
52
|
-
|
|
51
|
+
draftOrder: {
|
|
52
|
+
type: "string",
|
|
53
|
+
label: "Draft Order ID",
|
|
54
|
+
description: "The identifier of a draft order",
|
|
55
|
+
},
|
|
53
56
|
};
|
|
54
57
|
|
|
55
58
|
const props = {};
|
|
56
59
|
|
|
57
|
-
if (ownerResource === "variants"
|
|
60
|
+
if (ownerResource === "variants") {
|
|
58
61
|
props.productId = resources.product;
|
|
59
62
|
}
|
|
60
63
|
if (ownerResource === "article") {
|
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
import shopify from "../../shopify_developer_app.app.mjs";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import common from "@pipedream/shopify/actions/update-metaobject/update-metaobject.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);
|
|
4
10
|
|
|
5
11
|
export default {
|
|
6
|
-
...
|
|
7
|
-
...common,
|
|
12
|
+
...others,
|
|
8
13
|
key: "shopify_developer_app-update-metaobject",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type
|
|
13
|
-
methods: {
|
|
14
|
-
...metaobjects.methods,
|
|
15
|
-
...common.methods,
|
|
16
|
-
},
|
|
14
|
+
version: "0.0.9",
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
type,
|
|
17
18
|
props: {
|
|
18
19
|
shopify,
|
|
19
|
-
|
|
20
|
-
type: "string",
|
|
21
|
-
label: "Type",
|
|
22
|
-
description: "The Metaobject Type",
|
|
23
|
-
async options() {
|
|
24
|
-
const { data: { metaobjectDefinitions: { nodes } } }
|
|
25
|
-
= await this.listMetaobjectDefinitions();
|
|
26
|
-
return nodes?.map(({ type }) => type) || [];
|
|
27
|
-
},
|
|
28
|
-
reloadProps: true,
|
|
29
|
-
},
|
|
30
|
-
...common.props,
|
|
20
|
+
...props,
|
|
31
21
|
},
|
|
32
22
|
};
|