@zauru-sdk/services 2.0.210 → 2.0.212
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
1
|
+
import { arrayToObject, 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";
|
|
@@ -36,10 +36,24 @@ export async function getShipments(session, config) {
|
|
|
36
36
|
*/
|
|
37
37
|
export async function receiveShipment_booking(headers, id) {
|
|
38
38
|
return handlePossibleAxiosErrors(async () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
await httpZauru.get(`/inventories/bookings/${id}/deliver.json`, {
|
|
40
|
+
headers,
|
|
41
|
+
});
|
|
42
|
+
return true;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export async function receiveTransit(headers, body) {
|
|
46
|
+
return handlePossibleAxiosErrors(async () => {
|
|
47
|
+
const sendBody = {
|
|
48
|
+
shipment: {
|
|
49
|
+
...body,
|
|
50
|
+
movements_attributes: arrayToObject(body.movements),
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
delete sendBody.shipment.movements;
|
|
54
|
+
await httpZauru.put(`/inventories/transits/${body.id}.json`, sendBody, {
|
|
55
|
+
headers,
|
|
56
|
+
});
|
|
43
57
|
return true;
|
|
44
58
|
});
|
|
45
59
|
}
|
|
@@ -34,6 +34,7 @@ export declare function getShipments(session: Session, config: {
|
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
36
|
export declare function receiveShipment_booking(headers: any, id: string | number): Promise<AxiosUtilsResponse<boolean>>;
|
|
37
|
+
export declare function receiveTransit(headers: any, body: ShipmentGraphQL): Promise<AxiosUtilsResponse<boolean>>;
|
|
37
38
|
/**
|
|
38
39
|
* despacharShipment_booking
|
|
39
40
|
* Esta función cambia el atributo 'shipment' de los envíos a 'true', lo que indica que el envío está en tránsito.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.212",
|
|
4
4
|
"description": "Servicios de consulta a Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"axios": "^1.6.7",
|
|
33
33
|
"chalk": "5.3.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "a68d1bf942a86a6824a804ba664a0b8692cf7e20"
|
|
36
36
|
}
|