arca-sdk 1.2.0 → 1.2.2
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 +12 -0
- package/README.md +33 -2
- package/dist/index.cjs +21 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/package.json +59 -59
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ Todos los cambios notables de este proyecto se documentan en este archivo.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.2.1] — 2026-05-29
|
|
8
|
+
|
|
9
|
+
### 🌐 Normativas ARCA 2026 & Actualizaciones de Infraestructura
|
|
10
|
+
|
|
11
|
+
- **Migración a Dominios ARCA**: Se actualizaron todos los endpoints predeterminados SOAP del SDK (`WSAA`, `WSFE` y `Padrón A13`) reemplazando los antiguos servidores `*.afip.gov.ar` / `*.afip.gob.ar` por la infraestructura oficial y definitiva de ARCA (`*.arca.gob.ar`).
|
|
12
|
+
- **URL del Código QR Oficial**: Se actualizó la URL de validación del QR de comprobantes electrónicos a `https://www.arca.gob.ar/fe/qr/?p=...` según la normativa vigente en 2026.
|
|
13
|
+
- **Documentación de Normativas Recientes**:
|
|
14
|
+
- **Identificación de Comprador (RG 5824/2026)**: Se documentó en el `README.md` el nuevo tope legal de **$10.000.000** a partir del cual es obligatorio identificar al receptor en facturas de Consumidores Finales.
|
|
15
|
+
- **Facturación A con Leyenda (RG 5762/2025)**: Se documentó cómo utilizar el campo `optionals` del SDK para dar cumplimiento a la disolución de la Factura Clase "M" mediante la emisión de Facturas A tradicionales con leyendas de retención impositivas ("OPERACIÓN SUJETA A RETENCIÓN" o "PAGO EN CBU INFORMADA").
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
7
19
|
## [1.2.0] — 2026-03-18
|
|
8
20
|
|
|
9
21
|
### ✨ Developer Experience (DX) y Normativas 2025
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ const result = await wsfe.issueSimpleReceipt({ total: 1500 });
|
|
|
104
104
|
|
|
105
105
|
console.log('CAE:', result.cae); // '75157992335329'
|
|
106
106
|
console.log('Vto:', result.caeExpiry); // '20260302'
|
|
107
|
-
console.log('QR:', result.qrUrl); // 'https://www.
|
|
107
|
+
console.log('QR:', result.qrUrl); // 'https://www.arca.gob.ar/fe/qr/?p=...'
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
> Los certificados se obtienen en el [portal de ARCA](https://auth.afip.gob.ar/contribuyente_/login.xhtml) (CLAVE FISCAL nivel 3+).
|
|
@@ -283,7 +283,38 @@ console.log(result.qrUrl); // listo para embeber en un generador de QR
|
|
|
283
283
|
const url = generateQRUrl(caeResponse, '20123456789', 1500.00);
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
> **Nota:** La URL usa base64 crudo sin `encodeURIComponent`. Es un quirk
|
|
286
|
+
> **Nota:** La URL usa base64 crudo sin `encodeURIComponent`. Es un quirk del spec oficial de ARCA — su scanner no acepta caracteres URL-encoded.
|
|
287
|
+
|
|
288
|
+
### 📋 Normativas ARCA 2026 & Buenas Prácticas
|
|
289
|
+
|
|
290
|
+
`arca-sdk` está completamente adaptada a las últimas directivas de la **Agencia de Recaudación y Control Aduanero (ARCA)**:
|
|
291
|
+
|
|
292
|
+
#### 1. Identificación del Comprador (RG 5824/2026)
|
|
293
|
+
* A partir de 2026, el monto límite para compras de **Consumidores Finales** sin identificar se elevó a **$10.000.000**.
|
|
294
|
+
* Si el importe acumulado del comprobante es **igual o mayor a $10.000.000**, es **obligatorio** identificar al comprador mediante su DNI, CUIT, CUIL o CDI en el objeto `buyer`.
|
|
295
|
+
* Si el cliente solicita el comprobante para deducir el gasto en el Impuesto a las Ganancias, es obligatorio identificarlo con su CUIT sin importar el monto.
|
|
296
|
+
|
|
297
|
+
#### 2. Emisión de Facturas Clase "A" con Leyenda (RG 5762/2025)
|
|
298
|
+
Con la eliminación total de la Factura Clase "M", ARCA instruyó el uso de Facturas Clase "A" tradicionales acompañadas de leyendas impositivas obligatorias. La SDK permite resolver este requerimiento utilizando el bloque de campos opcionales del protocolo SOAP:
|
|
299
|
+
|
|
300
|
+
* **Operación Sujeta a Retención (Reemplazo de Factura M):**
|
|
301
|
+
Para emitir una Factura A sujeta al régimen de retención, debés pasar en la propiedad `optionals` el identificador oficial provisto por ARCA:
|
|
302
|
+
```typescript
|
|
303
|
+
const result = await wsfe.issueInvoiceA({
|
|
304
|
+
items: [...],
|
|
305
|
+
buyer: { docType: TaxIdType.CUIT, docNumber: '30716024941' },
|
|
306
|
+
optionals: [
|
|
307
|
+
{
|
|
308
|
+
id: 5, // ID opcional para indicar la condicion
|
|
309
|
+
value: '1' // Valor segun catalogo de ARCA
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
});
|
|
313
|
+
```
|
|
314
|
+
* **Pago en CBU Informada:**
|
|
315
|
+
De igual modo, si te corresponde emitir con la leyenda de obligatoriedad de CBU, se adjunta el opcional correspondiente declarando tu cuenta bancaria asociada.
|
|
316
|
+
|
|
317
|
+
---
|
|
287
318
|
|
|
288
319
|
### Manejo de errores
|
|
289
320
|
|
package/dist/index.cjs
CHANGED
|
@@ -47,16 +47,16 @@ module.exports = __toCommonJS(index_exports);
|
|
|
47
47
|
|
|
48
48
|
// src/constants/endpoints.ts
|
|
49
49
|
var WSAA_ENDPOINTS = {
|
|
50
|
-
homologacion: "https://wsaahomo.
|
|
51
|
-
produccion: "https://wsaa.
|
|
50
|
+
homologacion: "https://wsaahomo.arca.gob.ar/ws/services/LoginCms",
|
|
51
|
+
produccion: "https://wsaa.arca.gob.ar/ws/services/LoginCms"
|
|
52
52
|
};
|
|
53
53
|
var WSFE_ENDPOINTS = {
|
|
54
|
-
homologacion: "https://wswhomo.
|
|
55
|
-
produccion: "https://servicios1.
|
|
54
|
+
homologacion: "https://wswhomo.arca.gob.ar/wsfev1/service.asmx",
|
|
55
|
+
produccion: "https://servicios1.arca.gob.ar/wsfev1/service.asmx"
|
|
56
56
|
};
|
|
57
57
|
var PADRON_A13_ENDPOINTS = {
|
|
58
|
-
homologacion: "https://awshomo.
|
|
59
|
-
produccion: "https://aws.
|
|
58
|
+
homologacion: "https://awshomo.arca.gob.ar/sr-padron/webservices/personaServiceA13",
|
|
59
|
+
produccion: "https://aws.arca.gob.ar/sr-padron/webservices/personaServiceA13"
|
|
60
60
|
};
|
|
61
61
|
function getWsaaEndpoint(environment) {
|
|
62
62
|
return WSAA_ENDPOINTS[environment];
|
|
@@ -291,6 +291,18 @@ var TicketManager = class {
|
|
|
291
291
|
|
|
292
292
|
// src/utils/network.ts
|
|
293
293
|
var import_https = __toESM(require("https"), 1);
|
|
294
|
+
var import_tls = __toESM(require("tls"), 1);
|
|
295
|
+
function checkArcaServerIdentity(hostname, cert) {
|
|
296
|
+
const error = import_tls.default.checkServerIdentity(hostname, cert);
|
|
297
|
+
if (error && hostname.endsWith("arca.gob.ar")) {
|
|
298
|
+
const fallbackHost = hostname.replace("arca.gob.ar", "afip.gov.ar");
|
|
299
|
+
const retryError = import_tls.default.checkServerIdentity(fallbackHost, cert);
|
|
300
|
+
if (!retryError) {
|
|
301
|
+
return void 0;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return error;
|
|
305
|
+
}
|
|
294
306
|
async function callArcaApi(url, options) {
|
|
295
307
|
const timeout = options.timeout || 15e3;
|
|
296
308
|
const isNode = typeof process !== "undefined" && process.versions && process.versions.node;
|
|
@@ -306,7 +318,8 @@ async function callArcaApi(url, options) {
|
|
|
306
318
|
minVersion: "TLSv1",
|
|
307
319
|
// @ts-ignore - Propiedad específica para mitigar "dh key too small" en Node 18+
|
|
308
320
|
minDHSize: 1024,
|
|
309
|
-
rejectUnauthorized: true
|
|
321
|
+
rejectUnauthorized: true,
|
|
322
|
+
checkServerIdentity: checkArcaServerIdentity
|
|
310
323
|
});
|
|
311
324
|
const reqOptions = {
|
|
312
325
|
method: options.method,
|
|
@@ -620,7 +633,7 @@ function generateQRUrl(caeResponse, issuerCUIT, total, buyer) {
|
|
|
620
633
|
qrData.codAut = Number(cleanCAE);
|
|
621
634
|
const jsonString = JSON.stringify(qrData);
|
|
622
635
|
const base64 = typeof Buffer !== "undefined" ? Buffer.from(jsonString).toString("base64") : btoa(jsonString);
|
|
623
|
-
return `https://www.
|
|
636
|
+
return `https://www.arca.gob.ar/fe/qr/?p=${base64}`;
|
|
624
637
|
}
|
|
625
638
|
|
|
626
639
|
// src/constants/errors.ts
|