@zauru-sdk/services 2.0.60 → 2.0.63
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.
|
@@ -6,13 +6,17 @@ import { httpZauru } from "./httpZauru.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* getPaymentTerms
|
|
8
8
|
*/
|
|
9
|
-
export async function getPaymentTerms(session, config
|
|
9
|
+
export async function getPaymentTerms(session, config) {
|
|
10
10
|
return handlePossibleAxiosErrors(async () => {
|
|
11
11
|
const headers = await getGraphQLAPIHeaders(session);
|
|
12
|
+
const defaultConfig = {
|
|
13
|
+
includeAllowedDiscounts: false,
|
|
14
|
+
includeAllowedPaymentTerms: false,
|
|
15
|
+
onlyActives: true,
|
|
16
|
+
};
|
|
17
|
+
const query = getPaymentTermsStringQuery({ ...defaultConfig, ...config });
|
|
12
18
|
const response = await httpGraphQLAPI.post("", {
|
|
13
|
-
query
|
|
14
|
-
includeDiscounts: config.includeDiscounts,
|
|
15
|
-
}),
|
|
19
|
+
query,
|
|
16
20
|
}, { headers });
|
|
17
21
|
if (response.data.errors) {
|
|
18
22
|
throw new Error(response.data.errors.map((x) => x.message).join(";"));
|
|
@@ -4,7 +4,9 @@ import { AxiosUtilsResponse, PaymentTermGraphQL } from "@zauru-sdk/types";
|
|
|
4
4
|
* getPaymentTerms
|
|
5
5
|
*/
|
|
6
6
|
export declare function getPaymentTerms(session: Session, config?: {
|
|
7
|
-
|
|
7
|
+
includeAllowedDiscounts?: boolean;
|
|
8
|
+
includeAllowedPaymentTerms?: boolean;
|
|
9
|
+
onlyActives?: boolean;
|
|
8
10
|
}): Promise<AxiosUtilsResponse<PaymentTermGraphQL[]>>;
|
|
9
11
|
/**
|
|
10
12
|
* getPaymentTermById
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.63",
|
|
4
4
|
"description": "Servicios de consulta a Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@remix-run/node": "^2.8.1",
|
|
27
27
|
"@zauru-sdk/common": "^2.0.51",
|
|
28
28
|
"@zauru-sdk/config": "^2.0.0",
|
|
29
|
-
"@zauru-sdk/graphql": "^2.0.
|
|
29
|
+
"@zauru-sdk/graphql": "^2.0.62",
|
|
30
30
|
"@zauru-sdk/types": "^2.0.51",
|
|
31
31
|
"axios": "^1.6.7",
|
|
32
32
|
"chalk": "5.3.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "0518e2e43085a2309cf845754e7fc678c60447b8"
|
|
35
35
|
}
|