@foxtware/mineral 0.1.8 → 0.1.10

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 (186) hide show
  1. package/.creds.yml.sample +43 -1
  2. package/AGENTS.md +6 -1
  3. package/README.md +1 -1
  4. package/api/bleckmann/.gitkeep +0 -0
  5. package/api/bleckmann/bleckmann.constants.js +8 -0
  6. package/api/bleckmann/bleckmann.utils.js +32 -0
  7. package/api/bleckmann/bleckmannAsnGet.js +52 -0
  8. package/api/bleckmann/bleckmannAsnsGet.js +65 -0
  9. package/api/constants.js +2 -1
  10. package/api/github/github.constants.js +11 -0
  11. package/api/github/github.utils.js +65 -0
  12. package/api/github/githubGet.js +144 -0
  13. package/api/github/githubIssueCreate.js +71 -0
  14. package/api/github/githubIssueGet.js +65 -0
  15. package/api/github/githubIssueUpdate.js +71 -0
  16. package/api/github/githubIssuesGet.js +74 -0
  17. package/api/github/githubPullRequestCreate.js +74 -0
  18. package/api/github/githubPullRequestGet.js +65 -0
  19. package/api/github/githubPullRequestMerge.js +77 -0
  20. package/api/github/githubPullRequestUpdate.js +72 -0
  21. package/api/github/githubPullRequestsGet.js +74 -0
  22. package/api/github/githubRepoCreate.js +80 -0
  23. package/api/github/githubRepoDelete.js +60 -0
  24. package/api/github/githubRepoGet.js +61 -0
  25. package/api/github/githubRepoUpdate.js +68 -0
  26. package/api/github/githubReposGet.js +69 -0
  27. package/api/github/githubUserGet.js +64 -0
  28. package/api/linear/linear.utils.js +9 -14
  29. package/api/linear/linearIssuesGet.js +9 -9
  30. package/api/logiwa/logiwa.utils.js +27 -25
  31. package/api/logiwa/logiwaInventoriesGet.js +5 -3
  32. package/api/logiwa/logiwaOrderGet.js +4 -2
  33. package/api/logiwa/logiwaOrdersGet.js +5 -3
  34. package/api/logiwa/logiwaProductGet.js +4 -2
  35. package/api/logiwa/logiwaProductsGet.js +5 -3
  36. package/api/logiwa/logiwaReportGetAvailableToPromise.js +5 -3
  37. package/api/logiwa/logiwaReportGetInventoryCalculation.js +5 -3
  38. package/api/logiwa/logiwaReportGetInventorySnapshot.js +5 -3
  39. package/api/logiwa/logiwaReportGetTotalInventory.js +5 -3
  40. package/api/logiwa/logiwaWebhookStatusGet.js +4 -2
  41. package/api/logiwa/logiwaWebhookSubscribe.js +8 -6
  42. package/api/logiwa/logiwaWebhookUnsubscribe.js +4 -2
  43. package/api/logiwa/logiwaWebhooksGet.js +4 -2
  44. package/api/loop/loop.constants.js +7 -0
  45. package/api/loop/loop.utils.js +37 -0
  46. package/api/loop/loopAllowlistItemsGet.js +42 -0
  47. package/api/loop/loopBlocklistItemsGet.js +46 -0
  48. package/api/loop/loopDestinationsGet.js +42 -0
  49. package/api/loop/loopGet.js +139 -0
  50. package/api/loop/loopReturnGet.js +73 -0
  51. package/api/loop/loopReturnsGet.js +46 -0
  52. package/api/peoplevox/peoplevox.constants.js +1 -1
  53. package/api/peoplevox/peoplevox.sessions.js +54 -0
  54. package/api/peoplevox/peoplevox.utils.js +67 -31
  55. package/api/peoplevox/peoplevoxGetSingle.js +7 -5
  56. package/api/peoplevox/peoplevoxOrderEdit.js +7 -5
  57. package/api/peoplevox/peoplevoxReportGet.js +11 -9
  58. package/api/pipelineSteps.js +49 -0
  59. package/api/shopify/shopify.utils.js +18 -24
  60. package/api/shopify/shopifyBulkMutationDo.js +211 -0
  61. package/api/shopify/shopifyBulkOperationGet.js +86 -0
  62. package/api/shopify/shopifyBulkOperationRunMutation.js +83 -0
  63. package/api/shopify/shopifyCheckoutAndAccountsConfigurationUpdate.js +79 -0
  64. package/api/shopify/shopifyCollectionGet.js +7 -7
  65. package/api/shopify/shopifyCustomerGet.js +6 -6
  66. package/api/shopify/shopifyGet.js +18 -13
  67. package/api/shopify/shopifyGetSingle.js +9 -9
  68. package/api/shopify/shopifyMutationDo.js +6 -6
  69. package/api/shopify/shopifyOrdersGet.js +11 -11
  70. package/api/shopify/shopifyStagedUploadCreate.js +96 -0
  71. package/api/shopify/shopifyTagsAdd.js +1 -1
  72. package/api/shopify/shopifyTagsAddBulk.js +90 -0
  73. package/api/shopify/shopifyTagsRemove.js +1 -1
  74. package/api/slack/slack.utils.js +10 -19
  75. package/api/slack/slackMessagePost.js +11 -11
  76. package/api/starshipit/starshipit.constants.js +8 -0
  77. package/api/starshipit/starshipit.utils.js +71 -0
  78. package/api/starshipit/starshipitAddressCreate.js +77 -0
  79. package/api/starshipit/starshipitAddressDelete.js +55 -0
  80. package/api/starshipit/starshipitAddressUpdate.js +69 -0
  81. package/api/starshipit/starshipitAddressesGet.js +52 -0
  82. package/api/starshipit/starshipitGet.js +146 -0
  83. package/api/starshipit/starshipitOrderDelete.js +102 -0
  84. package/api/starshipit/starshipitOrderGet.js +74 -0
  85. package/api/starshipit/starshipitOrderUpdate.js +109 -0
  86. package/api/starshipit/starshipitOrdersListShipped.js +64 -0
  87. package/api/starshipit/starshipitProductAdd.js +100 -0
  88. package/api/starshipit/starshipitProductsDelete.js +57 -0
  89. package/api/starshipit/starshipitProductsGet.js +49 -0
  90. package/api/starshipit/starshipitTrackingGet.js +69 -0
  91. package/api/stripe/_example.js +48 -0
  92. package/api/stripe/stripe.constants.js +5 -0
  93. package/api/stripe/stripe.utils.js +42 -0
  94. package/api/stripe/stripeCardCharge.js +98 -0
  95. package/api/stripe/stripeCardTokenCreate.js +70 -0
  96. package/api/stripe/stripeChargeCapture.js +63 -0
  97. package/api/stripe/stripeChargeCreate.js +70 -0
  98. package/api/stripe/stripeChargeGet.js +51 -0
  99. package/api/stripe/stripeChargesGet.js +52 -0
  100. package/api/stripe/stripeRefundCreate.js +64 -0
  101. package/api/stripe/stripeRefundGet.js +51 -0
  102. package/api/stripe/stripeRefundsGet.js +52 -0
  103. package/api/stripe/stripeTokenGet.js +51 -0
  104. package/api/stylearcade/stylearcade.constants.js +5 -0
  105. package/api/stylearcade/stylearcade.utils.js +40 -0
  106. package/api/stylearcade/stylearcadeDataGet.js +62 -0
  107. package/api/stylearcade/stylearcadeGet.js +133 -0
  108. package/api/stylearcade/stylearcadeMetadataGet.js +47 -0
  109. package/api/supabase/supabase.utils.js +52 -0
  110. package/api/supabase/supabaseRowDelete.js +95 -0
  111. package/api/supabase/supabaseRowGet.js +58 -0
  112. package/api/supabase/supabaseRowInsert.js +56 -0
  113. package/api/supabase/supabaseRowUpdate.js +58 -0
  114. package/api/supabase/supabaseRpc.js +61 -0
  115. package/api/supabase/supabaseTableGet.js +44 -0
  116. package/api/supabase/supabaseTableGetAll.js +86 -0
  117. package/api/threeclicks/threeclicks.constants.js +8 -0
  118. package/api/threeclicks/threeclicks.utils.js +119 -0
  119. package/api/threeclicks/threeclicksCollectionsGet.js +40 -0
  120. package/api/threeclicks/threeclicksGet.js +138 -0
  121. package/api/threeclicks/threeclicksKeycodeCreate.js +55 -0
  122. package/api/threeclicks/threeclicksKeycodeGet.js +47 -0
  123. package/api/threeclicks/threeclicksPurchaseOrderCreate.js +34 -0
  124. package/api/threeclicks/threeclicksPurchaseOrderCreateBulk.js +34 -0
  125. package/api/threeclicks/threeclicksPurchaseOrderGet.js +33 -0
  126. package/api/threeclicks/threeclicksPurchaseOrderQuantitiesGet.js +33 -0
  127. package/api/threeclicks/threeclicksPurchaseOrderQuantityCreate.js +34 -0
  128. package/api/threeclicks/threeclicksPurchaseOrderQuantityCreateBulk.js +34 -0
  129. package/api/threeclicks/threeclicksPurchaseOrderQuantityUpdate.js +46 -0
  130. package/api/threeclicks/threeclicksPurchaseOrderQuantityUpdateBulk.js +46 -0
  131. package/api/threeclicks/threeclicksPurchaseOrderUpdate.js +35 -0
  132. package/api/threeclicks/threeclicksPurchaseOrdersGet.js +30 -0
  133. package/api/threeclicks/threeclicksShipmentCreate.js +34 -0
  134. package/api/threeclicks/threeclicksShipmentGet.js +33 -0
  135. package/api/threeclicks/threeclicksShipmentOrderAdd.js +38 -0
  136. package/api/threeclicks/threeclicksShipmentOrderQuantityCreate.js +35 -0
  137. package/api/threeclicks/threeclicksShipmentQuantityUpdate.js +35 -0
  138. package/api/threeclicks/threeclicksShipmentStatusUpdate.js +45 -0
  139. package/api/threeclicks/threeclicksShipmentsGet.js +52 -0
  140. package/api/threeclicks/threeclicksSignatureCalculate.js +73 -0
  141. package/api/threeclicks/threeclicksStyleCodesGet.js +46 -0
  142. package/api/threeclicks/threeclicksStyleColourCreate.js +47 -0
  143. package/api/threeclicks/threeclicksStyleColourDelete.js +34 -0
  144. package/api/threeclicks/threeclicksStyleCreate.js +44 -0
  145. package/api/threeclicks/threeclicksStyleDelete.js +33 -0
  146. package/api/threeclicks/threeclicksStyleGet.js +43 -0
  147. package/api/threeclicks/threeclicksStylePriceUpdate.js +70 -0
  148. package/api/threeclicks/threeclicksStyleUpdate.js +47 -0
  149. package/api/threeclicks/threeclicksStylesGet.js +45 -0
  150. package/api/upstash/upstash.utils.js +36 -0
  151. package/api/upstash/upstashDel.js +46 -0
  152. package/api/upstash/upstashExists.js +46 -0
  153. package/api/upstash/upstashGet.js +46 -0
  154. package/api/upstash/upstashSet.js +64 -0
  155. package/api/utils.js +90 -76
  156. package/api/validators.js +1 -1
  157. package/api/workable/workable.constants.js +3 -0
  158. package/api/workable/workable.utils.js +41 -0
  159. package/api/workable/workableGet.js +151 -0
  160. package/api/workable/workableJobCandidateCreate.js +87 -0
  161. package/api/workable/workableJobGet.js +52 -0
  162. package/api/workable/workableJobMembersGet.js +52 -0
  163. package/api/workable/workableJobStagesGet.js +52 -0
  164. package/api/workable/workableJobsGet.js +78 -0
  165. package/api/yotpo/yotpo.utils.js +17 -22
  166. package/api/yotpo/yotpoCampaignsGet.js +6 -6
  167. package/api/yotpo/yotpoCustomerActionRecord.js +7 -7
  168. package/api/yotpo/yotpoCustomerAnniversaryGet.js +7 -7
  169. package/api/yotpo/yotpoCustomerAnniversarySet.js +7 -7
  170. package/api/yotpo/yotpoCustomerBirthdaySet.js +7 -7
  171. package/api/yotpo/yotpoCustomerGet.js +6 -6
  172. package/api/yotpo/yotpoCustomerPointsAdjust.js +7 -7
  173. package/api/yotpo/yotpoCustomerUpsert.js +7 -7
  174. package/api/yotpo/yotpoCustomersRecentGet.js +6 -6
  175. package/api/yotpo/yotpoRedemptionCreate.js +7 -7
  176. package/api/yotpo/yotpoRedemptionOptionsGet.js +6 -6
  177. package/api/yotpo/yotpoVipTiersGet.js +5 -5
  178. package/api/youtube/youtube.constants.js +5 -0
  179. package/api/youtube/youtube.utils.js +77 -0
  180. package/api/youtube/youtubeChannelVideosGet.js +25 -70
  181. package/hosting/.hosting.yml.sample +9 -11
  182. package/hosting/copyCredsToEnv.js +58 -2
  183. package/hosting/deployFromHostingYml.js +9 -2
  184. package/hosting/hosting.utils.js +3 -2
  185. package/package.json +3 -1
  186. package/server.utils.js +1 -0
@@ -0,0 +1,34 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order-createBulkStyle
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['orderPayload'],
10
+ ]);
11
+
12
+ const threeclicksPurchaseOrderCreateBulk = async (credsPayload, orderPayload) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, orderPayload });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: '/order/bulk-style',
18
+ method: 'post',
19
+ body: orderPayload,
20
+ },
21
+ context: {
22
+ credsPayload,
23
+ },
24
+ });
25
+ };
26
+
27
+ const funcApiConfig = {
28
+ argsWarden,
29
+ };
30
+
31
+ module.exports = {
32
+ threeclicksPurchaseOrderCreateBulk,
33
+ funcApiConfig,
34
+ };
@@ -0,0 +1,33 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-detail_7
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['orderNumber'],
10
+ ]);
11
+
12
+ const threeclicksPurchaseOrderGet = async (credsPayload, orderNumber) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, orderNumber });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: `/order/basic/${ orderNumber }`,
18
+ method: 'get',
19
+ },
20
+ context: {
21
+ credsPayload,
22
+ },
23
+ });
24
+ };
25
+
26
+ const funcApiConfig = {
27
+ argsWarden,
28
+ };
29
+
30
+ module.exports = {
31
+ threeclicksPurchaseOrderGet,
32
+ funcApiConfig,
33
+ };
@@ -0,0 +1,33 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-quantityNormal
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['orderNumber'],
10
+ ]);
11
+
12
+ const threeclicksPurchaseOrderQuantitiesGet = async (credsPayload, orderNumber) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, orderNumber });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: `/order/basic/quantity/normal/${ orderNumber }`,
18
+ method: 'get',
19
+ },
20
+ context: {
21
+ credsPayload,
22
+ },
23
+ });
24
+ };
25
+
26
+ const funcApiConfig = {
27
+ argsWarden,
28
+ };
29
+
30
+ module.exports = {
31
+ threeclicksPurchaseOrderQuantitiesGet,
32
+ funcApiConfig,
33
+ };
@@ -0,0 +1,34 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-quantityNormalCreate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['quantityPayload'],
10
+ ]);
11
+
12
+ const threeclicksPurchaseOrderQuantityCreate = async (credsPayload, quantityPayload) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, quantityPayload });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: '/order/basic/quantity/normal',
18
+ method: 'post',
19
+ body: quantityPayload ,
20
+ },
21
+ context: {
22
+ credsPayload,
23
+ },
24
+ });
25
+ };
26
+
27
+ const funcApiConfig = {
28
+ argsWarden,
29
+ };
30
+
31
+ module.exports = {
32
+ threeclicksPurchaseOrderQuantityCreate,
33
+ funcApiConfig,
34
+ };
@@ -0,0 +1,34 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-quantityBulkStyleCreate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['quantityPayload'],
10
+ ]);
11
+
12
+ const threeclicksPurchaseOrderQuantityCreateBulk = async (credsPayload, quantityPayload) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, quantityPayload });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: '/order/basic/quantity/bulk-style',
18
+ method: 'post',
19
+ body: quantityPayload,
20
+ },
21
+ context: {
22
+ credsPayload,
23
+ },
24
+ });
25
+ };
26
+
27
+ const funcApiConfig = {
28
+ argsWarden,
29
+ };
30
+
31
+ module.exports = {
32
+ threeclicksPurchaseOrderQuantityCreateBulk,
33
+ funcApiConfig,
34
+ };
@@ -0,0 +1,46 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-quantityNormalUpdate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['orderNumber'],
10
+ ['orderColoursizeId'],
11
+ ['quantityPayload'],
12
+ ]);
13
+
14
+ const threeclicksPurchaseOrderQuantityUpdate = async (
15
+ credsPayload,
16
+ orderNumber,
17
+ orderColoursizeId,
18
+ quantityPayload,
19
+ ) => {
20
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
21
+ credsPayload,
22
+ orderNumber,
23
+ orderColoursizeId,
24
+ quantityPayload,
25
+ });
26
+ if (rejectResponse) return rejectResponse;
27
+ return threeclicksClient.fetch({
28
+ requestPayload: {
29
+ url: `/order/basic/quantity/normal/${ orderNumber }/${ orderColoursizeId }`,
30
+ method: 'patch',
31
+ body: quantityPayload,
32
+ },
33
+ context: {
34
+ credsPayload,
35
+ },
36
+ });
37
+ };
38
+
39
+ const funcApiConfig = {
40
+ argsWarden,
41
+ };
42
+
43
+ module.exports = {
44
+ threeclicksPurchaseOrderQuantityUpdate,
45
+ funcApiConfig,
46
+ };
@@ -0,0 +1,46 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-quantityBulkStyleUpdate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['orderNumber'],
10
+ ['orderColoursizeId'],
11
+ ['quantityPayload'],
12
+ ]);
13
+
14
+ const threeclicksPurchaseOrderQuantityUpdateBulk = async (
15
+ credsPayload,
16
+ orderNumber,
17
+ orderColoursizeId,
18
+ quantityPayload,
19
+ ) => {
20
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
21
+ credsPayload,
22
+ orderNumber,
23
+ orderColoursizeId,
24
+ quantityPayload,
25
+ });
26
+ if (rejectResponse) return rejectResponse;
27
+ return threeclicksClient.fetch({
28
+ requestPayload: {
29
+ url: `/order/basic/quantity/bulk-style/${ orderNumber }/${ orderColoursizeId }`,
30
+ method: 'patch',
31
+ body: quantityPayload,
32
+ },
33
+ context: {
34
+ credsPayload,
35
+ },
36
+ });
37
+ };
38
+
39
+ const funcApiConfig = {
40
+ argsWarden,
41
+ };
42
+
43
+ module.exports = {
44
+ threeclicksPurchaseOrderQuantityUpdateBulk,
45
+ funcApiConfig,
46
+ };
@@ -0,0 +1,35 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Order_>_Details-update_3
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['orderNumber'],
10
+ ['orderPayload'],
11
+ ]);
12
+
13
+ const threeclicksPurchaseOrderUpdate = async (credsPayload, orderNumber, orderPayload) => {
14
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, orderNumber, orderPayload });
15
+ if (rejectResponse) return rejectResponse;
16
+ return threeclicksClient.fetch({
17
+ requestPayload: {
18
+ url: `/order/basic/${ orderNumber }`,
19
+ method: 'patch',
20
+ body: orderPayload,
21
+ },
22
+ context: {
23
+ credsPayload,
24
+ },
25
+ });
26
+ };
27
+
28
+ const funcApiConfig = {
29
+ argsWarden,
30
+ };
31
+
32
+ module.exports = {
33
+ threeclicksPurchaseOrderUpdate,
34
+ funcApiConfig,
35
+ };
@@ -0,0 +1,30 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Search_>_Advanced-orderSearch
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksGet } = require('../threeclicks/threeclicksGet');
6
+
7
+ const argsWarden = new ArgsWarden([['credsPayload', credsValidator]]);
8
+
9
+ const threeclicksPurchaseOrdersGet = async (credsPayload, { mode = 'all', ...getterOptions } = {}) => {
10
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload });
11
+ if (rejectResponse) return rejectResponse;
12
+ return threeclicksGet(credsPayload, '/search/advanced/order', { params: { mode }, ...getterOptions });
13
+ };
14
+
15
+ const funcApiConfig = {
16
+ argsWarden,
17
+ };
18
+
19
+ module.exports = {
20
+ threeclicksPurchaseOrdersGet,
21
+ funcApiConfig,
22
+ };
23
+
24
+ /*
25
+ curl -X POST "http://localhost:8000/threeclicksPurchaseOrdersGet" \
26
+ -H "Content-Type: application/json" \
27
+ -d '{
28
+ "credsPayload": { "credsPath": "threeclicks" }
29
+ }'
30
+ */
@@ -0,0 +1,34 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Shipping-create_3
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['shipmentPayload'],
10
+ ]);
11
+
12
+ const threeclicksShipmentCreate = async (credsPayload, shipmentPayload) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, shipmentPayload });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: '/shipping',
18
+ method: 'post',
19
+ body: shipmentPayload ,
20
+ },
21
+ context: {
22
+ credsPayload,
23
+ },
24
+ });
25
+ };
26
+
27
+ const funcApiConfig = {
28
+ argsWarden,
29
+ };
30
+
31
+ module.exports = {
32
+ threeclicksShipmentCreate,
33
+ funcApiConfig,
34
+ };
@@ -0,0 +1,33 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Shipping_>_Details-detail_5
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['shipmentNumber'],
10
+ ]);
11
+
12
+ const threeclicksShipmentGet = async (credsPayload, shipmentNumber) => {
13
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, shipmentNumber });
14
+ if (rejectResponse) return rejectResponse;
15
+ return threeclicksClient.fetch({
16
+ requestPayload: {
17
+ url: `/shipping/basic/${ shipmentNumber }`,
18
+ method: 'get',
19
+ },
20
+ context: {
21
+ credsPayload,
22
+ },
23
+ });
24
+ };
25
+
26
+ const funcApiConfig = {
27
+ argsWarden,
28
+ };
29
+
30
+ module.exports = {
31
+ threeclicksShipmentGet,
32
+ funcApiConfig,
33
+ };
@@ -0,0 +1,38 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Shipping_>_Details-addOrderToUnassignedOrder
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['shipmentNumber'],
10
+ ['orderNumber'],
11
+ ]);
12
+
13
+ const threeclicksShipmentOrderAdd = async (credsPayload, shipmentNumber, orderNumber) => {
14
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, shipmentNumber, orderNumber });
15
+ if (rejectResponse) return rejectResponse;
16
+ return threeclicksClient.fetch({
17
+ requestPayload: {
18
+ url: '/shipping/basic/unassigned-orders/order',
19
+ method: 'post',
20
+ body: {
21
+ shipment_number: shipmentNumber,
22
+ order_number: orderNumber,
23
+ },
24
+ },
25
+ context: {
26
+ credsPayload,
27
+ },
28
+ });
29
+ };
30
+
31
+ const funcApiConfig = {
32
+ argsWarden,
33
+ };
34
+
35
+ module.exports = {
36
+ threeclicksShipmentOrderAdd,
37
+ funcApiConfig,
38
+ };
@@ -0,0 +1,35 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Shipping_>_Details-shipmentQuantityCreate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['shipmentNumber'],
10
+ ['quantityPayload'],
11
+ ]);
12
+
13
+ const threeclicksShipmentOrderQuantityCreate = async (credsPayload, shipmentNumber, quantityPayload) => {
14
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, shipmentNumber, quantityPayload });
15
+ if (rejectResponse) return rejectResponse;
16
+ return threeclicksClient.fetch({
17
+ requestPayload: {
18
+ url: `/shipping/basic/orders/shipment-quantity/${ shipmentNumber }`,
19
+ method: 'post',
20
+ body: quantityPayload,
21
+ },
22
+ context: {
23
+ credsPayload,
24
+ },
25
+ });
26
+ };
27
+
28
+ const funcApiConfig = {
29
+ argsWarden,
30
+ };
31
+
32
+ module.exports = {
33
+ threeclicksShipmentOrderQuantityCreate,
34
+ funcApiConfig,
35
+ };
@@ -0,0 +1,35 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Shipping_>_Details-shipmentQuantityUpdate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['shipmentNumber'],
10
+ ['quantityPayload'],
11
+ ]);
12
+
13
+ const threeclicksShipmentQuantityUpdate = async (credsPayload, shipmentNumber, quantityPayload) => {
14
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, shipmentNumber, quantityPayload });
15
+ if (rejectResponse) return rejectResponse;
16
+ return threeclicksClient.fetch({
17
+ requestPayload: {
18
+ url: `/shipping/basic/orders/shipment-quantity/${ shipmentNumber }`,
19
+ method: 'patch',
20
+ body: quantityPayload,
21
+ },
22
+ context: {
23
+ credsPayload,
24
+ },
25
+ });
26
+ };
27
+
28
+ const funcApiConfig = {
29
+ argsWarden,
30
+ };
31
+
32
+ module.exports = {
33
+ threeclicksShipmentQuantityUpdate,
34
+ funcApiConfig,
35
+ };
@@ -0,0 +1,45 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Shipping-detailsUpdate
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksClient } = require('../threeclicks/threeclicks.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ['shipmentNumber'],
10
+ ['status'],
11
+ ]);
12
+
13
+ const threeclicksShipmentStatusUpdate = async (
14
+ credsPayload,
15
+ shipmentNumber,
16
+ status,
17
+ {
18
+ isUpdateAllAssociatedOrdersToCompletedStatus = true,
19
+ } = {},
20
+ ) => {
21
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload, shipmentNumber, status });
22
+ if (rejectResponse) return rejectResponse;
23
+ return threeclicksClient.fetch({
24
+ requestPayload: {
25
+ url: `/shipping/status/${ shipmentNumber }`,
26
+ method: 'patch',
27
+ body: {
28
+ status,
29
+ is_update_all_associated_orders_to_completed_status: isUpdateAllAssociatedOrdersToCompletedStatus,
30
+ },
31
+ },
32
+ context: {
33
+ credsPayload,
34
+ },
35
+ });
36
+ };
37
+
38
+ const funcApiConfig = {
39
+ argsWarden,
40
+ };
41
+
42
+ module.exports = {
43
+ threeclicksShipmentStatusUpdate,
44
+ funcApiConfig,
45
+ };
@@ -0,0 +1,52 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html#operations-v1_-_Search_>_Advanced-shippingSearch
2
+
3
+ const { ArgsWarden, timeMs } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { threeclicksGet } = require('../threeclicks/threeclicksGet');
6
+
7
+ const argsWarden = new ArgsWarden([['credsPayload', credsValidator]]);
8
+
9
+ const threeclicksShipmentsGet = async (
10
+ credsPayload,
11
+ {
12
+ mode = 'all',
13
+ updatedSinceDaysAgo,
14
+ updatedSinceHoursAgo,
15
+ ...getterOptions
16
+ } = {},
17
+ ) => {
18
+
19
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({ credsPayload });
20
+ if (rejectResponse) return rejectResponse;
21
+
22
+ const updatedSinceUnix = updatedSinceDaysAgo
23
+ ? Math.floor((Date.now() - timeMs.days(updatedSinceDaysAgo)) / 1000).toString()
24
+ : updatedSinceHoursAgo
25
+ ? Math.floor((Date.now() - timeMs.hours(updatedSinceHoursAgo)) / 1000).toString()
26
+ : null;
27
+
28
+ return threeclicksGet(credsPayload, '/search/advanced/shipping', {
29
+ params: {
30
+ mode,
31
+ ...updatedSinceUnix && { last_updated_at_from: updatedSinceUnix },
32
+ },
33
+ ...getterOptions,
34
+ });
35
+ };
36
+
37
+ const funcApiConfig = {
38
+ argsWarden,
39
+ };
40
+
41
+ module.exports = {
42
+ threeclicksShipmentsGet,
43
+ funcApiConfig,
44
+ };
45
+
46
+ /*
47
+ curl -X POST "http://localhost:8000/threeclicksShipmentsGet" \
48
+ -H "Content-Type: application/json" \
49
+ -d '{
50
+ "credsPayload": { "credsPath": "threeclicks" }
51
+ }'
52
+ */
@@ -0,0 +1,73 @@
1
+ // https://g40-server.instance.3clickscloud.com/swagger-ui/index.html
2
+
3
+ const { ArgsWarden, credsFromPayload } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const {
6
+ threeclicksSignatureCalculate,
7
+ getSignatureData,
8
+ } = require('../threeclicks/threeclicks.utils');
9
+
10
+ const argsWarden = new ArgsWarden([
11
+ ['credsPayload', credsValidator],
12
+ ['method'],
13
+ ]);
14
+
15
+ const threeclicksSignatureCalculateEndpoint = async (
16
+ credsPayload,
17
+ method,
18
+ {
19
+ params,
20
+ body,
21
+ } = {},
22
+ ) => {
23
+
24
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
25
+ credsPayload,
26
+ method,
27
+ });
28
+ if (rejectResponse) {
29
+ return rejectResponse;
30
+ }
31
+
32
+ const creds = await credsFromPayload(credsPayload);
33
+ const normalizedMethod = method.toLowerCase();
34
+ const data = getSignatureData({
35
+ method: normalizedMethod,
36
+ params,
37
+ body,
38
+ });
39
+
40
+ const result = threeclicksSignatureCalculate({
41
+ creds,
42
+ method: normalizedMethod,
43
+ data,
44
+ });
45
+
46
+ return {
47
+ ok: true,
48
+ data: result,
49
+ };
50
+ };
51
+
52
+ const funcApiConfig = {
53
+ argsWarden,
54
+ };
55
+
56
+ module.exports = {
57
+ threeclicksSignatureCalculate: threeclicksSignatureCalculateEndpoint,
58
+ funcApiConfig,
59
+ };
60
+
61
+ /*
62
+ curl -X POST "http://localhost:8000/threeclicksSignatureCalculate" \
63
+ -H "Content-Type: application/json" \
64
+ -d '{
65
+ "credsPayload": { "credsPath": "threeclicks" },
66
+ "method": "get",
67
+ "options": {
68
+ "params": {
69
+ "hey": "true"
70
+ }
71
+ }
72
+ }'
73
+ */