@zauru-sdk/services 2.0.163 → 2.0.164
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/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./zauru/zauru-print-templates.js";
|
|
|
32
32
|
export * from "./zauru/zauru-purchase-orders.js";
|
|
33
33
|
export * from "./zauru/zauru-profiles.js";
|
|
34
34
|
export * from "./zauru/zauru-receptions.js";
|
|
35
|
+
export * from "./zauru/zauru-serial-numbers.js";
|
|
35
36
|
export * from "./zauru/zauru-shipments.js";
|
|
36
37
|
export * from "./zauru/zauru-suggested-prices.js";
|
|
37
38
|
export * from "./zauru/zauru-tags.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
+
import { httpZauru } from "./httpZauru.js";
|
|
3
|
+
import { getGraphQLAPIHeaders } from "~/common.js";
|
|
4
|
+
import { httpGraphQLAPI } from "./httpGraphQL.js";
|
|
5
|
+
import { getSerialsStringQuery } from "@zauru-sdk/graphql";
|
|
6
|
+
/**
|
|
7
|
+
* getSerials
|
|
8
|
+
*/
|
|
9
|
+
export async function getSerials(session, filters) {
|
|
10
|
+
return handlePossibleAxiosErrors(async () => {
|
|
11
|
+
const headers = await getGraphQLAPIHeaders(session);
|
|
12
|
+
const defaultFilters = {
|
|
13
|
+
name: undefined,
|
|
14
|
+
};
|
|
15
|
+
const finalFilters = { ...defaultFilters, ...filters };
|
|
16
|
+
const response = await httpGraphQLAPI.post("", {
|
|
17
|
+
query: getSerialsStringQuery(finalFilters),
|
|
18
|
+
}, { headers });
|
|
19
|
+
if (response.data.errors) {
|
|
20
|
+
throw new Error(response.data.errors.map((x) => x.message).join(";"));
|
|
21
|
+
}
|
|
22
|
+
const registers = response?.data?.data?.serials;
|
|
23
|
+
return registers;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* createSupportSerialAttended
|
|
28
|
+
* @param headers
|
|
29
|
+
* @param body
|
|
30
|
+
*/
|
|
31
|
+
export async function createSupportSerialAttended(headers, body) {
|
|
32
|
+
return handlePossibleAxiosErrors(async () => {
|
|
33
|
+
const response = await httpZauru.post(`/support/serials_attended.json`, { serial: body }, { headers });
|
|
34
|
+
return response.data;
|
|
35
|
+
});
|
|
36
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./zauru/zauru-print-templates.js";
|
|
|
32
32
|
export * from "./zauru/zauru-purchase-orders.js";
|
|
33
33
|
export * from "./zauru/zauru-profiles.js";
|
|
34
34
|
export * from "./zauru/zauru-receptions.js";
|
|
35
|
+
export * from "./zauru/zauru-serial-numbers.js";
|
|
35
36
|
export * from "./zauru/zauru-shipments.js";
|
|
36
37
|
export * from "./zauru/zauru-suggested-prices.js";
|
|
37
38
|
export * from "./zauru/zauru-tags.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosUtilsResponse, SerialGraphQL } from "@zauru-sdk/types";
|
|
2
|
+
import { Session } from "@remix-run/node";
|
|
3
|
+
/**
|
|
4
|
+
* getSerials
|
|
5
|
+
*/
|
|
6
|
+
export declare function getSerials(session: Session, filters?: {
|
|
7
|
+
name?: string;
|
|
8
|
+
}): Promise<AxiosUtilsResponse<SerialGraphQL[]>>;
|
|
9
|
+
/**
|
|
10
|
+
* createSupportSerialAttended
|
|
11
|
+
* @param headers
|
|
12
|
+
* @param body
|
|
13
|
+
*/
|
|
14
|
+
export declare function createSupportSerialAttended(headers: any, body: Partial<SerialGraphQL> & {
|
|
15
|
+
payee_id: number;
|
|
16
|
+
}): Promise<AxiosUtilsResponse<SerialGraphQL>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.164",
|
|
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.
|
|
27
|
+
"@zauru-sdk/common": "^2.0.164",
|
|
28
28
|
"@zauru-sdk/config": "^2.0.100",
|
|
29
|
-
"@zauru-sdk/graphql": "^2.0.
|
|
30
|
-
"@zauru-sdk/types": "^2.0.
|
|
29
|
+
"@zauru-sdk/graphql": "^2.0.164",
|
|
30
|
+
"@zauru-sdk/types": "^2.0.164",
|
|
31
31
|
"axios": "^1.6.7",
|
|
32
32
|
"chalk": "5.3.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "44804384967c4f4a6315c49550b464b79b55a06a"
|
|
35
35
|
}
|