@zauru-sdk/services 6.13.0 → 6.15.0
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.
|
@@ -23,9 +23,9 @@ export const createDischarge = async (session, headers, body) => {
|
|
|
23
23
|
*/
|
|
24
24
|
export const generateDischargePDF = async (headers, session, body) => {
|
|
25
25
|
return handlePossibleAxiosErrors(async () => {
|
|
26
|
-
const {
|
|
27
|
-
body.print_template =
|
|
28
|
-
const response = await httpZauru.post("/purchases/
|
|
26
|
+
const { discharge_template_id } = await getVariablesByName(headers, session, ["discharge_template_id"]);
|
|
27
|
+
body.print_template = discharge_template_id;
|
|
28
|
+
const response = await httpZauru.post("/purchases/discharges/gen_print_all.json", body, { headers });
|
|
29
29
|
return response.data;
|
|
30
30
|
});
|
|
31
31
|
};
|
|
@@ -37,7 +37,7 @@ export const generateDischargePDF = async (headers, session, body) => {
|
|
|
37
37
|
*/
|
|
38
38
|
export const getDischargePDFResult = async (headers, zid) => {
|
|
39
39
|
return handlePossibleAxiosErrors(async () => {
|
|
40
|
-
const response = await httpZauru.get("purchases/
|
|
40
|
+
const response = await httpZauru.get("purchases/discharges/check_print_all", {
|
|
41
41
|
headers,
|
|
42
42
|
params: { zid },
|
|
43
43
|
});
|
|
@@ -2,6 +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 { getPrintTemplatesStringQuery } from "@zauru-sdk/graphql";
|
|
5
|
+
import { httpZauru } from "./httpZauru.js";
|
|
5
6
|
/**
|
|
6
7
|
* getPayees
|
|
7
8
|
* @param headers
|
|
@@ -18,3 +19,27 @@ export async function getPrintTemplates(session) {
|
|
|
18
19
|
return response.data?.data.print_templates;
|
|
19
20
|
});
|
|
20
21
|
}
|
|
22
|
+
export const getPrintTemplate = async (headers, id) => {
|
|
23
|
+
return handlePossibleAxiosErrors(async () => {
|
|
24
|
+
const response = await httpZauru.get(`/settings/templates/print_templates/${id}.json`, { headers });
|
|
25
|
+
return response.data;
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export const createPrintTemplate = async (headers, body) => {
|
|
29
|
+
return handlePossibleAxiosErrors(async () => {
|
|
30
|
+
const response = await httpZauru.post(`/settings/templates/print_templates.json`, { print_template: body }, { headers });
|
|
31
|
+
return response.data;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export const updatePrintTemplate = async (headers, id, body) => {
|
|
35
|
+
return handlePossibleAxiosErrors(async () => {
|
|
36
|
+
const response = await httpZauru.patch(`/settings/templates/print_templates/${id}.json`, { print_template: body }, { headers });
|
|
37
|
+
return response.data;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export const createDocumentPrint = async (headers, body) => {
|
|
41
|
+
return handlePossibleAxiosErrors(async () => {
|
|
42
|
+
const response = await httpZauru.post(`/settings/templates/document_prints.json`, { document_print: body }, { headers });
|
|
43
|
+
return response.data;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { Session } from "@remix-run/node";
|
|
2
|
-
import { AxiosUtilsResponse, PrintTemplateGraphQL } from "@zauru-sdk/types";
|
|
2
|
+
import { AxiosUtilsResponse, DocumentPrint, NewDocumentPrintBody, NewPrintTemplateBody, PrintTemplate, PrintTemplateGraphQL } from "@zauru-sdk/types";
|
|
3
3
|
/**
|
|
4
4
|
* getPayees
|
|
5
5
|
* @param headers
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
8
|
export declare function getPrintTemplates(session: Session): Promise<AxiosUtilsResponse<PrintTemplateGraphQL[]>>;
|
|
9
|
+
export declare const getPrintTemplate: (headers: any, id: number | string) => Promise<AxiosUtilsResponse<PrintTemplate>>;
|
|
10
|
+
export declare const createPrintTemplate: (headers: any, body: NewPrintTemplateBody) => Promise<AxiosUtilsResponse<PrintTemplate>>;
|
|
11
|
+
export declare const updatePrintTemplate: (headers: any, id: number | string, body: Partial<NewPrintTemplateBody>) => Promise<AxiosUtilsResponse<PrintTemplate>>;
|
|
12
|
+
export declare const createDocumentPrint: (headers: any, body: NewDocumentPrintBody) => Promise<AxiosUtilsResponse<DocumentPrint>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.15.0",
|
|
4
4
|
"description": "Servicios de consulta a Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "npm run build:esm",
|
|
15
15
|
"build:esm": "tsc -p tsconfig.esm.json",
|
|
16
|
-
"test": "tsx --test src/zauru
|
|
16
|
+
"test": "tsx --test src/zauru/*.test.ts"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@remix-run/node": "^2.8.1",
|
|
29
29
|
"@upstash/redis": "^1.34.5",
|
|
30
|
-
"@zauru-sdk/common": "^6.10.
|
|
30
|
+
"@zauru-sdk/common": "^6.10.1",
|
|
31
31
|
"@zauru-sdk/config": "^6.0.0",
|
|
32
32
|
"@zauru-sdk/graphql": "^6.9.0",
|
|
33
|
-
"@zauru-sdk/types": "^6.
|
|
33
|
+
"@zauru-sdk/types": "^6.26.0",
|
|
34
34
|
"axios": "^1.6.7",
|
|
35
35
|
"chalk": "5.3.0",
|
|
36
36
|
"moment": "^2.30.1"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "868c8fc18ec36bd771fbd2b3886d15b6d68fb7bb"
|
|
39
39
|
}
|