dgii-ts 0.1.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/LICENSE +21 -0
- package/README.en.md +192 -0
- package/README.md +196 -0
- package/dist/bulk.cjs +11 -0
- package/dist/bulk.d.cts +30 -0
- package/dist/bulk.d.ts +30 -0
- package/dist/bulk.js +11 -0
- package/dist/chunk-2ST6QKHA.cjs +1 -0
- package/dist/chunk-4OYLCOUL.cjs +201 -0
- package/dist/chunk-4TKAQ4WV.js +198 -0
- package/dist/chunk-53A7IG4Y.js +23 -0
- package/dist/chunk-6CIP7YH6.cjs +198 -0
- package/dist/chunk-7RJWFPCZ.cjs +44 -0
- package/dist/chunk-D26S6EXD.js +12 -0
- package/dist/chunk-DMGDJEUY.js +44 -0
- package/dist/chunk-ERBXSS64.js +0 -0
- package/dist/chunk-EZKSB553.js +0 -0
- package/dist/chunk-FZ6QDTC4.cjs +98 -0
- package/dist/chunk-HGE4QZ3H.js +281 -0
- package/dist/chunk-HR4DCHH7.js +201 -0
- package/dist/chunk-KIS7MVIW.js +98 -0
- package/dist/chunk-QH4BK5X3.cjs +12 -0
- package/dist/chunk-QOSGH7F5.cjs +1 -0
- package/dist/chunk-SUSDEKID.cjs +784 -0
- package/dist/chunk-TZC6RSWL.js +784 -0
- package/dist/chunk-VJ4ZQQIQ.cjs +281 -0
- package/dist/chunk-WY6V4Y7S.cjs +23 -0
- package/dist/client.cjs +17 -0
- package/dist/client.d.cts +95 -0
- package/dist/client.d.ts +95 -0
- package/dist/client.js +17 -0
- package/dist/errors.cjs +14 -0
- package/dist/errors.d.cts +40 -0
- package/dist/errors.d.ts +40 -0
- package/dist/errors.js +14 -0
- package/dist/index-CS-7YY2y.d.cts +58 -0
- package/dist/index-CS-7YY2y.d.ts +58 -0
- package/dist/index.cjs +66 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +66 -0
- package/dist/scraping.cjs +16 -0
- package/dist/scraping.d.cts +47 -0
- package/dist/scraping.d.ts +47 -0
- package/dist/scraping.js +16 -0
- package/dist/soap.cjs +23 -0
- package/dist/soap.d.cts +38 -0
- package/dist/soap.d.ts +38 -0
- package/dist/soap.js +23 -0
- package/dist/validators.cjs +17 -0
- package/dist/validators.d.cts +55 -0
- package/dist/validators.d.ts +55 -0
- package/dist/validators.js +17 -0
- package/package.json +109 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Franklin Martinez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# dgii-ts
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dgii-ts)
|
|
4
|
+
[](https://github.com/franklinmdev/dgii-ts/actions/workflows/ci.yml)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
|
|
8
|
+
TypeScript library for validation and integration with the Dominican Republic's
|
|
9
|
+
tax authority (DGII) β RNC, Cedula, NCF, e-NCF.
|
|
10
|
+
|
|
11
|
+
[π©π΄ EspaΓ±ol](./README.md)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why?
|
|
16
|
+
|
|
17
|
+
The Dominican Republic's tax authority (DGII) offers no public REST API for
|
|
18
|
+
basic RNC or NCF lookups. Dominican developers rely on fragile scrapers that
|
|
19
|
+
parse ASP.NET WebForms pages with ViewState β and those pages have changed URLs
|
|
20
|
+
at least three times, breaking every existing integration.
|
|
21
|
+
|
|
22
|
+
**dgii-ts** solves this with a three-layer approach designed for resilience:
|
|
23
|
+
|
|
24
|
+
1. **Offline validation** β never fails, zero network calls
|
|
25
|
+
2. **SOAP client** β real-time queries against the WSMovilDGII service
|
|
26
|
+
3. **Bulk data** β import DGII's daily bulk RNC file (DGII\_RNC.zip)
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
### Offline validation
|
|
31
|
+
|
|
32
|
+
Algorithmic check-digit validation for RNC (9 digits), Cedula (11 digits),
|
|
33
|
+
NCF (B-series), and e-NCF (E-series). No network dependencies, no external
|
|
34
|
+
points of failure. Includes whitelists of 578 Cedulas and 23 RNCs
|
|
35
|
+
(source: [python-stdnum](https://github.com/arthurdejong/python-stdnum))
|
|
36
|
+
that pass validation despite failing the check-digit algorithm.
|
|
37
|
+
|
|
38
|
+
### SOAP client (WSMovilDGII)
|
|
39
|
+
|
|
40
|
+
Typed wrapper around DGII's SOAP service for taxpayer lookups
|
|
41
|
+
(`GetContribuyentes`) and fiscal receipt validation (`GetNCF`). Includes
|
|
42
|
+
full TypeScript types for all responses.
|
|
43
|
+
|
|
44
|
+
### Bulk data importer
|
|
45
|
+
|
|
46
|
+
Downloads and parses the daily taxpayer ZIP file published by DGII
|
|
47
|
+
(`DGII_RNC.zip`). Ideal for batch operations and fast local lookups.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install dgii-ts
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm add dgii-ts
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
yarn add dgii-ts
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Quick start
|
|
64
|
+
|
|
65
|
+
### Validate an RNC
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { validateRnc } from 'dgii-ts';
|
|
69
|
+
|
|
70
|
+
const result = validateRnc('131098193');
|
|
71
|
+
// { valid: true, formatted: '1-31-09819-3' }
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Validate a Cedula
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { validateCedula } from 'dgii-ts';
|
|
78
|
+
|
|
79
|
+
const result = validateCedula('00114272360');
|
|
80
|
+
// { valid: true, formatted: '001-1427236-0' }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Validate an NCF
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { validateNcf } from 'dgii-ts';
|
|
87
|
+
|
|
88
|
+
const result = validateNcf('B0100000001');
|
|
89
|
+
// { valid: true, type: 'CREDITO_FISCAL', serie: 'B01' }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Validate an e-NCF
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { validateEcf } from 'dgii-ts';
|
|
96
|
+
|
|
97
|
+
const result = validateEcf('E310000000001');
|
|
98
|
+
// { valid: true, type: 'CREDITO_FISCAL_ELECTRONICA', serie: 'E31' }
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Import only validators (tree-shaking)
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import { validateRnc } from 'dgii-ts/validators';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Available submodules: `dgii-ts/validators`, `dgii-ts/soap`, and
|
|
108
|
+
`dgii-ts/bulk`.
|
|
109
|
+
|
|
110
|
+
### Look up a taxpayer (SOAP) β *coming soon*
|
|
111
|
+
|
|
112
|
+
> **Note:** The SOAP client is not yet implemented. The interface is defined
|
|
113
|
+
> and will be available in a future release.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { DgiiSoapClient } from 'dgii-ts';
|
|
117
|
+
|
|
118
|
+
const client = new DgiiSoapClient();
|
|
119
|
+
const result = await client.getContribuyente('131098193');
|
|
120
|
+
// { rnc: '131098193', nombre: '...', estado: '...', ... }
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## API reference
|
|
124
|
+
|
|
125
|
+
### Validators
|
|
126
|
+
|
|
127
|
+
| Function | Description |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| `validateRnc(value)` | Validates a 9-digit RNC with check digit |
|
|
130
|
+
| `validateCedula(value)` | Validates an 11-digit Cedula with check digit |
|
|
131
|
+
| `validateNcf(value)` | Validates NCF format and type (B-series) |
|
|
132
|
+
| `validateEcf(value)` | Validates e-NCF format and type (E-series) |
|
|
133
|
+
|
|
134
|
+
### SOAP client
|
|
135
|
+
|
|
136
|
+
| Class/Method | Description |
|
|
137
|
+
| --- | --- |
|
|
138
|
+
| `DgiiSoapClient` | Typed client for WSMovilDGII |
|
|
139
|
+
| `client.getContribuyente(rnc)` | Looks up taxpayer data by RNC |
|
|
140
|
+
| `client.getNCF(rnc, ncf)` | Validates a fiscal receipt against DGII |
|
|
141
|
+
|
|
142
|
+
### Bulk data
|
|
143
|
+
|
|
144
|
+
| Class/Method | Description |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| `downloadBulkFile(path)` | Downloads DGII\_RNC.zip to the given directory |
|
|
147
|
+
| `parseBulkFile(path)` | Parses the taxpayer TXT file |
|
|
148
|
+
|
|
149
|
+
## Architecture
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
153
|
+
β Your application β
|
|
154
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
155
|
+
β Layer 1: Offline validation β
|
|
156
|
+
β β RNC/Cedula check-digit β NCF/e-NCF format β
|
|
157
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
158
|
+
β Layer 2: SOAP client (WSMovilDGII) β
|
|
159
|
+
β β Taxpayer lookup β NCF validation β
|
|
160
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
161
|
+
β Layer 3: Bulk data (DGII_RNC.zip) β
|
|
162
|
+
β β Daily download β TXT parsing β
|
|
163
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Layer 1** is instant and works offline. **Layer 2** provides real-time data
|
|
167
|
+
for recently registered taxpayers. **Layer 3** is ideal for batch operations
|
|
168
|
+
where you need to look up thousands of RNCs quickly.
|
|
169
|
+
|
|
170
|
+
## Project status
|
|
171
|
+
|
|
172
|
+
- [x] Offline validation (RNC, Cedula, NCF, e-NCF)
|
|
173
|
+
- [ ] SOAP client (WSMovilDGII)
|
|
174
|
+
- [ ] Bulk data importer (DGII\_RNC.zip)
|
|
175
|
+
- [ ] CLI tool
|
|
176
|
+
|
|
177
|
+
## Security
|
|
178
|
+
|
|
179
|
+
To report vulnerabilities, see [SECURITY.md](./SECURITY.md).
|
|
180
|
+
|
|
181
|
+
## Contributing
|
|
182
|
+
|
|
183
|
+
Contributions are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
[MIT](./LICENSE)
|
|
188
|
+
|
|
189
|
+
## Disclaimer
|
|
190
|
+
|
|
191
|
+
This is an independent community library, not affiliated with or endorsed by
|
|
192
|
+
DGII. For critical tax data, always verify with a licensed tax professional.
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# dgii-ts
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dgii-ts)
|
|
4
|
+
[](https://github.com/franklinmdev/dgii-ts/actions/workflows/ci.yml)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
|
|
8
|
+
LibrerΓa TypeScript para validaciΓ³n e integraciΓ³n con la DGII de
|
|
9
|
+
RepΓΊblica Dominicana β RNC, cΓ©dula, NCF, e-NCF.
|
|
10
|
+
|
|
11
|
+
[πΊπΈ English](./README.en.md)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ΒΏPor quΓ©?
|
|
16
|
+
|
|
17
|
+
La DirecciΓ³n General de Impuestos Internos (DGII) no ofrece un API REST
|
|
18
|
+
pΓΊblico para consultas bΓ‘sicas de RNC o NCF. Los desarrolladores dominicanos
|
|
19
|
+
dependen de scrapers frΓ‘giles que parsean pΓ‘ginas ASP.NET con ViewState β y
|
|
20
|
+
esas pΓ‘ginas han cambiado de URL al menos tres veces, rompiendo cada integraciΓ³n
|
|
21
|
+
existente.
|
|
22
|
+
|
|
23
|
+
**dgii-ts** resuelve esto con un enfoque de tres capas diseΓ±ado para
|
|
24
|
+
resiliencia:
|
|
25
|
+
|
|
26
|
+
1. **ValidaciΓ³n offline** β nunca falla, cero llamadas de red
|
|
27
|
+
2. **Cliente SOAP** β consultas en tiempo real contra el servicio WSMovilDGII
|
|
28
|
+
3. **Datos masivos** β importaciΓ³n del archivo diario DGII\_RNC.zip
|
|
29
|
+
|
|
30
|
+
## CaracterΓsticas
|
|
31
|
+
|
|
32
|
+
### ValidaciΓ³n offline
|
|
33
|
+
|
|
34
|
+
ValidaciΓ³n algorΓtmica de dΓgitos verificadores para RNC (9 dΓgitos), cΓ©dula
|
|
35
|
+
(11 dΓgitos), NCF (serie B) y e-NCF (serie E). Sin dependencias de red, sin
|
|
36
|
+
puntos de fallo externos. Incluye whitelists de 578 cΓ©dulas y 23 RNCs
|
|
37
|
+
(fuente: [python-stdnum](https://github.com/arthurdejong/python-stdnum)) que
|
|
38
|
+
pasan validaciΓ³n aunque no cumplan el algoritmo de dΓgito verificador.
|
|
39
|
+
|
|
40
|
+
### Cliente SOAP (WSMovilDGII)
|
|
41
|
+
|
|
42
|
+
Wrapper tipado alrededor del servicio SOAP de la DGII para consultas de
|
|
43
|
+
contribuyentes (`GetContribuyentes`) y validaciΓ³n de comprobantes fiscales
|
|
44
|
+
(`GetNCF`). Incluye tipos TypeScript completos para todas las respuestas.
|
|
45
|
+
|
|
46
|
+
### Importador de datos masivos
|
|
47
|
+
|
|
48
|
+
Descarga y parseo del archivo ZIP diario de contribuyentes que publica la DGII
|
|
49
|
+
(`DGII_RNC.zip`). Ideal para operaciones en lote y bΓΊsquedas locales rΓ‘pidas.
|
|
50
|
+
|
|
51
|
+
## InstalaciΓ³n
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install dgii-ts
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm add dgii-ts
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
yarn add dgii-ts
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Uso rΓ‘pido
|
|
66
|
+
|
|
67
|
+
### Validar un RNC
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { validateRnc } from 'dgii-ts';
|
|
71
|
+
|
|
72
|
+
const result = validateRnc('131098193');
|
|
73
|
+
// { valid: true, formatted: '1-31-09819-3' }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Validar una cΓ©dula
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { validateCedula } from 'dgii-ts';
|
|
80
|
+
|
|
81
|
+
const result = validateCedula('00114272360');
|
|
82
|
+
// { valid: true, formatted: '001-1427236-0' }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Validar un NCF
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { validateNcf } from 'dgii-ts';
|
|
89
|
+
|
|
90
|
+
const result = validateNcf('B0100000001');
|
|
91
|
+
// { valid: true, type: 'CREDITO_FISCAL', serie: 'B01' }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Validar un e-NCF
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { validateEcf } from 'dgii-ts';
|
|
98
|
+
|
|
99
|
+
const result = validateEcf('E310000000001');
|
|
100
|
+
// { valid: true, type: 'CREDITO_FISCAL_ELECTRONICA', serie: 'E31' }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Importar solo validadores (tree-shaking)
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { validateRnc } from 'dgii-ts/validators';
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Los submΓ³dulos disponibles son `dgii-ts/validators`, `dgii-ts/soap` y
|
|
110
|
+
`dgii-ts/bulk`.
|
|
111
|
+
|
|
112
|
+
### Consultar contribuyente (SOAP) β *pendiente*
|
|
113
|
+
|
|
114
|
+
> **Nota:** El cliente SOAP aΓΊn no estΓ‘ implementado. La interfaz estΓ‘ definida
|
|
115
|
+
> y estarΓ‘ disponible en una futura versiΓ³n.
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { DgiiSoapClient } from 'dgii-ts';
|
|
119
|
+
|
|
120
|
+
const client = new DgiiSoapClient();
|
|
121
|
+
const result = await client.getContribuyente('131098193');
|
|
122
|
+
// { rnc: '131098193', nombre: '...', estado: '...', ... }
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Referencia del API
|
|
126
|
+
|
|
127
|
+
### Validadores
|
|
128
|
+
|
|
129
|
+
| FunciΓ³n | DescripciΓ³n |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `validateRnc(value)` | Valida RNC de 9 dΓgitos con dΓgito verificador |
|
|
132
|
+
| `validateCedula(value)` | Valida cΓ©dula de 11 dΓgitos con dΓgito verificador |
|
|
133
|
+
| `validateNcf(value)` | Valida formato y tipo de NCF (serie B) |
|
|
134
|
+
| `validateEcf(value)` | Valida formato y tipo de e-NCF (serie E) |
|
|
135
|
+
|
|
136
|
+
### Cliente SOAP
|
|
137
|
+
|
|
138
|
+
| Clase/MΓ©todo | DescripciΓ³n |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| `DgiiSoapClient` | Cliente tipado para WSMovilDGII |
|
|
141
|
+
| `client.getContribuyente(rnc)` | Consulta datos de un contribuyente por RNC |
|
|
142
|
+
| `client.getNCF(rnc, ncf)` | Valida un comprobante fiscal contra la DGII |
|
|
143
|
+
|
|
144
|
+
### Datos masivos
|
|
145
|
+
|
|
146
|
+
| Clase/MΓ©todo | DescripciΓ³n |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `downloadBulkFile(path)` | Descarga DGII\_RNC.zip al directorio especificado |
|
|
149
|
+
| `parseBulkFile(path)` | Parsea el archivo TXT de contribuyentes |
|
|
150
|
+
|
|
151
|
+
## Arquitectura
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
155
|
+
β Tu aplicaciΓ³n β
|
|
156
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
157
|
+
β Capa 1: ValidaciΓ³n offline β
|
|
158
|
+
β β Check-digit RNC/CΓ©dula β Formato NCF/e-NCF β
|
|
159
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
160
|
+
β Capa 2: Cliente SOAP (WSMovilDGII) β
|
|
161
|
+
β β Consulta contribuyentes β ValidaciΓ³n NCF β
|
|
162
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
163
|
+
β Capa 3: Datos masivos (DGII_RNC.zip) β
|
|
164
|
+
β β Descarga diaria β Parseo TXT β
|
|
165
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
La **capa 1** es instantΓ‘nea y funciona sin conexiΓ³n. La **capa 2** ofrece
|
|
169
|
+
datos en tiempo real para contribuyentes reciΓ©n registrados. La **capa 3** es
|
|
170
|
+
ideal para operaciones en lote donde necesitas buscar miles de RNC rΓ‘pidamente.
|
|
171
|
+
|
|
172
|
+
## Estado del proyecto
|
|
173
|
+
|
|
174
|
+
- [x] ValidaciΓ³n offline (RNC, cΓ©dula, NCF, e-NCF)
|
|
175
|
+
- [ ] Cliente SOAP WSMovilDGII
|
|
176
|
+
- [ ] Importador DGII\_RNC.zip
|
|
177
|
+
- [ ] Herramienta CLI
|
|
178
|
+
|
|
179
|
+
## Seguridad
|
|
180
|
+
|
|
181
|
+
Para reportar vulnerabilidades, consulta [SECURITY.md](./SECURITY.md).
|
|
182
|
+
|
|
183
|
+
## Contribuciones
|
|
184
|
+
|
|
185
|
+
Las contribuciones son bienvenidas. Consulta [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
186
|
+
para mΓ‘s detalles.
|
|
187
|
+
|
|
188
|
+
## Licencia
|
|
189
|
+
|
|
190
|
+
[MIT](./LICENSE)
|
|
191
|
+
|
|
192
|
+
## Nota
|
|
193
|
+
|
|
194
|
+
Esta es una librerΓa comunitaria independiente, no estΓ‘ afiliada ni respaldada
|
|
195
|
+
por la DGII. Para datos fiscales crΓticos, verifica siempre con un profesional
|
|
196
|
+
contable autorizado.
|
package/dist/bulk.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkFZ6QDTC4cjs = require('./chunk-FZ6QDTC4.cjs');
|
|
6
|
+
require('./chunk-QH4BK5X3.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.DGII_BULK_URL = _chunkFZ6QDTC4cjs.DGII_BULK_URL; exports.downloadBulkFile = _chunkFZ6QDTC4cjs.downloadBulkFile; exports.parseBulkFile = _chunkFZ6QDTC4cjs.parseBulkFile;
|
package/dist/bulk.d.cts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { B as BulkContribuyente } from './index-CS-7YY2y.cjs';
|
|
2
|
+
|
|
3
|
+
interface DownloadOptions {
|
|
4
|
+
/** Directorio de destino para el archivo ZIP */
|
|
5
|
+
outputDir: string;
|
|
6
|
+
/** Tiempo de espera en milisegundos (por defecto: 60000) */
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
interface ParseOptions {
|
|
10
|
+
/** Ruta al archivo TXT extraΓdo del ZIP */
|
|
11
|
+
filePath: string;
|
|
12
|
+
}
|
|
13
|
+
declare const DGII_BULK_URL: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Descarga el archivo masivo DGII_RNC.zip desde el portal de la DGII.
|
|
17
|
+
*
|
|
18
|
+
* @returns Ruta absoluta al archivo ZIP descargado
|
|
19
|
+
*/
|
|
20
|
+
declare function downloadBulkFile(options: DownloadOptions): Promise<string>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Parsea el archivo TXT de contribuyentes extraido de DGII_RNC.zip.
|
|
24
|
+
*
|
|
25
|
+
* El archivo usa delimitador pipe (|) con 9 columnas.
|
|
26
|
+
* Los registros pueden tener espacios dobles que se limpian.
|
|
27
|
+
*/
|
|
28
|
+
declare function parseBulkFile(options: ParseOptions): Promise<BulkContribuyente[]>;
|
|
29
|
+
|
|
30
|
+
export { BulkContribuyente, DGII_BULK_URL, type DownloadOptions, type ParseOptions, downloadBulkFile, parseBulkFile };
|
package/dist/bulk.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { B as BulkContribuyente } from './index-CS-7YY2y.js';
|
|
2
|
+
|
|
3
|
+
interface DownloadOptions {
|
|
4
|
+
/** Directorio de destino para el archivo ZIP */
|
|
5
|
+
outputDir: string;
|
|
6
|
+
/** Tiempo de espera en milisegundos (por defecto: 60000) */
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
interface ParseOptions {
|
|
10
|
+
/** Ruta al archivo TXT extraΓdo del ZIP */
|
|
11
|
+
filePath: string;
|
|
12
|
+
}
|
|
13
|
+
declare const DGII_BULK_URL: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Descarga el archivo masivo DGII_RNC.zip desde el portal de la DGII.
|
|
17
|
+
*
|
|
18
|
+
* @returns Ruta absoluta al archivo ZIP descargado
|
|
19
|
+
*/
|
|
20
|
+
declare function downloadBulkFile(options: DownloadOptions): Promise<string>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Parsea el archivo TXT de contribuyentes extraido de DGII_RNC.zip.
|
|
24
|
+
*
|
|
25
|
+
* El archivo usa delimitador pipe (|) con 9 columnas.
|
|
26
|
+
* Los registros pueden tener espacios dobles que se limpian.
|
|
27
|
+
*/
|
|
28
|
+
declare function parseBulkFile(options: ParseOptions): Promise<BulkContribuyente[]>;
|
|
29
|
+
|
|
30
|
+
export { BulkContribuyente, DGII_BULK_URL, type DownloadOptions, type ParseOptions, downloadBulkFile, parseBulkFile };
|
package/dist/bulk.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|