@zauru-sdk/services 2.0.31 → 2.0.33

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.
@@ -56,7 +56,9 @@ export const getBookings = async (session, wheres = []) => {
56
56
  return handlePossibleAxiosErrors(async () => {
57
57
  const headers = await getGraphQLAPIHeaders(session);
58
58
  const response = await httpGraphQLAPI.post("", {
59
- query: getShipmentsStringQuery([...wheres, "delivered: {_eq: false}"]),
59
+ query: getShipmentsStringQuery({
60
+ wheres: [...wheres, "delivered: {_eq: false}"],
61
+ }),
60
62
  }, { headers });
61
63
  if (response.data.errors) {
62
64
  throw new Error(response.data.errors.map((x) => x.message).join(";"));
@@ -1,7 +1,7 @@
1
1
  import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
2
2
  import { getGraphQLAPIHeaders } from "../common.js";
3
3
  import httpGraphQLAPI from "./httpGraphQL.js";
4
- import { getLast100ShipmentsStringQuery } from "@zauru-sdk/graphql";
4
+ import { getShipmentsStringQuery } from "@zauru-sdk/graphql";
5
5
  import httpZauru from "./httpZauru.js";
6
6
  /**
7
7
  * getShipments
@@ -9,14 +9,17 @@ import httpZauru from "./httpZauru.js";
9
9
  export async function getShipments(session, config) {
10
10
  return handlePossibleAxiosErrors(async () => {
11
11
  const headers = await getGraphQLAPIHeaders(session);
12
- const query = getLast100ShipmentsStringQuery({
12
+ const query = getShipmentsStringQuery({
13
13
  agency_to_id: Number(config.agency_to_id),
14
+ agency_from_id: config.agency_from_id
15
+ ? Number(config.agency_from_id)
16
+ : undefined,
14
17
  suffix: config.suffix,
15
18
  id_number: config.id_number,
16
19
  id_number_not_null: config.id_number_not_null,
17
20
  id_number_not_empty: config.id_number_not_empty,
21
+ withMovementLots: config.withMovementLots,
18
22
  });
19
- console.log("query", query);
20
23
  const response = await httpGraphQLAPI.post("", {
21
24
  query,
22
25
  }, { headers });
@@ -42,6 +45,20 @@ export async function receiveShipment_booking(headers, id) {
42
45
  return true;
43
46
  });
44
47
  }
48
+ /**
49
+ * despacharShipment_booking
50
+ * Esta función cambia el atributo 'shipment' de los envíos a 'true', lo que indica que el envío está en tránsito.
51
+ * Esto es utilizado para marcar los envíos que necesitan ser entregados en las tablas como "En tránsito".
52
+ * @param headers
53
+ * @param id
54
+ * @returns
55
+ */
56
+ export async function despacharShipment_booking(headers, id) {
57
+ return handlePossibleAxiosErrors(async () => {
58
+ await httpZauru.get(`/inventories/bookings/${id}/ship`, { headers });
59
+ return true;
60
+ });
61
+ }
45
62
  /**
46
63
  * deleteShipment_booking
47
64
  * @param headers
@@ -5,10 +5,12 @@ import { AxiosUtilsResponse, ShipmentGraphQL } from "@zauru-sdk/types";
5
5
  */
6
6
  export declare function getShipments(session: Session, config: {
7
7
  agency_to_id: string | number;
8
+ agency_from_id?: string | number;
8
9
  suffix?: string;
9
10
  id_number?: string;
10
11
  id_number_not_null?: boolean;
11
12
  id_number_not_empty?: boolean;
13
+ withMovementLots?: boolean;
12
14
  }): Promise<AxiosUtilsResponse<ShipmentGraphQL[]>>;
13
15
  /**
14
16
  * receiveShipment_booking
@@ -17,6 +19,15 @@ export declare function getShipments(session: Session, config: {
17
19
  * @returns
18
20
  */
19
21
  export declare function receiveShipment_booking(headers: any, id: string | number): Promise<AxiosUtilsResponse<boolean>>;
22
+ /**
23
+ * despacharShipment_booking
24
+ * Esta función cambia el atributo 'shipment' de los envíos a 'true', lo que indica que el envío está en tránsito.
25
+ * Esto es utilizado para marcar los envíos que necesitan ser entregados en las tablas como "En tránsito".
26
+ * @param headers
27
+ * @param id
28
+ * @returns
29
+ */
30
+ export declare function despacharShipment_booking(headers: any, id: string | number): Promise<AxiosUtilsResponse<boolean>>;
20
31
  /**
21
32
  * deleteShipment_booking
22
33
  * @param headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@remix-run/node": "^2.8.1",
27
- "@zauru-sdk/common": "^2.0.24",
27
+ "@zauru-sdk/common": "^2.0.33",
28
28
  "@zauru-sdk/config": "^2.0.0",
29
- "@zauru-sdk/graphql": "^2.0.31",
30
- "@zauru-sdk/types": "^2.0.24",
29
+ "@zauru-sdk/graphql": "^2.0.33",
30
+ "@zauru-sdk/types": "^2.0.33",
31
31
  "axios": "^1.6.7",
32
32
  "chalk": "5.3.0"
33
33
  },
34
- "gitHead": "06b14f4fc6a5a06dba2e0ad910afbc57c9448d7d"
34
+ "gitHead": "16838516924a5b98ef2fdf89ec46881451b9589b"
35
35
  }