@zauru-sdk/utils 1.0.117 → 1.0.120

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,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateTipoMuestra = exports.deleteTipoMuestra = exports.createTipoMuestra = exports.getTipoMuestras = void 0;
4
- const common_1 = require("@zauru-sdk/common");
5
- const services_1 = require("@zauru-sdk/services");
6
- /**
7
- * Get tipoMuestras from the web app table.
8
- * @param headers Request headers.
9
- * @param session Session object.
10
- * @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<TipoMuestra>[]>>.
11
- */
12
- const getTipoMuestras = (headers, session) => {
13
- return (0, common_1.handlePossibleAxiosErrors)(async () => {
14
- const { tipo_muestra_web_app_table_id } = await (0, services_1.getVariablesByName)(headers, session, ["tipo_muestra_web_app_table_id"]);
15
- const response = await (0, services_1.getWebAppTableRegisters)(session, tipo_muestra_web_app_table_id);
16
- if (response.error) {
17
- throw new Error(`Ocurrió un error al consultar los tipos de muestra: ${response.userMsg}`);
18
- }
19
- const tipoMuestras = response.data ?? [];
20
- return tipoMuestras;
21
- });
22
- };
23
- exports.getTipoMuestras = getTipoMuestras;
24
- /**
25
- * Create a tipoMuestra in the web app table.
26
- * @param headers Request headers.
27
- * @param session Session object.
28
- * @param body TipoMuestra data to be created.
29
- * @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
30
- */
31
- const createTipoMuestra = (headers, session, body) => {
32
- return (0, common_1.handlePossibleAxiosErrors)(async () => {
33
- const { tipo_muestra_web_app_table_id } = await (0, services_1.getVariablesByName)(headers, session, ["tipo_muestra_web_app_table_id"]);
34
- const response = await (0, services_1.createWebAppTableRegister)(headers, tipo_muestra_web_app_table_id, body);
35
- return response;
36
- });
37
- };
38
- exports.createTipoMuestra = createTipoMuestra;
39
- /**
40
- * Delete a tipoMuestra from the web app table.
41
- * @param headers Request headers.
42
- * @param session Session object.
43
- * @param id ID of the tipoMuestra to be deleted.
44
- * @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
45
- */
46
- const deleteTipoMuestra = (headers, session, id) => {
47
- return (0, common_1.handlePossibleAxiosErrors)(async () => {
48
- const { tipo_muestra_web_app_table_id } = await (0, services_1.getVariablesByName)(headers, session, ["tipo_muestra_web_app_table_id"]);
49
- const response = await (0, services_1.deleteWebAppTableRegister)(headers, tipo_muestra_web_app_table_id, Number(id));
50
- return response;
51
- });
52
- };
53
- exports.deleteTipoMuestra = deleteTipoMuestra;
54
- /**
55
- * Update a tipoMuestra in the web app table.
56
- * @param headers Request headers.
57
- * @param session Session object.
58
- * @param id ID of the tipoMuestra to be updated.
59
- * @param body Updated tipoMuestra data.
60
- * @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
61
- */
62
- const updateTipoMuestra = (headers, session, id, body) => {
63
- return (0, common_1.handlePossibleAxiosErrors)(async () => {
64
- const { tipo_muestra_web_app_table_id } = await (0, services_1.getVariablesByName)(headers, session, ["tipo_muestra_web_app_table_id"]);
65
- const response = await (0, services_1.updateWebAppTableRegister)(headers, tipo_muestra_web_app_table_id, Number(id), body);
66
- return response;
67
- });
68
- };
69
- exports.updateTipoMuestra = updateTipoMuestra;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getReceptionTypes = void 0;
4
- const common_1 = require("@zauru-sdk/common");
5
- const services_1 = require("@zauru-sdk/services");
6
- /**
7
- * Get template history entries from the web app table.
8
- * @param headers Request headers.
9
- * @param session Session object.
10
- * @returns A Promise of AxiosUtilsResponse<ReceptionType[]>.
11
- */
12
- const getReceptionTypes = (headers, session) => {
13
- return (0, common_1.handlePossibleAxiosErrors)(async () => {
14
- const { recepciones_receptions_type_table_id } = await (0, services_1.getVariablesByName)(headers, session, ["recepciones_receptions_type_table_id"]);
15
- const response = await (0, services_1.getWebAppTableRegisters)(session, recepciones_receptions_type_table_id);
16
- const receptionTypes = response?.data ?? [];
17
- return receptionTypes;
18
- });
19
- };
20
- exports.getReceptionTypes = getReceptionTypes;