dgii-ts 0.1.2 → 0.1.3

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 (43) hide show
  1. package/README.en.md +4 -0
  2. package/README.md +4 -0
  3. package/dist/bulk.cjs +8 -2
  4. package/dist/bulk.d.cts +48 -5
  5. package/dist/bulk.d.ts +48 -5
  6. package/dist/bulk.js +7 -1
  7. package/dist/{chunk-BQPH3JDZ.cjs → chunk-AML7LZBU.cjs} +12 -12
  8. package/dist/{chunk-JBKAE66C.cjs → chunk-DLB5RJ7E.cjs} +16 -16
  9. package/dist/{chunk-DMGDJEUY.js → chunk-IRQX4WNQ.js} +8 -1
  10. package/dist/{chunk-ROJUYPIK.js → chunk-KJXLES3I.js} +3 -3
  11. package/dist/{chunk-53A7IG4Y.js → chunk-KW4ZV6FJ.js} +1 -1
  12. package/dist/{chunk-5FZ4F5UR.cjs → chunk-MUAPXS3H.cjs} +12 -12
  13. package/dist/{chunk-7RJWFPCZ.cjs → chunk-NASWEFHN.cjs} +8 -1
  14. package/dist/{chunk-43LGK4YP.js → chunk-QTN5ZT4P.js} +2 -2
  15. package/dist/{chunk-FZ6QDTC4.cjs → chunk-VIZWYFHP.cjs} +62 -11
  16. package/dist/{chunk-WY6V4Y7S.cjs → chunk-WMFHPNFP.cjs} +3 -3
  17. package/dist/{chunk-HRRYZUKI.js → chunk-YTX4QOLE.js} +2 -2
  18. package/dist/{chunk-KIS7MVIW.js → chunk-Z72T6CZG.js} +61 -10
  19. package/dist/client.cjs +6 -6
  20. package/dist/client.d.cts +1 -1
  21. package/dist/client.d.ts +1 -1
  22. package/dist/client.js +5 -5
  23. package/dist/errors.cjs +4 -2
  24. package/dist/errors.d.cts +10 -1
  25. package/dist/errors.d.ts +10 -1
  26. package/dist/errors.js +3 -1
  27. package/dist/{index-BE6Wfozd.d.ts → index-KNOaUG34.d.cts} +7 -0
  28. package/dist/{index-BE6Wfozd.d.cts → index-KNOaUG34.d.ts} +7 -0
  29. package/dist/index.cjs +11 -7
  30. package/dist/index.d.cts +3 -3
  31. package/dist/index.d.ts +3 -3
  32. package/dist/index.js +10 -6
  33. package/dist/scraping.cjs +4 -4
  34. package/dist/scraping.d.cts +1 -1
  35. package/dist/scraping.d.ts +1 -1
  36. package/dist/scraping.js +3 -3
  37. package/dist/soap.cjs +4 -4
  38. package/dist/soap.d.cts +1 -1
  39. package/dist/soap.d.ts +1 -1
  40. package/dist/soap.js +3 -3
  41. package/dist/validators.d.cts +1 -1
  42. package/dist/validators.d.ts +1 -1
  43. package/package.json +1 -1
@@ -2,6 +2,9 @@
2
2
 
3
3
  var _chunkQH4BK5X3cjs = require('./chunk-QH4BK5X3.cjs');
4
4
 
5
+
6
+ var _chunkNASWEFHNcjs = require('./chunk-NASWEFHN.cjs');
7
+
5
8
  // src/bulk/downloader.ts
6
9
  var _https = require('https');
7
10
  var _fs = require('fs');
@@ -10,6 +13,14 @@ var _path = require('path');
10
13
 
11
14
  // src/bulk/types.ts
12
15
  var DGII_BULK_URL = "https://dgii.gov.do/app/WebApps/Consultas/RNC/DGII_RNC.zip";
16
+ var DGII_ESTADOS = /* @__PURE__ */ Object.freeze([
17
+ "ACTIVO",
18
+ "SUSPENDIDO",
19
+ "DADO DE BAJA",
20
+ "CESE TEMPORAL",
21
+ "ANULADO",
22
+ "RECHAZADO"
23
+ ]);
13
24
 
14
25
  // src/bulk/downloader.ts
15
26
  async function downloadBulkFile(options) {
@@ -68,26 +79,65 @@ function handleResponse(response, destPath, resolve, reject) {
68
79
  // src/bulk/parser.ts
69
80
 
70
81
  var _readline = require('readline');
82
+ var KNOWN_ESTADOS = new Set(DGII_ESTADOS);
83
+ var EXPECTED_COLUMNS = 11;
84
+ var COLUMN = {
85
+ rnc: 0,
86
+ nombre: 1,
87
+ nombreComercial: 2,
88
+ actividad: 3,
89
+ fechaConstitucion: 8,
90
+ estado: 9,
91
+ regimen: 10
92
+ };
93
+ var ESTADO_SAMPLE_SIZE = 1e3;
94
+ var ESTADO_MIN_RECOGNIZED_RATIO = 0.5;
95
+ var UTF8_BOM = "\uFEFF";
96
+ var UTF8_BOM_AS_LATIN1 = "\xEF\xBB\xBF";
97
+ function stripBom(line) {
98
+ if (line.startsWith(UTF8_BOM)) return line.slice(UTF8_BOM.length);
99
+ if (line.startsWith(UTF8_BOM_AS_LATIN1)) {
100
+ return line.slice(UTF8_BOM_AS_LATIN1.length);
101
+ }
102
+ return line;
103
+ }
71
104
  async function parseBulkFile(options) {
72
105
  const results = [];
106
+ let dataLines = 0;
107
+ let firstLine = true;
73
108
  const rl = _readline.createInterface.call(void 0, {
74
- input: _fs.createReadStream.call(void 0, options.filePath, { encoding: "utf-8" }),
109
+ input: _fs.createReadStream.call(void 0, options.filePath, {
110
+ encoding: _nullishCoalesce(options.encoding, () => ( "latin1"))
111
+ }),
75
112
  crlfDelay: Infinity
76
113
  });
77
- for await (const line of rl) {
114
+ for await (const rawLine of rl) {
115
+ const line = firstLine ? stripBom(rawLine) : rawLine;
116
+ firstLine = false;
78
117
  if (line.trim() === "") continue;
118
+ dataLines += 1;
79
119
  const fields = line.split("|");
80
- if (fields.length < 7) continue;
120
+ if (fields.length !== EXPECTED_COLUMNS) continue;
81
121
  results.push({
82
- rnc: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[0], () => ( ""))),
83
- nombre: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[1], () => ( ""))),
84
- nombreComercial: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[2], () => ( ""))),
85
- actividad: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[6], () => ( ""))),
86
- estado: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[5], () => ( ""))),
87
- regimen: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[4], () => ( ""))),
88
- fechaConstitucion: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, _nullishCoalesce(fields[7], () => ( "")))
122
+ rnc: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.rnc]),
123
+ nombre: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.nombre]),
124
+ nombreComercial: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.nombreComercial]),
125
+ actividad: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.actividad]),
126
+ fechaConstitucion: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.fechaConstitucion]),
127
+ estado: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.estado]).toUpperCase(),
128
+ regimen: _chunkQH4BK5X3cjs.collapseSpaces.call(void 0, fields[COLUMN.regimen])
89
129
  });
90
130
  }
131
+ if (dataLines > 0) {
132
+ const sample = results.slice(0, ESTADO_SAMPLE_SIZE);
133
+ const reconocidos = sample.filter((r) => KNOWN_ESTADOS.has(r.estado));
134
+ const ratio = sample.length === 0 ? 0 : reconocidos.length / sample.length;
135
+ if (ratio < ESTADO_MIN_RECOGNIZED_RATIO) {
136
+ throw new (0, _chunkNASWEFHNcjs.BulkFormatError)(
137
+ `El archivo masivo de la DGII no coincide con el layout esperado de 11 columnas: la mayor\xEDa de las filas muestreadas no trae un \`estado\` reconocido (${DGII_ESTADOS.join(", ")}). \xBFCambi\xF3 el formato del archivo?`
138
+ );
139
+ }
140
+ }
91
141
  return results;
92
142
  }
93
143
 
@@ -95,4 +145,5 @@ async function parseBulkFile(options) {
95
145
 
96
146
 
97
147
 
98
- exports.DGII_BULK_URL = DGII_BULK_URL; exports.downloadBulkFile = downloadBulkFile; exports.parseBulkFile = parseBulkFile;
148
+
149
+ exports.DGII_BULK_URL = DGII_BULK_URL; exports.DGII_ESTADOS = DGII_ESTADOS; exports.downloadBulkFile = downloadBulkFile; exports.parseBulkFile = parseBulkFile;
@@ -1,18 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
3
+ var _chunkNASWEFHNcjs = require('./chunk-NASWEFHN.cjs');
4
4
 
5
5
  // src/utils/fetch-error.ts
6
6
  function wrapFetchError(error, timeoutMs) {
7
7
  const name = error.name;
8
8
  const causeName = _optionalChain([error, 'access', _ => _.cause, 'optionalAccess', _2 => _2.name]);
9
9
  if (name === "TimeoutError" || causeName === "TimeoutError" || name === "AbortError" || causeName === "AbortError") {
10
- return new (0, _chunk7RJWFPCZcjs.DgiiConnectionError)(
10
+ return new (0, _chunkNASWEFHNcjs.DgiiConnectionError)(
11
11
  `Timeout de ${timeoutMs}ms excedido al conectar con la DGII`,
12
12
  { cause: error }
13
13
  );
14
14
  }
15
- return new (0, _chunk7RJWFPCZcjs.DgiiConnectionError)(
15
+ return new (0, _chunkNASWEFHNcjs.DgiiConnectionError)(
16
16
  "Error de conexi\xF3n con el servicio de la DGII",
17
17
  { cause: error }
18
18
  );
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  wrapFetchError
3
- } from "./chunk-53A7IG4Y.js";
3
+ } from "./chunk-KW4ZV6FJ.js";
4
4
  import {
5
5
  collapseSpaces,
6
6
  stripNonDigits
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  DgiiNotFoundError,
10
10
  DgiiServiceError
11
- } from "./chunk-DMGDJEUY.js";
11
+ } from "./chunk-IRQX4WNQ.js";
12
12
 
13
13
  // src/scraping/endpoints.ts
14
14
  var DGII_RNC_URL = "https://dgii.gov.do/app/WebApps/ConsultasWeb2/ConsultasWeb/consultas/rnc.aspx";
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  collapseSpaces
3
3
  } from "./chunk-D26S6EXD.js";
4
+ import {
5
+ BulkFormatError
6
+ } from "./chunk-IRQX4WNQ.js";
4
7
 
5
8
  // src/bulk/downloader.ts
6
9
  import { get } from "https";
@@ -10,6 +13,14 @@ import { join } from "path";
10
13
 
11
14
  // src/bulk/types.ts
12
15
  var DGII_BULK_URL = "https://dgii.gov.do/app/WebApps/Consultas/RNC/DGII_RNC.zip";
16
+ var DGII_ESTADOS = /* @__PURE__ */ Object.freeze([
17
+ "ACTIVO",
18
+ "SUSPENDIDO",
19
+ "DADO DE BAJA",
20
+ "CESE TEMPORAL",
21
+ "ANULADO",
22
+ "RECHAZADO"
23
+ ]);
13
24
 
14
25
  // src/bulk/downloader.ts
15
26
  async function downloadBulkFile(options) {
@@ -68,31 +79,71 @@ function handleResponse(response, destPath, resolve, reject) {
68
79
  // src/bulk/parser.ts
69
80
  import { createReadStream } from "fs";
70
81
  import { createInterface } from "readline";
82
+ var KNOWN_ESTADOS = new Set(DGII_ESTADOS);
83
+ var EXPECTED_COLUMNS = 11;
84
+ var COLUMN = {
85
+ rnc: 0,
86
+ nombre: 1,
87
+ nombreComercial: 2,
88
+ actividad: 3,
89
+ fechaConstitucion: 8,
90
+ estado: 9,
91
+ regimen: 10
92
+ };
93
+ var ESTADO_SAMPLE_SIZE = 1e3;
94
+ var ESTADO_MIN_RECOGNIZED_RATIO = 0.5;
95
+ var UTF8_BOM = "\uFEFF";
96
+ var UTF8_BOM_AS_LATIN1 = "\xEF\xBB\xBF";
97
+ function stripBom(line) {
98
+ if (line.startsWith(UTF8_BOM)) return line.slice(UTF8_BOM.length);
99
+ if (line.startsWith(UTF8_BOM_AS_LATIN1)) {
100
+ return line.slice(UTF8_BOM_AS_LATIN1.length);
101
+ }
102
+ return line;
103
+ }
71
104
  async function parseBulkFile(options) {
72
105
  const results = [];
106
+ let dataLines = 0;
107
+ let firstLine = true;
73
108
  const rl = createInterface({
74
- input: createReadStream(options.filePath, { encoding: "utf-8" }),
109
+ input: createReadStream(options.filePath, {
110
+ encoding: options.encoding ?? "latin1"
111
+ }),
75
112
  crlfDelay: Infinity
76
113
  });
77
- for await (const line of rl) {
114
+ for await (const rawLine of rl) {
115
+ const line = firstLine ? stripBom(rawLine) : rawLine;
116
+ firstLine = false;
78
117
  if (line.trim() === "") continue;
118
+ dataLines += 1;
79
119
  const fields = line.split("|");
80
- if (fields.length < 7) continue;
120
+ if (fields.length !== EXPECTED_COLUMNS) continue;
81
121
  results.push({
82
- rnc: collapseSpaces(fields[0] ?? ""),
83
- nombre: collapseSpaces(fields[1] ?? ""),
84
- nombreComercial: collapseSpaces(fields[2] ?? ""),
85
- actividad: collapseSpaces(fields[6] ?? ""),
86
- estado: collapseSpaces(fields[5] ?? ""),
87
- regimen: collapseSpaces(fields[4] ?? ""),
88
- fechaConstitucion: collapseSpaces(fields[7] ?? "")
122
+ rnc: collapseSpaces(fields[COLUMN.rnc]),
123
+ nombre: collapseSpaces(fields[COLUMN.nombre]),
124
+ nombreComercial: collapseSpaces(fields[COLUMN.nombreComercial]),
125
+ actividad: collapseSpaces(fields[COLUMN.actividad]),
126
+ fechaConstitucion: collapseSpaces(fields[COLUMN.fechaConstitucion]),
127
+ estado: collapseSpaces(fields[COLUMN.estado]).toUpperCase(),
128
+ regimen: collapseSpaces(fields[COLUMN.regimen])
89
129
  });
90
130
  }
131
+ if (dataLines > 0) {
132
+ const sample = results.slice(0, ESTADO_SAMPLE_SIZE);
133
+ const reconocidos = sample.filter((r) => KNOWN_ESTADOS.has(r.estado));
134
+ const ratio = sample.length === 0 ? 0 : reconocidos.length / sample.length;
135
+ if (ratio < ESTADO_MIN_RECOGNIZED_RATIO) {
136
+ throw new BulkFormatError(
137
+ `El archivo masivo de la DGII no coincide con el layout esperado de 11 columnas: la mayor\xEDa de las filas muestreadas no trae un \`estado\` reconocido (${DGII_ESTADOS.join(", ")}). \xBFCambi\xF3 el formato del archivo?`
138
+ );
139
+ }
140
+ }
91
141
  return results;
92
142
  }
93
143
 
94
144
  export {
95
145
  DGII_BULK_URL,
146
+ DGII_ESTADOS,
96
147
  downloadBulkFile,
97
148
  parseBulkFile
98
149
  };
package/dist/client.cjs CHANGED
@@ -3,15 +3,15 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk5FZ4F5URcjs = require('./chunk-5FZ4F5UR.cjs');
7
- require('./chunk-JBKAE66C.cjs');
8
- require('./chunk-BQPH3JDZ.cjs');
9
- require('./chunk-WY6V4Y7S.cjs');
6
+ var _chunkMUAPXS3Hcjs = require('./chunk-MUAPXS3H.cjs');
7
+ require('./chunk-DLB5RJ7E.cjs');
8
+ require('./chunk-AML7LZBU.cjs');
9
+ require('./chunk-WMFHPNFP.cjs');
10
10
  require('./chunk-QH4BK5X3.cjs');
11
- require('./chunk-7RJWFPCZ.cjs');
11
+ require('./chunk-NASWEFHN.cjs');
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.ConsecutiveBreaker = _chunk5FZ4F5URcjs.ConsecutiveBreaker; exports.DgiiClient = _chunk5FZ4F5URcjs.DgiiClient; exports.isRetryableError = _chunk5FZ4F5URcjs.isRetryableError; exports.withRetry = _chunk5FZ4F5URcjs.withRetry;
17
+ exports.ConsecutiveBreaker = _chunkMUAPXS3Hcjs.ConsecutiveBreaker; exports.DgiiClient = _chunkMUAPXS3Hcjs.DgiiClient; exports.isRetryableError = _chunkMUAPXS3Hcjs.isRetryableError; exports.withRetry = _chunkMUAPXS3Hcjs.withRetry;
package/dist/client.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Contribuyente, N as NcfQueryResult } from './index-BE6Wfozd.cjs';
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-KNOaUG34.cjs';
2
2
 
3
3
  interface RetryOptions {
4
4
  /** Número máximo de reintentos (por defecto: 2) */
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Contribuyente, N as NcfQueryResult } from './index-BE6Wfozd.js';
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-KNOaUG34.js';
2
2
 
3
3
  interface RetryOptions {
4
4
  /** Número máximo de reintentos (por defecto: 2) */
package/dist/client.js CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  DgiiClient,
4
4
  isRetryableError,
5
5
  withRetry
6
- } from "./chunk-ROJUYPIK.js";
7
- import "./chunk-43LGK4YP.js";
8
- import "./chunk-HRRYZUKI.js";
9
- import "./chunk-53A7IG4Y.js";
6
+ } from "./chunk-KJXLES3I.js";
7
+ import "./chunk-QTN5ZT4P.js";
8
+ import "./chunk-YTX4QOLE.js";
9
+ import "./chunk-KW4ZV6FJ.js";
10
10
  import "./chunk-D26S6EXD.js";
11
- import "./chunk-DMGDJEUY.js";
11
+ import "./chunk-IRQX4WNQ.js";
12
12
  export {
13
13
  ConsecutiveBreaker,
14
14
  DgiiClient,
package/dist/errors.cjs CHANGED
@@ -4,11 +4,13 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
8
7
 
8
+ var _chunkNASWEFHNcjs = require('./chunk-NASWEFHN.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
- exports.AllStrategiesFailedError = _chunk7RJWFPCZcjs.AllStrategiesFailedError; exports.DgiiConnectionError = _chunk7RJWFPCZcjs.DgiiConnectionError; exports.DgiiError = _chunk7RJWFPCZcjs.DgiiError; exports.DgiiNotFoundError = _chunk7RJWFPCZcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunk7RJWFPCZcjs.DgiiServiceError;
14
+
15
+
16
+ exports.AllStrategiesFailedError = _chunkNASWEFHNcjs.AllStrategiesFailedError; exports.BulkFormatError = _chunkNASWEFHNcjs.BulkFormatError; exports.DgiiConnectionError = _chunkNASWEFHNcjs.DgiiConnectionError; exports.DgiiError = _chunkNASWEFHNcjs.DgiiError; exports.DgiiNotFoundError = _chunkNASWEFHNcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunkNASWEFHNcjs.DgiiServiceError;
package/dist/errors.d.cts CHANGED
@@ -36,5 +36,14 @@ declare class AllStrategiesFailedError extends DgiiError {
36
36
  readonly errors: ReadonlyArray<Error>;
37
37
  constructor(message: string, errors: ReadonlyArray<Error>);
38
38
  }
39
+ /**
40
+ * El archivo masivo (DGII_RNC.zip) no coincide con el layout esperado:
41
+ * cambió el número de columnas o la columna `estado` dejó de traer
42
+ * valores reconocidos. Se lanza para que un cambio de formato de la DGII
43
+ * falle de forma ruidosa en vez de devolver `estado` vacío en silencio.
44
+ */
45
+ declare class BulkFormatError extends DgiiError {
46
+ constructor(message: string);
47
+ }
39
48
 
40
- export { AllStrategiesFailedError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError };
49
+ export { AllStrategiesFailedError, BulkFormatError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError };
package/dist/errors.d.ts CHANGED
@@ -36,5 +36,14 @@ declare class AllStrategiesFailedError extends DgiiError {
36
36
  readonly errors: ReadonlyArray<Error>;
37
37
  constructor(message: string, errors: ReadonlyArray<Error>);
38
38
  }
39
+ /**
40
+ * El archivo masivo (DGII_RNC.zip) no coincide con el layout esperado:
41
+ * cambió el número de columnas o la columna `estado` dejó de traer
42
+ * valores reconocidos. Se lanza para que un cambio de formato de la DGII
43
+ * falle de forma ruidosa en vez de devolver `estado` vacío en silencio.
44
+ */
45
+ declare class BulkFormatError extends DgiiError {
46
+ constructor(message: string);
47
+ }
39
48
 
40
- export { AllStrategiesFailedError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError };
49
+ export { AllStrategiesFailedError, BulkFormatError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError };
package/dist/errors.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  AllStrategiesFailedError,
3
+ BulkFormatError,
3
4
  DgiiConnectionError,
4
5
  DgiiError,
5
6
  DgiiNotFoundError,
6
7
  DgiiServiceError
7
- } from "./chunk-DMGDJEUY.js";
8
+ } from "./chunk-IRQX4WNQ.js";
8
9
  export {
9
10
  AllStrategiesFailedError,
11
+ BulkFormatError,
10
12
  DgiiConnectionError,
11
13
  DgiiError,
12
14
  DgiiNotFoundError,
@@ -55,6 +55,13 @@ interface BulkContribuyente {
55
55
  nombre: string;
56
56
  nombreComercial: string;
57
57
  actividad: string;
58
+ /**
59
+ * Estado tal como lo trae el archivo masivo, normalizado a mayúsculas:
60
+ * uno de los valores de `DGII_ESTADOS` (ACTIVO, SUSPENDIDO, DADO DE
61
+ * BAJA, ...). Es un vocabulario más amplio que el `estado` binario
62
+ * (ACTIVO/INACTIVO) de {@link Contribuyente}, así que no son
63
+ * intercambiables al comparar entre fuentes.
64
+ */
58
65
  estado: string;
59
66
  regimen: string;
60
67
  fechaConstitucion: string;
@@ -55,6 +55,13 @@ interface BulkContribuyente {
55
55
  nombre: string;
56
56
  nombreComercial: string;
57
57
  actividad: string;
58
+ /**
59
+ * Estado tal como lo trae el archivo masivo, normalizado a mayúsculas:
60
+ * uno de los valores de `DGII_ESTADOS` (ACTIVO, SUSPENDIDO, DADO DE
61
+ * BAJA, ...). Es un vocabulario más amplio que el `estado` binario
62
+ * (ACTIVO/INACTIVO) de {@link Contribuyente}, así que no son
63
+ * intercambiables al comparar entre fuentes.
64
+ */
58
65
  estado: string;
59
66
  regimen: string;
60
67
  fechaConstitucion: string;
package/dist/index.cjs CHANGED
@@ -11,25 +11,26 @@ require('./chunk-QOSGH7F5.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkFZ6QDTC4cjs = require('./chunk-FZ6QDTC4.cjs');
14
+
15
+ var _chunkVIZWYFHPcjs = require('./chunk-VIZWYFHP.cjs');
15
16
  require('./chunk-2ST6QKHA.cjs');
16
17
 
17
18
 
18
19
 
19
20
 
20
21
 
21
- var _chunk5FZ4F5URcjs = require('./chunk-5FZ4F5UR.cjs');
22
+ var _chunkMUAPXS3Hcjs = require('./chunk-MUAPXS3H.cjs');
22
23
 
23
24
 
24
25
 
25
26
 
26
- var _chunkJBKAE66Ccjs = require('./chunk-JBKAE66C.cjs');
27
+ var _chunkDLB5RJ7Ecjs = require('./chunk-DLB5RJ7E.cjs');
27
28
 
28
29
 
29
30
 
30
31
 
31
- var _chunkBQPH3JDZcjs = require('./chunk-BQPH3JDZ.cjs');
32
- require('./chunk-WY6V4Y7S.cjs');
32
+ var _chunkAML7LZBUcjs = require('./chunk-AML7LZBU.cjs');
33
+ require('./chunk-WMFHPNFP.cjs');
33
34
  require('./chunk-QH4BK5X3.cjs');
34
35
 
35
36
 
@@ -37,7 +38,10 @@ require('./chunk-QH4BK5X3.cjs');
37
38
 
38
39
 
39
40
 
40
- var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
41
+
42
+ var _chunkNASWEFHNcjs = require('./chunk-NASWEFHN.cjs');
43
+
44
+
41
45
 
42
46
 
43
47
 
@@ -63,4 +67,4 @@ var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
63
67
 
64
68
 
65
69
 
66
- exports.AllStrategiesFailedError = _chunk7RJWFPCZcjs.AllStrategiesFailedError; exports.ConsecutiveBreaker = _chunk5FZ4F5URcjs.ConsecutiveBreaker; exports.DGII_BULK_URL = _chunkFZ6QDTC4cjs.DGII_BULK_URL; exports.DGII_NCF_URL = _chunkBQPH3JDZcjs.DGII_NCF_URL; exports.DGII_RNC_URL = _chunkBQPH3JDZcjs.DGII_RNC_URL; exports.DGII_SOAP_BASE_URL = _chunkJBKAE66Ccjs.DGII_SOAP_BASE_URL; exports.DgiiClient = _chunk5FZ4F5URcjs.DgiiClient; exports.DgiiConnectionError = _chunk7RJWFPCZcjs.DgiiConnectionError; exports.DgiiError = _chunk7RJWFPCZcjs.DgiiError; exports.DgiiNotFoundError = _chunk7RJWFPCZcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunk7RJWFPCZcjs.DgiiServiceError; exports.DgiiSoapClient = _chunkJBKAE66Ccjs.DgiiSoapClient; exports.ECF_TYPE_NAMES = _chunkSUSDEKIDcjs.ECF_TYPE_NAMES; exports.NCF_TYPE_NAMES = _chunkSUSDEKIDcjs.NCF_TYPE_NAMES; exports.SOAP_ACTIONS = _chunkJBKAE66Ccjs.SOAP_ACTIONS; exports.ScrapingClient = _chunkBQPH3JDZcjs.ScrapingClient; exports.downloadBulkFile = _chunkFZ6QDTC4cjs.downloadBulkFile; exports.isRetryableError = _chunk5FZ4F5URcjs.isRetryableError; exports.parseBulkFile = _chunkFZ6QDTC4cjs.parseBulkFile; exports.validateCedula = _chunkSUSDEKIDcjs.validateCedula; exports.validateEcf = _chunkSUSDEKIDcjs.validateEcf; exports.validateNcf = _chunkSUSDEKIDcjs.validateNcf; exports.validateRnc = _chunkSUSDEKIDcjs.validateRnc; exports.withRetry = _chunk5FZ4F5URcjs.withRetry;
70
+ exports.AllStrategiesFailedError = _chunkNASWEFHNcjs.AllStrategiesFailedError; exports.BulkFormatError = _chunkNASWEFHNcjs.BulkFormatError; exports.ConsecutiveBreaker = _chunkMUAPXS3Hcjs.ConsecutiveBreaker; exports.DGII_BULK_URL = _chunkVIZWYFHPcjs.DGII_BULK_URL; exports.DGII_ESTADOS = _chunkVIZWYFHPcjs.DGII_ESTADOS; exports.DGII_NCF_URL = _chunkAML7LZBUcjs.DGII_NCF_URL; exports.DGII_RNC_URL = _chunkAML7LZBUcjs.DGII_RNC_URL; exports.DGII_SOAP_BASE_URL = _chunkDLB5RJ7Ecjs.DGII_SOAP_BASE_URL; exports.DgiiClient = _chunkMUAPXS3Hcjs.DgiiClient; exports.DgiiConnectionError = _chunkNASWEFHNcjs.DgiiConnectionError; exports.DgiiError = _chunkNASWEFHNcjs.DgiiError; exports.DgiiNotFoundError = _chunkNASWEFHNcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunkNASWEFHNcjs.DgiiServiceError; exports.DgiiSoapClient = _chunkDLB5RJ7Ecjs.DgiiSoapClient; exports.ECF_TYPE_NAMES = _chunkSUSDEKIDcjs.ECF_TYPE_NAMES; exports.NCF_TYPE_NAMES = _chunkSUSDEKIDcjs.NCF_TYPE_NAMES; exports.SOAP_ACTIONS = _chunkDLB5RJ7Ecjs.SOAP_ACTIONS; exports.ScrapingClient = _chunkAML7LZBUcjs.ScrapingClient; exports.downloadBulkFile = _chunkVIZWYFHPcjs.downloadBulkFile; exports.isRetryableError = _chunkMUAPXS3Hcjs.isRetryableError; exports.parseBulkFile = _chunkVIZWYFHPcjs.parseBulkFile; exports.validateCedula = _chunkSUSDEKIDcjs.validateCedula; exports.validateEcf = _chunkSUSDEKIDcjs.validateEcf; exports.validateNcf = _chunkSUSDEKIDcjs.validateNcf; exports.validateRnc = _chunkSUSDEKIDcjs.validateRnc; exports.withRetry = _chunkMUAPXS3Hcjs.withRetry;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { ECF_TYPE_NAMES, NCF_TYPE_NAMES, validateCedula, validateEcf, validateNcf, validateRnc } from './validators.cjs';
2
2
  export { DGII_SOAP_BASE_URL, DgiiSoapClient, SOAP_ACTIONS, SoapClientOptions } from './soap.cjs';
3
- export { AllStrategiesFailedError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.cjs';
3
+ export { AllStrategiesFailedError, BulkFormatError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.cjs';
4
4
  export { DGII_NCF_URL, DGII_RNC_URL, ScrapingClient, ScrapingClientOptions } from './scraping.cjs';
5
5
  export { CircuitBreakerOptions, ClientOptions, ConsecutiveBreaker, DgiiClient, RetryOptions, isRetryableError, withRetry } from './client.cjs';
6
- export { DGII_BULK_URL, DownloadOptions, ParseOptions, downloadBulkFile, parseBulkFile } from './bulk.cjs';
7
- export { B as BulkContribuyente, C as Contribuyente, N as NcfQueryResult, a as NcfValidationResult, V as ValidationResult } from './index-BE6Wfozd.cjs';
6
+ export { DGII_BULK_URL, DGII_ESTADOS, DgiiEstado, DownloadOptions, ParseOptions, downloadBulkFile, parseBulkFile } from './bulk.cjs';
7
+ export { B as BulkContribuyente, C as Contribuyente, N as NcfQueryResult, a as NcfValidationResult, V as ValidationResult } from './index-KNOaUG34.cjs';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { ECF_TYPE_NAMES, NCF_TYPE_NAMES, validateCedula, validateEcf, validateNcf, validateRnc } from './validators.js';
2
2
  export { DGII_SOAP_BASE_URL, DgiiSoapClient, SOAP_ACTIONS, SoapClientOptions } from './soap.js';
3
- export { AllStrategiesFailedError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.js';
3
+ export { AllStrategiesFailedError, BulkFormatError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.js';
4
4
  export { DGII_NCF_URL, DGII_RNC_URL, ScrapingClient, ScrapingClientOptions } from './scraping.js';
5
5
  export { CircuitBreakerOptions, ClientOptions, ConsecutiveBreaker, DgiiClient, RetryOptions, isRetryableError, withRetry } from './client.js';
6
- export { DGII_BULK_URL, DownloadOptions, ParseOptions, downloadBulkFile, parseBulkFile } from './bulk.js';
7
- export { B as BulkContribuyente, C as Contribuyente, N as NcfQueryResult, a as NcfValidationResult, V as ValidationResult } from './index-BE6Wfozd.js';
6
+ export { DGII_BULK_URL, DGII_ESTADOS, DgiiEstado, DownloadOptions, ParseOptions, downloadBulkFile, parseBulkFile } from './bulk.js';
7
+ export { B as BulkContribuyente, C as Contribuyente, N as NcfQueryResult, a as NcfValidationResult, V as ValidationResult } from './index-KNOaUG34.js';
package/dist/index.js CHANGED
@@ -9,39 +9,43 @@ import {
9
9
  import "./chunk-ERBXSS64.js";
10
10
  import {
11
11
  DGII_BULK_URL,
12
+ DGII_ESTADOS,
12
13
  downloadBulkFile,
13
14
  parseBulkFile
14
- } from "./chunk-KIS7MVIW.js";
15
+ } from "./chunk-Z72T6CZG.js";
15
16
  import "./chunk-EZKSB553.js";
16
17
  import {
17
18
  ConsecutiveBreaker,
18
19
  DgiiClient,
19
20
  isRetryableError,
20
21
  withRetry
21
- } from "./chunk-ROJUYPIK.js";
22
+ } from "./chunk-KJXLES3I.js";
22
23
  import {
23
24
  DGII_SOAP_BASE_URL,
24
25
  DgiiSoapClient,
25
26
  SOAP_ACTIONS
26
- } from "./chunk-43LGK4YP.js";
27
+ } from "./chunk-QTN5ZT4P.js";
27
28
  import {
28
29
  DGII_NCF_URL,
29
30
  DGII_RNC_URL,
30
31
  ScrapingClient
31
- } from "./chunk-HRRYZUKI.js";
32
- import "./chunk-53A7IG4Y.js";
32
+ } from "./chunk-YTX4QOLE.js";
33
+ import "./chunk-KW4ZV6FJ.js";
33
34
  import "./chunk-D26S6EXD.js";
34
35
  import {
35
36
  AllStrategiesFailedError,
37
+ BulkFormatError,
36
38
  DgiiConnectionError,
37
39
  DgiiError,
38
40
  DgiiNotFoundError,
39
41
  DgiiServiceError
40
- } from "./chunk-DMGDJEUY.js";
42
+ } from "./chunk-IRQX4WNQ.js";
41
43
  export {
42
44
  AllStrategiesFailedError,
45
+ BulkFormatError,
43
46
  ConsecutiveBreaker,
44
47
  DGII_BULK_URL,
48
+ DGII_ESTADOS,
45
49
  DGII_NCF_URL,
46
50
  DGII_RNC_URL,
47
51
  DGII_SOAP_BASE_URL,
package/dist/scraping.cjs CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkBQPH3JDZcjs = require('./chunk-BQPH3JDZ.cjs');
8
- require('./chunk-WY6V4Y7S.cjs');
7
+ var _chunkAML7LZBUcjs = require('./chunk-AML7LZBU.cjs');
8
+ require('./chunk-WMFHPNFP.cjs');
9
9
  require('./chunk-QH4BK5X3.cjs');
10
- require('./chunk-7RJWFPCZ.cjs');
10
+ require('./chunk-NASWEFHN.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
- exports.DGII_NCF_URL = _chunkBQPH3JDZcjs.DGII_NCF_URL; exports.DGII_RNC_URL = _chunkBQPH3JDZcjs.DGII_RNC_URL; exports.FORM_FIELDS = _chunkBQPH3JDZcjs.FORM_FIELDS; exports.ScrapingClient = _chunkBQPH3JDZcjs.ScrapingClient;
16
+ exports.DGII_NCF_URL = _chunkAML7LZBUcjs.DGII_NCF_URL; exports.DGII_RNC_URL = _chunkAML7LZBUcjs.DGII_RNC_URL; exports.FORM_FIELDS = _chunkAML7LZBUcjs.FORM_FIELDS; exports.ScrapingClient = _chunkAML7LZBUcjs.ScrapingClient;
@@ -1,4 +1,4 @@
1
- import { C as Contribuyente, N as NcfQueryResult } from './index-BE6Wfozd.cjs';
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-KNOaUG34.cjs';
2
2
 
3
3
  interface ScrapingClientOptions {
4
4
  /** Tiempo de espera en milisegundos (por defecto: 15000) */
@@ -1,4 +1,4 @@
1
- import { C as Contribuyente, N as NcfQueryResult } from './index-BE6Wfozd.js';
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-KNOaUG34.js';
2
2
 
3
3
  interface ScrapingClientOptions {
4
4
  /** Tiempo de espera en milisegundos (por defecto: 15000) */
package/dist/scraping.js CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  DGII_RNC_URL,
5
5
  FORM_FIELDS,
6
6
  ScrapingClient
7
- } from "./chunk-HRRYZUKI.js";
8
- import "./chunk-53A7IG4Y.js";
7
+ } from "./chunk-YTX4QOLE.js";
8
+ import "./chunk-KW4ZV6FJ.js";
9
9
  import "./chunk-D26S6EXD.js";
10
- import "./chunk-DMGDJEUY.js";
10
+ import "./chunk-IRQX4WNQ.js";
11
11
  export {
12
12
  DGII_NCF_URL,
13
13
  DGII_RNC_URL,
package/dist/soap.cjs CHANGED
@@ -3,15 +3,15 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkJBKAE66Ccjs = require('./chunk-JBKAE66C.cjs');
7
- require('./chunk-WY6V4Y7S.cjs');
6
+ var _chunkDLB5RJ7Ecjs = require('./chunk-DLB5RJ7E.cjs');
7
+ require('./chunk-WMFHPNFP.cjs');
8
8
  require('./chunk-QH4BK5X3.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
14
+ var _chunkNASWEFHNcjs = require('./chunk-NASWEFHN.cjs');
15
15
 
16
16
 
17
17
 
@@ -20,4 +20,4 @@ var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
20
20
 
21
21
 
22
22
 
23
- exports.DGII_SOAP_BASE_URL = _chunkJBKAE66Ccjs.DGII_SOAP_BASE_URL; exports.DgiiConnectionError = _chunk7RJWFPCZcjs.DgiiConnectionError; exports.DgiiError = _chunk7RJWFPCZcjs.DgiiError; exports.DgiiNotFoundError = _chunk7RJWFPCZcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunk7RJWFPCZcjs.DgiiServiceError; exports.DgiiSoapClient = _chunkJBKAE66Ccjs.DgiiSoapClient; exports.SOAP_ACTIONS = _chunkJBKAE66Ccjs.SOAP_ACTIONS;
23
+ exports.DGII_SOAP_BASE_URL = _chunkDLB5RJ7Ecjs.DGII_SOAP_BASE_URL; exports.DgiiConnectionError = _chunkNASWEFHNcjs.DgiiConnectionError; exports.DgiiError = _chunkNASWEFHNcjs.DgiiError; exports.DgiiNotFoundError = _chunkNASWEFHNcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunkNASWEFHNcjs.DgiiServiceError; exports.DgiiSoapClient = _chunkDLB5RJ7Ecjs.DgiiSoapClient; exports.SOAP_ACTIONS = _chunkDLB5RJ7Ecjs.SOAP_ACTIONS;
package/dist/soap.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Contribuyente, N as NcfQueryResult } from './index-BE6Wfozd.cjs';
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-KNOaUG34.cjs';
2
2
  export { DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.cjs';
3
3
 
4
4
  interface SoapClientOptions {
package/dist/soap.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Contribuyente, N as NcfQueryResult } from './index-BE6Wfozd.js';
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-KNOaUG34.js';
2
2
  export { DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.js';
3
3
 
4
4
  interface SoapClientOptions {
package/dist/soap.js CHANGED
@@ -3,15 +3,15 @@ import {
3
3
  DGII_SOAP_BASE_URL,
4
4
  DgiiSoapClient,
5
5
  SOAP_ACTIONS
6
- } from "./chunk-43LGK4YP.js";
7
- import "./chunk-53A7IG4Y.js";
6
+ } from "./chunk-QTN5ZT4P.js";
7
+ import "./chunk-KW4ZV6FJ.js";
8
8
  import "./chunk-D26S6EXD.js";
9
9
  import {
10
10
  DgiiConnectionError,
11
11
  DgiiError,
12
12
  DgiiNotFoundError,
13
13
  DgiiServiceError
14
- } from "./chunk-DMGDJEUY.js";
14
+ } from "./chunk-IRQX4WNQ.js";
15
15
  export {
16
16
  DGII_SOAP_BASE_URL,
17
17
  DgiiConnectionError,