facturas 0.5.2 → 0.6.1
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/README.md +2 -0
- package/dist/constants.d.ts +18 -1
- package/dist/constants.mjs +17 -3
- package/dist/constants.mjs.map +1 -1
- package/dist/errors.d.ts +16 -1
- package/dist/errors.mjs +14 -0
- package/dist/errors.mjs.map +1 -1
- package/dist/fiscal-evidence-DbbFH74x.d.ts +69 -0
- package/dist/{index-CqXVyU0E.d.ts → index-3fdgJ3c2.d.ts} +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.mjs +1070 -348
- package/dist/index.mjs.map +1 -1
- package/dist/padron.d.ts +2 -2
- package/dist/padron.mjs.map +1 -1
- package/dist/{types-CKKe1Oo4.d.ts → types-Cup-oevW.d.ts} +2 -0
- package/dist/types.d.ts +1 -1
- package/dist/wsfe.d.ts +32 -3
- package/dist/wsfe.mjs +505 -115
- package/dist/wsfe.mjs.map +1 -1
- package/dist/wsmtxca.d.ts +64 -8
- package/dist/wsmtxca.mjs +556 -156
- package/dist/wsmtxca.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,8 @@ The package exports:
|
|
|
33
33
|
|
|
34
34
|
Authenticated WSFE and WSMTXCA methods accept `forceRefresh: true` when callers need to discard the cached WSAA TA and request a fresh Token Authorization for the same service.
|
|
35
35
|
|
|
36
|
+
For durable fiscal workflows, `authorizeVoucherOutcome(...)` returns typed `authorized`, `rejected`, or `indeterminate` evidence and performs one authorization transport attempt. `lookupVoucher(...)` provides operation-scoped `found` or `not_found` recovery evidence. The existing `authorizeVoucher(...)`, `getVoucherInfo(...)`, and `getVoucher(...)` methods remain compatibility wrappers.
|
|
37
|
+
|
|
36
38
|
## WSFE associated periods
|
|
37
39
|
|
|
38
40
|
`client.wsfe.createNextVoucher({ data })` supports `associatedPeriod` for credit/debit notes that use `PeriodoAsoc` instead of `CbtesAsoc`:
|
package/dist/constants.d.ts
CHANGED
|
@@ -6,11 +6,26 @@ declare const ARCA_VOUCHER_TYPES: {
|
|
|
6
6
|
readonly FACTURA_B: 6;
|
|
7
7
|
readonly NOTA_DEBITO_B: 7;
|
|
8
8
|
readonly NOTA_CREDITO_B: 8;
|
|
9
|
+
readonly FACTURA_C: 11;
|
|
10
|
+
readonly NOTA_DEBITO_C: 12;
|
|
11
|
+
readonly NOTA_CREDITO_C: 13;
|
|
9
12
|
};
|
|
10
13
|
/** Common document types accepted by ARCA services. */
|
|
11
14
|
declare const ARCA_DOCUMENT_TYPES: {
|
|
12
15
|
readonly CUIT: 80;
|
|
13
16
|
readonly DNI: 96;
|
|
17
|
+
readonly CONSUMIDOR_FINAL: 99;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Common receiver IVA condition identifiers used by WSFE.
|
|
21
|
+
* Allowed values depend on the voucher class and ARCA's live catalog.
|
|
22
|
+
*/
|
|
23
|
+
declare const ARCA_RECEIVER_VAT_CONDITIONS: {
|
|
24
|
+
readonly RESPONSABLE_INSCRIPTO: 1;
|
|
25
|
+
readonly EXENTO: 4;
|
|
26
|
+
readonly CONSUMIDOR_FINAL: 5;
|
|
27
|
+
readonly MONOTRIBUTISTA: 6;
|
|
28
|
+
readonly IVA_NO_ALCANZADO: 15;
|
|
14
29
|
};
|
|
15
30
|
/** Supported invoice concept types for WSFE requests. */
|
|
16
31
|
declare const ARCA_CONCEPT_TYPES: {
|
|
@@ -24,6 +39,8 @@ declare const ARCA_VAT_RATES: {
|
|
|
24
39
|
readonly IVA_10_5: 4;
|
|
25
40
|
readonly IVA_21: 5;
|
|
26
41
|
readonly IVA_27: 6;
|
|
42
|
+
readonly IVA_5: 8;
|
|
43
|
+
readonly IVA_2_5: 9;
|
|
27
44
|
};
|
|
28
45
|
/** Common ARCA currency identifiers. */
|
|
29
46
|
declare const ARCA_CURRENCIES: {
|
|
@@ -31,4 +48,4 @@ declare const ARCA_CURRENCIES: {
|
|
|
31
48
|
readonly DOL: "DOL";
|
|
32
49
|
};
|
|
33
50
|
|
|
34
|
-
export { ARCA_CONCEPT_TYPES, ARCA_CURRENCIES, ARCA_DOCUMENT_TYPES, ARCA_VAT_RATES, ARCA_VOUCHER_TYPES };
|
|
51
|
+
export { ARCA_CONCEPT_TYPES, ARCA_CURRENCIES, ARCA_DOCUMENT_TYPES, ARCA_RECEIVER_VAT_CONDITIONS, ARCA_VAT_RATES, ARCA_VOUCHER_TYPES };
|
package/dist/constants.mjs
CHANGED
|
@@ -5,11 +5,22 @@ var ARCA_VOUCHER_TYPES = {
|
|
|
5
5
|
NOTA_CREDITO_A: 3,
|
|
6
6
|
FACTURA_B: 6,
|
|
7
7
|
NOTA_DEBITO_B: 7,
|
|
8
|
-
NOTA_CREDITO_B: 8
|
|
8
|
+
NOTA_CREDITO_B: 8,
|
|
9
|
+
FACTURA_C: 11,
|
|
10
|
+
NOTA_DEBITO_C: 12,
|
|
11
|
+
NOTA_CREDITO_C: 13
|
|
9
12
|
};
|
|
10
13
|
var ARCA_DOCUMENT_TYPES = {
|
|
11
14
|
CUIT: 80,
|
|
12
|
-
DNI: 96
|
|
15
|
+
DNI: 96,
|
|
16
|
+
CONSUMIDOR_FINAL: 99
|
|
17
|
+
};
|
|
18
|
+
var ARCA_RECEIVER_VAT_CONDITIONS = {
|
|
19
|
+
RESPONSABLE_INSCRIPTO: 1,
|
|
20
|
+
EXENTO: 4,
|
|
21
|
+
CONSUMIDOR_FINAL: 5,
|
|
22
|
+
MONOTRIBUTISTA: 6,
|
|
23
|
+
IVA_NO_ALCANZADO: 15
|
|
13
24
|
};
|
|
14
25
|
var ARCA_CONCEPT_TYPES = {
|
|
15
26
|
PRODUCTOS: 1,
|
|
@@ -20,7 +31,9 @@ var ARCA_VAT_RATES = {
|
|
|
20
31
|
IVA_0: 3,
|
|
21
32
|
IVA_10_5: 4,
|
|
22
33
|
IVA_21: 5,
|
|
23
|
-
IVA_27: 6
|
|
34
|
+
IVA_27: 6,
|
|
35
|
+
IVA_5: 8,
|
|
36
|
+
IVA_2_5: 9
|
|
24
37
|
};
|
|
25
38
|
var ARCA_CURRENCIES = {
|
|
26
39
|
PES: "PES",
|
|
@@ -30,6 +43,7 @@ export {
|
|
|
30
43
|
ARCA_CONCEPT_TYPES,
|
|
31
44
|
ARCA_CURRENCIES,
|
|
32
45
|
ARCA_DOCUMENT_TYPES,
|
|
46
|
+
ARCA_RECEIVER_VAT_CONDITIONS,
|
|
33
47
|
ARCA_VAT_RATES,
|
|
34
48
|
ARCA_VOUCHER_TYPES
|
|
35
49
|
};
|
package/dist/constants.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["/** Common ARCA reference data for readable userland code and examples. */\nexport const ARCA_VOUCHER_TYPES = {\n FACTURA_A: 1,\n NOTA_DEBITO_A: 2,\n NOTA_CREDITO_A: 3,\n FACTURA_B: 6,\n NOTA_DEBITO_B: 7,\n NOTA_CREDITO_B: 8,\n} as const;\n\n/** Common document types accepted by ARCA services. */\nexport const ARCA_DOCUMENT_TYPES = {\n CUIT: 80,\n DNI: 96,\n} as const;\n\n/** Supported invoice concept types for WSFE requests. */\nexport const ARCA_CONCEPT_TYPES = {\n PRODUCTOS: 1,\n SERVICIOS: 2,\n PRODUCTOS_Y_SERVICIOS: 3,\n} as const;\n\n/** Common IVA rate identifiers used by WSFE. */\nexport const ARCA_VAT_RATES = {\n IVA_0: 3,\n IVA_10_5: 4,\n IVA_21: 5,\n IVA_27: 6,\n} as const;\n\n/** Common ARCA currency identifiers. */\nexport const ARCA_CURRENCIES = {\n PES: \"PES\",\n DOL: \"DOL\",\n} as const;\n"],"mappings":";AACO,IAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAClB;AAGO,IAAM,sBAAsB;AAAA,EACjC,MAAM;AAAA,EACN,KAAK;
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["/** Common ARCA reference data for readable userland code and examples. */\nexport const ARCA_VOUCHER_TYPES = {\n FACTURA_A: 1,\n NOTA_DEBITO_A: 2,\n NOTA_CREDITO_A: 3,\n FACTURA_B: 6,\n NOTA_DEBITO_B: 7,\n NOTA_CREDITO_B: 8,\n FACTURA_C: 11,\n NOTA_DEBITO_C: 12,\n NOTA_CREDITO_C: 13,\n} as const;\n\n/** Common document types accepted by ARCA services. */\nexport const ARCA_DOCUMENT_TYPES = {\n CUIT: 80,\n DNI: 96,\n CONSUMIDOR_FINAL: 99,\n} as const;\n\n/**\n * Common receiver IVA condition identifiers used by WSFE.\n * Allowed values depend on the voucher class and ARCA's live catalog.\n */\nexport const ARCA_RECEIVER_VAT_CONDITIONS = {\n RESPONSABLE_INSCRIPTO: 1,\n EXENTO: 4,\n CONSUMIDOR_FINAL: 5,\n MONOTRIBUTISTA: 6,\n IVA_NO_ALCANZADO: 15,\n} as const;\n\n/** Supported invoice concept types for WSFE requests. */\nexport const ARCA_CONCEPT_TYPES = {\n PRODUCTOS: 1,\n SERVICIOS: 2,\n PRODUCTOS_Y_SERVICIOS: 3,\n} as const;\n\n/** Common IVA rate identifiers used by WSFE. */\nexport const ARCA_VAT_RATES = {\n IVA_0: 3,\n IVA_10_5: 4,\n IVA_21: 5,\n IVA_27: 6,\n IVA_5: 8,\n IVA_2_5: 9,\n} as const;\n\n/** Common ARCA currency identifiers. */\nexport const ARCA_CURRENCIES = {\n PES: \"PES\",\n DOL: \"DOL\",\n} as const;\n"],"mappings":";AACO,IAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB;AAClB;AAGO,IAAM,sBAAsB;AAAA,EACjC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,kBAAkB;AACpB;AAMO,IAAM,+BAA+B;AAAA,EAC1C,uBAAuB;AAAA,EACvB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,kBAAkB;AACpB;AAGO,IAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,WAAW;AAAA,EACX,uBAAuB;AACzB;AAGO,IAAM,iBAAiB;AAAA,EAC5B,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AACX;AAGO,IAAM,kBAAkB;AAAA,EAC7B,KAAK;AAAA,EACL,KAAK;AACP;","names":[]}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { A as ArcaServiceName } from './types-
|
|
1
|
+
import { A as ArcaServiceName } from './types-Cup-oevW.js';
|
|
2
|
+
import { A as ArcaFiscalResultLevel, a as ArcaFiscalResults, b as ArcaFiscalIssue } from './fiscal-evidence-DbbFH74x.js';
|
|
2
3
|
|
|
3
4
|
/** Base error class for all ARCA-related errors. */
|
|
4
5
|
declare class ArcaError extends Error {
|
|
@@ -67,9 +68,23 @@ declare class ArcaInvalidSoapResponseError extends ArcaError {
|
|
|
67
68
|
declare class ArcaServiceError extends ArcaError {
|
|
68
69
|
readonly name: string;
|
|
69
70
|
readonly serviceCode?: string | number;
|
|
71
|
+
readonly service?: ArcaServiceName;
|
|
72
|
+
readonly operation?: string;
|
|
73
|
+
readonly result?: string;
|
|
74
|
+
readonly resultLevel?: ArcaFiscalResultLevel;
|
|
75
|
+
readonly results?: ArcaFiscalResults;
|
|
76
|
+
readonly cae?: string;
|
|
77
|
+
readonly issues?: readonly ArcaFiscalIssue[];
|
|
70
78
|
readonly detail?: unknown;
|
|
71
79
|
constructor(message: string, options?: ErrorOptions & {
|
|
72
80
|
serviceCode?: string | number;
|
|
81
|
+
service?: ArcaServiceName;
|
|
82
|
+
operation?: string;
|
|
83
|
+
result?: string;
|
|
84
|
+
resultLevel?: ArcaFiscalResultLevel;
|
|
85
|
+
results?: ArcaFiscalResults;
|
|
86
|
+
cae?: string;
|
|
87
|
+
issues?: readonly ArcaFiscalIssue[];
|
|
73
88
|
detail?: unknown;
|
|
74
89
|
});
|
|
75
90
|
}
|
package/dist/errors.mjs
CHANGED
|
@@ -68,10 +68,24 @@ var ArcaInvalidSoapResponseError = class extends ArcaError {
|
|
|
68
68
|
var ArcaServiceError = class extends ArcaError {
|
|
69
69
|
name = "ArcaServiceError";
|
|
70
70
|
serviceCode;
|
|
71
|
+
service;
|
|
72
|
+
operation;
|
|
73
|
+
result;
|
|
74
|
+
resultLevel;
|
|
75
|
+
results;
|
|
76
|
+
cae;
|
|
77
|
+
issues;
|
|
71
78
|
detail;
|
|
72
79
|
constructor(message, options) {
|
|
73
80
|
super(message, "ARCA_SERVICE_ERROR", options);
|
|
74
81
|
this.serviceCode = options?.serviceCode;
|
|
82
|
+
this.service = options?.service;
|
|
83
|
+
this.operation = options?.operation;
|
|
84
|
+
this.result = options?.result;
|
|
85
|
+
this.resultLevel = options?.resultLevel;
|
|
86
|
+
this.results = options?.results;
|
|
87
|
+
this.cae = options?.cae;
|
|
88
|
+
this.issues = options?.issues;
|
|
75
89
|
this.detail = options?.detail;
|
|
76
90
|
}
|
|
77
91
|
};
|
package/dist/errors.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type { ArcaServiceName } from \"./internal/types\";\n\n/** Base error class for all ARCA-related errors. */\nexport class ArcaError extends Error {\n readonly code: string;\n override readonly name: string = \"ArcaError\";\n\n constructor(message: string, code = \"ARCA_ERROR\", options?: ErrorOptions) {\n super(message, options);\n this.code = code;\n }\n}\n\n/** Thrown when the ARCA client configuration is missing or invalid. */\nexport class ArcaConfigurationError extends ArcaError {\n override readonly name: string = \"ArcaConfigurationError\";\n\n constructor(message: string, options?: ErrorOptions) {\n super(message, \"ARCA_CONFIGURATION_ERROR\", options);\n }\n}\n\n/** Thrown when caller-provided input data is missing or invalid. */\nexport class ArcaInputError extends ArcaError {\n override readonly name: string = \"ArcaInputError\";\n readonly detail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n detail?: unknown;\n }\n ) {\n super(message, \"ARCA_INPUT_ERROR\", options);\n this.detail = options?.detail;\n }\n}\n\n/** Thrown when an HTTP request to an ARCA endpoint fails at the transport level. */\nexport class ArcaTransportError extends ArcaError {\n override readonly name: string = \"ArcaTransportError\";\n readonly statusCode?: number;\n readonly contentType?: string;\n readonly responseBody?: string;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n statusCode?: number;\n contentType?: string;\n responseBody?: string;\n }\n ) {\n super(message, \"ARCA_TRANSPORT_ERROR\", options);\n this.statusCode = options?.statusCode;\n this.contentType = options?.contentType;\n this.responseBody = options?.responseBody;\n }\n}\n\n/** Thrown when the SOAP response contains a Fault element. */\nexport class ArcaSoapFaultError extends ArcaError {\n override readonly name: string = \"ArcaSoapFaultError\";\n readonly faultCode?: string;\n readonly detail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n faultCode?: string;\n detail?: unknown;\n }\n ) {\n super(message, \"ARCA_SOAP_FAULT\", options);\n this.faultCode = options?.faultCode;\n this.detail = options?.detail;\n }\n}\n\n/** Thrown when a response cannot be parsed as a valid SOAP envelope. */\nexport class ArcaInvalidSoapResponseError extends ArcaError {\n override readonly name: string = \"ArcaInvalidSoapResponseError\";\n readonly service?: ArcaServiceName;\n readonly operation?: string;\n readonly endpointUrl?: string;\n readonly statusCode?: number;\n readonly contentType?: string;\n readonly responseBodyLength?: number;\n readonly responseBodyPreview?: string;\n readonly parsedDetail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n service?: ArcaServiceName;\n operation?: string;\n endpointUrl?: string;\n statusCode?: number;\n contentType?: string;\n responseBodyLength?: number;\n responseBodyPreview?: string;\n parsedDetail?: unknown;\n }\n ) {\n super(message, \"ARCA_INVALID_SOAP_RESPONSE\", options);\n this.service = options?.service;\n this.operation = options?.operation;\n this.endpointUrl = options?.endpointUrl;\n this.statusCode = options?.statusCode;\n this.contentType = options?.contentType;\n this.responseBodyLength = options?.responseBodyLength;\n this.responseBodyPreview = options?.responseBodyPreview;\n this.parsedDetail = options?.parsedDetail;\n }\n}\n\n/** Thrown when an ARCA service (WSFE, WSMTXCA, Padron) returns a domain-level error. */\nexport class ArcaServiceError extends ArcaError {\n override readonly name: string = \"ArcaServiceError\";\n readonly serviceCode?: string | number;\n readonly detail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n serviceCode?: string | number;\n detail?: unknown;\n }\n ) {\n super(message, \"ARCA_SERVICE_ERROR\", options);\n this.serviceCode = options?.serviceCode;\n this.detail = options?.detail;\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type { ArcaServiceName } from \"./internal/types\";\nimport type {\n ArcaFiscalIssue,\n ArcaFiscalResultLevel,\n ArcaFiscalResults,\n} from \"./services/fiscal-evidence\";\n\n/** Base error class for all ARCA-related errors. */\nexport class ArcaError extends Error {\n readonly code: string;\n override readonly name: string = \"ArcaError\";\n\n constructor(message: string, code = \"ARCA_ERROR\", options?: ErrorOptions) {\n super(message, options);\n this.code = code;\n }\n}\n\n/** Thrown when the ARCA client configuration is missing or invalid. */\nexport class ArcaConfigurationError extends ArcaError {\n override readonly name: string = \"ArcaConfigurationError\";\n\n constructor(message: string, options?: ErrorOptions) {\n super(message, \"ARCA_CONFIGURATION_ERROR\", options);\n }\n}\n\n/** Thrown when caller-provided input data is missing or invalid. */\nexport class ArcaInputError extends ArcaError {\n override readonly name: string = \"ArcaInputError\";\n readonly detail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n detail?: unknown;\n }\n ) {\n super(message, \"ARCA_INPUT_ERROR\", options);\n this.detail = options?.detail;\n }\n}\n\n/** Thrown when an HTTP request to an ARCA endpoint fails at the transport level. */\nexport class ArcaTransportError extends ArcaError {\n override readonly name: string = \"ArcaTransportError\";\n readonly statusCode?: number;\n readonly contentType?: string;\n readonly responseBody?: string;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n statusCode?: number;\n contentType?: string;\n responseBody?: string;\n }\n ) {\n super(message, \"ARCA_TRANSPORT_ERROR\", options);\n this.statusCode = options?.statusCode;\n this.contentType = options?.contentType;\n this.responseBody = options?.responseBody;\n }\n}\n\n/** Thrown when the SOAP response contains a Fault element. */\nexport class ArcaSoapFaultError extends ArcaError {\n override readonly name: string = \"ArcaSoapFaultError\";\n readonly faultCode?: string;\n readonly detail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n faultCode?: string;\n detail?: unknown;\n }\n ) {\n super(message, \"ARCA_SOAP_FAULT\", options);\n this.faultCode = options?.faultCode;\n this.detail = options?.detail;\n }\n}\n\n/** Thrown when a response cannot be parsed as a valid SOAP envelope. */\nexport class ArcaInvalidSoapResponseError extends ArcaError {\n override readonly name: string = \"ArcaInvalidSoapResponseError\";\n readonly service?: ArcaServiceName;\n readonly operation?: string;\n readonly endpointUrl?: string;\n readonly statusCode?: number;\n readonly contentType?: string;\n readonly responseBodyLength?: number;\n readonly responseBodyPreview?: string;\n readonly parsedDetail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n service?: ArcaServiceName;\n operation?: string;\n endpointUrl?: string;\n statusCode?: number;\n contentType?: string;\n responseBodyLength?: number;\n responseBodyPreview?: string;\n parsedDetail?: unknown;\n }\n ) {\n super(message, \"ARCA_INVALID_SOAP_RESPONSE\", options);\n this.service = options?.service;\n this.operation = options?.operation;\n this.endpointUrl = options?.endpointUrl;\n this.statusCode = options?.statusCode;\n this.contentType = options?.contentType;\n this.responseBodyLength = options?.responseBodyLength;\n this.responseBodyPreview = options?.responseBodyPreview;\n this.parsedDetail = options?.parsedDetail;\n }\n}\n\n/** Thrown when an ARCA service (WSFE, WSMTXCA, Padron) returns a domain-level error. */\nexport class ArcaServiceError extends ArcaError {\n override readonly name: string = \"ArcaServiceError\";\n readonly serviceCode?: string | number;\n readonly service?: ArcaServiceName;\n readonly operation?: string;\n readonly result?: string;\n readonly resultLevel?: ArcaFiscalResultLevel;\n readonly results?: ArcaFiscalResults;\n readonly cae?: string;\n readonly issues?: readonly ArcaFiscalIssue[];\n readonly detail?: unknown;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n serviceCode?: string | number;\n service?: ArcaServiceName;\n operation?: string;\n result?: string;\n resultLevel?: ArcaFiscalResultLevel;\n results?: ArcaFiscalResults;\n cae?: string;\n issues?: readonly ArcaFiscalIssue[];\n detail?: unknown;\n }\n ) {\n super(message, \"ARCA_SERVICE_ERROR\", options);\n this.serviceCode = options?.serviceCode;\n this.service = options?.service;\n this.operation = options?.operation;\n this.result = options?.result;\n this.resultLevel = options?.resultLevel;\n this.results = options?.results;\n this.cae = options?.cae;\n this.issues = options?.issues;\n this.detail = options?.detail;\n }\n}\n"],"mappings":";AAQO,IAAM,YAAN,cAAwB,MAAM;AAAA,EAC1B;AAAA,EACS,OAAe;AAAA,EAEjC,YAAY,SAAiB,OAAO,cAAc,SAAwB;AACxE,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AAAA,EACd;AACF;AAGO,IAAM,yBAAN,cAAqC,UAAU;AAAA,EAClC,OAAe;AAAA,EAEjC,YAAY,SAAiB,SAAwB;AACnD,UAAM,SAAS,4BAA4B,OAAO;AAAA,EACpD;AACF;AAGO,IAAM,iBAAN,cAA6B,UAAU;AAAA,EAC1B,OAAe;AAAA,EACxB;AAAA,EAET,YACE,SACA,SAGA;AACA,UAAM,SAAS,oBAAoB,OAAO;AAC1C,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;AAGO,IAAM,qBAAN,cAAiC,UAAU;AAAA,EAC9B,OAAe;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,SACA,SAKA;AACA,UAAM,SAAS,wBAAwB,OAAO;AAC9C,SAAK,aAAa,SAAS;AAC3B,SAAK,cAAc,SAAS;AAC5B,SAAK,eAAe,SAAS;AAAA,EAC/B;AACF;AAGO,IAAM,qBAAN,cAAiC,UAAU;AAAA,EAC9B,OAAe;AAAA,EACxB;AAAA,EACA;AAAA,EAET,YACE,SACA,SAIA;AACA,UAAM,SAAS,mBAAmB,OAAO;AACzC,SAAK,YAAY,SAAS;AAC1B,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;AAGO,IAAM,+BAAN,cAA2C,UAAU;AAAA,EACxC,OAAe;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,SACA,SAUA;AACA,UAAM,SAAS,8BAA8B,OAAO;AACpD,SAAK,UAAU,SAAS;AACxB,SAAK,YAAY,SAAS;AAC1B,SAAK,cAAc,SAAS;AAC5B,SAAK,aAAa,SAAS;AAC3B,SAAK,cAAc,SAAS;AAC5B,SAAK,qBAAqB,SAAS;AACnC,SAAK,sBAAsB,SAAS;AACpC,SAAK,eAAe,SAAS;AAAA,EAC/B;AACF;AAGO,IAAM,mBAAN,cAA+B,UAAU;AAAA,EAC5B,OAAe;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,SACA,SAWA;AACA,UAAM,SAAS,sBAAsB,OAAO;AAC5C,SAAK,cAAc,SAAS;AAC5B,SAAK,UAAU,SAAS;AACxB,SAAK,YAAY,SAAS;AAC1B,SAAK,SAAS,SAAS;AACvB,SAAK,cAAc,SAAS;AAC5B,SAAK,UAAU,SAAS;AACxB,SAAK,MAAM,SAAS;AACpB,SAAK,SAAS,SAAS;AACvB,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** ARCA services that authorize fiscal vouchers. */
|
|
2
|
+
type ArcaFiscalService = "wsfe" | "wsmtxca";
|
|
3
|
+
/** Location of a structured authorization result in the service response. */
|
|
4
|
+
type ArcaFiscalResultLevel = "header" | "detail" | "operation";
|
|
5
|
+
/** Every structured result field exposed by one provider response. */
|
|
6
|
+
type ArcaFiscalResults = {
|
|
7
|
+
header?: string;
|
|
8
|
+
detail?: string;
|
|
9
|
+
operation?: string;
|
|
10
|
+
};
|
|
11
|
+
/** Source and meaning of one provider issue. */
|
|
12
|
+
type ArcaFiscalIssue = {
|
|
13
|
+
service: ArcaFiscalService;
|
|
14
|
+
operation: string;
|
|
15
|
+
source: "error" | "observation";
|
|
16
|
+
category: "business" | "infrastructure" | "observation" | "unknown";
|
|
17
|
+
code?: string;
|
|
18
|
+
message: string;
|
|
19
|
+
resultLevel?: ArcaFiscalResultLevel;
|
|
20
|
+
};
|
|
21
|
+
/** Why an authorization response cannot prove approval or rejection. */
|
|
22
|
+
type ArcaAuthorizationIndeterminateReason = "transport_error" | "soap_fault" | "invalid_response" | "incomplete_response" | "contradictory_response" | "unexpected_error";
|
|
23
|
+
type ArcaAuthorizationEvidenceBase<TService extends ArcaFiscalService = ArcaFiscalService> = {
|
|
24
|
+
service: TService;
|
|
25
|
+
operation: string;
|
|
26
|
+
results: ArcaFiscalResults;
|
|
27
|
+
errors: ArcaFiscalIssue[];
|
|
28
|
+
observations: ArcaFiscalIssue[];
|
|
29
|
+
raw?: Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
/** Structured evidence returned by one exact voucher authorization attempt. */
|
|
32
|
+
type ArcaAuthorizationOutcome<TService extends ArcaFiscalService = ArcaFiscalService> = (ArcaAuthorizationEvidenceBase<TService> & {
|
|
33
|
+
kind: "authorized";
|
|
34
|
+
result: "A" | "O";
|
|
35
|
+
resultLevel: ArcaFiscalResultLevel;
|
|
36
|
+
cae: string;
|
|
37
|
+
caeExpiry?: string;
|
|
38
|
+
voucherNumber: number;
|
|
39
|
+
}) | (ArcaAuthorizationEvidenceBase<TService> & {
|
|
40
|
+
kind: "rejected";
|
|
41
|
+
result: "R";
|
|
42
|
+
resultLevel: ArcaFiscalResultLevel;
|
|
43
|
+
}) | (ArcaAuthorizationEvidenceBase<TService> & {
|
|
44
|
+
kind: "indeterminate";
|
|
45
|
+
reason: ArcaAuthorizationIndeterminateReason;
|
|
46
|
+
result?: string;
|
|
47
|
+
resultLevel?: ArcaFiscalResultLevel;
|
|
48
|
+
cae?: string;
|
|
49
|
+
caeExpiry?: string;
|
|
50
|
+
voucherNumber?: number;
|
|
51
|
+
});
|
|
52
|
+
/** Structured result of consulting one exact voucher number. */
|
|
53
|
+
type ArcaVoucherLookupResult<TVoucher, TService extends ArcaFiscalService = ArcaFiscalService> = {
|
|
54
|
+
kind: "found";
|
|
55
|
+
service: TService;
|
|
56
|
+
operation: string;
|
|
57
|
+
voucher: TVoucher;
|
|
58
|
+
observations: ArcaFiscalIssue[];
|
|
59
|
+
raw: Record<string, unknown>;
|
|
60
|
+
} | {
|
|
61
|
+
kind: "not_found";
|
|
62
|
+
service: TService;
|
|
63
|
+
operation: string;
|
|
64
|
+
errors: ArcaFiscalIssue[];
|
|
65
|
+
observations: ArcaFiscalIssue[];
|
|
66
|
+
raw: Record<string, unknown>;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type { ArcaFiscalResultLevel as A, ArcaFiscalResults as a, ArcaFiscalIssue as b, ArcaAuthorizationIndeterminateReason as c, ArcaAuthorizationOutcome as d, ArcaFiscalService as e, ArcaVoucherLookupResult as f };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ArcaSoapExecutionOptions, b as ArcaSoapResponse, c as ArcaWsaaServiceId, d as ArcaAuthOptions, e as ArcaAuthCredentials } from './types-
|
|
1
|
+
import { a as ArcaSoapExecutionOptions, b as ArcaSoapResponse, c as ArcaWsaaServiceId, d as ArcaAuthOptions, e as ArcaAuthCredentials } from './types-Cup-oevW.js';
|
|
2
2
|
|
|
3
3
|
type SoapTransport = {
|
|
4
4
|
execute<TBody, TResult>(request: ArcaSoapExecutionOptions<TBody>): Promise<ArcaSoapResponse<TResult>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { f as ArcaClientConfig, g as ArcaEnvironment, h as ArcaWsaaSessionStore } from './types-
|
|
2
|
-
export { e as ArcaAuthCredentials, d as ArcaAuthOptions, i as ArcaLogLevel, j as ArcaLoggerConfig, k as ArcaPadronServiceName, l as ArcaRepresentedTaxId, A as ArcaServiceName, m as ArcaServiceTarget, c as ArcaWsaaServiceId, n as ArcaWsaaSessionKey } from './types-
|
|
1
|
+
import { f as ArcaClientConfig, g as ArcaEnvironment, h as ArcaWsaaSessionStore } from './types-Cup-oevW.js';
|
|
2
|
+
export { e as ArcaAuthCredentials, d as ArcaAuthOptions, i as ArcaLogLevel, j as ArcaLoggerConfig, k as ArcaPadronServiceName, l as ArcaRepresentedTaxId, A as ArcaServiceName, m as ArcaServiceTarget, c as ArcaWsaaServiceId, n as ArcaWsaaSessionKey } from './types-Cup-oevW.js';
|
|
3
3
|
import { PadronService } from './padron.js';
|
|
4
4
|
export { CreatePadronServiceOptions, PadronTaxIdLookupResult, PadronTaxpayerResult, createPadronService } from './padron.js';
|
|
5
5
|
import { WsfeService } from './wsfe.js';
|
|
6
|
-
export { CreateWsfeServiceOptions, WsfeActivity, WsfeActivityType, WsfeAssociatedPeriod, WsfeAssociatedVoucher, WsfeAuthorizationResult, WsfeAuthorizeVoucherInput, WsfeBuyer, WsfeCatalogEntry, WsfeCurrencyType, WsfeDateInput, WsfeOptionalField, WsfeQuotation, WsfeReceiverVatCondition, WsfeSalesPoint, WsfeServerStatus, WsfeTax, WsfeVatRate, WsfeVoucherInfo, WsfeVoucherInput, createWsfeService } from './wsfe.js';
|
|
6
|
+
export { CreateWsfeServiceOptions, WsfeActivity, WsfeActivityType, WsfeAssociatedPeriod, WsfeAssociatedVoucher, WsfeAuthorizationOutcome, WsfeAuthorizationResult, WsfeAuthorizeVoucherInput, WsfeBuyer, WsfeCatalogEntry, WsfeCurrencyType, WsfeDateInput, WsfeOptionalField, WsfeQuotation, WsfeReceiverVatCondition, WsfeSalesPoint, WsfeServerStatus, WsfeTax, WsfeVatRate, WsfeVoucherInfo, WsfeVoucherInput, WsfeVoucherLookupResult, createWsfeService } from './wsfe.js';
|
|
7
7
|
import { WsmtxcaService } from './wsmtxca.js';
|
|
8
|
-
export { CreateWsmtxcaServiceOptions, WsmtxcaAuthorizationResult, WsmtxcaLastAuthorizedVoucherResult, WsmtxcaVoucherLookupResult, createWsmtxcaService } from './wsmtxca.js';
|
|
8
|
+
export { CreateWsmtxcaServiceOptions, WsmtxcaAuthorizationOutcome, WsmtxcaAuthorizationResult, WsmtxcaAuthorizeVoucherInput, WsmtxcaLastAuthorizedVoucherResult, WsmtxcaSalesPoint, WsmtxcaSalesPointsResult, WsmtxcaVoucherInfo, WsmtxcaVoucherLookupOutcome, WsmtxcaVoucherLookupResult, createWsmtxcaService } from './wsmtxca.js';
|
|
9
9
|
export { ArcaConfigurationError, ArcaError, ArcaInputError, ArcaInvalidSoapResponseError, ArcaServiceError, ArcaSoapFaultError, ArcaTransportError } from './errors.js';
|
|
10
|
-
|
|
10
|
+
export { c as ArcaAuthorizationIndeterminateReason, d as ArcaAuthorizationOutcome, b as ArcaFiscalIssue, A as ArcaFiscalResultLevel, a as ArcaFiscalResults, e as ArcaFiscalService, f as ArcaVoucherLookupResult } from './fiscal-evidence-DbbFH74x.js';
|
|
11
|
+
import './index-3fdgJ3c2.js';
|
|
11
12
|
|
|
12
13
|
/** Fully wired ARCA client with access to all service modules. */
|
|
13
14
|
type ArcaClient = {
|