@zauru-sdk/services 2.0.52 → 2.0.55
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.
- package/dist/esm/common.js +1 -1
- package/dist/esm/zauru/httpZauru.js +1 -2
- package/dist/esm/zauru/zauru-automatic-numbers.js +1 -1
- package/dist/esm/zauru/zauru-bookings.js +1 -1
- package/dist/esm/zauru/zauru-bundles.js +1 -1
- package/dist/esm/zauru/zauru-consolidated.js +1 -1
- package/dist/esm/zauru/zauru-deliveries.js +1 -1
- package/dist/esm/zauru/zauru-discharges.js +1 -1
- package/dist/esm/zauru/zauru-forms.js +1 -1
- package/dist/esm/zauru/zauru-invoices.js +2 -5
- package/dist/esm/zauru/zauru-items.js +1 -1
- package/dist/esm/zauru/zauru-lotes.js +1 -1
- package/dist/esm/zauru/zauru-payees.js +1 -1
- package/dist/esm/zauru/zauru-payment-terms.js +1 -1
- package/dist/esm/zauru/zauru-payments.js +1 -1
- package/dist/esm/zauru/zauru-price-lists.js +1 -1
- package/dist/esm/zauru/zauru-profiles.js +1 -1
- package/dist/esm/zauru/zauru-purchase-orders.js +3 -3
- package/dist/esm/zauru/zauru-receptions.js +1 -1
- package/dist/esm/zauru/zauru-shipments.js +1 -1
- package/dist/esm/zauru/zauru-suggested-prices.js +1 -1
- package/dist/esm/zauru/zauru-tags.js +1 -1
- package/dist/esm/zauru/zauru-templates.js +1 -1
- package/dist/esm/zauru/zauru-variables.js +1 -1
- package/dist/esm/zauru/zauru-web-app-tables.js +1 -1
- package/dist/zauru/httpZauru.d.ts +1 -2
- package/dist/zauru/zauru-purchase-orders.d.ts +1 -1
- package/package.json +2 -2
package/dist/esm/common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { redirect } from "@remix-run/node";
|
|
2
2
|
import { commitSession, getSession } from "./sessions/sessions.js";
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
import httpZauru from "./zauru/httpZauru.js";
|
|
4
|
+
import { httpZauru } from "./zauru/httpZauru.js";
|
|
5
5
|
import { getAgencyInfo, getEmployeeInfo, getOauthUserInfo, getProfileInformation, } from "./zauru/zauru-profiles.js";
|
|
6
6
|
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
7
7
|
import { getVariables } from "./zauru/zauru-variables.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { arrayToObject, handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
-
import httpZauru from "./httpZauru.js";
|
|
2
|
+
import { httpZauru } from "./httpZauru.js";
|
|
3
3
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
4
4
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
5
5
|
import { getShipmentsStringQuery } from "@zauru-sdk/graphql";
|
|
@@ -2,7 +2,7 @@ import { arrayToObject, handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
|
2
2
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getBundleByNameStringQuery, getBundlesByItemCategoryIdStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getBundlesByItemCategoryId
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatDateToUTC, handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
-
import httpZauru from "./httpZauru.js";
|
|
2
|
+
import { httpZauru } from "./httpZauru.js";
|
|
3
3
|
import { getGraphQLAPIHeaders, getVariablesByName } from "../common.js";
|
|
4
4
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
5
5
|
import { getConsolidatesBetweenDatesStringQuery } from "@zauru-sdk/graphql";
|
|
@@ -2,7 +2,7 @@ import { arrayToObject, convertToFormData, handlePossibleAxiosErrors, } from "@z
|
|
|
2
2
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getAllFormsStringQuery, getFormByNameStringQuery, getFormSubmissionByIdStringQuery, getFormsByDocumentTypeStringQuery, getFormsStringQuery, getInvoiceFormSubmissionsByAgencyIdStringQuery, getInvoiceFormSubmissionsByInvoiceIdStringQuery, getLastInvoiceFormSubmissionStringQuery, getMyCaseFormSubmissionsStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getForms
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@ import { arrayToObject, handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
|
2
2
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getInvoicesByAgencyIdStringQuery } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getInvoicesByAgencyId
|
|
8
8
|
*/
|
|
@@ -10,10 +10,7 @@ export async function getInvoicesByAgencyId(session, id) {
|
|
|
10
10
|
return handlePossibleAxiosErrors(async () => {
|
|
11
11
|
const headers = await getGraphQLAPIHeaders(session);
|
|
12
12
|
const response = await httpGraphQLAPI.post("", {
|
|
13
|
-
query: getInvoicesByAgencyIdStringQuery,
|
|
14
|
-
variables: {
|
|
15
|
-
id,
|
|
16
|
-
},
|
|
13
|
+
query: getInvoicesByAgencyIdStringQuery(Number(id ?? 0)),
|
|
17
14
|
}, { headers });
|
|
18
15
|
if (response.data.errors) {
|
|
19
16
|
throw new Error(response.data.errors.map((x) => x.message).join(";"));
|
|
@@ -2,7 +2,7 @@ import { extractValueBetweenTags, handlePossibleAxiosErrors, } from "@zauru-sdk/
|
|
|
2
2
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getItemByNameStringQuery, getItemCategoryByIdStringQuery, getItemsByCategoryStringQuery, getItemsBySuperCategoryStringQuery, getItemsStringQuery, getSuperCategoryByIdStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
//============================ FORMATEADO DE ITEMS
|
|
7
7
|
function extractIdFromURL(input) {
|
|
8
8
|
const regex = /\/items\/(\d+)/;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getBasketsSchema, handlePossibleAxiosErrors, reduceAdd, truncateDecimals, } from "@zauru-sdk/common";
|
|
2
2
|
import moment from "moment";
|
|
3
3
|
import { getGraphQLAPIHeaders, getVariablesByName } from "../common.js";
|
|
4
|
-
import httpZauru from "./httpZauru.js";
|
|
4
|
+
import { httpZauru } from "./httpZauru.js";
|
|
5
5
|
import { createLoteRecord } from "./zauru-lote-record.js";
|
|
6
6
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
7
7
|
import { getLotStocksByAgencyIdStringQuery, getLotsByNameStringQuery, } from "@zauru-sdk/graphql";
|
|
@@ -2,7 +2,7 @@ import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
|
2
2
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
3
3
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
4
4
|
import { getClientCategoriesStringQuery, getPayeeByIdStringQuery, getPayeeCategoriesByNotesMatchStringQuery, getPayeeCategoriesStringQuery, getPayeeCategoryByIdStringQuery, getPayeesStringQuery, getProviderCategoriesStringQuery, getProvidersStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getPayees
|
|
8
8
|
* @param headers
|
|
@@ -2,7 +2,7 @@ import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
|
2
2
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getPaymentTermByIdStringQuery, getPaymentTermsStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getPaymentTerms
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { arrayToObject, convertToFormData, formatDateToUTC, getBasketsSchema, handlePossibleAxiosErrors, reduceAdd, } from "@zauru-sdk/common";
|
|
2
|
-
import httpZauru from "./httpZauru.js";
|
|
2
|
+
import { httpZauru } from "./httpZauru.js";
|
|
3
3
|
import { getGraphQLAPIHeaders, getVariablesByName } from "../common.js";
|
|
4
4
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
5
5
|
import { getLast100ReceptionsStringQuery, getPurchaseOrderByIdNumberStringQuery, getPurchaseOrderStringQuery, getPurchaseOrdersBetweenDatesStringQuery, } from "@zauru-sdk/graphql";
|
|
@@ -371,10 +371,10 @@ export const getGraphQLPurchaseOrderBetweenDates = (session, dates, config = {})
|
|
|
371
371
|
//Esto se aplica porque hay veces que hay mas de un lote,
|
|
372
372
|
//esto se debe a que en el momento que se hace una actualización sobre
|
|
373
373
|
//una orden de compra, se crea una recepción nueva lo que genera también un nuevo lote.
|
|
374
|
-
if (finalConfig.
|
|
374
|
+
if (finalConfig.onlyFirstLot) {
|
|
375
375
|
responseData = responseData.map((x) => {
|
|
376
376
|
if (x.lots.length > 0) {
|
|
377
|
-
x.lots = [x.lots[
|
|
377
|
+
x.lots = [x.lots[0]];
|
|
378
378
|
}
|
|
379
379
|
return x;
|
|
380
380
|
});
|
|
@@ -2,7 +2,7 @@ import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
|
2
2
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getShipmentsStringQuery } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getShipments
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
-
import httpZauru from "./httpZauru.js";
|
|
2
|
+
import { httpZauru } from "./httpZauru.js";
|
|
3
3
|
import { getGraphQLAPIHeaders } from "../common.js";
|
|
4
4
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
5
5
|
import { getSuggestedPricesStringQuery } from "@zauru-sdk/graphql";
|
|
@@ -2,7 +2,7 @@ import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
|
2
2
|
import { getGraphQLAPIHeaders, getVariablesByName } from "../common.js";
|
|
3
3
|
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
4
|
import { getWebAppRowStringQuery, getWebAppRowsByWebAppTableIdStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
-
import httpZauru from "./httpZauru.js";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
6
6
|
/**
|
|
7
7
|
* getWebAppRow
|
|
8
8
|
* @param headers
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const httpZauru: import("axios").AxiosInstance;
|
|
2
|
-
export default httpZauru;
|
|
1
|
+
export declare const httpZauru: import("axios").AxiosInstance;
|
|
@@ -145,7 +145,7 @@ export declare const getGraphQLPurchaseOrderBetweenDates: (session: Session, dat
|
|
|
145
145
|
payeeCategoryIds?: number[];
|
|
146
146
|
excludePayeeCategoryIds?: number[];
|
|
147
147
|
withLotStocks?: boolean;
|
|
148
|
-
|
|
148
|
+
onlyFirstLot?: boolean;
|
|
149
149
|
discountComparisonOperator?: "_eq" | "_neq" | "_gte" | "_lte" | "_gt" | "_lt";
|
|
150
150
|
discount?: number;
|
|
151
151
|
}) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.55",
|
|
4
4
|
"description": "Servicios de consulta a Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"axios": "^1.6.7",
|
|
32
32
|
"chalk": "5.3.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "d267ebc71c86b810518cccc6645c648c6453f447"
|
|
35
35
|
}
|