@nubiia/mcp-freematica 0.6.1
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/LICENSE +21 -0
- package/README.md +485 -0
- package/dist/clients/base-client.d.ts +31 -0
- package/dist/clients/base-client.js +102 -0
- package/dist/clients/base-client.js.map +1 -0
- package/dist/clients/fiql-builder.d.ts +118 -0
- package/dist/clients/fiql-builder.js +257 -0
- package/dist/clients/fiql-builder.js.map +1 -0
- package/dist/clients/freematica-client.d.ts +659 -0
- package/dist/clients/freematica-client.js +1327 -0
- package/dist/clients/freematica-client.js.map +1 -0
- package/dist/clients/hardened-base-client.d.ts +143 -0
- package/dist/clients/hardened-base-client.js +366 -0
- package/dist/clients/hardened-base-client.js.map +1 -0
- package/dist/config.d.ts +104 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +71 -0
- package/dist/logger.js +114 -0
- package/dist/logger.js.map +1 -0
- package/dist/schemas/albaranes.d.ts +124 -0
- package/dist/schemas/albaranes.js +250 -0
- package/dist/schemas/albaranes.js.map +1 -0
- package/dist/schemas/cartera.d.ts +70 -0
- package/dist/schemas/cartera.js +104 -0
- package/dist/schemas/cartera.js.map +1 -0
- package/dist/schemas/contratos.d.ts +7 -0
- package/dist/schemas/contratos.js +2 -0
- package/dist/schemas/contratos.js.map +1 -0
- package/dist/schemas/facturas-electronicas.d.ts +60 -0
- package/dist/schemas/facturas-electronicas.js +79 -0
- package/dist/schemas/facturas-electronicas.js.map +1 -0
- package/dist/schemas/facturas-ventas.d.ts +118 -0
- package/dist/schemas/facturas-ventas.js +153 -0
- package/dist/schemas/facturas-ventas.js.map +1 -0
- package/dist/schemas/filters.d.ts +92 -0
- package/dist/schemas/filters.js +76 -0
- package/dist/schemas/filters.js.map +1 -0
- package/dist/schemas/master-data.d.ts +26 -0
- package/dist/schemas/master-data.js +86 -0
- package/dist/schemas/master-data.js.map +1 -0
- package/dist/schemas/pagination.d.ts +14 -0
- package/dist/schemas/pagination.js +27 -0
- package/dist/schemas/pagination.js.map +1 -0
- package/dist/schemas/pedidos-compras.d.ts +92 -0
- package/dist/schemas/pedidos-compras.js +189 -0
- package/dist/schemas/pedidos-compras.js.map +1 -0
- package/dist/server-instructions.d.ts +1 -0
- package/dist/server-instructions.js +83 -0
- package/dist/server-instructions.js.map +1 -0
- package/dist/server.d.ts +6 -0
- package/dist/server.js +41 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/albaranes.d.ts +16 -0
- package/dist/tools/albaranes.js +202 -0
- package/dist/tools/albaranes.js.map +1 -0
- package/dist/tools/calendarios.d.ts +13 -0
- package/dist/tools/calendarios.js +82 -0
- package/dist/tools/calendarios.js.map +1 -0
- package/dist/tools/cartera.d.ts +13 -0
- package/dist/tools/cartera.js +78 -0
- package/dist/tools/cartera.js.map +1 -0
- package/dist/tools/clientes.d.ts +3 -0
- package/dist/tools/clientes.js +48 -0
- package/dist/tools/clientes.js.map +1 -0
- package/dist/tools/contabilidad.d.ts +14 -0
- package/dist/tools/contabilidad.js +259 -0
- package/dist/tools/contabilidad.js.map +1 -0
- package/dist/tools/contactos-clientes.d.ts +3 -0
- package/dist/tools/contactos-clientes.js +25 -0
- package/dist/tools/contactos-clientes.js.map +1 -0
- package/dist/tools/contratos.d.ts +10 -0
- package/dist/tools/contratos.js +35 -0
- package/dist/tools/contratos.js.map +1 -0
- package/dist/tools/facturas-compras.d.ts +13 -0
- package/dist/tools/facturas-compras.js +131 -0
- package/dist/tools/facturas-compras.js.map +1 -0
- package/dist/tools/facturas-electronicas.d.ts +17 -0
- package/dist/tools/facturas-electronicas.js +268 -0
- package/dist/tools/facturas-electronicas.js.map +1 -0
- package/dist/tools/facturas-ventas.d.ts +16 -0
- package/dist/tools/facturas-ventas.js +181 -0
- package/dist/tools/facturas-ventas.js.map +1 -0
- package/dist/tools/helpers.d.ts +17 -0
- package/dist/tools/helpers.js +36 -0
- package/dist/tools/helpers.js.map +1 -0
- package/dist/tools/localizaciones.d.ts +17 -0
- package/dist/tools/localizaciones.js +192 -0
- package/dist/tools/localizaciones.js.map +1 -0
- package/dist/tools/master-data.d.ts +10 -0
- package/dist/tools/master-data.js +70 -0
- package/dist/tools/master-data.js.map +1 -0
- package/dist/tools/oportunidades-negocio.d.ts +3 -0
- package/dist/tools/oportunidades-negocio.js +68 -0
- package/dist/tools/oportunidades-negocio.js.map +1 -0
- package/dist/tools/pedidos-compras.d.ts +14 -0
- package/dist/tools/pedidos-compras.js +105 -0
- package/dist/tools/pedidos-compras.js.map +1 -0
- package/dist/tools/personal.d.ts +13 -0
- package/dist/tools/personal.js +154 -0
- package/dist/tools/personal.js.map +1 -0
- package/dist/tools/prl.d.ts +47 -0
- package/dist/tools/prl.js +242 -0
- package/dist/tools/prl.js.map +1 -0
- package/dist/tools/proveedores.d.ts +14 -0
- package/dist/tools/proveedores.js +122 -0
- package/dist/tools/proveedores.js.map +1 -0
- package/dist/transports/http.d.ts +12 -0
- package/dist/transports/http.js +110 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/transports/stdio.d.ts +12 -0
- package/dist/transports/stdio.js +15 -0
- package/dist/transports/stdio.js.map +1 -0
- package/dist/types/api-envelope.d.ts +27 -0
- package/dist/types/api-envelope.js +2 -0
- package/dist/types/api-envelope.js.map +1 -0
- package/dist/types/clientes.d.ts +9 -0
- package/dist/types/clientes.js +2 -0
- package/dist/types/clientes.js.map +1 -0
- package/dist/types/contactos-clientes.d.ts +7 -0
- package/dist/types/contactos-clientes.js +2 -0
- package/dist/types/contactos-clientes.js.map +1 -0
- package/dist/types/contratos.d.ts +8 -0
- package/dist/types/contratos.js +2 -0
- package/dist/types/contratos.js.map +1 -0
- package/dist/types/master-data.d.ts +9 -0
- package/dist/types/master-data.js +2 -0
- package/dist/types/master-data.js.map +1 -0
- package/dist/types/oportunidades-negocio.d.ts +8 -0
- package/dist/types/oportunidades-negocio.js +2 -0
- package/dist/types/oportunidades-negocio.js.map +1 -0
- package/dist/utils/size-guardrail.d.ts +22 -0
- package/dist/utils/size-guardrail.js +31 -0
- package/dist/utils/size-guardrail.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Filtros tipados para `freematica_list_facturas_cabecera`.
|
|
4
|
+
*
|
|
5
|
+
* Todos los campos son opcionales y se combinan con AND en la FIQL generada
|
|
6
|
+
* (`rquery`). El campo de paginación hereda de `PaginationSchema`.
|
|
7
|
+
*
|
|
8
|
+
* Mapeo de filtros → campos FIQL de Freemática:
|
|
9
|
+
* | Filtro lógico | Campo FIQL |
|
|
10
|
+
* |----------------------------|------------------|
|
|
11
|
+
* | empresa | FVC_EMP |
|
|
12
|
+
* | codCliente | FVC_CODAUX |
|
|
13
|
+
* | representante | FVC_CODREP |
|
|
14
|
+
* | fechaFacturaDesde | FVC_FECFAC =ge= |
|
|
15
|
+
* | fechaFacturaHasta | FVC_FECFAC =le= |
|
|
16
|
+
* | serie | FVC_SERFAC |
|
|
17
|
+
* | numFactura | FVC_NUMFAC |
|
|
18
|
+
* | formaPago | FVC_CODFPAG |
|
|
19
|
+
* | traspasadoContabilidad | FVC_TRSCONT |
|
|
20
|
+
* | delegacion | FVC_DELEG |
|
|
21
|
+
*/
|
|
22
|
+
export declare const ListFacturasCabeceraFiltersSchema: {
|
|
23
|
+
empresa: z.ZodOptional<z.ZodString>;
|
|
24
|
+
codCliente: z.ZodOptional<z.ZodString>;
|
|
25
|
+
representante: z.ZodOptional<z.ZodString>;
|
|
26
|
+
fechaFacturaDesde: z.ZodOptional<z.ZodString>;
|
|
27
|
+
fechaFacturaHasta: z.ZodOptional<z.ZodString>;
|
|
28
|
+
serie: z.ZodOptional<z.ZodString>;
|
|
29
|
+
numFactura: z.ZodOptional<z.ZodString>;
|
|
30
|
+
formaPago: z.ZodOptional<z.ZodString>;
|
|
31
|
+
traspasadoContabilidad: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
delegacion: z.ZodOptional<z.ZodString>;
|
|
33
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
items: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
};
|
|
36
|
+
export type ListFacturasCabeceraFilters = {
|
|
37
|
+
page?: number;
|
|
38
|
+
items?: number;
|
|
39
|
+
empresa?: string;
|
|
40
|
+
codCliente?: string;
|
|
41
|
+
representante?: string;
|
|
42
|
+
fechaFacturaDesde?: string;
|
|
43
|
+
fechaFacturaHasta?: string;
|
|
44
|
+
serie?: string;
|
|
45
|
+
numFactura?: string;
|
|
46
|
+
formaPago?: string;
|
|
47
|
+
traspasadoContabilidad?: boolean;
|
|
48
|
+
delegacion?: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Filtros tipados para `freematica_list_factura_lineas`.
|
|
52
|
+
*
|
|
53
|
+
* Mapeo de filtros → campos FIQL de Freemática (prefijo `FVL_`):
|
|
54
|
+
* | Filtro lógico | Campo FIQL |
|
|
55
|
+
* |----------------|------------------|
|
|
56
|
+
* | codArticulo | FVL_CODART |
|
|
57
|
+
* | codFamilia | FVL_CODFAM |
|
|
58
|
+
* | codSubfamilia | FVL_CODSFAM |
|
|
59
|
+
* | delegacion | FVL_DELEG |
|
|
60
|
+
*/
|
|
61
|
+
export declare const ListFacturaLineasFiltersSchema: {
|
|
62
|
+
codArticulo: z.ZodOptional<z.ZodString>;
|
|
63
|
+
codFamilia: z.ZodOptional<z.ZodString>;
|
|
64
|
+
codSubfamilia: z.ZodOptional<z.ZodString>;
|
|
65
|
+
delegacion: z.ZodOptional<z.ZodString>;
|
|
66
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
67
|
+
items: z.ZodDefault<z.ZodNumber>;
|
|
68
|
+
};
|
|
69
|
+
export type ListFacturaLineasFilters = {
|
|
70
|
+
page?: number;
|
|
71
|
+
items?: number;
|
|
72
|
+
codArticulo?: string;
|
|
73
|
+
codFamilia?: string;
|
|
74
|
+
codSubfamilia?: string;
|
|
75
|
+
delegacion?: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Filtros tipados para `freematica_list_factura_iva`.
|
|
79
|
+
*
|
|
80
|
+
* Mapeo de filtros → campos FIQL de Freemática (prefijo `FVI_`):
|
|
81
|
+
* | Filtro lógico | Campo FIQL |
|
|
82
|
+
* |----------------|-------------|
|
|
83
|
+
* | tipoIva | FVI_TIPIVA |
|
|
84
|
+
*/
|
|
85
|
+
export declare const ListFacturaIvaFiltersSchema: {
|
|
86
|
+
tipoIva: z.ZodOptional<z.ZodString>;
|
|
87
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
items: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
};
|
|
90
|
+
export type ListFacturaIvaFilters = {
|
|
91
|
+
page?: number;
|
|
92
|
+
items?: number;
|
|
93
|
+
tipoIva?: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Filtros tipados para `freematica_list_factura_vencimientos`.
|
|
97
|
+
*
|
|
98
|
+
* Mapeo de filtros → campos FIQL de Freemática (prefijo `FVV_`):
|
|
99
|
+
* | Filtro lógico | Campo FIQL |
|
|
100
|
+
* |---------------------------|------------------|
|
|
101
|
+
* | fechaVencimientoDesde | FVV_FECVCTO =ge= |
|
|
102
|
+
* | fechaVencimientoHasta | FVV_FECVCTO =le= |
|
|
103
|
+
* | modoPago | FVV_CODMPAG |
|
|
104
|
+
*/
|
|
105
|
+
export declare const ListFacturaVencimientosFiltersSchema: {
|
|
106
|
+
fechaVencimientoDesde: z.ZodOptional<z.ZodString>;
|
|
107
|
+
fechaVencimientoHasta: z.ZodOptional<z.ZodString>;
|
|
108
|
+
modoPago: z.ZodOptional<z.ZodString>;
|
|
109
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
110
|
+
items: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
};
|
|
112
|
+
export type ListFacturaVencimientosFilters = {
|
|
113
|
+
page?: number;
|
|
114
|
+
items?: number;
|
|
115
|
+
fechaVencimientoDesde?: string;
|
|
116
|
+
fechaVencimientoHasta?: string;
|
|
117
|
+
modoPago?: string;
|
|
118
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PaginationSchema } from './pagination.js';
|
|
3
|
+
/**
|
|
4
|
+
* Filtros tipados para `freematica_list_facturas_cabecera`.
|
|
5
|
+
*
|
|
6
|
+
* Todos los campos son opcionales y se combinan con AND en la FIQL generada
|
|
7
|
+
* (`rquery`). El campo de paginación hereda de `PaginationSchema`.
|
|
8
|
+
*
|
|
9
|
+
* Mapeo de filtros → campos FIQL de Freemática:
|
|
10
|
+
* | Filtro lógico | Campo FIQL |
|
|
11
|
+
* |----------------------------|------------------|
|
|
12
|
+
* | empresa | FVC_EMP |
|
|
13
|
+
* | codCliente | FVC_CODAUX |
|
|
14
|
+
* | representante | FVC_CODREP |
|
|
15
|
+
* | fechaFacturaDesde | FVC_FECFAC =ge= |
|
|
16
|
+
* | fechaFacturaHasta | FVC_FECFAC =le= |
|
|
17
|
+
* | serie | FVC_SERFAC |
|
|
18
|
+
* | numFactura | FVC_NUMFAC |
|
|
19
|
+
* | formaPago | FVC_CODFPAG |
|
|
20
|
+
* | traspasadoContabilidad | FVC_TRSCONT |
|
|
21
|
+
* | delegacion | FVC_DELEG |
|
|
22
|
+
*/
|
|
23
|
+
export const ListFacturasCabeceraFiltersSchema = {
|
|
24
|
+
...PaginationSchema,
|
|
25
|
+
empresa: z
|
|
26
|
+
.string()
|
|
27
|
+
.min(1)
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Código de empresa Freemática (FVC_EMP). Ej.: "1".'),
|
|
30
|
+
codCliente: z
|
|
31
|
+
.string()
|
|
32
|
+
.min(1)
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('Código natural del cliente facturado (FVC_CODAUX).'),
|
|
35
|
+
representante: z
|
|
36
|
+
.string()
|
|
37
|
+
.min(1)
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Código del representante/comercial (FVC_CODREP).'),
|
|
40
|
+
fechaFacturaDesde: z
|
|
41
|
+
.string()
|
|
42
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Debe ser una fecha en formato ISO 8601 YYYY-MM-DD')
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Fecha inicio de la factura (FVC_FECFAC). Formato YYYY-MM-DD. Inclusive.'),
|
|
45
|
+
fechaFacturaHasta: z
|
|
46
|
+
.string()
|
|
47
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Debe ser una fecha en formato ISO 8601 YYYY-MM-DD')
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Fecha fin de la factura (FVC_FECFAC). Formato YYYY-MM-DD. Inclusive.'),
|
|
50
|
+
serie: z
|
|
51
|
+
.string()
|
|
52
|
+
.min(1)
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('Serie de facturación (FVC_SERFAC). Ej.: "A", "B".'),
|
|
55
|
+
numFactura: z
|
|
56
|
+
.string()
|
|
57
|
+
.min(1)
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Número de factura exacto (FVC_NUMFAC).'),
|
|
60
|
+
formaPago: z
|
|
61
|
+
.string()
|
|
62
|
+
.min(1)
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Código de forma de pago (FVC_CODFPAG). Ej.: "REC", "TRF".'),
|
|
65
|
+
traspasadoContabilidad: z
|
|
66
|
+
.boolean()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Si true, filtra facturas ya traspasadas a contabilidad (FVC_TRSCONT). Si false, las no traspasadas.'),
|
|
69
|
+
delegacion: z
|
|
70
|
+
.string()
|
|
71
|
+
.min(1)
|
|
72
|
+
.optional()
|
|
73
|
+
.describe('Código de delegación (FVC_DELEG).'),
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Filtros tipados para `freematica_list_factura_lineas`.
|
|
77
|
+
*
|
|
78
|
+
* Mapeo de filtros → campos FIQL de Freemática (prefijo `FVL_`):
|
|
79
|
+
* | Filtro lógico | Campo FIQL |
|
|
80
|
+
* |----------------|------------------|
|
|
81
|
+
* | codArticulo | FVL_CODART |
|
|
82
|
+
* | codFamilia | FVL_CODFAM |
|
|
83
|
+
* | codSubfamilia | FVL_CODSFAM |
|
|
84
|
+
* | delegacion | FVL_DELEG |
|
|
85
|
+
*/
|
|
86
|
+
export const ListFacturaLineasFiltersSchema = {
|
|
87
|
+
...PaginationSchema,
|
|
88
|
+
codArticulo: z
|
|
89
|
+
.string()
|
|
90
|
+
.min(1)
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Código de artículo (FVL_CODART).'),
|
|
93
|
+
codFamilia: z
|
|
94
|
+
.string()
|
|
95
|
+
.min(1)
|
|
96
|
+
.optional()
|
|
97
|
+
.describe('Código de familia de artículo (FVL_CODFAM).'),
|
|
98
|
+
codSubfamilia: z
|
|
99
|
+
.string()
|
|
100
|
+
.min(1)
|
|
101
|
+
.optional()
|
|
102
|
+
.describe('Código de subfamilia de artículo (FVL_CODSFAM).'),
|
|
103
|
+
delegacion: z
|
|
104
|
+
.string()
|
|
105
|
+
.min(1)
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Código de delegación (FVL_DELEG).'),
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Filtros tipados para `freematica_list_factura_iva`.
|
|
111
|
+
*
|
|
112
|
+
* Mapeo de filtros → campos FIQL de Freemática (prefijo `FVI_`):
|
|
113
|
+
* | Filtro lógico | Campo FIQL |
|
|
114
|
+
* |----------------|-------------|
|
|
115
|
+
* | tipoIva | FVI_TIPIVA |
|
|
116
|
+
*/
|
|
117
|
+
export const ListFacturaIvaFiltersSchema = {
|
|
118
|
+
...PaginationSchema,
|
|
119
|
+
tipoIva: z
|
|
120
|
+
.string()
|
|
121
|
+
.min(1)
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('Tipo de IVA (FVI_TIPIVA). Ej.: "21", "10", "4".'),
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Filtros tipados para `freematica_list_factura_vencimientos`.
|
|
127
|
+
*
|
|
128
|
+
* Mapeo de filtros → campos FIQL de Freemática (prefijo `FVV_`):
|
|
129
|
+
* | Filtro lógico | Campo FIQL |
|
|
130
|
+
* |---------------------------|------------------|
|
|
131
|
+
* | fechaVencimientoDesde | FVV_FECVCTO =ge= |
|
|
132
|
+
* | fechaVencimientoHasta | FVV_FECVCTO =le= |
|
|
133
|
+
* | modoPago | FVV_CODMPAG |
|
|
134
|
+
*/
|
|
135
|
+
export const ListFacturaVencimientosFiltersSchema = {
|
|
136
|
+
...PaginationSchema,
|
|
137
|
+
fechaVencimientoDesde: z
|
|
138
|
+
.string()
|
|
139
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Debe ser una fecha en formato ISO 8601 YYYY-MM-DD')
|
|
140
|
+
.optional()
|
|
141
|
+
.describe('Fecha inicio de vencimiento (FVV_FECVCTO). Formato YYYY-MM-DD. Inclusive.'),
|
|
142
|
+
fechaVencimientoHasta: z
|
|
143
|
+
.string()
|
|
144
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, 'Debe ser una fecha en formato ISO 8601 YYYY-MM-DD')
|
|
145
|
+
.optional()
|
|
146
|
+
.describe('Fecha fin de vencimiento (FVV_FECVCTO). Formato YYYY-MM-DD. Inclusive.'),
|
|
147
|
+
modoPago: z
|
|
148
|
+
.string()
|
|
149
|
+
.min(1)
|
|
150
|
+
.optional()
|
|
151
|
+
.describe('Código de modo de pago (FVV_CODMPAG). Ej.: "TRF", "CHQ".'),
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=facturas-ventas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facturas-ventas.js","sourceRoot":"","sources":["../../src/schemas/facturas-ventas.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Rango de fechas opcional en formato ISO 8601 (YYYY-MM-DD o ISO datetime).
|
|
4
|
+
*
|
|
5
|
+
* Ambos extremos son opcionales: se puede usar sólo `fechaDesde`, sólo
|
|
6
|
+
* `fechaHasta`, o ambos para un rango cerrado.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Sólo desde:
|
|
10
|
+
* { fechaDesde: '2024-01-01' }
|
|
11
|
+
* // Rango cerrado:
|
|
12
|
+
* { fechaDesde: '2024-01-01', fechaHasta: '2024-12-31' }
|
|
13
|
+
*/
|
|
14
|
+
export declare const DateRangeSchema: z.ZodObject<{
|
|
15
|
+
fechaDesde: z.ZodOptional<z.ZodString>;
|
|
16
|
+
fechaHasta: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
fechaDesde?: string | undefined;
|
|
19
|
+
fechaHasta?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
fechaDesde?: string | undefined;
|
|
22
|
+
fechaHasta?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export type DateRange = z.infer<typeof DateRangeSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* Filtros de identidad para entidades de Freemática.
|
|
27
|
+
*
|
|
28
|
+
* Permite filtrar por cliente, grupo de clientes, proveedor o grupo de
|
|
29
|
+
* proveedores. Todos los campos son opcionales y se combinan con AND cuando
|
|
30
|
+
* se usan junto con `BaseFiltersSchema`.
|
|
31
|
+
*
|
|
32
|
+
* Los códigos deben ser los códigos naturales del API de Freemática (ej.
|
|
33
|
+
* `COD_CLI`, `GRUPO_CLI`, `COD_PRO`, `GRUPO_PRO`).
|
|
34
|
+
*/
|
|
35
|
+
export declare const IdentityFiltersSchema: z.ZodObject<{
|
|
36
|
+
codCliente: z.ZodOptional<z.ZodString>;
|
|
37
|
+
grupoCliente: z.ZodOptional<z.ZodString>;
|
|
38
|
+
codProveedor: z.ZodOptional<z.ZodString>;
|
|
39
|
+
grupoProveedor: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
codProveedor?: string | undefined;
|
|
42
|
+
codCliente?: string | undefined;
|
|
43
|
+
grupoCliente?: string | undefined;
|
|
44
|
+
grupoProveedor?: string | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
codProveedor?: string | undefined;
|
|
47
|
+
codCliente?: string | undefined;
|
|
48
|
+
grupoCliente?: string | undefined;
|
|
49
|
+
grupoProveedor?: string | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
export type IdentityFilters = z.infer<typeof IdentityFiltersSchema>;
|
|
52
|
+
/**
|
|
53
|
+
* Schema base para tools que necesitan paginación + rango de fechas + filtros
|
|
54
|
+
* de identidad.
|
|
55
|
+
*
|
|
56
|
+
* Combina `PaginationSchema` + `DateRangeSchema` + `IdentityFiltersSchema`
|
|
57
|
+
* para que las tools que necesiten filtros tengan un único punto de importación.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Usar en el registro de una tool:
|
|
61
|
+
* import { BaseFiltersSchema } from '../schemas/filters.js';
|
|
62
|
+
* server.tool('mi_tool', desc, BaseFiltersSchema, ...);
|
|
63
|
+
*/
|
|
64
|
+
export declare const BaseFiltersSchema: z.ZodObject<{
|
|
65
|
+
codCliente: z.ZodOptional<z.ZodString>;
|
|
66
|
+
grupoCliente: z.ZodOptional<z.ZodString>;
|
|
67
|
+
codProveedor: z.ZodOptional<z.ZodString>;
|
|
68
|
+
grupoProveedor: z.ZodOptional<z.ZodString>;
|
|
69
|
+
fechaDesde: z.ZodOptional<z.ZodString>;
|
|
70
|
+
fechaHasta: z.ZodOptional<z.ZodString>;
|
|
71
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
72
|
+
items: z.ZodDefault<z.ZodNumber>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
page: number;
|
|
75
|
+
items: number;
|
|
76
|
+
codProveedor?: string | undefined;
|
|
77
|
+
codCliente?: string | undefined;
|
|
78
|
+
fechaDesde?: string | undefined;
|
|
79
|
+
fechaHasta?: string | undefined;
|
|
80
|
+
grupoCliente?: string | undefined;
|
|
81
|
+
grupoProveedor?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
codProveedor?: string | undefined;
|
|
84
|
+
codCliente?: string | undefined;
|
|
85
|
+
page?: number | undefined;
|
|
86
|
+
items?: number | undefined;
|
|
87
|
+
fechaDesde?: string | undefined;
|
|
88
|
+
fechaHasta?: string | undefined;
|
|
89
|
+
grupoCliente?: string | undefined;
|
|
90
|
+
grupoProveedor?: string | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
export type BaseFilters = z.infer<typeof BaseFiltersSchema>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PaginationSchema } from './pagination.js';
|
|
3
|
+
/**
|
|
4
|
+
* Rango de fechas opcional en formato ISO 8601 (YYYY-MM-DD o ISO datetime).
|
|
5
|
+
*
|
|
6
|
+
* Ambos extremos son opcionales: se puede usar sólo `fechaDesde`, sólo
|
|
7
|
+
* `fechaHasta`, o ambos para un rango cerrado.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Sólo desde:
|
|
11
|
+
* { fechaDesde: '2024-01-01' }
|
|
12
|
+
* // Rango cerrado:
|
|
13
|
+
* { fechaDesde: '2024-01-01', fechaHasta: '2024-12-31' }
|
|
14
|
+
*/
|
|
15
|
+
export const DateRangeSchema = z.object({
|
|
16
|
+
fechaDesde: z
|
|
17
|
+
.string()
|
|
18
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?)?$/, 'Debe ser una fecha ISO 8601 (YYYY-MM-DD o ISO datetime)')
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Fecha inicio del rango en formato ISO 8601 (YYYY-MM-DD). Inclusive.'),
|
|
21
|
+
fechaHasta: z
|
|
22
|
+
.string()
|
|
23
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?)?$/, 'Debe ser una fecha ISO 8601 (YYYY-MM-DD o ISO datetime)')
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Fecha fin del rango en formato ISO 8601 (YYYY-MM-DD). Inclusive.'),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Filtros de identidad para entidades de Freemática.
|
|
29
|
+
*
|
|
30
|
+
* Permite filtrar por cliente, grupo de clientes, proveedor o grupo de
|
|
31
|
+
* proveedores. Todos los campos son opcionales y se combinan con AND cuando
|
|
32
|
+
* se usan junto con `BaseFiltersSchema`.
|
|
33
|
+
*
|
|
34
|
+
* Los códigos deben ser los códigos naturales del API de Freemática (ej.
|
|
35
|
+
* `COD_CLI`, `GRUPO_CLI`, `COD_PRO`, `GRUPO_PRO`).
|
|
36
|
+
*/
|
|
37
|
+
export const IdentityFiltersSchema = z.object({
|
|
38
|
+
codCliente: z
|
|
39
|
+
.string()
|
|
40
|
+
.min(1)
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('Código natural del cliente (COD_CLI en Freemática).'),
|
|
43
|
+
grupoCliente: z
|
|
44
|
+
.string()
|
|
45
|
+
.min(1)
|
|
46
|
+
.optional()
|
|
47
|
+
.describe('Código de grupo de clientes (GRUPO_CLI en Freemática).'),
|
|
48
|
+
codProveedor: z
|
|
49
|
+
.string()
|
|
50
|
+
.min(1)
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('Código natural del proveedor (COD_PRO en Freemática).'),
|
|
53
|
+
grupoProveedor: z
|
|
54
|
+
.string()
|
|
55
|
+
.min(1)
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Código de grupo de proveedores (GRUPO_PRO en Freemática).'),
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Schema base para tools que necesitan paginación + rango de fechas + filtros
|
|
61
|
+
* de identidad.
|
|
62
|
+
*
|
|
63
|
+
* Combina `PaginationSchema` + `DateRangeSchema` + `IdentityFiltersSchema`
|
|
64
|
+
* para que las tools que necesiten filtros tengan un único punto de importación.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Usar en el registro de una tool:
|
|
68
|
+
* import { BaseFiltersSchema } from '../schemas/filters.js';
|
|
69
|
+
* server.tool('mi_tool', desc, BaseFiltersSchema, ...);
|
|
70
|
+
*/
|
|
71
|
+
export const BaseFiltersSchema = z.object({
|
|
72
|
+
...PaginationSchema,
|
|
73
|
+
...DateRangeSchema.shape,
|
|
74
|
+
...IdentityFiltersSchema.shape,
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../src/schemas/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,KAAK,CACJ,yEAAyE,EACzE,yDAAyD,CAC1D;SACA,QAAQ,EAAE;SACV,QAAQ,CAAC,qEAAqE,CAAC;IAClF,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,KAAK,CACJ,yEAAyE,EACzE,yDAAyD,CAC1D;SACA,QAAQ,EAAE;SACV,QAAQ,CAAC,kEAAkE,CAAC;CAChF,CAAC,CAAC;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;IAClE,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,uDAAuD,CAAC;IACpE,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,2DAA2D,CAAC;CACzE,CAAC,CAAC;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,gBAAgB;IACnB,GAAG,eAAe,CAAC,KAAK;IACxB,GAAG,qBAAqB,CAAC,KAAK;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Enum de catálogos de datos maestros disponibles en el API de Freemática.
|
|
4
|
+
*
|
|
5
|
+
* Cada entrada en este array corresponde a un catálogo consultable vía
|
|
6
|
+
* `freematica_get_master_data`. El endpoint asociado está definido en
|
|
7
|
+
* `CATALOG_ENDPOINTS`.
|
|
8
|
+
*
|
|
9
|
+
* Para añadir un nuevo catálogo:
|
|
10
|
+
* 1. Añadir el nombre aquí (mantener orden: tipos, geográficos, organizativos, inventario, financiero)
|
|
11
|
+
* 2. Añadir el endpoint en `CATALOG_ENDPOINTS`
|
|
12
|
+
* 3. Añadir descripción en `CATALOG_DESCRIPTIONS` de `src/tools/master-data.ts`
|
|
13
|
+
* 4. Añadir fila en la tabla "Datos maestros disponibles" del README
|
|
14
|
+
* 5. Añadir test en `tests/schemas/master-data.test.ts` y `tests/tools/master-data.test.ts`
|
|
15
|
+
*/
|
|
16
|
+
export declare const MASTER_DATA_CATALOGS: readonly ["tipos-contrato", "tipo-instalacion", "clases-servicios", "tipos-casos", "subtipos-casos", "tipos-oportunidad-negocio", "tipos-impuestos", "naturalezas-abono", "incidencecode", "claves-facturacion", "paises", "nacionalidades", "provincias", "poblaciones", "empresas", "delegaciones", "lineas-negocio", "cargos-clientes", "calendarios", "series", "familias", "subfamilias", "lineas", "bancos"];
|
|
17
|
+
export type MasterDataCatalog = typeof MASTER_DATA_CATALOGS[number];
|
|
18
|
+
export declare const MasterDataCatalogSchema: z.ZodEnum<["tipos-contrato", "tipo-instalacion", "clases-servicios", "tipos-casos", "subtipos-casos", "tipos-oportunidad-negocio", "tipos-impuestos", "naturalezas-abono", "incidencecode", "claves-facturacion", "paises", "nacionalidades", "provincias", "poblaciones", "empresas", "delegaciones", "lineas-negocio", "cargos-clientes", "calendarios", "series", "familias", "subfamilias", "lineas", "bancos"]>;
|
|
19
|
+
/**
|
|
20
|
+
* Mapeo catálogo → endpoint REST de Freemática.
|
|
21
|
+
*
|
|
22
|
+
* Solo se incluyen endpoints que funcionan sin parámetros requeridos adicionales.
|
|
23
|
+
* Catálogos que requieren parámetros obligatorios no documentados (ej: `tipos-marcajes`
|
|
24
|
+
* con `sTipoMarcaje`) quedan excluidos hasta descubrir los valores válidos.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CATALOG_ENDPOINTS: Record<MasterDataCatalog, string>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Enum de catálogos de datos maestros disponibles en el API de Freemática.
|
|
4
|
+
*
|
|
5
|
+
* Cada entrada en este array corresponde a un catálogo consultable vía
|
|
6
|
+
* `freematica_get_master_data`. El endpoint asociado está definido en
|
|
7
|
+
* `CATALOG_ENDPOINTS`.
|
|
8
|
+
*
|
|
9
|
+
* Para añadir un nuevo catálogo:
|
|
10
|
+
* 1. Añadir el nombre aquí (mantener orden: tipos, geográficos, organizativos, inventario, financiero)
|
|
11
|
+
* 2. Añadir el endpoint en `CATALOG_ENDPOINTS`
|
|
12
|
+
* 3. Añadir descripción en `CATALOG_DESCRIPTIONS` de `src/tools/master-data.ts`
|
|
13
|
+
* 4. Añadir fila en la tabla "Datos maestros disponibles" del README
|
|
14
|
+
* 5. Añadir test en `tests/schemas/master-data.test.ts` y `tests/tools/master-data.test.ts`
|
|
15
|
+
*/
|
|
16
|
+
export const MASTER_DATA_CATALOGS = [
|
|
17
|
+
// --- Tipos / clasificaciones ---
|
|
18
|
+
'tipos-contrato',
|
|
19
|
+
'tipo-instalacion',
|
|
20
|
+
'clases-servicios',
|
|
21
|
+
'tipos-casos',
|
|
22
|
+
'subtipos-casos',
|
|
23
|
+
'tipos-oportunidad-negocio',
|
|
24
|
+
'tipos-impuestos',
|
|
25
|
+
'naturalezas-abono',
|
|
26
|
+
'incidencecode',
|
|
27
|
+
'claves-facturacion',
|
|
28
|
+
// --- Geográficos ---
|
|
29
|
+
'paises',
|
|
30
|
+
'nacionalidades',
|
|
31
|
+
'provincias',
|
|
32
|
+
'poblaciones',
|
|
33
|
+
// --- Organizativos ---
|
|
34
|
+
'empresas',
|
|
35
|
+
'delegaciones',
|
|
36
|
+
'lineas-negocio',
|
|
37
|
+
'cargos-clientes',
|
|
38
|
+
'calendarios',
|
|
39
|
+
'series',
|
|
40
|
+
// --- Inventario ---
|
|
41
|
+
'familias',
|
|
42
|
+
'subfamilias',
|
|
43
|
+
'lineas',
|
|
44
|
+
// --- Financiero ---
|
|
45
|
+
'bancos',
|
|
46
|
+
];
|
|
47
|
+
export const MasterDataCatalogSchema = z.enum(MASTER_DATA_CATALOGS);
|
|
48
|
+
/**
|
|
49
|
+
* Mapeo catálogo → endpoint REST de Freemática.
|
|
50
|
+
*
|
|
51
|
+
* Solo se incluyen endpoints que funcionan sin parámetros requeridos adicionales.
|
|
52
|
+
* Catálogos que requieren parámetros obligatorios no documentados (ej: `tipos-marcajes`
|
|
53
|
+
* con `sTipoMarcaje`) quedan excluidos hasta descubrir los valores válidos.
|
|
54
|
+
*/
|
|
55
|
+
export const CATALOG_ENDPOINTS = {
|
|
56
|
+
// Tipos / clasificaciones
|
|
57
|
+
'tipos-contrato': '/ppre/v2/tipos-contrato',
|
|
58
|
+
'tipo-instalacion': '/ppre/v1/tipo-instalacion',
|
|
59
|
+
'clases-servicios': '/pvss/v1/clases-servicios',
|
|
60
|
+
'tipos-casos': '/pcrm/v2/tipos-casos',
|
|
61
|
+
'subtipos-casos': '/pcrm/v2/subtipos-casos',
|
|
62
|
+
'tipos-oportunidad-negocio': '/pcrm/v2/tipos-oportunidad-negocio',
|
|
63
|
+
'tipos-impuestos': '/pgrl/v2/tipos-impuestos',
|
|
64
|
+
'naturalezas-abono': '/pven/v1/naturalezas-abono',
|
|
65
|
+
incidencecode: '/pvss/v2/incidencecode',
|
|
66
|
+
'claves-facturacion': '/pvss/v2/claves-facturacion',
|
|
67
|
+
// Geográficos
|
|
68
|
+
paises: '/pgrl/v1/paises',
|
|
69
|
+
nacionalidades: '/pgrl/v1/nacionalidades',
|
|
70
|
+
provincias: '/pgrl/v1/provincias',
|
|
71
|
+
poblaciones: '/pgrl/v2/poblaciones',
|
|
72
|
+
// Organizativos
|
|
73
|
+
empresas: '/pgrl/v1/empresas',
|
|
74
|
+
delegaciones: '/pgrl/v1/delegaciones/agrupcod',
|
|
75
|
+
'lineas-negocio': '/pgrl/v2/lineas-negocio',
|
|
76
|
+
'cargos-clientes': '/pgrl/v2/cargos-clientes',
|
|
77
|
+
calendarios: '/pgrl/v1/calendarios',
|
|
78
|
+
series: '/pgrl/v2/series',
|
|
79
|
+
// Inventario
|
|
80
|
+
familias: '/part/v1/familias',
|
|
81
|
+
subfamilias: '/part/v1/subfamilias',
|
|
82
|
+
lineas: '/part/v1/lineas',
|
|
83
|
+
// Financiero
|
|
84
|
+
bancos: '/pgrl/v2/bancos',
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=master-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"master-data.js","sourceRoot":"","sources":["../../src/schemas/master-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,kCAAkC;IAClC,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,aAAa;IACb,gBAAgB;IAChB,2BAA2B;IAC3B,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;IACf,oBAAoB;IACpB,sBAAsB;IACtB,QAAQ;IACR,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,wBAAwB;IACxB,UAAU;IACV,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,QAAQ;IACR,qBAAqB;IACrB,UAAU;IACV,aAAa;IACb,QAAQ;IACR,qBAAqB;IACrB,QAAQ;CACA,CAAC;AAIX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAClE,0BAA0B;IAC1B,gBAAgB,EAAE,yBAAyB;IAC3C,kBAAkB,EAAE,2BAA2B;IAC/C,kBAAkB,EAAE,2BAA2B;IAC/C,aAAa,EAAE,sBAAsB;IACrC,gBAAgB,EAAE,yBAAyB;IAC3C,2BAA2B,EAAE,oCAAoC;IACjE,iBAAiB,EAAE,0BAA0B;IAC7C,mBAAmB,EAAE,4BAA4B;IACjD,aAAa,EAAE,wBAAwB;IACvC,oBAAoB,EAAE,6BAA6B;IACnD,cAAc;IACd,MAAM,EAAE,iBAAiB;IACzB,cAAc,EAAE,yBAAyB;IACzC,UAAU,EAAE,qBAAqB;IACjC,WAAW,EAAE,sBAAsB;IACnC,gBAAgB;IAChB,QAAQ,EAAE,mBAAmB;IAC7B,YAAY,EAAE,gCAAgC;IAC9C,gBAAgB,EAAE,yBAAyB;IAC3C,iBAAiB,EAAE,0BAA0B;IAC7C,WAAW,EAAE,sBAAsB;IACnC,MAAM,EAAE,iBAAiB;IACzB,aAAa;IACb,QAAQ,EAAE,mBAAmB;IAC7B,WAAW,EAAE,sBAAsB;IACnC,MAAM,EAAE,iBAAiB;IACzB,aAAa;IACb,MAAM,EAAE,iBAAiB;CAC1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema parts to paginate Freemática listing tools.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: We block `page=0` because the Freemática API treats it as
|
|
6
|
+
* "return the FULL dataset" (we measured 2.5 MB responses on the clientes
|
|
7
|
+
* endpoint). Pages are 1-indexed.
|
|
8
|
+
*
|
|
9
|
+
* `items` is capped at 50 to keep LLM context manageable.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PaginationSchema: {
|
|
12
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
items: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema parts to paginate Freemática listing tools.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: We block `page=0` because the Freemática API treats it as
|
|
6
|
+
* "return the FULL dataset" (we measured 2.5 MB responses on the clientes
|
|
7
|
+
* endpoint). Pages are 1-indexed.
|
|
8
|
+
*
|
|
9
|
+
* `items` is capped at 50 to keep LLM context manageable.
|
|
10
|
+
*/
|
|
11
|
+
export const PaginationSchema = {
|
|
12
|
+
page: z
|
|
13
|
+
.number()
|
|
14
|
+
.int()
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(999)
|
|
17
|
+
.default(1)
|
|
18
|
+
.describe('Página a recuperar (1-indexed). Default: 1. AVISO: el API trata page=0 como "devuelve TODO el dataset"; este parámetro lo bloquea al mínimo 1.'),
|
|
19
|
+
items: z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(50)
|
|
24
|
+
.default(20)
|
|
25
|
+
.describe('Items por página. Default 20, máximo 50.'),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/schemas/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CACP,gJAAgJ,CACjJ;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,0CAA0C,CAAC;CACxD,CAAC"}
|