@foxtware/mineral 0.1.0 → 0.1.2

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.
Files changed (68) hide show
  1. package/.creds.yml.sample +5 -0
  2. package/.gcloudignore +17 -0
  3. package/.hosting.yml.sample +23 -0
  4. package/README.md +3 -1
  5. package/_build_scripts/publish.js +105 -0
  6. package/_deploy_scripts/deployFromHostingYml.js +319 -0
  7. package/_deploy_scripts/execCommand.js +38 -0
  8. package/_deploy_scripts/generateHosted.js +44 -0
  9. package/_deploy_scripts/setEnvVarsGcloud.js +51 -0
  10. package/api/logiwa/logiwa.constants.js +8 -0
  11. package/api/logiwa/logiwa.utils.js +53 -0
  12. package/api/logiwa/logiwaAuthGet.js +86 -0
  13. package/api/logiwa/logiwaInventoriesGet.js +67 -0
  14. package/api/logiwa/logiwaOrderGet.js +54 -0
  15. package/api/logiwa/logiwaOrdersGet.js +92 -0
  16. package/api/logiwa/logiwaProductGet.js +54 -0
  17. package/api/logiwa/logiwaProductsGet.js +80 -0
  18. package/api/logiwa/logiwaReportGetAvailableToPromise.js +179 -0
  19. package/api/logiwa/logiwaReportGetInventoryCalculation.js +62 -0
  20. package/api/logiwa/logiwaReportGetInventorySnapshot.js +66 -0
  21. package/api/logiwa/logiwaReportGetTotalInventory.js +72 -0
  22. package/api/logiwa/logiwaWebhookStatusGet.js +54 -0
  23. package/api/logiwa/logiwaWebhookSubscribe.js +64 -0
  24. package/api/logiwa/logiwaWebhookUnsubscribe.js +54 -0
  25. package/api/logiwa/logiwaWebhooksGet.js +48 -0
  26. package/api/shopify/_example.get.js +46 -0
  27. package/api/shopify/shopifyAbandonedCheckoutsGet.js +46 -0
  28. package/api/shopify/shopifyArticlesGet.js +46 -0
  29. package/api/shopify/shopifyBlogsGet.js +46 -0
  30. package/api/shopify/shopifyBulkOperationsGet.js +46 -0
  31. package/api/shopify/shopifyCatalogsGet.js +46 -0
  32. package/api/shopify/shopifyChannelsGet.js +46 -0
  33. package/api/shopify/shopifyCheckoutAndAccountsConfigurationsGet.js +46 -0
  34. package/api/shopify/shopifyCollectionsGet.js +46 -0
  35. package/api/shopify/shopifyCustomersGet.js +2 -0
  36. package/api/shopify/shopifyDeliveryCustomizationsGet.js +46 -0
  37. package/api/shopify/shopifyDeliveryProfilesGet.js +46 -0
  38. package/api/shopify/shopifyDiscountNodesGet.js +46 -0
  39. package/api/shopify/shopifyDisputesGet.js +46 -0
  40. package/api/shopify/shopifyDraftOrdersGet.js +46 -0
  41. package/api/shopify/shopifyEventsGet.js +46 -0
  42. package/api/shopify/shopifyFilesGet.js +46 -0
  43. package/api/shopify/shopifyFulfillmentOrdersGet.js +46 -0
  44. package/api/shopify/shopifyGiftCardsGet.js +46 -0
  45. package/api/shopify/shopifyInventoryItemsGet.js +46 -0
  46. package/api/shopify/shopifyLocationsGet.js +46 -0
  47. package/api/shopify/shopifyMarketingEventsGet.js +46 -0
  48. package/api/shopify/shopifyMarketsGet.js +46 -0
  49. package/api/shopify/shopifyMenusGet.js +46 -0
  50. package/api/shopify/shopifyMetafieldDefinitionsGet.js +50 -0
  51. package/api/shopify/shopifyMetaobjectDefinitionsGet.js +46 -0
  52. package/api/shopify/shopifyMetaobjectsGet.js +50 -0
  53. package/api/shopify/shopifyPagesGet.js +46 -0
  54. package/api/shopify/shopifyPaymentCustomizationsGet.js +46 -0
  55. package/api/shopify/shopifyProductFeedsGet.js +46 -0
  56. package/api/shopify/shopifyProductVariantsGet.js +46 -0
  57. package/api/shopify/shopifyProductsGet.js +46 -0
  58. package/api/shopify/shopifyPublicationsGet.js +46 -0
  59. package/api/shopify/shopifySegmentsGet.js +46 -0
  60. package/api/shopify/shopifyUrlRedirectsGet.js +46 -0
  61. package/api/shopify/shopifyWebhookSubscriptionsGet.js +46 -0
  62. package/api/utils.js +4 -3
  63. package/api/workspace.js +43 -0
  64. package/cli.js +42 -0
  65. package/hosting.utils.js +232 -0
  66. package/package.json +5 -3
  67. package/server.js +157 -107
  68. package/server.utils.js +40 -0
@@ -0,0 +1,66 @@
1
+ // https://myapi.logiwa.com/swagger/index.html#/Report/get_v3_1_Report_InventorySnapshot_i__index__s__size_
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { logiwaClient } = require('../logiwa/logiwa.utils');
6
+ const { MAX_PER_PAGE } = require('../logiwa/logiwa.constants');
7
+
8
+ const argsWarden = new ArgsWarden([
9
+ ['credsPayload', credsValidator],
10
+ ]);
11
+
12
+ const logiwaReportGetInventorySnapshot = async (
13
+ credsPayload,
14
+ {
15
+ apiVersion,
16
+ page = 0,
17
+ perPage = MAX_PER_PAGE,
18
+ warehouseIdentifier_eq,
19
+ clientIdentifier_eq,
20
+ locationIdentifier_eq,
21
+ sku_eq,
22
+ snapshotDate_bt,
23
+ } = {},
24
+ ) => {
25
+
26
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload });
27
+ if (rejectResponse) {
28
+ return rejectResponse;
29
+ }
30
+
31
+ const params = {
32
+ ...(warehouseIdentifier_eq && { 'WarehouseIdentifier.eq': warehouseIdentifier_eq }),
33
+ ...(clientIdentifier_eq && { 'ClientIdentifier.eq': clientIdentifier_eq }),
34
+ ...(locationIdentifier_eq && { 'LocationIdentifier.eq': locationIdentifier_eq }),
35
+ ...(sku_eq && { 'Sku.eq': sku_eq }),
36
+ ...(snapshotDate_bt && { 'SnapshotDate.bt': snapshotDate_bt }),
37
+ };
38
+
39
+ return logiwaClient.fetch({
40
+ method: 'get',
41
+ url: `/Report/InventorySnapshot/i/${ page }/s/${ perPage }`,
42
+ params,
43
+ context: {
44
+ credsPayload,
45
+ apiVersion,
46
+ },
47
+ });
48
+ };
49
+
50
+ const funcApiConfig = {
51
+ argsWarden,
52
+ };
53
+
54
+ module.exports = {
55
+ logiwaReportGetInventorySnapshot,
56
+ funcApiConfig,
57
+ };
58
+
59
+ /*
60
+ curl -X POST "http://localhost:8000/logiwaReportGetInventorySnapshot" \
61
+ -H "Content-Type: application/json" \
62
+ -d '{
63
+ "credsPayload": { "credsPath": "logiwa" },
64
+ "options": { "clientIdentifier_eq": "9f1ea39a-fccc-48af-8986-a35c34fcef8b" }
65
+ }'
66
+ */
@@ -0,0 +1,72 @@
1
+ // https://myapi.logiwa.com/swagger/index.html#/Report/get_v3_1_Report_TotalInventory_i__index__s__size_
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { logiwaClient } = require('../logiwa/logiwa.utils');
6
+ const { MAX_PER_PAGE } = require('../logiwa/logiwa.constants');
7
+
8
+ const argsWarden = new ArgsWarden([
9
+ ['credsPayload', credsValidator],
10
+ ]);
11
+
12
+ const logiwaReportGetTotalInventory = async (
13
+ credsPayload,
14
+ {
15
+ apiVersion,
16
+ page = 0,
17
+ perPage = MAX_PER_PAGE,
18
+ sku_eq,
19
+ clientIdentifier_eq,
20
+ clientIdentifier_in,
21
+ outOfStock_eq,
22
+ warehouseIdentifier_eq,
23
+ warehouseIdentifier_in,
24
+ productTypeName_eq,
25
+ productGroupName_eq,
26
+ } = {},
27
+ ) => {
28
+
29
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload });
30
+ if (rejectResponse) {
31
+ return rejectResponse;
32
+ }
33
+
34
+ const params = {
35
+ ...(sku_eq && { 'Sku.eq': sku_eq }),
36
+ ...(clientIdentifier_eq && { 'ClientIdentifier.eq': clientIdentifier_eq }),
37
+ ...(clientIdentifier_in && { 'ClientIdentifier.in': clientIdentifier_in }),
38
+ ...(outOfStock_eq !== undefined && { 'OutOfStock.eq': outOfStock_eq }),
39
+ ...(warehouseIdentifier_eq && { 'WarehouseIdentifier.eq': warehouseIdentifier_eq }),
40
+ ...(warehouseIdentifier_in && { 'WarehouseIdentifier.in': warehouseIdentifier_in }),
41
+ ...(productTypeName_eq && { 'ProductTypeName.eq': productTypeName_eq }),
42
+ ...(productGroupName_eq && { 'ProductGroupName.eq': productGroupName_eq }),
43
+ };
44
+
45
+ return logiwaClient.fetch({
46
+ method: 'get',
47
+ url: `/Report/TotalInventory/i/${ page }/s/${ perPage }`,
48
+ params,
49
+ context: {
50
+ credsPayload,
51
+ apiVersion,
52
+ },
53
+ });
54
+ };
55
+
56
+ const funcApiConfig = {
57
+ argsWarden,
58
+ };
59
+
60
+ module.exports = {
61
+ logiwaReportGetTotalInventory,
62
+ funcApiConfig,
63
+ };
64
+
65
+ /*
66
+ curl -X POST "http://localhost:8000/logiwaReportGetTotalInventory" \
67
+ -H "Content-Type: application/json" \
68
+ -d '{
69
+ "credsPayload": { "credsPath": "logiwa" },
70
+ "options": { "outOfStock_eq": true }
71
+ }'
72
+ */
@@ -0,0 +1,54 @@
1
+ // https://myapi.logiwa.com/swagger/index.html#/Webhook/get_v3_1_Webhook_status__identifier_
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { logiwaClient } = require('../logiwa/logiwa.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['subscriptionId'],
10
+ ]);
11
+
12
+ const logiwaWebhookStatusGet = async (
13
+ credsPayload,
14
+ subscriptionId,
15
+ {
16
+ apiVersion,
17
+ } = {},
18
+ ) => {
19
+
20
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
21
+ credsPayload,
22
+ subscriptionId,
23
+ });
24
+ if (rejectResponse) {
25
+ return rejectResponse;
26
+ }
27
+
28
+ return logiwaClient.fetch({
29
+ method: 'get',
30
+ url: `/Webhook/status/${ subscriptionId }`,
31
+ context: {
32
+ credsPayload,
33
+ apiVersion,
34
+ },
35
+ });
36
+ };
37
+
38
+ const funcApiConfig = {
39
+ argsWarden,
40
+ };
41
+
42
+ module.exports = {
43
+ logiwaWebhookStatusGet,
44
+ funcApiConfig,
45
+ };
46
+
47
+ /*
48
+ curl -X POST "http://localhost:8000/logiwaWebhookStatusGet" \
49
+ -H "Content-Type: application/json" \
50
+ -d '{
51
+ "credsPayload": { "credsPath": "logiwa" },
52
+ "subscriptionId": "68706c98-0198-4671-9a97-4b3e3e59a56d"
53
+ }'
54
+ */
@@ -0,0 +1,64 @@
1
+ // https://myapi.logiwa.com/swagger/index.html#/Webhook/post_v3_1_Webhook_create
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { logiwaClient } = require('../logiwa/logiwa.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['topic'],
10
+ ['url'],
11
+ ]);
12
+
13
+ const logiwaWebhookSubscribe = async (
14
+ credsPayload,
15
+ topic,
16
+ url,
17
+ {
18
+ apiVersion,
19
+ clientIdentifier,
20
+ } = {},
21
+ ) => {
22
+
23
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
24
+ credsPayload,
25
+ topic,
26
+ url,
27
+ });
28
+ if (rejectResponse) {
29
+ return rejectResponse;
30
+ }
31
+
32
+ return logiwaClient.fetch({
33
+ method: 'post',
34
+ url: '/Webhook/create',
35
+ body: {
36
+ topic,
37
+ address: url,
38
+ ...(clientIdentifier ? { clientIdentifier } : { ignoreClient: true }),
39
+ },
40
+ context: {
41
+ credsPayload,
42
+ apiVersion,
43
+ },
44
+ });
45
+ };
46
+
47
+ const funcApiConfig = {
48
+ argsWarden,
49
+ };
50
+
51
+ module.exports = {
52
+ logiwaWebhookSubscribe,
53
+ funcApiConfig,
54
+ };
55
+
56
+ /*
57
+ curl -X POST "http://localhost:8000/logiwaWebhookSubscribe" \
58
+ -H "Content-Type: application/json" \
59
+ -d '{
60
+ "credsPayload": { "credsPath": "logiwa" },
61
+ "topic": "wms/inventory/available",
62
+ "url": "https://example.com/webhook"
63
+ }'
64
+ */
@@ -0,0 +1,54 @@
1
+ // https://myapi.logiwa.com/swagger/index.html#/Webhook/delete_v3_1_Webhook_unsubscribe__subscriptionIdentifier_
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { logiwaClient } = require('../logiwa/logiwa.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['subscriptionId'],
10
+ ]);
11
+
12
+ const logiwaWebhookUnsubscribe = async (
13
+ credsPayload,
14
+ subscriptionId,
15
+ {
16
+ apiVersion,
17
+ } = {},
18
+ ) => {
19
+
20
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
21
+ credsPayload,
22
+ subscriptionId,
23
+ });
24
+ if (rejectResponse) {
25
+ return rejectResponse;
26
+ }
27
+
28
+ return logiwaClient.fetch({
29
+ method: 'delete',
30
+ url: `/Webhook/unsubscribe/${ subscriptionId }`,
31
+ context: {
32
+ credsPayload,
33
+ apiVersion,
34
+ },
35
+ });
36
+ };
37
+
38
+ const funcApiConfig = {
39
+ argsWarden,
40
+ };
41
+
42
+ module.exports = {
43
+ logiwaWebhookUnsubscribe,
44
+ funcApiConfig,
45
+ };
46
+
47
+ /*
48
+ curl -X POST "http://localhost:8000/logiwaWebhookUnsubscribe" \
49
+ -H "Content-Type: application/json" \
50
+ -d '{
51
+ "credsPayload": { "credsPath": "logiwa" },
52
+ "subscriptionId": "68706c98-0198-4671-9a97-4b3e3e59a56d"
53
+ }'
54
+ */
@@ -0,0 +1,48 @@
1
+ // https://myapi.logiwa.com/swagger/index.html#/Webhook/get_v3_1_Webhook_list
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { logiwaClient } = require('../logiwa/logiwa.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ]);
10
+
11
+ const logiwaWebhooksGet = async (
12
+ credsPayload,
13
+ {
14
+ apiVersion,
15
+ } = {},
16
+ ) => {
17
+
18
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload });
19
+ if (rejectResponse) {
20
+ return rejectResponse;
21
+ }
22
+
23
+ return logiwaClient.fetch({
24
+ method: 'get',
25
+ url: '/Webhook/list',
26
+ context: {
27
+ credsPayload,
28
+ apiVersion,
29
+ },
30
+ });
31
+ };
32
+
33
+ const funcApiConfig = {
34
+ argsWarden,
35
+ };
36
+
37
+ module.exports = {
38
+ logiwaWebhooksGet,
39
+ funcApiConfig,
40
+ };
41
+
42
+ /*
43
+ curl -X POST "http://localhost:8000/logiwaWebhooksGet" \
44
+ -H "Content-Type: application/json" \
45
+ -d '{
46
+ "credsPayload": { "credsPath": "logiwa" }
47
+ }'
48
+ */
@@ -0,0 +1,46 @@
1
+ // https://shopify.dev/docs/api/admin-graphql/latest/queries/things
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 shopifyThingsGet = 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, 'thing', { ...getterOptions });
26
+ };
27
+
28
+ const funcApiConfig = {
29
+ argsWarden,
30
+ };
31
+
32
+ module.exports = {
33
+ shopifyThingsGet,
34
+ funcApiConfig,
35
+ };
36
+
37
+ /*
38
+ curl -X POST "http://localhost:8000/shopifyThingsGet" \
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/abandonedCheckouts
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 shopifyAbandonedCheckoutsGet = 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, 'abandonedCheckout', { ...getterOptions });
26
+ };
27
+
28
+ const funcApiConfig = {
29
+ argsWarden,
30
+ };
31
+
32
+ module.exports = {
33
+ shopifyAbandonedCheckoutsGet,
34
+ funcApiConfig,
35
+ };
36
+
37
+ /*
38
+ curl -X POST "http://localhost:8000/shopifyAbandonedCheckoutsGet" \
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/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
+ */