@albertomarturelo/sii-core 0.6.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/adapters/fake/index.d.ts +18 -1
  3. package/dist/adapters/fake/index.d.ts.map +1 -1
  4. package/dist/adapters/fake/index.js +20 -0
  5. package/dist/adapters/fake/index.js.map +1 -1
  6. package/dist/adapters/node/index.d.ts +10 -1
  7. package/dist/adapters/node/index.d.ts.map +1 -1
  8. package/dist/adapters/node/index.js +17 -1
  9. package/dist/adapters/node/index.js.map +1 -1
  10. package/dist/adapters/node/portal.d.ts.map +1 -1
  11. package/dist/adapters/node/portal.js +25 -0
  12. package/dist/adapters/node/portal.js.map +1 -1
  13. package/dist/config/config.d.ts +10 -0
  14. package/dist/config/config.d.ts.map +1 -1
  15. package/dist/config/config.js +10 -0
  16. package/dist/config/config.js.map +1 -1
  17. package/dist/errors/errors.d.ts +5 -1
  18. package/dist/errors/errors.d.ts.map +1 -1
  19. package/dist/errors/errors.js +5 -1
  20. package/dist/errors/errors.js.map +1 -1
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +2 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/node.d.ts +1 -1
  26. package/dist/node.d.ts.map +1 -1
  27. package/dist/node.js +3 -2
  28. package/dist/node.js.map +1 -1
  29. package/dist/portal/dte-mipyme.d.ts +228 -0
  30. package/dist/portal/dte-mipyme.d.ts.map +1 -0
  31. package/dist/portal/dte-mipyme.js +890 -0
  32. package/dist/portal/dte-mipyme.js.map +1 -0
  33. package/dist/portal/f29-pdf.d.ts +35 -0
  34. package/dist/portal/f29-pdf.d.ts.map +1 -0
  35. package/dist/portal/f29-pdf.js +83 -0
  36. package/dist/portal/f29-pdf.js.map +1 -0
  37. package/dist/seams/index.d.ts +38 -0
  38. package/dist/seams/index.d.ts.map +1 -1
  39. package/dist/tasks/dte.d.ts +124 -0
  40. package/dist/tasks/dte.d.ts.map +1 -1
  41. package/dist/tasks/dte.js +471 -5
  42. package/dist/tasks/dte.js.map +1 -1
  43. package/dist/tasks/f29.d.ts +49 -0
  44. package/dist/tasks/f29.d.ts.map +1 -1
  45. package/dist/tasks/f29.js +107 -0
  46. package/dist/tasks/f29.js.map +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,228 @@
1
+ import { Rut } from '../rut/index.js';
2
+ import type { PortalSession } from '../seams/index.js';
3
+ /** The DTE types the MIPYME portal exposes as their own `mipeLaunchPage` OPCION (observed
4
+ * 2026-09-08 on sii.cl/servicios_online/1039-1183.html). Only 33/34 are wired here — the
5
+ * others need their own live capture before their extra fields can be trusted. */
6
+ export declare const TIPOS_DTE: {
7
+ readonly 33: "Factura electrónica";
8
+ readonly 34: "Factura no afecta o exenta electrónica";
9
+ };
10
+ export type TipoDte = keyof typeof TIPOS_DTE;
11
+ export declare const isTipoDte: (n: number) => n is TipoDte;
12
+ /** SII's `EFXP_FMA_PAGO` codes (observed in the form's `<select>`). */
13
+ export declare const FORMA_PAGO: {
14
+ readonly contado: "1";
15
+ readonly credito: "2";
16
+ readonly sin_costo: "3";
17
+ };
18
+ export type FormaPago = keyof typeof FORMA_PAGO;
19
+ /** The grid's hard ceiling — the form's own `cantTotCol` (observed). */
20
+ export declare const MAX_ITEMS = 10;
21
+ /** An empresa the authenticated user may invoice for, as offered by `mipeSelEmpresa.cgi`. */
22
+ export interface DteEmpresa {
23
+ readonly rut: string;
24
+ readonly nombre: string;
25
+ }
26
+ export interface DteReceptor {
27
+ readonly rut: string;
28
+ readonly dv: string;
29
+ readonly razonSocial: string;
30
+ readonly direccion: string;
31
+ readonly comuna: string;
32
+ readonly ciudad: string;
33
+ readonly giro: string;
34
+ readonly contacto?: string;
35
+ }
36
+ export interface DteItem {
37
+ readonly nombre: string;
38
+ readonly descripcion?: string;
39
+ readonly cantidad: number;
40
+ readonly unidad?: string;
41
+ readonly precioUnitario: number;
42
+ readonly descuentoPct?: number;
43
+ }
44
+ /** Everything the caller supplies. The EMISOR block (razón social, giro, domicilio, acteco,
45
+ * sucursal) is read from the live form — except `ciudadEmisor`, which SII leaves BLANK yet
46
+ * its own validation demands, so the caller must provide it (observed 2026-09-08). */
47
+ export interface DteBorradorInput {
48
+ readonly empresa: string;
49
+ readonly tipoDte: TipoDte;
50
+ readonly fechaEmision: string;
51
+ readonly ciudadEmisor: string;
52
+ readonly receptor: DteReceptor;
53
+ readonly items: readonly DteItem[];
54
+ readonly formaPago: FormaPago;
55
+ /** Set to UPDATE an existing borrador in place; omit to create a new one. */
56
+ readonly borradorId?: string;
57
+ }
58
+ /** Server-side totals, computed by the form's own JS (so the arithmetic is SII's, not ours). */
59
+ export interface DteTotales {
60
+ readonly neto: number;
61
+ readonly iva: number;
62
+ readonly total: number;
63
+ }
64
+ /** SII's `ESTADO` filter values on the emitted listing (observed in the form's <select>). */
65
+ export declare const ESTADO_EMITIDO: {
66
+ readonly emitido: "EMI";
67
+ readonly preview: "PRV";
68
+ };
69
+ export type EstadoEmitido = keyof typeof ESTADO_EMITIDO;
70
+ /** Filters the emitted listing accepts, all optional (observed as query params). */
71
+ export interface DteEmitidosFiltro {
72
+ readonly tipoDoc?: number;
73
+ readonly estado?: EstadoEmitido;
74
+ readonly folio?: number;
75
+ readonly receptor?: string;
76
+ readonly desde?: string;
77
+ readonly hasta?: string;
78
+ readonly pagina?: number;
79
+ }
80
+ /** One emitted DTE — CURATED, no `raw` (the row is receptor identity, ADR-004). */
81
+ export interface DteEmitido {
82
+ /** `DHDR_CODIGO` — SII's internal id and the key the PDF is fetched by. */
83
+ readonly codigo: string;
84
+ readonly receptorRut: string | null;
85
+ readonly receptorNombre: string | null;
86
+ readonly tipoDteDesc: string | null;
87
+ readonly folio: number | null;
88
+ readonly fecha: string | null;
89
+ readonly monto: number | null;
90
+ readonly estado: string | null;
91
+ }
92
+ /** One row of the borradores list — CURATED. */
93
+ export interface DteBorradorRow {
94
+ readonly id: string;
95
+ readonly tipoDte: number;
96
+ readonly tipoDteDesc: string;
97
+ readonly fecha: string | null;
98
+ readonly receptorRut: string | null;
99
+ readonly receptorNombre: string | null;
100
+ readonly emisorNombre: string | null;
101
+ readonly iva: number | null;
102
+ readonly total: number | null;
103
+ }
104
+ /** What `mipeSelEmpresa.cgi` answers. THREE shapes observed, decided by how many empresas list
105
+ * the account as "usuario autorizado":
106
+ * * `chooser` — two or more: the `RUT_EMP` select (observed 2026-09-08).
107
+ * * `sinAutorizacion` — none: the same select with an EMPTY `<optgroup>` (observed 2026-09-09
108
+ * on an empresa account that is not itself a usuario autorizado).
109
+ * * `launcher` — exactly one: NO chooser at all — a 593-byte JS shim titled
110
+ * "Facturacion Electronica - Launcher" whose `start_pop()` jumps straight
111
+ * to the destination. The session is ALREADY scoped to that empresa, so
112
+ * there is nothing to POST (observed 2026-09-09, #95, for BOTH wired DTE
113
+ * types: `OPCION=33` and `OPCION=34` answer the identical shim). */
114
+ export type ChooserShape = {
115
+ readonly kind: 'chooser';
116
+ readonly empresas: DteEmpresa[];
117
+ } | {
118
+ readonly kind: 'sinAutorizacion';
119
+ } | {
120
+ readonly kind: 'launcher';
121
+ };
122
+ /** Classify the chooser response. Read the `<option value="RUT">NOMBRE RUT` rows when there is
123
+ * a select: SII closes neither the `<option>` nor quotes the label, so match up to the next
124
+ * `<` or newline (observed). A page that is none of the three shapes is "scraper roto". */
125
+ export declare function parseChooser(html: string): ChooserShape;
126
+ /** Read the message out of SII's server-side rejection page: a 200 "Redireccionando" document
127
+ * whose script is `alert('…')` followed by `window.history.go(-1)` (observed 2026-09-08).
128
+ * Returns the alert text with its escaped newlines turned into separators, or null. */
129
+ export declare function serverAlert(html: string): string | null;
130
+ export declare function latin1FormBody(fields: Iterable<readonly [string, string]>): string;
131
+ /** The `name`s of the `VIEW` form inside `PreViewFrame.html` — the EXACT field set the iframe
132
+ * posts to the PDF CGI, in order (observed 2026-09-08: 239 inputs, matching the browser's own
133
+ * request byte-for-byte in count). Read from SII's frame at runtime so an upstream edit is
134
+ * followed rather than drifting against a hardcoded list. */
135
+ export declare function frameFields(html: string): {
136
+ name: string;
137
+ value: string;
138
+ }[];
139
+ /** `content-type` says PDF AND the body starts with the `%PDF` magic. Status is never a
140
+ * success signal here — SII answers 200 for its own error page (ADR-022). */
141
+ export declare function isPdfBytes(bytes: Uint8Array, contentType: string | null): boolean;
142
+ /** Also relay SII's generic failure page ("Error al contribuyente"), which carries a support
143
+ * code rather than a validation message — it is a SII-side refusal, not our bad input. */
144
+ export declare function contribuyenteError(bytes: Uint8Array, contentType: string | null): string | null;
145
+ /** A receptor field SII renders as a <select> where the requested value matched no option.
146
+ * SII's own selection was KEPT (assigning a non-matching value blanks the select — observed
147
+ * 2026-09-08), and `opciones` lists what it actually offers so a caller can choose a real one. */
148
+ export interface DteSelectAviso {
149
+ readonly campo: string;
150
+ readonly solicitado: string;
151
+ readonly usado: string;
152
+ readonly opciones: readonly string[];
153
+ }
154
+ /** A filled, SII-validated form: the exact body to POST plus the totals SII computed. */
155
+ export interface DteFilled {
156
+ readonly fields: Record<string, string>;
157
+ readonly totales: DteTotales;
158
+ /** Non-fatal: <select> fields where SII's own option was kept. Surfaced to the user. */
159
+ readonly avisos: readonly DteSelectAviso[];
160
+ }
161
+ /** The empresas the authenticated user may invoice for. This is the MIPYME "usuario
162
+ * autorizado" list — its own value domain, NOT the operate pointer's operable set. On a
163
+ * single-empresa account (no chooser) it is the one empresa the portal scoped the session to. */
164
+ export declare function fetchEmpresas(session: PortalSession, tipoDte: TipoDte, sleep?: () => Promise<void>): Promise<DteEmpresa[]>;
165
+ /** Resolve `rut` against the live authorized list and select it. Returns the matched empresa so
166
+ * callers can echo SII's own razón social. An unknown RUT fails with the list (ADR-005 style). */
167
+ export declare function resolveAndSelectEmpresa(session: PortalSession, rut: Rut, tipoDte: TipoDte, sleep?: () => Promise<void>): Promise<DteEmpresa>;
168
+ /** Load the factura form for `empresa` (a fresh one, or an existing borrador) and fill it with
169
+ * `input`, letting SII's own client-side validator pass judgement. Returns the POST-ready body
170
+ * + SII's computed totals, which every downstream CGI (graba / elimina / preview) consumes. */
171
+ export declare function fillFactura(session: PortalSession, empresa: DteEmpresa, input: DteBorradorInput): Promise<DteFilled>;
172
+ /** Serialize an EXISTING borrador's form without changing it — the body `mipeEliminaBorrador`
173
+ * needs (the CGI takes the whole form back, keyed by `EHDR_CODIGO`). Totals come from the
174
+ * form as SII rendered it. */
175
+ export declare function loadBorrador(session: PortalSession, empresa: DteEmpresa, tipoDte: TipoDte, borradorId: string): Promise<DteFilled>;
176
+ /** Persist the filled form as a borrador (create, or update when `EHDR_CODIGO` is set).
177
+ * `ES_BORR=TRUE` is what tells the CGI this is a draft, not a document to sign (observed). */
178
+ export declare function grabaBorrador(session: PortalSession, filled: DteFilled): Promise<void>;
179
+ /** Delete a borrador. SII takes the WHOLE form back, keyed by `EHDR_CODIGO` (observed). */
180
+ export declare function eliminaBorrador(session: PortalSession, filled: DteFilled): Promise<void>;
181
+ /** Repair SII's DOUBLE-ENCODED text. `listaBorrador` declares `charset=ISO-8859-1` but serves
182
+ * UTF-8 bytes of an ALREADY-mojibaked string: "Á" arrives as `C3 83 C2 81`, i.e. UTF-8 of
183
+ * ("Ã", U+0081) — so a correct UTF-8 decode still yields "Fundación" / "Ñuñoa" (observed
184
+ * 2026-09-08). Undo the extra layer by re-encoding the decoded string as Latin-1 and decoding
185
+ * it as UTF-8 again. Applied ONLY when the string carries the tell-tale `Ã`/`Â` + continuation
186
+ * pair AND the round trip decodes cleanly, so legitimately-accented text is left untouched.
187
+ * This only fixes what we DISPLAY — nothing sent to SII is altered. */
188
+ export declare function repairMojibake(v: string): string;
189
+ /** The borradores of the CURRENTLY SELECTED empresa. A plain JSON array (no SDI `respEstado`
190
+ * envelope — observed), served ISO-8859-1; the seam decodes it. Rows carry ~250 mostly-null
191
+ * form columns; only the listing columns are curated (no `raw` — the row is receptor +
192
+ * emisor identity, i.e. PII, ADR-004). */
193
+ export declare function fetchBorradores(session: PortalSession): Promise<DteBorradorRow[]>;
194
+ /** Parse the emitted-documents table. The markup is MALFORMED — SII leaves the receptor cell
195
+ * unclosed (`<td>64000001-5 <td>NOMBRE</td>`, observed 2026-09-08) — so rows are split on the
196
+ * `mipeGesDocEmi.cgi?...CODIGO=` anchor and cells on `<td`, never with a strict parser.
197
+ *
198
+ * Cells map POSITIONALLY and a blank one is NEVER dropped. A `PRV` (vista previa) document has
199
+ * no folio; dropping that cell before indexing slid every later column one place left — fecha
200
+ * into folio, monto into fecha, estado into monto — producing a plausible row with the values
201
+ * under the wrong names and no error at all (#92). A row that does not carry the known cells is
202
+ * a changed portal, so it raises instead of realigning silently. */
203
+ export declare function parseEmitidas(html: string): DteEmitido[];
204
+ /** The DTEs already emitted by the selected empresa. Read-only: this touches nothing and
205
+ * cannot issue a document (ADR-023). Every filter is optional; SII takes them as query
206
+ * params and answers ISO-8859-1 HTML (observed 2026-09-08). */
207
+ export declare function fetchEmitidas(session: PortalSession, filtro?: DteEmitidosFiltro): Promise<DteEmitido[]>;
208
+ /** The PDF of an ALREADY EMITTED document, by its listing `codigo` (`DHDR_CODIGO`). A plain
209
+ * authenticated GET — far simpler than the borrador preview, which needs the review page and
210
+ * the iframe's own form. Success is decided by `content-type` + `%PDF` magic, NEVER by HTTP
211
+ * status: SII answers 200 for its error page and for the login-wall bounce too (ADR-022). */
212
+ export declare function fetchEmitidaPdf(session: PortalSession, codigo: string): Promise<Uint8Array>;
213
+ /** Fetch the PREVIEW PDF of a filled (unsigned) document — the "Validar y visualizar" path.
214
+ *
215
+ * TWO hops, both first-hand-observed 2026-09-08:
216
+ * 1. POST the VIEW_EFXP body to `mipeDisplayPreView.cgi` → the review page, whose
217
+ * `PreViewDTE` form carries the document as ~245 HIDDEN inputs.
218
+ * 2. POST that `PreViewDTE` body to `mipePreView.cgi` → `application/pdf`.
219
+ *
220
+ * Hop 2 is the PDF the portal embeds in its `framePdf` iframe: the document stamped
221
+ * "VISTA PREVIA / DOCUMENTO NO VALIDO", folio NOT assigned. Reaching the review page is NOT
222
+ * signing it — its `Firmar` button posts to `mipeGenXMLFirma.cgi`, which this module never
223
+ * calls (ADR-023).
224
+ *
225
+ * Success is decided by `content-type` + the `%PDF` magic, NEVER by HTTP status — SII answers
226
+ * 200 for its own error page and for the login-wall bounce too (the ADR-022 rule). */
227
+ export declare function fetchPreviewPdf(session: PortalSession, filled: DteFilled, sleep?: () => Promise<void>): Promise<Uint8Array>;
228
+ //# sourceMappingURL=dte-mipyme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dte-mipyme.d.ts","sourceRoot":"","sources":["../../src/portal/dte-mipyme.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AAgCvE;;mFAEmF;AACnF,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AACX,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,OAA+B,CAAC;AAE3E,uEAAuE;AACvE,eAAO,MAAM,UAAU;;;;CAA0D,CAAC;AAClF,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAC;AAEhD,wEAAwE;AACxE,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,6FAA6F;AAC7F,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAA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