@zauru-sdk/services 1.0.82 → 1.0.83

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.
@@ -19,9 +19,6 @@ async function getPaymentMethods(session, config = {
19
19
  }) {
20
20
  return (0, common_1.handlePossibleAxiosErrors)(async () => {
21
21
  const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
22
- console.log((0, graphql_1.getPaymentMethodsStringQuery)({
23
- onlyActives: config.onlyActives,
24
- }));
25
22
  const response = await httpGraphQL_js_1.default.post("", {
26
23
  query: (0, graphql_1.getPaymentMethodsStringQuery)({
27
24
  onlyActives: config.onlyActives,
@@ -12,11 +12,13 @@ const httpZauru_js_1 = __importDefault(require("./httpZauru.js"));
12
12
  /**
13
13
  * getPaymentTerms
14
14
  */
15
- async function getPaymentTerms(session) {
15
+ async function getPaymentTerms(session, config = { includeDiscounts: false }) {
16
16
  return (0, common_1.handlePossibleAxiosErrors)(async () => {
17
17
  const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
18
18
  const response = await httpGraphQL_js_1.default.post("", {
19
- query: graphql_1.getPaymentTermsStringQuery,
19
+ query: (0, graphql_1.getPaymentTermsStringQuery)({
20
+ includeDiscounts: config.includeDiscounts,
21
+ }),
20
22
  }, { headers });
21
23
  if (response.data.errors) {
22
24
  throw new Error(response.data.errors.map((x) => x.message).join(";"));
@@ -25,8 +25,8 @@ async function createPayment(headers, body) {
25
25
  delete sendBody.__rvfInternalFormId;
26
26
  if (sendBody.payment_details)
27
27
  delete sendBody.payment_details;
28
- if (sendBody.tagging_payment)
29
- delete sendBody.tagging_payment;
28
+ if (sendBody.tagging_payments)
29
+ delete sendBody.tagging_payments;
30
30
  const response = await httpZauru_js_1.default.post(`/sales/payments.json`, { payment: sendBody }, { headers });
31
31
  return response.data;
32
32
  });
@@ -13,9 +13,6 @@ export async function getPaymentMethods(session, config = {
13
13
  }) {
14
14
  return handlePossibleAxiosErrors(async () => {
15
15
  const headers = await getGraphQLAPIHeaders(session);
16
- console.log(getPaymentMethodsStringQuery({
17
- onlyActives: config.onlyActives,
18
- }));
19
16
  const response = await httpGraphQLAPI.post("", {
20
17
  query: getPaymentMethodsStringQuery({
21
18
  onlyActives: config.onlyActives,
@@ -6,11 +6,13 @@ import httpZauru from "./httpZauru.js";
6
6
  /**
7
7
  * getPaymentTerms
8
8
  */
9
- export async function getPaymentTerms(session) {
9
+ export async function getPaymentTerms(session, config = { includeDiscounts: false }) {
10
10
  return handlePossibleAxiosErrors(async () => {
11
11
  const headers = await getGraphQLAPIHeaders(session);
12
12
  const response = await httpGraphQLAPI.post("", {
13
- query: getPaymentTermsStringQuery,
13
+ query: getPaymentTermsStringQuery({
14
+ includeDiscounts: config.includeDiscounts,
15
+ }),
14
16
  }, { headers });
15
17
  if (response.data.errors) {
16
18
  throw new Error(response.data.errors.map((x) => x.message).join(";"));
@@ -19,8 +19,8 @@ export async function createPayment(headers, body) {
19
19
  delete sendBody.__rvfInternalFormId;
20
20
  if (sendBody.payment_details)
21
21
  delete sendBody.payment_details;
22
- if (sendBody.tagging_payment)
23
- delete sendBody.tagging_payment;
22
+ if (sendBody.tagging_payments)
23
+ delete sendBody.tagging_payments;
24
24
  const response = await httpZauru.post(`/sales/payments.json`, { payment: sendBody }, { headers });
25
25
  return response.data;
26
26
  });
@@ -3,7 +3,9 @@ import { AxiosUtilsResponse, PaymentTermGraphQL } from "@zauru-sdk/types";
3
3
  /**
4
4
  * getPaymentTerms
5
5
  */
6
- export declare function getPaymentTerms(session: Session): Promise<AxiosUtilsResponse<PaymentTermGraphQL[]>>;
6
+ export declare function getPaymentTerms(session: Session, config?: {
7
+ includeDiscounts: boolean;
8
+ }): Promise<AxiosUtilsResponse<PaymentTermGraphQL[]>>;
7
9
  /**
8
10
  * getPaymentTermById
9
11
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -25,12 +25,12 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@remix-run/node": "^2.8.1",
28
- "@zauru-sdk/common": "^1.0.82",
28
+ "@zauru-sdk/common": "^1.0.83",
29
29
  "@zauru-sdk/config": "^1.0.60",
30
- "@zauru-sdk/graphql": "^1.0.81",
31
- "@zauru-sdk/types": "^1.0.82",
30
+ "@zauru-sdk/graphql": "^1.0.83",
31
+ "@zauru-sdk/types": "^1.0.83",
32
32
  "axios": "^1.6.7",
33
33
  "chalk": "5.3.0"
34
34
  },
35
- "gitHead": "c48744ed8b74b9e9bcab1e20e2a71391b15d281f"
35
+ "gitHead": "ee7c5a89327913cc2cb8755e215014e236e8799d"
36
36
  }