@zauru-sdk/common 1.0.6 → 1.0.7

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,14 @@
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.7](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.6...v1.0.7) (2024-03-16)
7
+
8
+ **Note:** Version bump only for package @zauru-sdk/common
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.0.6](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.5...v1.0.6) (2024-03-16)
7
15
 
8
16
  **Note:** Version bump only for package @zauru-sdk/common
package/dist/common.d.ts CHANGED
@@ -1,69 +1,13 @@
1
1
  import "moment-timezone";
2
2
  import "moment/locale/es";
3
- import type { PayeeGraphQL, AxiosUtilsResponse } from "@zauru-sdk/types";
4
- export type SelectFieldOption = {
5
- label: any;
6
- value: any;
7
- };
3
+ import type { PayeeGraphQL, AxiosUtilsResponse, BasketSchema, SelectFieldOption } from "@zauru-sdk/types";
8
4
  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
5
  /**
19
6
  * Obtener el objeto de canastas en base al string de canastas
20
7
  * @param basketsString
21
8
  * @returns
22
9
  */
23
10
  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
11
  export declare function generateClientUUID(): string;
68
12
  /**
69
13
  * extractValueBetweenTags
@@ -137,7 +81,7 @@ export declare const getPayeeFormated: (payee: PayeeGraphQL) => string;
137
81
  export declare const getPayeeInfoOptions: (payees: PayeeGraphQL[]) => (SelectFieldOption & {
138
82
  id: number;
139
83
  })[];
140
- export declare const parsedBaculoFormValue: (value: any) => any;
84
+ export declare const parsedBaculoFormValue: (value: any) => string | undefined;
141
85
  export declare function extractIdFromForm(s: string): number | null;
142
86
  /**
143
87
  * Formatea una fecha de tipo YYYY-MM-DD a 2023-08-07T20:56:00.540245
package/dist/common.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import moment from "moment";
2
2
  import "moment-timezone";
3
3
  import "moment/locale/es";
4
+ import { MONTHS } from "@zauru-sdk/types";
4
5
  export const DESTINOS_MUESTRA_OPTIONS = [
5
6
  { label: "Microbiología", value: "microbiologa" },
6
7
  { label: "Residuos de plaguicidas", value: "residuos_de_plaguicidas" },
@@ -376,20 +377,6 @@ export function convertToFormData(obj) {
376
377
  appendFormData(obj);
377
378
  return formData;
378
379
  }
379
- const MONTHS = {
380
- ene: 0,
381
- feb: 1,
382
- mar: 2,
383
- abr: 3,
384
- may: 4,
385
- jun: 5,
386
- jul: 6,
387
- ago: 7,
388
- sep: 8,
389
- oct: 9,
390
- nov: 10,
391
- dic: 11,
392
- };
393
380
  export const ZAURU_REGEX = {
394
381
  porcentaje: /^\d{1,2}(\.\d{1,2})?$/,
395
382
  };
package/dist/gtZones.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SelectFieldOption } from "./common.js";
1
+ import { SelectFieldOption } from "@zauru-sdk/types";
2
2
  export declare const guatemalaCountryInfo: {
3
3
  value: number;
4
4
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/common",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Funciones de uso común en el desarrollo de webapps en Zauru",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,12 +19,12 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@remix-run/node": "^2.8.1",
22
- "@zauru-sdk/types": "^1.0.6",
22
+ "@zauru-sdk/types": "^1.0.7",
23
23
  "moment": "^2.30.1",
24
24
  "moment-timezone": "^0.5.45"
25
25
  },
26
26
  "engines": {
27
27
  "node": ">=18.0.0"
28
28
  },
29
- "gitHead": "d49d7b1cec4ab5685b34983c46d97db129115aaf"
29
+ "gitHead": "8078893206a171382f3783914ceec8959cdda945"
30
30
  }
package/src/common.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  import moment from "moment";
2
2
  import "moment-timezone";
3
3
  import "moment/locale/es";
4
- import type { PayeeGraphQL, AxiosUtilsResponse } from "@zauru-sdk/types";
5
-
6
- export type SelectFieldOption = {
7
- label: any;
8
- value: any;
9
- };
4
+ import type {
5
+ PayeeGraphQL,
6
+ AxiosUtilsResponse,
7
+ BasketSchema,
8
+ SelectFieldOption,
9
+ MonthsType,
10
+ } from "@zauru-sdk/types";
11
+ import { MONTHS } from "@zauru-sdk/types";
10
12
 
11
13
  export const DESTINOS_MUESTRA_OPTIONS: SelectFieldOption[] = [
12
14
  { label: "Microbiología", value: "microbiologa" },
@@ -15,14 +17,6 @@ export const DESTINOS_MUESTRA_OPTIONS: SelectFieldOption[] = [
15
17
 
16
18
  moment.locale("es");
17
19
 
18
- export type GenericStepResponse = { msg: string; step: string };
19
-
20
- export type BasketSchema = {
21
- total: number;
22
- id: number;
23
- color: string;
24
- };
25
-
26
20
  /**
27
21
  * Obtener el objeto de canastas en base al string de canastas
28
22
  * @param basketsString
@@ -44,48 +38,6 @@ export const getBasketsSchema = (basketsString: string): BasketSchema[] => {
44
38
  return baskets;
45
39
  };
46
40
 
47
- export type DataTablesFilterBody = {
48
- start: number;
49
- length: number;
50
- tag?: string;
51
- agency?: string;
52
- agency_from?: string;
53
- search?: {
54
- value: string;
55
- regex: boolean;
56
- };
57
- order: { [key: string]: { column: string; dir: string } };
58
- Desde?: string;
59
- Hasta?: string;
60
- vendor?: string;
61
- vendor_category?: string;
62
- item?: string;
63
- };
64
-
65
- //Modelo formateado para interactuar en la aplicación
66
- export type BasicIdNameSchema = {
67
- id: number;
68
- name: string;
69
- };
70
-
71
- export type ObjectKeyString<T> = {
72
- [key: string]: T;
73
- };
74
-
75
- export type GeneratePDFBody = {
76
- s_date: string;
77
- e_date: string;
78
- print_template: number | string;
79
- };
80
-
81
- export type GeneratedPDFResult = { status: number; zid: number };
82
-
83
- export type PDFResult = {
84
- status: number;
85
- percentage: number;
86
- message: string;
87
- };
88
-
89
41
  export function generateClientUUID() {
90
42
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
91
43
  const r = (Math.random() * 16) | 0,
@@ -164,7 +116,7 @@ export const getNewDateByFormat = (date: string): Date => {
164
116
 
165
117
  const new_date = new Date(
166
118
  parseInt(date_parts[4]),
167
- MONTHS[date_parts[2] as keyof monthsType],
119
+ MONTHS[date_parts[2] as keyof MonthsType],
168
120
  parseInt(date_parts[0])
169
121
  );
170
122
  return new_date;
@@ -515,36 +467,6 @@ export function convertToFormData(obj: any) {
515
467
  return formData;
516
468
  }
517
469
 
518
- type monthsType = {
519
- ene: number;
520
- feb: number;
521
- mar: number;
522
- abr: number;
523
- may: number;
524
- jun: number;
525
- jul: number;
526
- ago: number;
527
- sep: number;
528
- oct: number;
529
- nov: number;
530
- dic: number;
531
- };
532
-
533
- const MONTHS = {
534
- ene: 0,
535
- feb: 1,
536
- mar: 2,
537
- abr: 3,
538
- may: 4,
539
- jun: 5,
540
- jul: 6,
541
- ago: 7,
542
- sep: 8,
543
- oct: 9,
544
- nov: 10,
545
- dic: 11,
546
- };
547
-
548
470
  export const ZAURU_REGEX = {
549
471
  porcentaje: /^\d{1,2}(\.\d{1,2})?$/,
550
472
  };
package/src/gtZones.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SelectFieldOption } from "./common.js";
1
+ import { SelectFieldOption } from "@zauru-sdk/types";
2
2
 
3
3
  export const guatemalaCountryInfo = [
4
4
  { value: 0, label: "GUATEMALA,GUATEMALA" },