latinfo 0.7.0 → 0.8.0

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/dist/index.js CHANGED
@@ -495,16 +495,31 @@ DATA
495
495
  return;
496
496
  }
497
497
  for (const r of results) {
498
- const monto = parseFloat(r.monto);
498
+ const tender = r.tender || {};
499
+ const monto = tender.value?.amount ?? 0;
499
500
  const montoFmt = monto > 0 ? `S/ ${monto.toLocaleString('es-PE', { minimumFractionDigits: 2 })}` : 'N/A';
500
- const fecha = r.fecha?.split('T')[0] || '';
501
- const desc = r.descripcion?.length > 100 ? r.descripcion.substring(0, 100) + '...' : (r.descripcion || '');
502
- console.log(` ${fecha} ${montoFmt} [${r.categoria}] [${r.estado}]`);
503
- console.log(` ${desc}`);
504
- console.log(` Buyer: ${r.buyer_nombre}`);
501
+ const fecha = (tender.datePublished || r.date || '').split('T')[0];
502
+ const cierre = tender.tenderPeriod?.endDate?.split('T')[0] || '';
503
+ const desc = (tender.description || '');
504
+ const descFmt = desc.length > 100 ? desc.substring(0, 100) + '...' : desc;
505
+ const cat = tender.mainProcurementCategory || '';
506
+ const status = tender.items?.[0]?.statusDetails || '';
507
+ const method = tender.procurementMethodDetails || '';
508
+ console.log(` ${fecha} ${montoFmt} [${cat}] [${status}]`);
509
+ if (cierre)
510
+ console.log(` Cierre: ${cierre}`);
511
+ console.log(` ${descFmt}`);
512
+ console.log(` Buyer: ${r.buyer?.name || 'N/A'}`);
513
+ // Show documents (bases)
514
+ const docs = tender.documents || [];
515
+ if (docs.length > 0) {
516
+ const bases = docs.find((d) => d.title?.toLowerCase().includes('bases'));
517
+ if (bases)
518
+ console.log(` Bases: ${bases.url}`);
519
+ }
505
520
  if (r.url)
506
521
  console.log(` ${r.url}`);
507
- console.log(` ${r.metodo} — ${r.ocid}`);
522
+ console.log(` ${method} — ${r.ocid}`);
508
523
  console.log();
509
524
  }
510
525
  console.log(`${results.length} result(s)`);
package/dist/sdk.d.ts CHANGED
@@ -15,20 +15,97 @@ export interface PeRecord {
15
15
  manzana: string;
16
16
  kilometro: string;
17
17
  }
18
+ /** Full OCDS 1.1 compiledRelease + url field added by Latinfo. */
18
19
  export interface PeLicitacion {
19
20
  ocid: string;
20
- titulo: string;
21
- descripcion: string;
22
- monto: string;
23
- moneda: string;
24
- categoria: string;
25
- metodo: string;
26
- buyer_nombre: string;
27
- buyer_id: string;
28
- fecha: string;
29
- estado: string;
30
- unspsc: string;
31
21
  url: string;
22
+ date?: string;
23
+ tender: {
24
+ title?: string;
25
+ description?: string;
26
+ datePublished?: string;
27
+ value?: {
28
+ amount?: number;
29
+ currency?: string;
30
+ };
31
+ mainProcurementCategory?: string;
32
+ procurementMethodDetails?: string;
33
+ tenderPeriod?: {
34
+ startDate?: string;
35
+ endDate?: string;
36
+ };
37
+ enquiryPeriod?: {
38
+ startDate?: string;
39
+ endDate?: string;
40
+ durationInDays?: number;
41
+ };
42
+ items?: Array<{
43
+ description?: string;
44
+ quantity?: number;
45
+ unit?: {
46
+ name?: string;
47
+ };
48
+ statusDetails?: string;
49
+ additionalClassifications?: Array<{
50
+ scheme?: string;
51
+ id?: string;
52
+ }>;
53
+ }>;
54
+ documents?: Array<{
55
+ title?: string;
56
+ url?: string;
57
+ format?: string;
58
+ }>;
59
+ tenderers?: Array<{
60
+ name?: string;
61
+ id?: string;
62
+ }>;
63
+ numberOfTenderers?: number;
64
+ };
65
+ buyer?: {
66
+ name?: string;
67
+ id?: string;
68
+ };
69
+ parties?: Array<{
70
+ name?: string;
71
+ roles?: string[];
72
+ address?: {
73
+ region?: string;
74
+ locality?: string;
75
+ };
76
+ }>;
77
+ awards?: Array<{
78
+ status?: string;
79
+ value?: {
80
+ amount?: number;
81
+ currency?: string;
82
+ };
83
+ suppliers?: Array<{
84
+ name?: string;
85
+ id?: string;
86
+ }>;
87
+ date?: string;
88
+ }>;
89
+ contracts?: Array<{
90
+ status?: string;
91
+ value?: {
92
+ amount?: number;
93
+ };
94
+ period?: {
95
+ startDate?: string;
96
+ endDate?: string;
97
+ durationInDays?: number;
98
+ };
99
+ }>;
100
+ planning?: {
101
+ budget?: {
102
+ amount?: {
103
+ amount?: number;
104
+ currency?: string;
105
+ };
106
+ };
107
+ };
108
+ [key: string]: any;
32
109
  }
33
110
  export interface LicitacionesQuery {
34
111
  q?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "latinfo",
3
- "version": "0.7.0",
4
- "description": "Tax registry API for Latin America. Query RUC, DNI, and company data from SUNAT Peru. 18M+ records, updated daily, sub-100ms from anywhere.",
3
+ "version": "0.8.0",
4
+ "description": "Tax registry & procurement API for Latin America. Query RUC, DNI, licitaciones (OECE/SEACE) from Peru. Full OCDS data, updated daily.",
5
5
  "homepage": "https://latinfo.dev",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,7 +21,12 @@
21
21
  "api",
22
22
  "latin-america",
23
23
  "latam",
24
- "json"
24
+ "json",
25
+ "licitaciones",
26
+ "oece",
27
+ "seace",
28
+ "ocds",
29
+ "procurement"
25
30
  ],
26
31
  "main": "dist/sdk.js",
27
32
  "types": "dist/sdk.d.ts",