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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +192 -0
  3. package/README.md +196 -0
  4. package/dist/bulk.cjs +11 -0
  5. package/dist/bulk.d.cts +30 -0
  6. package/dist/bulk.d.ts +30 -0
  7. package/dist/bulk.js +11 -0
  8. package/dist/chunk-2ST6QKHA.cjs +1 -0
  9. package/dist/chunk-4OYLCOUL.cjs +201 -0
  10. package/dist/chunk-4TKAQ4WV.js +198 -0
  11. package/dist/chunk-53A7IG4Y.js +23 -0
  12. package/dist/chunk-6CIP7YH6.cjs +198 -0
  13. package/dist/chunk-7RJWFPCZ.cjs +44 -0
  14. package/dist/chunk-D26S6EXD.js +12 -0
  15. package/dist/chunk-DMGDJEUY.js +44 -0
  16. package/dist/chunk-ERBXSS64.js +0 -0
  17. package/dist/chunk-EZKSB553.js +0 -0
  18. package/dist/chunk-FZ6QDTC4.cjs +98 -0
  19. package/dist/chunk-HGE4QZ3H.js +281 -0
  20. package/dist/chunk-HR4DCHH7.js +201 -0
  21. package/dist/chunk-KIS7MVIW.js +98 -0
  22. package/dist/chunk-QH4BK5X3.cjs +12 -0
  23. package/dist/chunk-QOSGH7F5.cjs +1 -0
  24. package/dist/chunk-SUSDEKID.cjs +784 -0
  25. package/dist/chunk-TZC6RSWL.js +784 -0
  26. package/dist/chunk-VJ4ZQQIQ.cjs +281 -0
  27. package/dist/chunk-WY6V4Y7S.cjs +23 -0
  28. package/dist/client.cjs +17 -0
  29. package/dist/client.d.cts +95 -0
  30. package/dist/client.d.ts +95 -0
  31. package/dist/client.js +17 -0
  32. package/dist/errors.cjs +14 -0
  33. package/dist/errors.d.cts +40 -0
  34. package/dist/errors.d.ts +40 -0
  35. package/dist/errors.js +14 -0
  36. package/dist/index-CS-7YY2y.d.cts +58 -0
  37. package/dist/index-CS-7YY2y.d.ts +58 -0
  38. package/dist/index.cjs +66 -0
  39. package/dist/index.d.cts +7 -0
  40. package/dist/index.d.ts +7 -0
  41. package/dist/index.js +66 -0
  42. package/dist/scraping.cjs +16 -0
  43. package/dist/scraping.d.cts +47 -0
  44. package/dist/scraping.d.ts +47 -0
  45. package/dist/scraping.js +16 -0
  46. package/dist/soap.cjs +23 -0
  47. package/dist/soap.d.cts +38 -0
  48. package/dist/soap.d.ts +38 -0
  49. package/dist/soap.js +23 -0
  50. package/dist/validators.cjs +17 -0
  51. package/dist/validators.d.cts +55 -0
  52. package/dist/validators.d.ts +55 -0
  53. package/dist/validators.js +17 -0
  54. package/package.json +109 -0
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Resultado de validación para RNC y cédula.
3
+ */
4
+ type ValidationResult = {
5
+ valid: true;
6
+ formatted: string;
7
+ } | {
8
+ valid: false;
9
+ formatted?: undefined;
10
+ };
11
+ /**
12
+ * Resultado de validación para NCF (serie B) y e-NCF (serie E).
13
+ */
14
+ type NcfValidationResult = {
15
+ valid: true;
16
+ type: string;
17
+ serie: string;
18
+ } | {
19
+ valid: false;
20
+ type?: undefined;
21
+ serie?: undefined;
22
+ };
23
+ /**
24
+ * Datos de un contribuyente registrado en la DGII.
25
+ */
26
+ interface Contribuyente {
27
+ rnc: string;
28
+ nombre: string;
29
+ nombreComercial: string;
30
+ estado: string;
31
+ categoria: string;
32
+ actividadEconomica?: string;
33
+ regimenDePagos?: string;
34
+ administracionLocal?: string;
35
+ }
36
+ /**
37
+ * Resultado de validación de un comprobante fiscal contra la DGII.
38
+ */
39
+ interface NcfQueryResult {
40
+ valid: boolean;
41
+ rnc: string;
42
+ ncf: string;
43
+ nombreComercial?: string;
44
+ }
45
+ /**
46
+ * Registro del archivo masivo de contribuyentes (DGII_RNC.zip).
47
+ */
48
+ interface BulkContribuyente {
49
+ rnc: string;
50
+ nombre: string;
51
+ nombreComercial: string;
52
+ actividad: string;
53
+ estado: string;
54
+ regimen: string;
55
+ fechaConstitucion: string;
56
+ }
57
+
58
+ export type { BulkContribuyente as B, Contribuyente as C, NcfQueryResult as N, ValidationResult as V, NcfValidationResult as a };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Resultado de validación para RNC y cédula.
3
+ */
4
+ type ValidationResult = {
5
+ valid: true;
6
+ formatted: string;
7
+ } | {
8
+ valid: false;
9
+ formatted?: undefined;
10
+ };
11
+ /**
12
+ * Resultado de validación para NCF (serie B) y e-NCF (serie E).
13
+ */
14
+ type NcfValidationResult = {
15
+ valid: true;
16
+ type: string;
17
+ serie: string;
18
+ } | {
19
+ valid: false;
20
+ type?: undefined;
21
+ serie?: undefined;
22
+ };
23
+ /**
24
+ * Datos de un contribuyente registrado en la DGII.
25
+ */
26
+ interface Contribuyente {
27
+ rnc: string;
28
+ nombre: string;
29
+ nombreComercial: string;
30
+ estado: string;
31
+ categoria: string;
32
+ actividadEconomica?: string;
33
+ regimenDePagos?: string;
34
+ administracionLocal?: string;
35
+ }
36
+ /**
37
+ * Resultado de validación de un comprobante fiscal contra la DGII.
38
+ */
39
+ interface NcfQueryResult {
40
+ valid: boolean;
41
+ rnc: string;
42
+ ncf: string;
43
+ nombreComercial?: string;
44
+ }
45
+ /**
46
+ * Registro del archivo masivo de contribuyentes (DGII_RNC.zip).
47
+ */
48
+ interface BulkContribuyente {
49
+ rnc: string;
50
+ nombre: string;
51
+ nombreComercial: string;
52
+ actividad: string;
53
+ estado: string;
54
+ regimen: string;
55
+ fechaConstitucion: string;
56
+ }
57
+
58
+ export type { BulkContribuyente as B, Contribuyente as C, NcfQueryResult as N, ValidationResult as V, NcfValidationResult as a };
package/dist/index.cjs ADDED
@@ -0,0 +1,66 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkSUSDEKIDcjs = require('./chunk-SUSDEKID.cjs');
9
+ require('./chunk-QOSGH7F5.cjs');
10
+
11
+
12
+
13
+
14
+ var _chunkFZ6QDTC4cjs = require('./chunk-FZ6QDTC4.cjs');
15
+ require('./chunk-2ST6QKHA.cjs');
16
+
17
+
18
+
19
+
20
+
21
+ var _chunk6CIP7YH6cjs = require('./chunk-6CIP7YH6.cjs');
22
+
23
+
24
+
25
+
26
+ var _chunk4OYLCOULcjs = require('./chunk-4OYLCOUL.cjs');
27
+
28
+
29
+
30
+
31
+ var _chunkVJ4ZQQIQcjs = require('./chunk-VJ4ZQQIQ.cjs');
32
+ require('./chunk-WY6V4Y7S.cjs');
33
+ require('./chunk-QH4BK5X3.cjs');
34
+
35
+
36
+
37
+
38
+
39
+
40
+ var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+ exports.AllStrategiesFailedError = _chunk7RJWFPCZcjs.AllStrategiesFailedError; exports.ConsecutiveBreaker = _chunk6CIP7YH6cjs.ConsecutiveBreaker; exports.DGII_BULK_URL = _chunkFZ6QDTC4cjs.DGII_BULK_URL; exports.DGII_NCF_URL = _chunkVJ4ZQQIQcjs.DGII_NCF_URL; exports.DGII_RNC_URL = _chunkVJ4ZQQIQcjs.DGII_RNC_URL; exports.DGII_SOAP_BASE_URL = _chunk4OYLCOULcjs.DGII_SOAP_BASE_URL; exports.DgiiClient = _chunk6CIP7YH6cjs.DgiiClient; exports.DgiiConnectionError = _chunk7RJWFPCZcjs.DgiiConnectionError; exports.DgiiError = _chunk7RJWFPCZcjs.DgiiError; exports.DgiiNotFoundError = _chunk7RJWFPCZcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunk7RJWFPCZcjs.DgiiServiceError; exports.DgiiSoapClient = _chunk4OYLCOULcjs.DgiiSoapClient; exports.ECF_TYPE_NAMES = _chunkSUSDEKIDcjs.ECF_TYPE_NAMES; exports.NCF_TYPE_NAMES = _chunkSUSDEKIDcjs.NCF_TYPE_NAMES; exports.SOAP_ACTIONS = _chunk4OYLCOULcjs.SOAP_ACTIONS; exports.ScrapingClient = _chunkVJ4ZQQIQcjs.ScrapingClient; exports.downloadBulkFile = _chunkFZ6QDTC4cjs.downloadBulkFile; exports.isRetryableError = _chunk6CIP7YH6cjs.isRetryableError; exports.parseBulkFile = _chunkFZ6QDTC4cjs.parseBulkFile; exports.validateCedula = _chunkSUSDEKIDcjs.validateCedula; exports.validateEcf = _chunkSUSDEKIDcjs.validateEcf; exports.validateNcf = _chunkSUSDEKIDcjs.validateNcf; exports.validateRnc = _chunkSUSDEKIDcjs.validateRnc; exports.withRetry = _chunk6CIP7YH6cjs.withRetry;
@@ -0,0 +1,7 @@
1
+ export { ECF_TYPE_NAMES, NCF_TYPE_NAMES, validateCedula, validateEcf, validateNcf, validateRnc } from './validators.cjs';
2
+ export { DGII_SOAP_BASE_URL, DgiiSoapClient, SOAP_ACTIONS, SoapClientOptions } from './soap.cjs';
3
+ export { AllStrategiesFailedError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.cjs';
4
+ export { DGII_NCF_URL, DGII_RNC_URL, ScrapingClient, ScrapingClientOptions } from './scraping.cjs';
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-CS-7YY2y.cjs';
@@ -0,0 +1,7 @@
1
+ export { ECF_TYPE_NAMES, NCF_TYPE_NAMES, validateCedula, validateEcf, validateNcf, validateRnc } from './validators.js';
2
+ export { DGII_SOAP_BASE_URL, DgiiSoapClient, SOAP_ACTIONS, SoapClientOptions } from './soap.js';
3
+ export { AllStrategiesFailedError, DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.js';
4
+ export { DGII_NCF_URL, DGII_RNC_URL, ScrapingClient, ScrapingClientOptions } from './scraping.js';
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-CS-7YY2y.js';
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ import {
2
+ ECF_TYPE_NAMES,
3
+ NCF_TYPE_NAMES,
4
+ validateCedula,
5
+ validateEcf,
6
+ validateNcf,
7
+ validateRnc
8
+ } from "./chunk-TZC6RSWL.js";
9
+ import "./chunk-ERBXSS64.js";
10
+ import {
11
+ DGII_BULK_URL,
12
+ downloadBulkFile,
13
+ parseBulkFile
14
+ } from "./chunk-KIS7MVIW.js";
15
+ import "./chunk-EZKSB553.js";
16
+ import {
17
+ ConsecutiveBreaker,
18
+ DgiiClient,
19
+ isRetryableError,
20
+ withRetry
21
+ } from "./chunk-4TKAQ4WV.js";
22
+ import {
23
+ DGII_SOAP_BASE_URL,
24
+ DgiiSoapClient,
25
+ SOAP_ACTIONS
26
+ } from "./chunk-HR4DCHH7.js";
27
+ import {
28
+ DGII_NCF_URL,
29
+ DGII_RNC_URL,
30
+ ScrapingClient
31
+ } from "./chunk-HGE4QZ3H.js";
32
+ import "./chunk-53A7IG4Y.js";
33
+ import "./chunk-D26S6EXD.js";
34
+ import {
35
+ AllStrategiesFailedError,
36
+ DgiiConnectionError,
37
+ DgiiError,
38
+ DgiiNotFoundError,
39
+ DgiiServiceError
40
+ } from "./chunk-DMGDJEUY.js";
41
+ export {
42
+ AllStrategiesFailedError,
43
+ ConsecutiveBreaker,
44
+ DGII_BULK_URL,
45
+ DGII_NCF_URL,
46
+ DGII_RNC_URL,
47
+ DGII_SOAP_BASE_URL,
48
+ DgiiClient,
49
+ DgiiConnectionError,
50
+ DgiiError,
51
+ DgiiNotFoundError,
52
+ DgiiServiceError,
53
+ DgiiSoapClient,
54
+ ECF_TYPE_NAMES,
55
+ NCF_TYPE_NAMES,
56
+ SOAP_ACTIONS,
57
+ ScrapingClient,
58
+ downloadBulkFile,
59
+ isRetryableError,
60
+ parseBulkFile,
61
+ validateCedula,
62
+ validateEcf,
63
+ validateNcf,
64
+ validateRnc,
65
+ withRetry
66
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-2ST6QKHA.cjs');
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkVJ4ZQQIQcjs = require('./chunk-VJ4ZQQIQ.cjs');
8
+ require('./chunk-WY6V4Y7S.cjs');
9
+ require('./chunk-QH4BK5X3.cjs');
10
+ require('./chunk-7RJWFPCZ.cjs');
11
+
12
+
13
+
14
+
15
+
16
+ exports.DGII_NCF_URL = _chunkVJ4ZQQIQcjs.DGII_NCF_URL; exports.DGII_RNC_URL = _chunkVJ4ZQQIQcjs.DGII_RNC_URL; exports.FORM_FIELDS = _chunkVJ4ZQQIQcjs.FORM_FIELDS; exports.ScrapingClient = _chunkVJ4ZQQIQcjs.ScrapingClient;
@@ -0,0 +1,47 @@
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-CS-7YY2y.cjs';
2
+
3
+ interface ScrapingClientOptions {
4
+ /** Tiempo de espera en milisegundos (por defecto: 15000) */
5
+ timeout?: number;
6
+ /** URL de la página de consulta RNC */
7
+ baseRncUrl?: string;
8
+ /** URL de la página de consulta NCF */
9
+ baseNcfUrl?: string;
10
+ }
11
+
12
+ /**
13
+ * Cliente que consulta la DGII vía web scraping de la página
14
+ * de consultas ASP.NET.
15
+ */
16
+ declare class ScrapingClient {
17
+ private readonly _rncUrl;
18
+ private readonly _ncfUrl;
19
+ private readonly _timeout;
20
+ constructor(options?: ScrapingClientOptions);
21
+ /**
22
+ * Consulta datos de un contribuyente por RNC o cédula.
23
+ */
24
+ getContribuyente(rnc: string): Promise<Contribuyente>;
25
+ /**
26
+ * Valida un comprobante fiscal (NCF) contra la DGII.
27
+ */
28
+ getNCF(rnc: string, ncf: string): Promise<NcfQueryResult>;
29
+ private _fetchTokens;
30
+ private _post;
31
+ private _wrapFetchError;
32
+ }
33
+
34
+ declare const DGII_RNC_URL = "https://dgii.gov.do/app/WebApps/ConsultasWeb2/ConsultasWeb/consultas/rnc.aspx";
35
+ declare const DGII_NCF_URL = "https://dgii.gov.do/app/WebApps/ConsultasWeb2/ConsultasWeb/consultas/ncf.aspx";
36
+ declare const FORM_FIELDS: Readonly<{
37
+ readonly viewState: "__VIEWSTATE";
38
+ readonly viewStateGenerator: "__VIEWSTATEGENERATOR";
39
+ readonly eventValidation: "__EVENTVALIDATION";
40
+ readonly rncInput: "ctl00$cphMain$txtRNCCedula";
41
+ readonly rncSubmit: "ctl00$cphMain$btnBuscarPorRNC";
42
+ readonly ncfRncInput: "ctl00$cphMain$txtRNC";
43
+ readonly ncfInput: "ctl00$cphMain$txtNCF";
44
+ readonly ncfSubmit: "ctl00$cphMain$btnConsultar";
45
+ }>;
46
+
47
+ export { DGII_NCF_URL, DGII_RNC_URL, FORM_FIELDS, ScrapingClient, type ScrapingClientOptions };
@@ -0,0 +1,47 @@
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-CS-7YY2y.js';
2
+
3
+ interface ScrapingClientOptions {
4
+ /** Tiempo de espera en milisegundos (por defecto: 15000) */
5
+ timeout?: number;
6
+ /** URL de la página de consulta RNC */
7
+ baseRncUrl?: string;
8
+ /** URL de la página de consulta NCF */
9
+ baseNcfUrl?: string;
10
+ }
11
+
12
+ /**
13
+ * Cliente que consulta la DGII vía web scraping de la página
14
+ * de consultas ASP.NET.
15
+ */
16
+ declare class ScrapingClient {
17
+ private readonly _rncUrl;
18
+ private readonly _ncfUrl;
19
+ private readonly _timeout;
20
+ constructor(options?: ScrapingClientOptions);
21
+ /**
22
+ * Consulta datos de un contribuyente por RNC o cédula.
23
+ */
24
+ getContribuyente(rnc: string): Promise<Contribuyente>;
25
+ /**
26
+ * Valida un comprobante fiscal (NCF) contra la DGII.
27
+ */
28
+ getNCF(rnc: string, ncf: string): Promise<NcfQueryResult>;
29
+ private _fetchTokens;
30
+ private _post;
31
+ private _wrapFetchError;
32
+ }
33
+
34
+ declare const DGII_RNC_URL = "https://dgii.gov.do/app/WebApps/ConsultasWeb2/ConsultasWeb/consultas/rnc.aspx";
35
+ declare const DGII_NCF_URL = "https://dgii.gov.do/app/WebApps/ConsultasWeb2/ConsultasWeb/consultas/ncf.aspx";
36
+ declare const FORM_FIELDS: Readonly<{
37
+ readonly viewState: "__VIEWSTATE";
38
+ readonly viewStateGenerator: "__VIEWSTATEGENERATOR";
39
+ readonly eventValidation: "__EVENTVALIDATION";
40
+ readonly rncInput: "ctl00$cphMain$txtRNCCedula";
41
+ readonly rncSubmit: "ctl00$cphMain$btnBuscarPorRNC";
42
+ readonly ncfRncInput: "ctl00$cphMain$txtRNC";
43
+ readonly ncfInput: "ctl00$cphMain$txtNCF";
44
+ readonly ncfSubmit: "ctl00$cphMain$btnConsultar";
45
+ }>;
46
+
47
+ export { DGII_NCF_URL, DGII_RNC_URL, FORM_FIELDS, ScrapingClient, type ScrapingClientOptions };
@@ -0,0 +1,16 @@
1
+ import "./chunk-EZKSB553.js";
2
+ import {
3
+ DGII_NCF_URL,
4
+ DGII_RNC_URL,
5
+ FORM_FIELDS,
6
+ ScrapingClient
7
+ } from "./chunk-HGE4QZ3H.js";
8
+ import "./chunk-53A7IG4Y.js";
9
+ import "./chunk-D26S6EXD.js";
10
+ import "./chunk-DMGDJEUY.js";
11
+ export {
12
+ DGII_NCF_URL,
13
+ DGII_RNC_URL,
14
+ FORM_FIELDS,
15
+ ScrapingClient
16
+ };
package/dist/soap.cjs ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-QOSGH7F5.cjs');
2
+
3
+
4
+
5
+
6
+ var _chunk4OYLCOULcjs = require('./chunk-4OYLCOUL.cjs');
7
+ require('./chunk-WY6V4Y7S.cjs');
8
+ require('./chunk-QH4BK5X3.cjs');
9
+
10
+
11
+
12
+
13
+
14
+ var _chunk7RJWFPCZcjs = require('./chunk-7RJWFPCZ.cjs');
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+ exports.DGII_SOAP_BASE_URL = _chunk4OYLCOULcjs.DGII_SOAP_BASE_URL; exports.DgiiConnectionError = _chunk7RJWFPCZcjs.DgiiConnectionError; exports.DgiiError = _chunk7RJWFPCZcjs.DgiiError; exports.DgiiNotFoundError = _chunk7RJWFPCZcjs.DgiiNotFoundError; exports.DgiiServiceError = _chunk7RJWFPCZcjs.DgiiServiceError; exports.DgiiSoapClient = _chunk4OYLCOULcjs.DgiiSoapClient; exports.SOAP_ACTIONS = _chunk4OYLCOULcjs.SOAP_ACTIONS;
@@ -0,0 +1,38 @@
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-CS-7YY2y.cjs';
2
+ export { DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.cjs';
3
+
4
+ interface SoapClientOptions {
5
+ /** Tiempo de espera en milisegundos (por defecto: 10000) */
6
+ timeout?: number;
7
+ /** URL base del servicio SOAP (por defecto: endpoint oficial de la DGII) */
8
+ baseUrl?: string;
9
+ }
10
+
11
+ /**
12
+ * Cliente SOAP tipado para el servicio WSMovilDGII de la DGII.
13
+ *
14
+ * @deprecated Usar {@link DgiiClient} en su lugar. El endpoint SOAP
15
+ * de la DGII fue bloqueado permanentemente en enero 2025.
16
+ */
17
+ declare class DgiiSoapClient {
18
+ private readonly _options;
19
+ constructor(options?: SoapClientOptions);
20
+ private _fetch;
21
+ /**
22
+ * Consulta datos de un contribuyente por RNC o cédula.
23
+ */
24
+ getContribuyente(rnc: string): Promise<Contribuyente>;
25
+ /**
26
+ * Valida un comprobante fiscal (NCF) contra la DGII.
27
+ */
28
+ getNCF(rnc: string, ncf: string): Promise<NcfQueryResult>;
29
+ }
30
+
31
+ /** @deprecated Endpoint bloqueado permanentemente desde enero 2025. */
32
+ declare const DGII_SOAP_BASE_URL = "https://dgii.gov.do/wsMovilDGII/WSMovilDGII.asmx";
33
+ declare const SOAP_ACTIONS: Readonly<{
34
+ readonly getContribuyentes: "http://dgii.gov.do/GetContribuyentes";
35
+ readonly getNCF: "http://dgii.gov.do/GetNCF";
36
+ }>;
37
+
38
+ export { Contribuyente, DGII_SOAP_BASE_URL, DgiiSoapClient, NcfQueryResult, SOAP_ACTIONS, type SoapClientOptions };
package/dist/soap.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ import { C as Contribuyente, N as NcfQueryResult } from './index-CS-7YY2y.js';
2
+ export { DgiiConnectionError, DgiiError, DgiiNotFoundError, DgiiServiceError } from './errors.js';
3
+
4
+ interface SoapClientOptions {
5
+ /** Tiempo de espera en milisegundos (por defecto: 10000) */
6
+ timeout?: number;
7
+ /** URL base del servicio SOAP (por defecto: endpoint oficial de la DGII) */
8
+ baseUrl?: string;
9
+ }
10
+
11
+ /**
12
+ * Cliente SOAP tipado para el servicio WSMovilDGII de la DGII.
13
+ *
14
+ * @deprecated Usar {@link DgiiClient} en su lugar. El endpoint SOAP
15
+ * de la DGII fue bloqueado permanentemente en enero 2025.
16
+ */
17
+ declare class DgiiSoapClient {
18
+ private readonly _options;
19
+ constructor(options?: SoapClientOptions);
20
+ private _fetch;
21
+ /**
22
+ * Consulta datos de un contribuyente por RNC o cédula.
23
+ */
24
+ getContribuyente(rnc: string): Promise<Contribuyente>;
25
+ /**
26
+ * Valida un comprobante fiscal (NCF) contra la DGII.
27
+ */
28
+ getNCF(rnc: string, ncf: string): Promise<NcfQueryResult>;
29
+ }
30
+
31
+ /** @deprecated Endpoint bloqueado permanentemente desde enero 2025. */
32
+ declare const DGII_SOAP_BASE_URL = "https://dgii.gov.do/wsMovilDGII/WSMovilDGII.asmx";
33
+ declare const SOAP_ACTIONS: Readonly<{
34
+ readonly getContribuyentes: "http://dgii.gov.do/GetContribuyentes";
35
+ readonly getNCF: "http://dgii.gov.do/GetNCF";
36
+ }>;
37
+
38
+ export { Contribuyente, DGII_SOAP_BASE_URL, DgiiSoapClient, NcfQueryResult, SOAP_ACTIONS, type SoapClientOptions };
package/dist/soap.js ADDED
@@ -0,0 +1,23 @@
1
+ import "./chunk-ERBXSS64.js";
2
+ import {
3
+ DGII_SOAP_BASE_URL,
4
+ DgiiSoapClient,
5
+ SOAP_ACTIONS
6
+ } from "./chunk-HR4DCHH7.js";
7
+ import "./chunk-53A7IG4Y.js";
8
+ import "./chunk-D26S6EXD.js";
9
+ import {
10
+ DgiiConnectionError,
11
+ DgiiError,
12
+ DgiiNotFoundError,
13
+ DgiiServiceError
14
+ } from "./chunk-DMGDJEUY.js";
15
+ export {
16
+ DGII_SOAP_BASE_URL,
17
+ DgiiConnectionError,
18
+ DgiiError,
19
+ DgiiNotFoundError,
20
+ DgiiServiceError,
21
+ DgiiSoapClient,
22
+ SOAP_ACTIONS
23
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkSUSDEKIDcjs = require('./chunk-SUSDEKID.cjs');
9
+ require('./chunk-QH4BK5X3.cjs');
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ exports.ECF_TYPE_NAMES = _chunkSUSDEKIDcjs.ECF_TYPE_NAMES; exports.NCF_TYPE_NAMES = _chunkSUSDEKIDcjs.NCF_TYPE_NAMES; exports.validateCedula = _chunkSUSDEKIDcjs.validateCedula; exports.validateEcf = _chunkSUSDEKIDcjs.validateEcf; exports.validateNcf = _chunkSUSDEKIDcjs.validateNcf; exports.validateRnc = _chunkSUSDEKIDcjs.validateRnc;
@@ -0,0 +1,55 @@
1
+ import { V as ValidationResult, a as NcfValidationResult } from './index-CS-7YY2y.cjs';
2
+
3
+ /**
4
+ * Valida un RNC (Registro Nacional de Contribuyentes) dominicano.
5
+ *
6
+ * El RNC tiene 9 dígitos y usa un algoritmo de dígito verificador
7
+ * basado en módulo 11 con pesos [7, 9, 8, 6, 5, 4, 3, 2].
8
+ *
9
+ * @param value - RNC a validar (con o sin guiones)
10
+ * @returns Resultado con validez y formato X-XX-XXXXX-X
11
+ */
12
+ declare function validateRnc(value: string): ValidationResult;
13
+
14
+ /**
15
+ * Valida una cédula de identidad dominicana.
16
+ *
17
+ * La cédula tiene 11 dígitos y usa el algoritmo de Luhn (módulo 10)
18
+ * con pesos alternados [1, 2].
19
+ *
20
+ * @param value - Cédula a validar (con o sin guiones)
21
+ * @returns Resultado con validez y formato XXX-XXXXXXX-X
22
+ */
23
+ declare function validateCedula(value: string): ValidationResult;
24
+
25
+ /**
26
+ * Nombres legibles de cada tipo de NCF.
27
+ */
28
+ declare const NCF_TYPE_NAMES: Readonly<Record<string, string>>;
29
+ /**
30
+ * Valida un NCF (Número de Comprobante Fiscal) dominicano.
31
+ *
32
+ * Formato: B + 2 dígitos (tipo) + 8 dígitos (secuencial) = 11 caracteres.
33
+ * Ejemplo: B0100000001
34
+ *
35
+ * @param value - NCF a validar
36
+ * @returns Resultado con validez, tipo y serie
37
+ */
38
+ declare function validateNcf(value: string): NcfValidationResult;
39
+
40
+ /**
41
+ * Nombres legibles de cada tipo de e-NCF.
42
+ */
43
+ declare const ECF_TYPE_NAMES: Readonly<Record<string, string>>;
44
+ /**
45
+ * Valida un e-NCF (comprobante fiscal electrónico) dominicano.
46
+ *
47
+ * Formato: E + 2 dígitos (tipo) + 10 dígitos (secuencial) = 13 caracteres.
48
+ * Ejemplo: E310000000001
49
+ *
50
+ * @param value - e-NCF a validar
51
+ * @returns Resultado con validez, tipo y serie
52
+ */
53
+ declare function validateEcf(value: string): NcfValidationResult;
54
+
55
+ export { ECF_TYPE_NAMES, NCF_TYPE_NAMES, validateCedula, validateEcf, validateNcf, validateRnc };
@@ -0,0 +1,55 @@
1
+ import { V as ValidationResult, a as NcfValidationResult } from './index-CS-7YY2y.js';
2
+
3
+ /**
4
+ * Valida un RNC (Registro Nacional de Contribuyentes) dominicano.
5
+ *
6
+ * El RNC tiene 9 dígitos y usa un algoritmo de dígito verificador
7
+ * basado en módulo 11 con pesos [7, 9, 8, 6, 5, 4, 3, 2].
8
+ *
9
+ * @param value - RNC a validar (con o sin guiones)
10
+ * @returns Resultado con validez y formato X-XX-XXXXX-X
11
+ */
12
+ declare function validateRnc(value: string): ValidationResult;
13
+
14
+ /**
15
+ * Valida una cédula de identidad dominicana.
16
+ *
17
+ * La cédula tiene 11 dígitos y usa el algoritmo de Luhn (módulo 10)
18
+ * con pesos alternados [1, 2].
19
+ *
20
+ * @param value - Cédula a validar (con o sin guiones)
21
+ * @returns Resultado con validez y formato XXX-XXXXXXX-X
22
+ */
23
+ declare function validateCedula(value: string): ValidationResult;
24
+
25
+ /**
26
+ * Nombres legibles de cada tipo de NCF.
27
+ */
28
+ declare const NCF_TYPE_NAMES: Readonly<Record<string, string>>;
29
+ /**
30
+ * Valida un NCF (Número de Comprobante Fiscal) dominicano.
31
+ *
32
+ * Formato: B + 2 dígitos (tipo) + 8 dígitos (secuencial) = 11 caracteres.
33
+ * Ejemplo: B0100000001
34
+ *
35
+ * @param value - NCF a validar
36
+ * @returns Resultado con validez, tipo y serie
37
+ */
38
+ declare function validateNcf(value: string): NcfValidationResult;
39
+
40
+ /**
41
+ * Nombres legibles de cada tipo de e-NCF.
42
+ */
43
+ declare const ECF_TYPE_NAMES: Readonly<Record<string, string>>;
44
+ /**
45
+ * Valida un e-NCF (comprobante fiscal electrónico) dominicano.
46
+ *
47
+ * Formato: E + 2 dígitos (tipo) + 10 dígitos (secuencial) = 13 caracteres.
48
+ * Ejemplo: E310000000001
49
+ *
50
+ * @param value - e-NCF a validar
51
+ * @returns Resultado con validez, tipo y serie
52
+ */
53
+ declare function validateEcf(value: string): NcfValidationResult;
54
+
55
+ export { ECF_TYPE_NAMES, NCF_TYPE_NAMES, validateCedula, validateEcf, validateNcf, validateRnc };
@@ -0,0 +1,17 @@
1
+ import {
2
+ ECF_TYPE_NAMES,
3
+ NCF_TYPE_NAMES,
4
+ validateCedula,
5
+ validateEcf,
6
+ validateNcf,
7
+ validateRnc
8
+ } from "./chunk-TZC6RSWL.js";
9
+ import "./chunk-D26S6EXD.js";
10
+ export {
11
+ ECF_TYPE_NAMES,
12
+ NCF_TYPE_NAMES,
13
+ validateCedula,
14
+ validateEcf,
15
+ validateNcf,
16
+ validateRnc
17
+ };