@zauru-sdk/utils 1.0.17 → 1.0.18
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/CHANGELOG.md +8 -0
- package/dist/zauru/bitacora-edicion-masiva.utils.d.ts +3 -3
- package/dist/zauru/bitacora-edicion-masiva.utils.js +6 -6
- package/dist/zauru/consolidated-history.utils.d.ts +3 -3
- package/dist/zauru/consolidated-history.utils.js +6 -6
- package/dist/zauru/costos-items.utils.d.ts +9 -9
- package/dist/zauru/costos-items.utils.js +17 -17
- package/dist/zauru/discharges-histsory.utils.d.ts +3 -3
- package/dist/zauru/discharges-histsory.utils.js +6 -6
- package/dist/zauru/items.utils.d.ts +3 -3
- package/dist/zauru/items.utils.js +6 -6
- package/dist/zauru/motivos-rechazo.utils.d.ts +2 -2
- package/dist/zauru/motivos-rechazo.utils.js +4 -4
- package/dist/zauru/payees.utils.d.ts +5 -5
- package/dist/zauru/payees.utils.js +10 -10
- package/dist/zauru/specialItem.utils.d.ts +4 -4
- package/dist/zauru/specialItem.utils.js +9 -9
- package/dist/zauru/templates.utils.d.ts +6 -6
- package/dist/zauru/templates.utils.js +12 -12
- package/dist/zauru/tiposMuestra.utils.d.ts +4 -4
- package/dist/zauru/tiposMuestra.utils.js +8 -8
- package/dist/zauru/webapp-tables.utils.d.ts +1 -1
- package/dist/zauru/webapp-tables.utils.js +2 -2
- package/package.json +3 -3
- package/src/zauru/bitacora-edicion-masiva.utils.ts +9 -9
- package/src/zauru/consolidated-history.utils.ts +9 -9
- package/src/zauru/costos-items.utils.ts +31 -25
- package/src/zauru/discharges-histsory.utils.ts +9 -9
- package/src/zauru/items.utils.ts +9 -9
- package/src/zauru/motivos-rechazo.utils.ts +6 -6
- package/src/zauru/payees.utils.ts +15 -15
- package/src/zauru/specialItem.utils.ts +25 -15
- package/src/zauru/templates.utils.ts +18 -18
- package/src/zauru/tiposMuestra.utils.ts +12 -12
- package/src/zauru/webapp-tables.utils.ts +2 -2
|
@@ -8,7 +8,7 @@ export const TEXT_PAYEE_CATEGORY_NAME_FOR_PRICE = "CAT-LABORATORIO: ";
|
|
|
8
8
|
* @param headers
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export const getClientesLaboratorio = (session) => {
|
|
12
12
|
return handlePossibleAxiosErrors(async () => {
|
|
13
13
|
const clientesResponse = await getPayeeCategoriesByNotesMatch(session, TEXT_PAYEE_CATEGORY_NOTES_FOR_PRICE);
|
|
14
14
|
if (clientesResponse.error || !clientesResponse.data) {
|
|
@@ -18,7 +18,7 @@ export async function getClientesLaboratorio(session) {
|
|
|
18
18
|
clientesResponse.data.forEach((x) => clientes.push(...x.payees));
|
|
19
19
|
return clientes;
|
|
20
20
|
});
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
/**
|
|
23
23
|
* createNewLaboratoryClient
|
|
24
24
|
* @param session
|
|
@@ -26,7 +26,7 @@ export async function getClientesLaboratorio(session) {
|
|
|
26
26
|
* @param body
|
|
27
27
|
* @returns
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export const createNewLaboratoryClient = (headers, body) => {
|
|
30
30
|
return handlePossibleAxiosErrors(async () => {
|
|
31
31
|
const sendBody = {
|
|
32
32
|
...body,
|
|
@@ -41,7 +41,7 @@ export async function createNewLaboratoryClient(headers, body) {
|
|
|
41
41
|
}
|
|
42
42
|
return true;
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
45
|
/**
|
|
46
46
|
* createNewLaboratoryClientCategoryPrice
|
|
47
47
|
* @param session
|
|
@@ -49,7 +49,7 @@ export async function createNewLaboratoryClient(headers, body) {
|
|
|
49
49
|
* @param body
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
|
-
export
|
|
52
|
+
export const updateLaboratoryClientCategoryPrice = (headers, body) => {
|
|
53
53
|
return handlePossibleAxiosErrors(async () => {
|
|
54
54
|
const sendBody = {
|
|
55
55
|
...body,
|
|
@@ -62,7 +62,7 @@ export async function updateLaboratoryClientCategoryPrice(headers, body) {
|
|
|
62
62
|
}
|
|
63
63
|
return true;
|
|
64
64
|
});
|
|
65
|
-
}
|
|
65
|
+
};
|
|
66
66
|
/**
|
|
67
67
|
* createNewLaboratoryClientCategoryPrice
|
|
68
68
|
* @param session
|
|
@@ -70,7 +70,7 @@ export async function updateLaboratoryClientCategoryPrice(headers, body) {
|
|
|
70
70
|
* @param body
|
|
71
71
|
* @returns
|
|
72
72
|
*/
|
|
73
|
-
export
|
|
73
|
+
export const createNewLaboratoryClientCategoryPrice = (headers, session, body) => {
|
|
74
74
|
return handlePossibleAxiosErrors(async () => {
|
|
75
75
|
const sendBody = {
|
|
76
76
|
...body,
|
|
@@ -110,14 +110,14 @@ export async function createNewLaboratoryClientCategoryPrice(headers, session, b
|
|
|
110
110
|
}
|
|
111
111
|
return true;
|
|
112
112
|
});
|
|
113
|
-
}
|
|
113
|
+
};
|
|
114
114
|
/**
|
|
115
115
|
* deleteLaboratoryClientCategoryPrice
|
|
116
116
|
* @param headers
|
|
117
117
|
* @param body
|
|
118
118
|
* @returns
|
|
119
119
|
*/
|
|
120
|
-
export
|
|
120
|
+
export const deleteLaboratoryClientCategoryPrice = (headers, body) => {
|
|
121
121
|
return handlePossibleAxiosErrors(async () => {
|
|
122
122
|
//Elimino la categoría
|
|
123
123
|
await deletePayeeCategory(headers, body.id ?? "");
|
|
@@ -125,4 +125,4 @@ export async function deleteLaboratoryClientCategoryPrice(headers, body) {
|
|
|
125
125
|
await deletePriceList(headers, body.price_list_id ?? "");
|
|
126
126
|
return true;
|
|
127
127
|
});
|
|
128
|
-
}
|
|
128
|
+
};
|
|
@@ -6,7 +6,7 @@ import { AxiosUtilsResponse, SpecialItem, WebAppRowGraphQL, WebAppTableUpdateRes
|
|
|
6
6
|
* @param session Session object.
|
|
7
7
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<SpecialItem>[]>>.
|
|
8
8
|
*/
|
|
9
|
-
export declare
|
|
9
|
+
export declare const getSpecialItems: (headers: any, session: Session) => Promise<AxiosUtilsResponse<WebAppRowGraphQL<SpecialItem>[]>>;
|
|
10
10
|
/**
|
|
11
11
|
* Create a specialItem in the web app table.
|
|
12
12
|
* @param headers Request headers.
|
|
@@ -14,7 +14,7 @@ export declare function getSpecialItems(headers: any, session: Session): Promise
|
|
|
14
14
|
* @param body SpecialItem data to be created.
|
|
15
15
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
16
16
|
*/
|
|
17
|
-
export declare
|
|
17
|
+
export declare const createSpecialItem: (headers: any, session: Session, body: SpecialItem) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
18
18
|
/**
|
|
19
19
|
* Delete a specialItem from the web app table.
|
|
20
20
|
* @param headers Request headers.
|
|
@@ -22,7 +22,7 @@ export declare function createSpecialItem(headers: any, session: Session, body:
|
|
|
22
22
|
* @param id ID of the specialItem to be deleted.
|
|
23
23
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
24
24
|
*/
|
|
25
|
-
export declare
|
|
25
|
+
export declare const deleteSpecialItem: (headers: any, session: Session, id: string) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
26
26
|
/**
|
|
27
27
|
* Update a specialItem in the web app table.
|
|
28
28
|
* @param headers Request headers.
|
|
@@ -31,4 +31,4 @@ export declare function deleteSpecialItem(headers: any, session: Session, id: st
|
|
|
31
31
|
* @param body Updated specialItem data.
|
|
32
32
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare const updateSpecialItem: (headers: any, session: Session, id: string, body: Partial<SpecialItem>) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
-
import { createWebAppTableRegister, deleteWebAppTableRegister, getVariablesByName, getWebAppTableRegisters, updateWebAppTableRegister } from "@zauru-sdk/services";
|
|
2
|
+
import { createWebAppTableRegister, deleteWebAppTableRegister, getVariablesByName, getWebAppTableRegisters, updateWebAppTableRegister, } from "@zauru-sdk/services";
|
|
3
3
|
/**
|
|
4
4
|
* Get specialItems from the web app table.
|
|
5
5
|
* @param headers Request headers.
|
|
6
6
|
* @param session Session object.
|
|
7
7
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<SpecialItem>[]>>.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export const getSpecialItems = (headers, session) => {
|
|
10
10
|
return handlePossibleAxiosErrors(async () => {
|
|
11
11
|
const { special_product_web_app_table_id } = await getVariablesByName(headers, session, ["special_product_web_app_table_id"]);
|
|
12
12
|
const response = await getWebAppTableRegisters(session, special_product_web_app_table_id);
|
|
@@ -16,7 +16,7 @@ export async function getSpecialItems(headers, session) {
|
|
|
16
16
|
const specialItems = response.data ?? [];
|
|
17
17
|
return specialItems;
|
|
18
18
|
});
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
/**
|
|
21
21
|
* Create a specialItem in the web app table.
|
|
22
22
|
* @param headers Request headers.
|
|
@@ -24,13 +24,13 @@ export async function getSpecialItems(headers, session) {
|
|
|
24
24
|
* @param body SpecialItem data to be created.
|
|
25
25
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export const createSpecialItem = (headers, session, body) => {
|
|
28
28
|
return handlePossibleAxiosErrors(async () => {
|
|
29
29
|
const { special_product_web_app_table_id } = await getVariablesByName(headers, session, ["special_product_web_app_table_id"]);
|
|
30
30
|
const response = await createWebAppTableRegister(headers, special_product_web_app_table_id, body);
|
|
31
31
|
return response;
|
|
32
32
|
});
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
/**
|
|
35
35
|
* Delete a specialItem from the web app table.
|
|
36
36
|
* @param headers Request headers.
|
|
@@ -38,13 +38,13 @@ export async function createSpecialItem(headers, session, body) {
|
|
|
38
38
|
* @param id ID of the specialItem to be deleted.
|
|
39
39
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
41
|
+
export const deleteSpecialItem = (headers, session, id) => {
|
|
42
42
|
return handlePossibleAxiosErrors(async () => {
|
|
43
43
|
const { special_product_web_app_table_id } = await getVariablesByName(headers, session, ["special_product_web_app_table_id"]);
|
|
44
44
|
const response = await deleteWebAppTableRegister(headers, special_product_web_app_table_id, Number(id));
|
|
45
45
|
return response;
|
|
46
46
|
});
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
/**
|
|
49
49
|
* Update a specialItem in the web app table.
|
|
50
50
|
* @param headers Request headers.
|
|
@@ -53,10 +53,10 @@ export async function deleteSpecialItem(headers, session, id) {
|
|
|
53
53
|
* @param body Updated specialItem data.
|
|
54
54
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export const updateSpecialItem = (headers, session, id, body) => {
|
|
57
57
|
return handlePossibleAxiosErrors(async () => {
|
|
58
58
|
const { special_product_web_app_table_id } = await getVariablesByName(headers, session, ["special_product_web_app_table_id"]);
|
|
59
59
|
const response = await updateWebAppTableRegister(headers, special_product_web_app_table_id, Number(id), body);
|
|
60
60
|
return response;
|
|
61
61
|
});
|
|
62
|
-
}
|
|
62
|
+
};
|
|
@@ -6,7 +6,7 @@ import { AxiosUtilsResponse, WebAppRowGraphQL, Template, WebAppTableUpdateRespon
|
|
|
6
6
|
* @param session Session object.
|
|
7
7
|
* @returns A Promise of AxiosUtilsResponse<TemplateWebAppTable[]>.
|
|
8
8
|
*/
|
|
9
|
-
export declare
|
|
9
|
+
export declare const getTemplates: (headers: any, session: Session) => Promise<AxiosUtilsResponse<WebAppRowGraphQL<Template>[]>>;
|
|
10
10
|
/**
|
|
11
11
|
* Create a template in the web app table.
|
|
12
12
|
* @param headers Request headers.
|
|
@@ -14,7 +14,7 @@ export declare function getTemplates(headers: any, session: Session): Promise<Ax
|
|
|
14
14
|
* @param body Template data to be created.
|
|
15
15
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
16
16
|
*/
|
|
17
|
-
export declare
|
|
17
|
+
export declare const createTemplate: (headers: any, session: Session, body: Template) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
18
18
|
/**
|
|
19
19
|
* Delete a template from the web app table.
|
|
20
20
|
* @param headers Request headers.
|
|
@@ -22,7 +22,7 @@ export declare function createTemplate(headers: any, session: Session, body: Tem
|
|
|
22
22
|
* @param id ID of the template to be deleted.
|
|
23
23
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
24
24
|
*/
|
|
25
|
-
export declare
|
|
25
|
+
export declare const deleteTemplate: (headers: any, session: Session, id: string) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
26
26
|
/**
|
|
27
27
|
* Update a template in the web app table.
|
|
28
28
|
* @param headers Request headers.
|
|
@@ -31,7 +31,7 @@ export declare function deleteTemplate(headers: any, session: Session, id: strin
|
|
|
31
31
|
* @param body Updated template data.
|
|
32
32
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare const updateTemplate: (headers: any, session: Session, id: string, body: Partial<Template>) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
35
35
|
/**
|
|
36
36
|
* Create a template history entry in the web app table.
|
|
37
37
|
* @param headers Request headers.
|
|
@@ -39,11 +39,11 @@ export declare function updateTemplate(headers: any, session: Session, id: strin
|
|
|
39
39
|
* @param body Template history data to be created.
|
|
40
40
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
41
41
|
*/
|
|
42
|
-
export declare
|
|
42
|
+
export declare const createTemplateHistory: (headers: any, session: Session, body: Partial<HistoryTemplate>) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
43
43
|
/**
|
|
44
44
|
* Get template history entries from the web app table.
|
|
45
45
|
* @param headers Request headers.
|
|
46
46
|
* @param session Session object.
|
|
47
47
|
* @returns A Promise of AxiosUtilsResponse<TemplateHistoryWebAppTable[]>.
|
|
48
48
|
*/
|
|
49
|
-
export declare
|
|
49
|
+
export declare const getTemplatesHistory: (headers: any, session: Session) => Promise<AxiosUtilsResponse<WebAppRowGraphQL<HistoryTemplate>[]>>;
|
|
@@ -6,7 +6,7 @@ import { createWebAppTableRegister, deleteWebAppTableRegister, getVariablesByNam
|
|
|
6
6
|
* @param session Session object.
|
|
7
7
|
* @returns A Promise of AxiosUtilsResponse<TemplateWebAppTable[]>.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export const getTemplates = (headers, session) => {
|
|
10
10
|
return handlePossibleAxiosErrors(async () => {
|
|
11
11
|
const { templates_web_app_table_id } = await getVariablesByName(headers, session, ["templates_web_app_table_id"]);
|
|
12
12
|
const response = await getWebAppTableRegisters(session, templates_web_app_table_id);
|
|
@@ -16,7 +16,7 @@ export async function getTemplates(headers, session) {
|
|
|
16
16
|
const templateRegisters = response.data ?? [];
|
|
17
17
|
return templateRegisters;
|
|
18
18
|
});
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
/**
|
|
21
21
|
* Create a template in the web app table.
|
|
22
22
|
* @param headers Request headers.
|
|
@@ -24,13 +24,13 @@ export async function getTemplates(headers, session) {
|
|
|
24
24
|
* @param body Template data to be created.
|
|
25
25
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export const createTemplate = (headers, session, body) => {
|
|
28
28
|
return handlePossibleAxiosErrors(async () => {
|
|
29
29
|
const { templates_web_app_table_id } = await getVariablesByName(headers, session, ["templates_web_app_table_id"]);
|
|
30
30
|
const response = await createWebAppTableRegister(headers, templates_web_app_table_id, body);
|
|
31
31
|
return response;
|
|
32
32
|
});
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
/**
|
|
35
35
|
* Delete a template from the web app table.
|
|
36
36
|
* @param headers Request headers.
|
|
@@ -38,13 +38,13 @@ export async function createTemplate(headers, session, body) {
|
|
|
38
38
|
* @param id ID of the template to be deleted.
|
|
39
39
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
41
|
+
export const deleteTemplate = (headers, session, id) => {
|
|
42
42
|
return handlePossibleAxiosErrors(async () => {
|
|
43
43
|
const { templates_web_app_table_id } = await getVariablesByName(headers, session, ["templates_web_app_table_id"]);
|
|
44
44
|
const response = await deleteWebAppTableRegister(headers, templates_web_app_table_id, Number(id));
|
|
45
45
|
return response;
|
|
46
46
|
});
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
/**
|
|
49
49
|
* Update a template in the web app table.
|
|
50
50
|
* @param headers Request headers.
|
|
@@ -53,13 +53,13 @@ export async function deleteTemplate(headers, session, id) {
|
|
|
53
53
|
* @param body Updated template data.
|
|
54
54
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export const updateTemplate = (headers, session, id, body) => {
|
|
57
57
|
return handlePossibleAxiosErrors(async () => {
|
|
58
58
|
const { templates_web_app_table_id } = await getVariablesByName(headers, session, ["templates_web_app_table_id"]);
|
|
59
59
|
const response = await updateWebAppTableRegister(headers, templates_web_app_table_id, Number(id), body);
|
|
60
60
|
return response;
|
|
61
61
|
});
|
|
62
|
-
}
|
|
62
|
+
};
|
|
63
63
|
/**
|
|
64
64
|
* Create a template history entry in the web app table.
|
|
65
65
|
* @param headers Request headers.
|
|
@@ -67,20 +67,20 @@ export async function updateTemplate(headers, session, id, body) {
|
|
|
67
67
|
* @param body Template history data to be created.
|
|
68
68
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
69
69
|
*/
|
|
70
|
-
export
|
|
70
|
+
export const createTemplateHistory = (headers, session, body) => {
|
|
71
71
|
return handlePossibleAxiosErrors(async () => {
|
|
72
72
|
const { history_templates_web_app_table_id } = await getVariablesByName(headers, session, ["history_templates_web_app_table_id"]);
|
|
73
73
|
const response = await createWebAppTableRegister(headers, history_templates_web_app_table_id, body);
|
|
74
74
|
return response;
|
|
75
75
|
});
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
/**
|
|
78
78
|
* Get template history entries from the web app table.
|
|
79
79
|
* @param headers Request headers.
|
|
80
80
|
* @param session Session object.
|
|
81
81
|
* @returns A Promise of AxiosUtilsResponse<TemplateHistoryWebAppTable[]>.
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export const getTemplatesHistory = (headers, session) => {
|
|
84
84
|
return handlePossibleAxiosErrors(async () => {
|
|
85
85
|
const { history_templates_web_app_table_id } = await getVariablesByName(headers, session, ["history_templates_web_app_table_id"]);
|
|
86
86
|
const response = await getWebAppTableRegisters(session, history_templates_web_app_table_id);
|
|
@@ -90,4 +90,4 @@ export async function getTemplatesHistory(headers, session) {
|
|
|
90
90
|
const templateRegisters = response.data ?? [];
|
|
91
91
|
return templateRegisters;
|
|
92
92
|
});
|
|
93
|
-
}
|
|
93
|
+
};
|
|
@@ -6,7 +6,7 @@ import { WebAppRowGraphQL, TipoMuestra, AxiosUtilsResponse, WebAppTableUpdateRes
|
|
|
6
6
|
* @param session Session object.
|
|
7
7
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<TipoMuestra>[]>>.
|
|
8
8
|
*/
|
|
9
|
-
export declare
|
|
9
|
+
export declare const getTipoMuestras: (headers: any, session: Session) => Promise<AxiosUtilsResponse<WebAppRowGraphQL<TipoMuestra>[]>>;
|
|
10
10
|
/**
|
|
11
11
|
* Create a tipoMuestra in the web app table.
|
|
12
12
|
* @param headers Request headers.
|
|
@@ -14,7 +14,7 @@ export declare function getTipoMuestras(headers: any, session: Session): Promise
|
|
|
14
14
|
* @param body TipoMuestra data to be created.
|
|
15
15
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
16
16
|
*/
|
|
17
|
-
export declare
|
|
17
|
+
export declare const createTipoMuestra: (headers: any, session: Session, body: TipoMuestra) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
18
18
|
/**
|
|
19
19
|
* Delete a tipoMuestra from the web app table.
|
|
20
20
|
* @param headers Request headers.
|
|
@@ -22,7 +22,7 @@ export declare function createTipoMuestra(headers: any, session: Session, body:
|
|
|
22
22
|
* @param id ID of the tipoMuestra to be deleted.
|
|
23
23
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
24
24
|
*/
|
|
25
|
-
export declare
|
|
25
|
+
export declare const deleteTipoMuestra: (headers: any, session: Session, id: string) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
26
26
|
/**
|
|
27
27
|
* Update a tipoMuestra in the web app table.
|
|
28
28
|
* @param headers Request headers.
|
|
@@ -31,4 +31,4 @@ export declare function deleteTipoMuestra(headers: any, session: Session, id: st
|
|
|
31
31
|
* @param body Updated tipoMuestra data.
|
|
32
32
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare const updateTipoMuestra: (headers: any, session: Session, id: string, body: Partial<TipoMuestra>) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
|
|
@@ -6,7 +6,7 @@ import { createWebAppTableRegister, deleteWebAppTableRegister, getVariablesByNam
|
|
|
6
6
|
* @param session Session object.
|
|
7
7
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<TipoMuestra>[]>>.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export const getTipoMuestras = (headers, session) => {
|
|
10
10
|
return handlePossibleAxiosErrors(async () => {
|
|
11
11
|
const { tipo_muestra_web_app_table_id } = await getVariablesByName(headers, session, ["tipo_muestra_web_app_table_id"]);
|
|
12
12
|
const response = await getWebAppTableRegisters(session, tipo_muestra_web_app_table_id);
|
|
@@ -16,7 +16,7 @@ export async function getTipoMuestras(headers, session) {
|
|
|
16
16
|
const tipoMuestras = response.data ?? [];
|
|
17
17
|
return tipoMuestras;
|
|
18
18
|
});
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
/**
|
|
21
21
|
* Create a tipoMuestra in the web app table.
|
|
22
22
|
* @param headers Request headers.
|
|
@@ -24,13 +24,13 @@ export async function getTipoMuestras(headers, session) {
|
|
|
24
24
|
* @param body TipoMuestra data to be created.
|
|
25
25
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export const createTipoMuestra = (headers, session, body) => {
|
|
28
28
|
return handlePossibleAxiosErrors(async () => {
|
|
29
29
|
const { tipo_muestra_web_app_table_id } = await getVariablesByName(headers, session, ["tipo_muestra_web_app_table_id"]);
|
|
30
30
|
const response = await createWebAppTableRegister(headers, tipo_muestra_web_app_table_id, body);
|
|
31
31
|
return response;
|
|
32
32
|
});
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
/**
|
|
35
35
|
* Delete a tipoMuestra from the web app table.
|
|
36
36
|
* @param headers Request headers.
|
|
@@ -38,13 +38,13 @@ export async function createTipoMuestra(headers, session, body) {
|
|
|
38
38
|
* @param id ID of the tipoMuestra to be deleted.
|
|
39
39
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
41
|
+
export const deleteTipoMuestra = (headers, session, id) => {
|
|
42
42
|
return handlePossibleAxiosErrors(async () => {
|
|
43
43
|
const { tipo_muestra_web_app_table_id } = await getVariablesByName(headers, session, ["tipo_muestra_web_app_table_id"]);
|
|
44
44
|
const response = await deleteWebAppTableRegister(headers, tipo_muestra_web_app_table_id, Number(id));
|
|
45
45
|
return response;
|
|
46
46
|
});
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
/**
|
|
49
49
|
* Update a tipoMuestra in the web app table.
|
|
50
50
|
* @param headers Request headers.
|
|
@@ -53,10 +53,10 @@ export async function deleteTipoMuestra(headers, session, id) {
|
|
|
53
53
|
* @param body Updated tipoMuestra data.
|
|
54
54
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export const updateTipoMuestra = (headers, session, id, body) => {
|
|
57
57
|
return handlePossibleAxiosErrors(async () => {
|
|
58
58
|
const { tipo_muestra_web_app_table_id } = await getVariablesByName(headers, session, ["tipo_muestra_web_app_table_id"]);
|
|
59
59
|
const response = await updateWebAppTableRegister(headers, tipo_muestra_web_app_table_id, Number(id), body);
|
|
60
60
|
return response;
|
|
61
61
|
});
|
|
62
|
-
}
|
|
62
|
+
};
|
|
@@ -13,4 +13,4 @@ export declare const getRejectionWebAppTable: (headers: any, session: Session) =
|
|
|
13
13
|
* @param session Session object.
|
|
14
14
|
* @returns A Promise of AxiosUtilsResponse<ReceptionType[]>.
|
|
15
15
|
*/
|
|
16
|
-
export declare
|
|
16
|
+
export declare const getReceptionTypes: (headers: any, session: Session) => Promise<AxiosUtilsResponse<WebAppRowGraphQL<ReceptionType>[]>>;
|
|
@@ -41,11 +41,11 @@ export const getRejectionWebAppTable = async (headers, session) => {
|
|
|
41
41
|
* @param session Session object.
|
|
42
42
|
* @returns A Promise of AxiosUtilsResponse<ReceptionType[]>.
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export const getReceptionTypes = (headers, session) => {
|
|
45
45
|
return handlePossibleAxiosErrors(async () => {
|
|
46
46
|
const { recepciones_receptions_type_table_id } = await getVariablesByName(headers, session, ["recepciones_receptions_type_table_id"]);
|
|
47
47
|
const response = await getWebAppTableRegisters(session, recepciones_receptions_type_table_id);
|
|
48
48
|
const receptionTypes = response?.data ?? [];
|
|
49
49
|
return receptionTypes;
|
|
50
50
|
});
|
|
51
|
-
}
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Utilidades, parseo de request y demás para desarrollo de webapps de Zauru",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"@zauru-sdk/common": "^1.0.13",
|
|
23
23
|
"@zauru-sdk/config": "^1.0.4",
|
|
24
24
|
"@zauru-sdk/graphql": "^1.0.9",
|
|
25
|
-
"@zauru-sdk/services": "^1.0.
|
|
25
|
+
"@zauru-sdk/services": "^1.0.18",
|
|
26
26
|
"@zauru-sdk/types": "^1.0.13"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=18.0.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "bcd403ed2996283a6eed13ce56cc24b2ee824369"
|
|
32
32
|
}
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
* @param session Session object.
|
|
20
20
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraPOMassive>[]>.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export const saveBitacoraPOMassive = (
|
|
23
23
|
headers: any,
|
|
24
24
|
session: Session,
|
|
25
25
|
body: BitacoraPOMassive
|
|
26
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
26
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
27
27
|
return handlePossibleAxiosErrors(async () => {
|
|
28
28
|
const { bitacora_ediciones_masivas_web_app_table_id } =
|
|
29
29
|
await getVariablesByName(headers, session, [
|
|
@@ -38,7 +38,7 @@ export async function saveBitacoraPOMassive(
|
|
|
38
38
|
|
|
39
39
|
return response;
|
|
40
40
|
});
|
|
41
|
-
}
|
|
41
|
+
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Get getBitacorasPOMassive from the web app table.
|
|
@@ -46,10 +46,10 @@ export async function saveBitacoraPOMassive(
|
|
|
46
46
|
* @param session Session object.
|
|
47
47
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraPOMassive>[]>.
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
49
|
+
export const getBitacorasPOMassive = (
|
|
50
50
|
headers: any,
|
|
51
51
|
session: Session
|
|
52
|
-
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<BitacoraPOMassive>[]>> {
|
|
52
|
+
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<BitacoraPOMassive>[]>> => {
|
|
53
53
|
return handlePossibleAxiosErrors(async () => {
|
|
54
54
|
const { bitacora_ediciones_masivas_web_app_table_id } =
|
|
55
55
|
await getVariablesByName(headers, session, [
|
|
@@ -67,7 +67,7 @@ export async function getBitacorasPOMassive(
|
|
|
67
67
|
|
|
68
68
|
return response.data;
|
|
69
69
|
});
|
|
70
|
-
}
|
|
70
|
+
};
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Put updateBitacorasPOMassive from the web app table.
|
|
@@ -75,12 +75,12 @@ export async function getBitacorasPOMassive(
|
|
|
75
75
|
* @param session Session object.
|
|
76
76
|
* @returns A Promise of AxiosUtilsResponse<BitacorasPOMassiveWebAppTable[]>.
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export const updateBitacorasPOMassive = (
|
|
79
79
|
headers: any,
|
|
80
80
|
session: Session,
|
|
81
81
|
body: BitacoraPOMassive,
|
|
82
82
|
id_registro: string | number
|
|
83
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
83
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
84
84
|
return handlePossibleAxiosErrors(async () => {
|
|
85
85
|
const { bitacora_ediciones_masivas_web_app_table_id } =
|
|
86
86
|
await getVariablesByName(headers, session, [
|
|
@@ -96,4 +96,4 @@ export async function updateBitacorasPOMassive(
|
|
|
96
96
|
|
|
97
97
|
return response;
|
|
98
98
|
});
|
|
99
|
-
}
|
|
99
|
+
};
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
* @param session Session object.
|
|
20
20
|
* @returns A Promise of AxiosUtilsResponse<ConsolidatedHistory[]>.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export const getConsolidatedHistories = (
|
|
23
23
|
headers: any,
|
|
24
24
|
session: Session
|
|
25
|
-
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<ConsolidatedHistory>[]>> {
|
|
25
|
+
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<ConsolidatedHistory>[]>> => {
|
|
26
26
|
return handlePossibleAxiosErrors(async () => {
|
|
27
27
|
const { purchase_order_consolidates_web_app_table_id } =
|
|
28
28
|
await getVariablesByName(headers, session, [
|
|
@@ -44,7 +44,7 @@ export async function getConsolidatedHistories(
|
|
|
44
44
|
|
|
45
45
|
return history;
|
|
46
46
|
});
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Create a template in the web app table.
|
|
@@ -53,11 +53,11 @@ export async function getConsolidatedHistories(
|
|
|
53
53
|
* @param body ConsolidatedHistory data to be created.
|
|
54
54
|
* @returns A Promise of AxiosUtilsResponse<ConsolidatedHistory>.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export const createConsolidatedHistory = (
|
|
57
57
|
headers: any,
|
|
58
58
|
session: Session,
|
|
59
59
|
body: ConsolidatedHistory
|
|
60
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
60
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
61
61
|
return handlePossibleAxiosErrors(async () => {
|
|
62
62
|
const { purchase_order_consolidates_web_app_table_id } =
|
|
63
63
|
await getVariablesByName(headers, session, [
|
|
@@ -70,7 +70,7 @@ export async function createConsolidatedHistory(
|
|
|
70
70
|
);
|
|
71
71
|
return response;
|
|
72
72
|
});
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Put updateConsolidatedHistory from the web app table.
|
|
@@ -78,12 +78,12 @@ export async function createConsolidatedHistory(
|
|
|
78
78
|
* @param session Session object.
|
|
79
79
|
* @returns A Promise of AxiosUtilsResponse<ConsolidatedHistory[]>.
|
|
80
80
|
*/
|
|
81
|
-
export
|
|
81
|
+
export const updateConsolidatedHistory = (
|
|
82
82
|
headers: any,
|
|
83
83
|
session: Session,
|
|
84
84
|
body: ConsolidatedHistory,
|
|
85
85
|
id_registro: string | number
|
|
86
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
86
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
87
87
|
return handlePossibleAxiosErrors(async () => {
|
|
88
88
|
const { purchase_order_consolidates_web_app_table_id } =
|
|
89
89
|
await getVariablesByName(headers, session, [
|
|
@@ -99,4 +99,4 @@ export async function updateConsolidatedHistory(
|
|
|
99
99
|
|
|
100
100
|
return response;
|
|
101
101
|
});
|
|
102
|
-
}
|
|
102
|
+
};
|