@foxtware/mineral 0.1.0 → 0.1.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/.creds.yml.sample +5 -0
- package/README.md +1 -1
- package/_build_scripts/publish.js +85 -0
- package/api/logiwa/logiwa.constants.js +8 -0
- package/api/logiwa/logiwa.utils.js +53 -0
- package/api/logiwa/logiwaAuthGet.js +86 -0
- package/api/logiwa/logiwaInventoriesGet.js +67 -0
- package/api/logiwa/logiwaOrderGet.js +54 -0
- package/api/logiwa/logiwaOrdersGet.js +92 -0
- package/api/logiwa/logiwaProductGet.js +54 -0
- package/api/logiwa/logiwaProductsGet.js +80 -0
- package/api/logiwa/logiwaReportGetAvailableToPromise.js +179 -0
- package/api/logiwa/logiwaReportGetInventoryCalculation.js +62 -0
- package/api/logiwa/logiwaReportGetInventorySnapshot.js +66 -0
- package/api/logiwa/logiwaReportGetTotalInventory.js +72 -0
- package/api/logiwa/logiwaWebhookStatusGet.js +54 -0
- package/api/logiwa/logiwaWebhookSubscribe.js +64 -0
- package/api/logiwa/logiwaWebhookUnsubscribe.js +54 -0
- package/api/logiwa/logiwaWebhooksGet.js +48 -0
- package/api/shopify/_example.get.js +46 -0
- package/api/shopify/shopifyAbandonedCheckoutsGet.js +46 -0
- package/api/shopify/shopifyArticlesGet.js +46 -0
- package/api/shopify/shopifyBlogsGet.js +46 -0
- package/api/shopify/shopifyBulkOperationsGet.js +46 -0
- package/api/shopify/shopifyCatalogsGet.js +46 -0
- package/api/shopify/shopifyChannelsGet.js +46 -0
- package/api/shopify/shopifyCheckoutAndAccountsConfigurationsGet.js +46 -0
- package/api/shopify/shopifyCollectionsGet.js +46 -0
- package/api/shopify/shopifyCustomersGet.js +2 -0
- package/api/shopify/shopifyDeliveryCustomizationsGet.js +46 -0
- package/api/shopify/shopifyDeliveryProfilesGet.js +46 -0
- package/api/shopify/shopifyDiscountNodesGet.js +46 -0
- package/api/shopify/shopifyDisputesGet.js +46 -0
- package/api/shopify/shopifyDraftOrdersGet.js +46 -0
- package/api/shopify/shopifyEventsGet.js +46 -0
- package/api/shopify/shopifyFilesGet.js +46 -0
- package/api/shopify/shopifyFulfillmentOrdersGet.js +46 -0
- package/api/shopify/shopifyGiftCardsGet.js +46 -0
- package/api/shopify/shopifyInventoryItemsGet.js +46 -0
- package/api/shopify/shopifyLocationsGet.js +46 -0
- package/api/shopify/shopifyMarketingEventsGet.js +46 -0
- package/api/shopify/shopifyMarketsGet.js +46 -0
- package/api/shopify/shopifyMenusGet.js +46 -0
- package/api/shopify/shopifyMetafieldDefinitionsGet.js +50 -0
- package/api/shopify/shopifyMetaobjectDefinitionsGet.js +46 -0
- package/api/shopify/shopifyMetaobjectsGet.js +50 -0
- package/api/shopify/shopifyPagesGet.js +46 -0
- package/api/shopify/shopifyPaymentCustomizationsGet.js +46 -0
- package/api/shopify/shopifyProductFeedsGet.js +46 -0
- package/api/shopify/shopifyProductVariantsGet.js +46 -0
- package/api/shopify/shopifyProductsGet.js +46 -0
- package/api/shopify/shopifyPublicationsGet.js +46 -0
- package/api/shopify/shopifySegmentsGet.js +46 -0
- package/api/shopify/shopifyUrlRedirectsGet.js +46 -0
- package/api/shopify/shopifyWebhookSubscriptionsGet.js +46 -0
- package/api/utils.js +4 -3
- package/api/workspace.js +43 -0
- package/package.json +5 -3
- package/server.js +205 -105
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/articles
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyArticlesGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'article', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyArticlesGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyArticlesGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/blogs
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyBlogsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'blog', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyBlogsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyBlogsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/bulkOperations
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyBulkOperationsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'bulkOperation', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyBulkOperationsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyBulkOperationsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/catalogs
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyCatalogsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'catalog', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyCatalogsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyCatalogsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/channels
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyChannelsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'channel', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyChannelsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyChannelsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/checkoutAndAccountsConfigurations
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyCheckoutAndAccountsConfigurationsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'checkoutAndAccountsConfiguration', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyCheckoutAndAccountsConfigurationsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyCheckoutAndAccountsConfigurationsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/collections
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyCollectionsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'collection', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyCollectionsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyCollectionsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/deliveryCustomizations
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyDeliveryCustomizationsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'deliveryCustomization', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyDeliveryCustomizationsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyDeliveryCustomizationsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/deliveryProfiles
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyDeliveryProfilesGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'deliveryProfile', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyDeliveryProfilesGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyDeliveryProfilesGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/discountNodes
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyDiscountNodesGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'discountNode', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyDiscountNodesGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyDiscountNodesGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/disputes
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyDisputesGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'shopifyPaymentsDispute', { resources: 'disputes', ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyDisputesGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyDisputesGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/draftOrders
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyDraftOrdersGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'draftOrder', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyDraftOrdersGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyDraftOrdersGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/events
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyEventsGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'event', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyEventsGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyEventsGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// https://shopify.dev/docs/api/admin-graphql/latest/queries/files
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { shopifyGet } = require('./shopifyGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const shopifyFilesGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
...getterOptions // e.g. limit
|
|
15
|
+
} = {},
|
|
16
|
+
) => {
|
|
17
|
+
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
21
|
+
if (rejectResponse) {
|
|
22
|
+
return rejectResponse;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await shopifyGet(credsPayload, 'file', { ...getterOptions });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const funcApiConfig = {
|
|
29
|
+
argsWarden,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
shopifyFilesGet,
|
|
34
|
+
funcApiConfig,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
curl -X POST "http://localhost:8000/shopifyFilesGet" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"credsPayload": { "credsPath": "shopify.au" },
|
|
42
|
+
"options": {
|
|
43
|
+
"limit": 10
|
|
44
|
+
}
|
|
45
|
+
}'
|
|
46
|
+
*/
|