@zauru-sdk/utils 1.0.16 → 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 +16 -0
- package/dist/zauru/4pinos-receptions-form-history.utils.d.ts +4 -4
- package/dist/zauru/4pinos-receptions-form-history.utils.js +8 -8
- 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/4pinos-receptions-form-history.utils.ts +12 -12
- 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
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
2
|
import { createWebAppTableRegister, getVariablesByName, } from "@zauru-sdk/services";
|
|
3
|
-
export
|
|
3
|
+
export const formatearMotivoDeRechazo = (entity) => {
|
|
4
4
|
return { id: entity.id, name: entity.data.Nombre };
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
/**
|
|
7
7
|
* Post saveBitacoraPOMassive from the web app table.
|
|
8
8
|
* @param headers Request headers.
|
|
9
9
|
* @param session Session object.
|
|
10
10
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraPOMassive>[]>.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export const saveRechazoCanastas = (headers, session, body) => {
|
|
13
13
|
return handlePossibleAxiosErrors(async () => {
|
|
14
14
|
const { recepciones_rejections_webapp_table_id } = await getVariablesByName(headers, session, ["recepciones_rejections_webapp_table_id"]);
|
|
15
15
|
const response = await createWebAppTableRegister(headers, recepciones_rejections_webapp_table_id, { ...body });
|
|
16
16
|
return response;
|
|
17
17
|
});
|
|
18
|
-
}
|
|
18
|
+
};
|
|
@@ -8,7 +8,7 @@ export declare const TEXT_PAYEE_CATEGORY_NAME_FOR_PRICE = "CAT-LABORATORIO: ";
|
|
|
8
8
|
* @param headers
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare const getClientesLaboratorio: (session: Session) => Promise<AxiosUtilsResponse<PayeeGraphQL[]>>;
|
|
12
12
|
/**
|
|
13
13
|
* createNewLaboratoryClient
|
|
14
14
|
* @param session
|
|
@@ -16,7 +16,7 @@ export declare function getClientesLaboratorio(session: Session): Promise<AxiosU
|
|
|
16
16
|
* @param body
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
19
|
+
export declare const createNewLaboratoryClient: (headers: any, body: Partial<PayeeGraphQL>) => Promise<AxiosUtilsResponse<boolean>>;
|
|
20
20
|
/**
|
|
21
21
|
* createNewLaboratoryClientCategoryPrice
|
|
22
22
|
* @param session
|
|
@@ -24,7 +24,7 @@ export declare function createNewLaboratoryClient(headers: any, body: Partial<Pa
|
|
|
24
24
|
* @param body
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
export declare
|
|
27
|
+
export declare const updateLaboratoryClientCategoryPrice: (headers: any, body: Partial<PayeeCategoryGraphQL>) => Promise<AxiosUtilsResponse<boolean>>;
|
|
28
28
|
/**
|
|
29
29
|
* createNewLaboratoryClientCategoryPrice
|
|
30
30
|
* @param session
|
|
@@ -32,11 +32,11 @@ export declare function updateLaboratoryClientCategoryPrice(headers: any, body:
|
|
|
32
32
|
* @param body
|
|
33
33
|
* @returns
|
|
34
34
|
*/
|
|
35
|
-
export declare
|
|
35
|
+
export declare const createNewLaboratoryClientCategoryPrice: (headers: any, session: Session, body: Partial<PayeeCategoryGraphQL>) => Promise<AxiosUtilsResponse<boolean>>;
|
|
36
36
|
/**
|
|
37
37
|
* deleteLaboratoryClientCategoryPrice
|
|
38
38
|
* @param headers
|
|
39
39
|
* @param body
|
|
40
40
|
* @returns
|
|
41
41
|
*/
|
|
42
|
-
export declare
|
|
42
|
+
export declare const deleteLaboratoryClientCategoryPrice: (headers: any, body: Partial<PayeeCategoryGraphQL>) => Promise<AxiosUtilsResponse<boolean>>;
|
|
@@ -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
|
}
|
|
@@ -27,12 +27,12 @@ export const ESTADOS_COLA_RECEPCIONES = {
|
|
|
27
27
|
* @param session Session object.
|
|
28
28
|
* @returns A Promise of AxiosUtilsResponse<QueueFormReceptionWebAppTable[]>.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export const getQueueFormReceptionHistories = (
|
|
31
31
|
headers: any,
|
|
32
32
|
session: Session
|
|
33
33
|
): Promise<
|
|
34
34
|
AxiosUtilsResponse<WebAppRowGraphQL<QueueFormReceptionWebAppTable>[]>
|
|
35
|
-
> {
|
|
35
|
+
> => {
|
|
36
36
|
return handlePossibleAxiosErrors(async () => {
|
|
37
37
|
const { queue_form_recepcion_submited_web_app_table_id } =
|
|
38
38
|
await getVariablesByName(headers, session, [
|
|
@@ -55,7 +55,7 @@ export async function getQueueFormReceptionHistories(
|
|
|
55
55
|
|
|
56
56
|
return history;
|
|
57
57
|
});
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Create a template in the web app table.
|
|
@@ -64,11 +64,11 @@ export async function getQueueFormReceptionHistories(
|
|
|
64
64
|
* @param body QueueFormReceptionWebAppTable data to be created.
|
|
65
65
|
* @returns A Promise of AxiosUtilsResponse<QueueFormReceptionWebAppTable>.
|
|
66
66
|
*/
|
|
67
|
-
export
|
|
67
|
+
export const createQueueFormReceptionHistory = (
|
|
68
68
|
headers: any,
|
|
69
69
|
session: Session,
|
|
70
70
|
body: QueueFormReceptionWebAppTable
|
|
71
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
71
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
72
72
|
return handlePossibleAxiosErrors(async () => {
|
|
73
73
|
const { queue_form_recepcion_submited_web_app_table_id } =
|
|
74
74
|
await getVariablesByName(headers, session, [
|
|
@@ -82,7 +82,7 @@ export async function createQueueFormReceptionHistory(
|
|
|
82
82
|
);
|
|
83
83
|
return response;
|
|
84
84
|
});
|
|
85
|
-
}
|
|
85
|
+
};
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Put updateQueueFormReception from the web app table.
|
|
@@ -90,12 +90,12 @@ export async function createQueueFormReceptionHistory(
|
|
|
90
90
|
* @param session Session object.
|
|
91
91
|
* @returns A Promise of AxiosUtilsResponse<QueueFormReceptionWebAppTable[]>.
|
|
92
92
|
*/
|
|
93
|
-
export
|
|
93
|
+
export const updateQueueFormReceptionHistory = (
|
|
94
94
|
headers: any,
|
|
95
95
|
session: Session,
|
|
96
96
|
body: Partial<QueueFormReceptionWebAppTable>,
|
|
97
97
|
id_registro: string | number
|
|
98
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
98
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
99
99
|
return handlePossibleAxiosErrors(async () => {
|
|
100
100
|
const { queue_form_recepcion_submited_web_app_table_id } =
|
|
101
101
|
await getVariablesByName(headers, session, [
|
|
@@ -112,7 +112,7 @@ export async function updateQueueFormReceptionHistory(
|
|
|
112
112
|
|
|
113
113
|
return response;
|
|
114
114
|
});
|
|
115
|
-
}
|
|
115
|
+
};
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* Delete QueueFormReceptionHistory from the web app table.
|
|
@@ -120,11 +120,11 @@ export async function updateQueueFormReceptionHistory(
|
|
|
120
120
|
* @param session Session object.
|
|
121
121
|
* @returns A Promise of AxiosUtilsResponse<QueueFormReceptionWebAppTable[]>.
|
|
122
122
|
*/
|
|
123
|
-
export
|
|
123
|
+
export const deleteQueueFormReceptionHistory = (
|
|
124
124
|
headers: any,
|
|
125
125
|
session: Session,
|
|
126
126
|
id: string
|
|
127
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
127
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
128
128
|
return handlePossibleAxiosErrors(async () => {
|
|
129
129
|
const { queue_form_recepcion_submited_web_app_table_id } =
|
|
130
130
|
await getVariablesByName(headers, session, [
|
|
@@ -139,4 +139,4 @@ export async function deleteQueueFormReceptionHistory(
|
|
|
139
139
|
|
|
140
140
|
return response;
|
|
141
141
|
});
|
|
142
|
-
}
|
|
142
|
+
};
|