@zauru-sdk/utils 1.0.9 → 1.0.13

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 CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.13](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.12...v1.0.13) (2024-03-21)
7
+
8
+ **Note:** Version bump only for package @zauru-sdk/utils
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.10](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.9...v1.0.10) (2024-03-17)
15
+
16
+ **Note:** Version bump only for package @zauru-sdk/utils
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.0.9](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.8...v1.0.9) (2024-03-16)
7
23
 
8
24
  **Note:** Version bump only for package @zauru-sdk/utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/utils",
3
- "version": "1.0.9",
3
+ "version": "1.0.13",
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",
@@ -19,14 +19,14 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@remix-run/node": "^2.8.1",
22
- "@zauru-sdk/common": "^1.0.8",
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.9",
26
- "@zauru-sdk/types": "^1.0.8"
25
+ "@zauru-sdk/services": "^1.0.13",
26
+ "@zauru-sdk/types": "^1.0.13"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=18.0.0"
30
30
  },
31
- "gitHead": "d5b8e3d9b606d6e275135e4624a27f44d9da7caf"
31
+ "gitHead": "9bca61fddd7c538e7f95a489d59436b5557c61cc"
32
32
  }
@@ -1,9 +0,0 @@
1
- import type { Session } from "@remix-run/node";
2
- import { AxiosUtilsResponse } from "@zauru-sdk/types";
3
- /**
4
- * updateMuestraAutomaticNumber
5
- * @param headers
6
- * @param session
7
- * @returns
8
- */
9
- export declare const updateMuestraAutomaticNumber: (headers: any, session: Session, current_number: number) => Promise<AxiosUtilsResponse<boolean>>;
@@ -1,24 +0,0 @@
1
- import { updateAutomaticNumber, getVariablesByName } from "@zauru-sdk/services";
2
- import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
3
- /**
4
- * updateMuestraAutomaticNumber
5
- * @param headers
6
- * @param session
7
- * @returns
8
- */
9
- export const updateMuestraAutomaticNumber = async (headers, session, current_number) => {
10
- return handlePossibleAxiosErrors(async () => {
11
- let msg = "";
12
- const { lab_muestra_automatic_number_id } = await getVariablesByName(headers, session, ["lab_muestra_automatic_number_id"]);
13
- const response = await updateAutomaticNumber(headers, {
14
- id: Number(lab_muestra_automatic_number_id),
15
- variable_doc_number: current_number,
16
- });
17
- if (response.error) {
18
- msg = `Ocurrió un error al intentar actualizar el número automático de muestras: ${response.userMsg}`;
19
- console.error(msg);
20
- throw new Error(msg);
21
- }
22
- return true;
23
- });
24
- };
package/dist/common.d.ts DELETED
@@ -1,189 +0,0 @@
1
- import "moment-timezone";
2
- import "moment/locale/es";
3
- import type { PayeeGraphQL } from "@zauru-sdk/types";
4
- export type SelectFieldOption = {
5
- label: any;
6
- value: any;
7
- };
8
- export declare const DESTINOS_MUESTRA_OPTIONS: SelectFieldOption[];
9
- export type GenericStepResponse = {
10
- msg: string;
11
- step: string;
12
- };
13
- export type BasketSchema = {
14
- total: number;
15
- id: number;
16
- color: string;
17
- };
18
- /**
19
- * Obtener el objeto de canastas en base al string de canastas
20
- * @param basketsString
21
- * @returns
22
- */
23
- export declare const getBasketsSchema: (basketsString: string) => BasketSchema[];
24
- export type DataTablesFilterBody = {
25
- start: number;
26
- length: number;
27
- tag?: string;
28
- agency?: string;
29
- agency_from?: string;
30
- search?: {
31
- value: string;
32
- regex: boolean;
33
- };
34
- order: {
35
- [key: string]: {
36
- column: string;
37
- dir: string;
38
- };
39
- };
40
- Desde?: string;
41
- Hasta?: string;
42
- vendor?: string;
43
- vendor_category?: string;
44
- item?: string;
45
- };
46
- export type BasicIdNameSchema = {
47
- id: number;
48
- name: string;
49
- };
50
- export type ObjectKeyString<T> = {
51
- [key: string]: T;
52
- };
53
- export type GeneratePDFBody = {
54
- s_date: string;
55
- e_date: string;
56
- print_template: number | string;
57
- };
58
- export type GeneratedPDFResult = {
59
- status: number;
60
- zid: number;
61
- };
62
- export type PDFResult = {
63
- status: number;
64
- percentage: number;
65
- message: string;
66
- };
67
- export declare function generateClientUUID(): string;
68
- /**
69
- * extractValueBetweenTags
70
- * @param input
71
- * @param tagName
72
- * @returns
73
- */
74
- export declare function extractValueBetweenTags(input: string, tagName: string): string;
75
- /**
76
- * isJsonArray
77
- * @param value
78
- * @returns
79
- */
80
- export declare function isJsonArray(value: string): boolean;
81
- /**
82
- *
83
- * @param date Recibe el date en formato UTC
84
- */
85
- export declare const getFechaJuliana: (date: string) => string;
86
- /**
87
- * Convierte una fecha de tipo 25 de jul de 2022 a Date
88
- * @param date
89
- * @returns
90
- */
91
- export declare const getNewDateByFormat: (date: string) => Date;
92
- /**
93
- * Convierte una fecha de tipo 25 de jul de 2022 a YYYY-MM-DD
94
- * @param date
95
- * @returns
96
- */
97
- export declare const getZauruDateByText: (date: string) => string;
98
- /**
99
- * Convierte una fecha de tipo Date a YYYY-MM-DD
100
- * @param date
101
- * @returns
102
- */
103
- export declare const getStringDate: (date: Date) => string;
104
- export declare function truncateText(text?: string, maxLength?: number): string;
105
- export declare const getTodayDaysDifference: (date: string) => number;
106
- export declare const getTodayMinutesDifference: (date: string) => number;
107
- /**
108
- * Convierte una fecha de tipo Date a DD-MM-YYY HH:mm:ss
109
- * @param date
110
- * @returns
111
- */
112
- export declare const getStringFullDate: (date: Date) => string;
113
- /**
114
- * Convierte una fecha de tipo DD/MM/YYYY a YYYY/MM/DD
115
- * @param dateStr
116
- * @returns
117
- */
118
- export declare const localDateToUSDate: (dateStr: string) => string;
119
- export declare const stringDateToParsedUTCDate: (date: string) => Date;
120
- /**
121
- * zauruDateToLongString
122
- * @param date
123
- * @returns
124
- */
125
- export declare function zauruDateToLongString(date: string, hours?: boolean): string;
126
- /**
127
- * todayLongString
128
- * @param date
129
- * @returns
130
- */
131
- export declare function todayLongString(hours?: boolean): string;
132
- export declare function isToday(dateStr: string): boolean;
133
- export declare const getDatePickerCurrentDate: () => string;
134
- export declare const getTimePickerCurrentTime: () => string;
135
- export declare const getDateAfterDays: (daysAfterToday: number) => string;
136
- export declare const getPayeeFormated: (payee: PayeeGraphQL) => string;
137
- export declare const getPayeeInfoOptions: (payees: PayeeGraphQL[]) => (SelectFieldOption & {
138
- id: number;
139
- })[];
140
- export declare const parsedBaculoFormValue: (value: any) => any;
141
- export declare function extractIdFromForm(s: string): number | null;
142
- /**
143
- * Formatea una fecha de tipo YYYY-MM-DD a 2023-08-07T20:56:00.540245
144
- * @param dateString
145
- * @returns
146
- */
147
- export declare function formatDateToUTC(dateString: string): string;
148
- export declare const formatDateToDatePicker: (date: Date) => string;
149
- export declare const formatTimeToTimePicker: (timeString: string) => Date;
150
- export declare const toFixedIfNeeded: (value: number) => string;
151
- export declare const isNumeric: (value: any) => boolean;
152
- export declare function incrementString(str: string): string;
153
- export declare function getParsedIdFromString(inputString: string): number;
154
- export declare const arrayToObject: (arr?: Array<any>, options?: {
155
- withOutId?: boolean;
156
- }) => {
157
- [key: string]: any;
158
- };
159
- export declare function convertToFormData(obj: any): import("undici-types").FormData;
160
- export declare const ZAURU_REGEX: {
161
- porcentaje: RegExp;
162
- };
163
- /**
164
- * Para hacer sumas en los reduce de arreglos enteros
165
- * @param accumulator
166
- * @param a
167
- * @returns
168
- */
169
- export declare function reduceAdd(accumulator: number, a: number): number;
170
- /**
171
- * Truncar decimales, ejemplo: truncateDecimals(43.434340934, 2) => 43.43
172
- * @param number
173
- * @param digits
174
- * @returns
175
- */
176
- export declare const truncateDecimals: (number: number, digits: number) => number;
177
- /**
178
- * PREFIX - QUEMADOS POR INDICACIONES DE SARTIP
179
- */
180
- export declare const CURRENCY_PREFIX: {
181
- id: number;
182
- code: string;
183
- prefix: string;
184
- }[];
185
- export declare const getRandomNum: () => number;
186
- export declare const labServicePattern: RegExp;
187
- export declare const labFormPatter: RegExp;
188
- export declare function capitalLetter(str?: string): string;
189
- export declare const sortByProperty: (array: any[], property: string) => any[];