@devlas/dte-sii 2.12.5 → 2.12.6
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/CafSolicitor.js +9 -0
- package/package.json +1 -1
package/CafSolicitor.js
CHANGED
|
@@ -325,6 +325,15 @@ class CafSolicitor {
|
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
// Si la respuesta final sigue siendo una redirección de auth, el cookieJar en memoria
|
|
329
|
+
// está inválido (sesión stale en _sessionRegistry). Eliminar del registro y hacer logout
|
|
330
|
+
// best-effort para que el próximo intento cree sesión fresca desde SiiPortalAuth.
|
|
331
|
+
if (this._requiresAuthentication(finalBody)) {
|
|
332
|
+
_sessionRegistry.delete(`${this.ambiente}::${this.rutEmisor}`);
|
|
333
|
+
try { await this.session.logout() } catch (_) {}
|
|
334
|
+
return { success: false, errorCode: 'SESSION_EXPIRED', error: 'Sesión SII inválida — registro limpiado, el próximo intento reautenticará.' };
|
|
335
|
+
}
|
|
336
|
+
|
|
328
337
|
return { success: false, errorCode: 'UNKNOWN', error: 'No se obtuvo CAF en la respuesta' };
|
|
329
338
|
|
|
330
339
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devlas/dte-sii",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.6",
|
|
4
4
|
"description": "Facturación y boletas electrónicas para el SII de Chile. Genera, timbra, firma y envía DTEs, libros electrónicos y automatiza la certificación.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "dte-sii.d.ts",
|