@zauru-sdk/services 2.0.59 → 2.0.62
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,16 @@ 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
|
+
includeAllowedDiscounts: false,
|
|
11
|
+
includeAllowedPaymentTerms: false,
|
|
12
|
+
onlyActives: true,
|
|
13
|
+
}) {
|
|
10
14
|
return handlePossibleAxiosErrors(async () => {
|
|
11
15
|
const headers = await getGraphQLAPIHeaders(session);
|
|
16
|
+
const query = getPaymentTermsStringQuery(config);
|
|
12
17
|
const response = await httpGraphQLAPI.post("", {
|
|
13
|
-
query
|
|
14
|
-
includeDiscounts: config.includeDiscounts,
|
|
15
|
-
}),
|
|
18
|
+
query,
|
|
16
19
|
}, { headers });
|
|
17
20
|
if (response.data.errors) {
|
|
18
21
|
throw new Error(response.data.errors.map((x) => x.message).join(";"));
|
|
@@ -23,7 +23,7 @@ export const getSuggestedPricesExportJSON = async (headers) => {
|
|
|
23
23
|
*/
|
|
24
24
|
export async function getSuggestedPrices(session, config) {
|
|
25
25
|
return handlePossibleAxiosErrors(async () => {
|
|
26
|
-
const { notNullPriceList = false, withItems = false, withItemCategories = false, onlyCurrent = true, } = config;
|
|
26
|
+
const { notNullPriceList = false, withItems = false, withItemCategories = false, onlyCurrent = true, item_super_category_id, } = config;
|
|
27
27
|
const headers = await getGraphQLAPIHeaders(session);
|
|
28
28
|
const response = await httpGraphQLAPI.post("", {
|
|
29
29
|
query: getSuggestedPricesStringQuery({
|
|
@@ -31,6 +31,7 @@ export async function getSuggestedPrices(session, config) {
|
|
|
31
31
|
withItems,
|
|
32
32
|
withItemCategories,
|
|
33
33
|
onlyCurrent,
|
|
34
|
+
item_super_category_id,
|
|
34
35
|
}),
|
|
35
36
|
}, { headers });
|
|
36
37
|
if (response.data.errors) {
|
|
@@ -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
|
|
@@ -16,6 +16,7 @@ export declare function getSuggestedPrices(session: Session, config: {
|
|
|
16
16
|
withItems?: boolean;
|
|
17
17
|
withItemCategories?: boolean;
|
|
18
18
|
onlyCurrent?: boolean;
|
|
19
|
+
item_super_category_id?: number;
|
|
19
20
|
}): Promise<AxiosUtilsResponse<SuggestedPriceGraphQL[]>>;
|
|
20
21
|
/**
|
|
21
22
|
* createSuggestedPrice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.62",
|
|
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": "54574ba8e5fa86be3b372d5803f228e95ee53c27"
|
|
35
35
|
}
|