@zauru-sdk/common 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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.120](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.119...v1.0.120) (2024-09-26)
7
+
8
+ **Note:** Version bump only for package @zauru-sdk/common
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.119](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.117...v1.0.119) (2024-09-26)
15
+
16
+ **Note:** Version bump only for package @zauru-sdk/common
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.0.118](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.117...v1.0.118) (2024-09-26)
23
+
24
+ **Note:** Version bump only for package @zauru-sdk/common
25
+
26
+
27
+
28
+
29
+
6
30
  ## [1.0.117](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.116...v1.0.117) (2024-09-26)
7
31
 
8
32
  **Note:** Version bump only for package @zauru-sdk/common
@@ -3,7 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.calculateTimeDifference = exports.parsedObject = exports.createPostgresUrl = exports.handlePossibleAxiosErrors = exports.sortByProperty = exports.capitalLetter = exports.labFormPatter = exports.labServicePattern = exports.getRandomNum = exports.CURRENCY_PREFIX = exports.truncateDecimals = exports.reduceAdd = exports.ZAURU_REGEX = exports.convertToFormData = exports.arrayToObject = exports.getParsedIdFromString = exports.incrementString = exports.isNumeric = exports.toFixedIfNeeded = exports.formatTimeToTimePicker = exports.formatDateToDatePicker = exports.getFormattedDate = exports.formatDateToUTC = exports.extractIdFromForm = exports.parsedBaculoFormValue = exports.getPayeeInfoOptions = exports.getPayeeInfoIdOptions = exports.getPayeeFormated = exports.getDateAfterDays = exports.getTimePickerCurrentTime = exports.getDatePickerCurrentDate = exports.isToday = exports.todayLongString = exports.stringDateToParsedUTCDate = exports.localDateToUSDate = exports.getStringFullDate = exports.getTodayMinutesDifference = exports.getTodayDaysDifference = exports.truncateText = exports.getStringDate = exports.getZauruDateByText = exports.getNewDateByFormat = exports.getFechaJuliana = exports.isJsonArray = exports.extractValueBetweenTags = exports.generateClientUUID = exports.getBasketsSchema = exports.DESTINOS_MUESTRA_OPTIONS = void 0;
6
+ exports.parsedObject = exports.sortByProperty = exports.labFormPatter = exports.labServicePattern = exports.getRandomNum = exports.CURRENCY_PREFIX = exports.truncateDecimals = exports.ZAURU_REGEX = exports.arrayToObject = exports.isNumeric = exports.toFixedIfNeeded = exports.formatTimeToTimePicker = exports.formatDateToDatePicker = exports.getFormattedDate = exports.parsedBaculoFormValue = exports.getPayeeInfoOptions = exports.getPayeeInfoIdOptions = exports.getPayeeFormated = exports.getDateAfterDays = exports.getTimePickerCurrentTime = exports.getDatePickerCurrentDate = exports.stringDateToParsedUTCDate = exports.localDateToUSDate = exports.getStringFullDate = exports.getTodayMinutesDifference = exports.getTodayDaysDifference = exports.getStringDate = exports.getZauruDateByText = exports.getNewDateByFormat = exports.getFechaJuliana = exports.getBasketsSchema = exports.DESTINOS_MUESTRA_OPTIONS = void 0;
7
+ exports.generateClientUUID = generateClientUUID;
8
+ exports.extractValueBetweenTags = extractValueBetweenTags;
9
+ exports.isJsonArray = isJsonArray;
10
+ exports.truncateText = truncateText;
11
+ exports.todayLongString = todayLongString;
12
+ exports.isToday = isToday;
13
+ exports.extractIdFromForm = extractIdFromForm;
14
+ exports.formatDateToUTC = formatDateToUTC;
15
+ exports.incrementString = incrementString;
16
+ exports.getParsedIdFromString = getParsedIdFromString;
17
+ exports.convertToFormData = convertToFormData;
18
+ exports.reduceAdd = reduceAdd;
19
+ exports.capitalLetter = capitalLetter;
20
+ exports.handlePossibleAxiosErrors = handlePossibleAxiosErrors;
21
+ exports.createPostgresUrl = createPostgresUrl;
22
+ exports.calculateTimeDifference = calculateTimeDifference;
7
23
  const moment_1 = __importDefault(require("moment"));
8
24
  require("moment-timezone");
9
25
  const types_1 = require("@zauru-sdk/types");
@@ -38,7 +54,6 @@ function generateClientUUID() {
38
54
  return v.toString(16);
39
55
  });
40
56
  }
41
- exports.generateClientUUID = generateClientUUID;
42
57
  /**
43
58
  * extractValueBetweenTags
44
59
  * @param input
@@ -50,7 +65,6 @@ function extractValueBetweenTags(input, tagName) {
50
65
  const match = input.match(regex);
51
66
  return match ? match[1] : "";
52
67
  }
53
- exports.extractValueBetweenTags = extractValueBetweenTags;
54
68
  /**
55
69
  * isJsonArray
56
70
  * @param value
@@ -65,7 +79,6 @@ function isJsonArray(value) {
65
79
  return false;
66
80
  }
67
81
  }
68
- exports.isJsonArray = isJsonArray;
69
82
  /**
70
83
  *
71
84
  * @param date Recibe el date en formato UTC
@@ -139,7 +152,6 @@ function truncateText(text, maxLength) {
139
152
  return text;
140
153
  }
141
154
  }
142
- exports.truncateText = truncateText;
143
155
  const getTodayDaysDifference = (date) => {
144
156
  // Crear el objeto de Moment para la fecha de creación
145
157
  const fechaCreacion = (0, moment_1.default)(date);
@@ -207,7 +219,6 @@ function todayLongString(hours = false) {
207
219
  // Formatea la fecha en el locale español
208
220
  return issueDate.locale("es").format(formatString);
209
221
  }
210
- exports.todayLongString = todayLongString;
211
222
  function isToday(dateStr) {
212
223
  // Parsea la fecha dada y la fecha actual a inicio del día (00:00:00)
213
224
  const givenDate = (0, moment_1.default)(dateStr).startOf("day");
@@ -215,7 +226,6 @@ function isToday(dateStr) {
215
226
  // Compara si son iguales
216
227
  return givenDate.isSame(today);
217
228
  }
218
- exports.isToday = isToday;
219
229
  const getDatePickerCurrentDate = () => {
220
230
  const date = new Date();
221
231
  const year = date.getFullYear();
@@ -293,7 +303,6 @@ function extractIdFromForm(s) {
293
303
  }
294
304
  return null;
295
305
  }
296
- exports.extractIdFromForm = extractIdFromForm;
297
306
  /**
298
307
  * Formatea una fecha de tipo YYYY-MM-DD a 2023-08-07T20:56:00.540245
299
308
  * @param dateString
@@ -310,7 +319,6 @@ function formatDateToUTC(dateString) {
310
319
  const milliseconds = String(date.getUTCMilliseconds()).padStart(3, "0");
311
320
  return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${milliseconds}`;
312
321
  }
313
- exports.formatDateToUTC = formatDateToUTC;
314
322
  /**
315
323
  * IMPORTANTE: Esta función está diseñada para funcionar solo en el lado del cliente.
316
324
  * Para renderizado del lado del servidor, utilice una función alternativa.
@@ -413,7 +421,6 @@ function incrementString(str) {
413
421
  .padStart(numberPart.length, "0");
414
422
  return prefix + incrementedString;
415
423
  }
416
- exports.incrementString = incrementString;
417
424
  function getParsedIdFromString(inputString) {
418
425
  const regex = /<(\d+)>/; // Expresión regular para encontrar el número entre los corchetes
419
426
  const match = inputString.match(regex); // Buscar la coincidencia en el string
@@ -427,7 +434,6 @@ function getParsedIdFromString(inputString) {
427
434
  }
428
435
  return number;
429
436
  }
430
- exports.getParsedIdFromString = getParsedIdFromString;
431
437
  const arrayToObject = (arr = [], options) => {
432
438
  return arr.reduce((acc, cur, idx) => {
433
439
  const tempVal = cur;
@@ -470,7 +476,6 @@ function convertToFormData(obj) {
470
476
  appendFormData(obj);
471
477
  return formData;
472
478
  }
473
- exports.convertToFormData = convertToFormData;
474
479
  exports.ZAURU_REGEX = {
475
480
  porcentaje: /^\d{1,2}(\.\d{1,2})?$/,
476
481
  };
@@ -483,7 +488,6 @@ exports.ZAURU_REGEX = {
483
488
  function reduceAdd(accumulator, a) {
484
489
  return accumulator + a;
485
490
  }
486
- exports.reduceAdd = reduceAdd;
487
491
  /**
488
492
  * Truncar decimales, ejemplo: truncateDecimals(43.434340934, 2) => 43.43
489
493
  * @param number
@@ -519,7 +523,6 @@ function capitalLetter(str = "") {
519
523
  }
520
524
  return str;
521
525
  }
522
- exports.capitalLetter = capitalLetter;
523
526
  const sortByProperty = (array, property) => {
524
527
  // Crear una copia del array
525
528
  const arrayCopy = [...array];
@@ -548,7 +551,6 @@ async function handlePossibleAxiosErrors(action) {
548
551
  return { error: true, userMsg: error?.toString() };
549
552
  }
550
553
  }
551
- exports.handlePossibleAxiosErrors = handlePossibleAxiosErrors;
552
554
  /**
553
555
  * createPostgresUrl
554
556
  * @param host
@@ -566,7 +568,6 @@ function createPostgresUrl(host = "localhost", port = "5432", dbName = "postgres
566
568
  }
567
569
  return `postgresql://${authPart}@${host}:${port}/${dbName}?schema=${schema}`;
568
570
  }
569
- exports.createPostgresUrl = createPostgresUrl;
570
571
  const parsedObject = (obj) => {
571
572
  if (typeof obj === "bigint") {
572
573
  return obj.toString();
@@ -600,4 +601,3 @@ function calculateTimeDifference(timestamp) {
600
601
  label: `${hours > 0 ? `${hours} ${hours > 1 ? "horas" : "hora"}` : ""}${hours > 0 && minutes > 0 ? " y " : ""}${minutes > 0 ? `${minutes} ${minutes > 1 ? "minutos" : "minuto"}` : ""}.`,
601
602
  };
602
603
  }
603
- exports.calculateTimeDifference = calculateTimeDifference;
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@zauru-sdk/common",
3
- "version": "1.0.117",
3
+ "version": "1.0.120",
4
4
  "description": "Funciones de uso común en el desarrollo de webapps en Zauru",
5
- "main": "./dist/cjs/index.js",
5
+ "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
11
  "scripts": {
12
- "build": "npm run build:cjs && npm run build:esm",
13
- "build:cjs": "tsc -p tsconfig.cjs.json",
12
+ "build": "npm run build:esm",
14
13
  "build:esm": "tsc -p tsconfig.esm.json",
15
14
  "test": "echo \"Error: no test specified\" && exit 1"
16
15
  },
@@ -21,9 +20,9 @@
21
20
  },
22
21
  "dependencies": {
23
22
  "@remix-run/node": "^2.8.1",
24
- "@zauru-sdk/types": "^1.0.117",
23
+ "@zauru-sdk/types": "^1.0.120",
25
24
  "moment": "^2.30.1",
26
25
  "moment-timezone": "^0.5.45"
27
26
  },
28
- "gitHead": "4534ce5b582579835c080f54facdcd4b7fad3b72"
27
+ "gitHead": "5c8b84d1723fc1342ecd45b49df51d4d96682f75"
29
28
  }