facturas 0.6.1 → 0.7.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/dist/padron.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { f as ArcaClientConfig } from './types-Cup-oevW.js';
2
- import { W as WsaaAuthModule, S as SoapTransport } from './index-3fdgJ3c2.js';
1
+ import { g as ArcaClientConfig } from './types-BXq0da71.js';
2
+ import { W as WsaaAuthModule, S as SoapTransport } from './index-CVpygFb0.js';
3
3
 
4
4
  /** Result of a taxpayer lookup via Padron A5. */
5
5
  type PadronTaxpayerResult = {
package/dist/padron.mjs CHANGED
@@ -1,120 +1,7 @@
1
- // src/errors.ts
2
- var ArcaError = class extends Error {
3
- code;
4
- name = "ArcaError";
5
- constructor(message, code = "ARCA_ERROR", options) {
6
- super(message, options);
7
- this.code = code;
8
- }
9
- };
10
- var ArcaSoapFaultError = class extends ArcaError {
11
- name = "ArcaSoapFaultError";
12
- faultCode;
13
- detail;
14
- constructor(message, options) {
15
- super(message, "ARCA_SOAP_FAULT", options);
16
- this.faultCode = options?.faultCode;
17
- this.detail = options?.detail;
18
- }
19
- };
20
-
21
- // src/services/padron.ts
22
- function createPadronService(options) {
23
- return {
24
- async getTaxpayerDetails(taxId) {
25
- const raw = await executePadronOperation(
26
- options,
27
- "padron-a5",
28
- "getPersona_v2",
29
- {
30
- idPersona: Number.parseInt(String(taxId), 10)
31
- }
32
- );
33
- if (!raw) {
34
- return null;
35
- }
36
- const record = raw;
37
- const datosGenerales = record.datosGenerales;
38
- return {
39
- taxId: String(record.idPersona ?? ""),
40
- ...record.tipoPersona === void 0 ? {} : { personType: String(record.tipoPersona) },
41
- ...datosGenerales ? { name: extractPadronName(datosGenerales) } : {},
42
- raw: record
43
- };
44
- },
45
- async getTaxIdByDocument(documentNumber) {
46
- const raw = await executePadronOperation(
47
- options,
48
- "padron-a13",
49
- "getIdPersonaListByDocumento",
50
- {
51
- documento: String(documentNumber)
52
- }
53
- );
54
- if (!raw) {
55
- return null;
56
- }
57
- const record = raw;
58
- const idPersona = record.idPersona;
59
- const taxIds = Array.isArray(idPersona) ? idPersona.map(String) : idPersona === void 0 ? [] : [String(idPersona)];
60
- return {
61
- taxIds,
62
- raw: record
63
- };
64
- }
65
- };
66
- }
67
- function extractPadronName(datosGenerales) {
68
- if (typeof datosGenerales.razonSocial === "string") {
69
- return datosGenerales.razonSocial;
70
- }
71
- const nombre = datosGenerales.nombre;
72
- const apellido = datosGenerales.apellido;
73
- if (typeof apellido === "string" && typeof nombre === "string") {
74
- return `${apellido} ${nombre}`.trim();
75
- }
76
- if (typeof apellido === "string") {
77
- return apellido;
78
- }
79
- if (typeof nombre === "string") {
80
- return nombre;
81
- }
82
- return void 0;
83
- }
84
- async function executePadronOperation(options, service, operation, body) {
85
- const auth = await options.auth.login(
86
- service === "padron-a5" ? "ws_sr_constancia_inscripcion" : "ws_sr_padron_a13"
87
- );
88
- try {
89
- const response = await options.soap.execute({
90
- service,
91
- operation,
92
- bodyElementNamespaceMode: "prefix",
93
- body: {
94
- token: auth.token,
95
- sign: auth.sign,
96
- cuitRepresentada: Number.parseInt(options.config.taxId, 10),
97
- ...body
98
- }
99
- });
100
- const operationResponse = response.result;
101
- if (operation === "getPersona_v2") {
102
- return operationResponse.personaReturn ?? null;
103
- }
104
- if (operation === "getIdPersonaListByDocumento") {
105
- return operationResponse.idPersonaListReturn ?? null;
106
- }
107
- return operationResponse.return ?? null;
108
- } catch (error) {
109
- if (error instanceof ArcaSoapFaultError && // Public Padron A5/A13 WSDLs expose only a generic validation fault, so
110
- // there is no documented not-found-specific fault code to match here.
111
- // Keep the current message fallback, but treat it as fragile.
112
- error.message.toLowerCase().includes("no existe")) {
113
- return null;
114
- }
115
- throw error;
116
- }
117
- }
1
+ import {
2
+ createPadronService
3
+ } from "./chunk-EDY3PNKJ.mjs";
4
+ import "./chunk-MBWOFO67.mjs";
118
5
  export {
119
6
  createPadronService
120
7
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/services/padron.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","import { ArcaSoapFaultError } from \"../errors\";\nimport type {\n ArcaClientConfig,\n ArcaPadronServiceName,\n} from \"../internal/types\";\nimport type { SoapTransport } from \"../soap\";\nimport type { WsaaAuthModule } from \"../wsaa\";\n\n/** Result of a taxpayer lookup via Padron A5. */\nexport type PadronTaxpayerResult = {\n taxId: string;\n personType?: string;\n name?: string;\n raw: Record<string, unknown>;\n};\n\n/** Result of a tax ID lookup by document number via Padron A13. */\nexport type PadronTaxIdLookupResult = {\n taxIds: string[];\n raw: Record<string, unknown>;\n};\n\n/** Padron taxpayer registry service. */\nexport type PadronService = {\n /** Looks up taxpayer details by CUIT. Returns `null` if the taxpayer does not exist. */\n getTaxpayerDetails(\n taxId: number | string\n ): Promise<PadronTaxpayerResult | null>;\n /** Looks up CUITs associated with a document number. Returns `null` if not found. */\n getTaxIdByDocument(\n documentNumber: number | string\n ): Promise<PadronTaxIdLookupResult | null>;\n};\n\nexport type CreatePadronServiceOptions = {\n config: ArcaClientConfig;\n auth: WsaaAuthModule;\n soap: SoapTransport;\n};\n\n/** Creates a Padron service instance wired with authentication and SOAP transport. */\nexport function createPadronService(\n options: CreatePadronServiceOptions\n): PadronService {\n return {\n async getTaxpayerDetails(taxId) {\n const raw = await executePadronOperation(\n options,\n \"padron-a5\",\n \"getPersona_v2\",\n {\n idPersona: Number.parseInt(String(taxId), 10),\n }\n );\n if (!raw) {\n return null;\n }\n const record = raw as Record<string, unknown>;\n const datosGenerales = record.datosGenerales as\n | Record<string, unknown>\n | undefined;\n return {\n taxId: String(record.idPersona ?? \"\"),\n ...(record.tipoPersona === undefined\n ? {}\n : { personType: String(record.tipoPersona) }),\n ...(datosGenerales ? { name: extractPadronName(datosGenerales) } : {}),\n raw: record,\n };\n },\n async getTaxIdByDocument(documentNumber) {\n const raw = await executePadronOperation(\n options,\n \"padron-a13\",\n \"getIdPersonaListByDocumento\",\n {\n documento: String(documentNumber),\n }\n );\n if (!raw) {\n return null;\n }\n const record = raw as Record<string, unknown>;\n const idPersona = record.idPersona;\n const taxIds = Array.isArray(idPersona)\n ? idPersona.map(String)\n : idPersona === undefined\n ? []\n : [String(idPersona)];\n return {\n taxIds,\n raw: record,\n };\n },\n };\n}\n\nfunction extractPadronName(\n datosGenerales: Record<string, unknown>\n): string | undefined {\n if (typeof datosGenerales.razonSocial === \"string\") {\n return datosGenerales.razonSocial;\n }\n const nombre = datosGenerales.nombre;\n const apellido = datosGenerales.apellido;\n if (typeof apellido === \"string\" && typeof nombre === \"string\") {\n return `${apellido} ${nombre}`.trim();\n }\n if (typeof apellido === \"string\") {\n return apellido;\n }\n if (typeof nombre === \"string\") {\n return nombre;\n }\n return undefined;\n}\n\nasync function executePadronOperation(\n options: CreatePadronServiceOptions,\n service: ArcaPadronServiceName,\n operation: string,\n body: Record<string, unknown>\n) {\n const auth = await options.auth.login(\n service === \"padron-a5\"\n ? \"ws_sr_constancia_inscripcion\"\n : \"ws_sr_padron_a13\"\n );\n\n try {\n const response = await options.soap.execute<\n Record<string, unknown>,\n Record<string, unknown>\n >({\n service,\n operation,\n bodyElementNamespaceMode: \"prefix\",\n body: {\n token: auth.token,\n sign: auth.sign,\n cuitRepresentada: Number.parseInt(options.config.taxId, 10),\n ...body,\n },\n });\n\n const operationResponse = response.result as Record<string, unknown>;\n\n if (operation === \"getPersona_v2\") {\n return operationResponse.personaReturn ?? null;\n }\n\n if (operation === \"getIdPersonaListByDocumento\") {\n return operationResponse.idPersonaListReturn ?? null;\n }\n\n return operationResponse.return ?? null;\n } catch (error) {\n if (\n error instanceof ArcaSoapFaultError &&\n // Public Padron A5/A13 WSDLs expose only a generic validation fault, so\n // there is no documented not-found-specific fault code to match here.\n // Keep the current message fallback, but treat it as fragile.\n error.message.toLowerCase().includes(\"no existe\")\n ) {\n return null;\n }\n\n throw error;\n }\n}\n"],"mappings":";AAQO,IA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"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -64,4 +64,4 @@ type ArcaSoapExecutionOptions<TBody> = {
64
64
  body: TBody;
65
65
  };
66
66
 
67
- export type { ArcaServiceName as A, ArcaSoapExecutionOptions as a, ArcaSoapResponse as b, ArcaWsaaServiceId as c, ArcaAuthOptions as d, ArcaAuthCredentials as e, ArcaClientConfig as f, ArcaEnvironment as g, ArcaWsaaSessionStore as h, ArcaLogLevel as i, ArcaLoggerConfig as j, ArcaPadronServiceName as k, ArcaRepresentedTaxId as l, ArcaServiceTarget as m, ArcaWsaaSessionKey as n };
67
+ export type { ArcaServiceName as A, ArcaSoapExecutionOptions as a, ArcaSoapResponse as b, ArcaWsaaServiceId as c, ArcaAuthOptions as d, ArcaAuthCredentials as e, ArcaEnvironment as f, ArcaClientConfig as g, ArcaWsaaSessionStore as h, ArcaLogLevel as i, ArcaLoggerConfig as j, ArcaPadronServiceName as k, ArcaRepresentedTaxId as l, ArcaServiceTarget as m, ArcaWsaaSessionKey as n };
package/dist/types.d.ts CHANGED
@@ -1 +1 @@
1
- export { e as ArcaAuthCredentials, d as ArcaAuthOptions, f as ArcaClientConfig, g as ArcaEnvironment, i as ArcaLogLevel, j as ArcaLoggerConfig, k as ArcaPadronServiceName, l as ArcaRepresentedTaxId, A as ArcaServiceName, m as ArcaServiceTarget, c as ArcaWsaaServiceId, n as ArcaWsaaSessionKey, h as ArcaWsaaSessionStore } from './types-Cup-oevW.js';
1
+ export { e as ArcaAuthCredentials, d as ArcaAuthOptions, g as ArcaClientConfig, f as ArcaEnvironment, i as ArcaLogLevel, j as ArcaLoggerConfig, k as ArcaPadronServiceName, l as ArcaRepresentedTaxId, A as ArcaServiceName, m as ArcaServiceTarget, c as ArcaWsaaServiceId, n as ArcaWsaaSessionKey, h as ArcaWsaaSessionStore } from './types-BXq0da71.js';
package/dist/wsfe.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { f as ArcaClientConfig } from './types-Cup-oevW.js';
2
- import { W as WsaaAuthModule, S as SoapTransport } from './index-3fdgJ3c2.js';
3
- import { d as ArcaAuthorizationOutcome, f as ArcaVoucherLookupResult } from './fiscal-evidence-DbbFH74x.js';
1
+ import { g as ArcaClientConfig } from './types-BXq0da71.js';
2
+ import { W as WsaaAuthModule, S as SoapTransport } from './index-CVpygFb0.js';
3
+ import { e as ArcaAuthorizationOutcome, s as ArcaVoucherLookupResult } from './fiscal-evidence-BQuBbJ3h.js';
4
4
 
5
5
  /** Accepted public date inputs for WSFE request fields. */
6
6
  type WsfeDateInput = `${number}${number}${number}${number}-${number}${number}-${number}${number}` | `${number}${number}${number}${number}${number}${number}${number}${number}`;
@@ -53,7 +53,7 @@ type WsfeVoucherInput = {
53
53
  concept: number;
54
54
  documentType: number;
55
55
  documentNumber: number;
56
- receiverVatConditionId?: number;
56
+ receiverVatConditionId: number;
57
57
  voucherDate: WsfeDateInput;
58
58
  totalAmount: number;
59
59
  nonTaxableAmount: number;
@@ -62,7 +62,7 @@ type WsfeVoucherInput = {
62
62
  taxAmount: number;
63
63
  vatAmount: number;
64
64
  currencyId: string;
65
- exchangeRate?: number;
65
+ exchangeRate?: number | string;
66
66
  sameCurrencyForeignCancellation?: "S" | "N";
67
67
  serviceStartDate?: WsfeDateInput;
68
68
  serviceEndDate?: WsfeDateInput;
@@ -201,7 +201,7 @@ type WsfeService = {
201
201
  representedTaxId?: number | string;
202
202
  forceRefresh?: boolean;
203
203
  }): Promise<WsfeCatalogEntry[]>;
204
- /** Lists supported currency types. */
204
+ /** Lists live ARCA currency identifiers such as PES and DOL, not ISO codes. */
205
205
  getCurrencyTypes(input: {
206
206
  representedTaxId?: number | string;
207
207
  forceRefresh?: boolean;
@@ -265,4 +265,45 @@ type CreateWsfeServiceOptions = {
265
265
  /** Creates a WSFE service instance wired with authentication and SOAP transport. */
266
266
  declare function createWsfeService(options: CreateWsfeServiceOptions): WsfeService;
267
267
 
268
- export { type CreateWsfeServiceOptions, type WsfeActivity, type WsfeActivityType, type WsfeAssociatedPeriod, type WsfeAssociatedVoucher, type WsfeAuthorizationOutcome, type WsfeAuthorizationResult, type WsfeAuthorizeVoucherInput, type WsfeBuyer, type WsfeCatalogEntry, type WsfeCurrencyType, type WsfeDateInput, type WsfeOptionalField, type WsfeQuotation, type WsfeReceiverVatCondition, type WsfeSalesPoint, type WsfeServerStatus, type WsfeService, type WsfeTax, type WsfeVatRate, type WsfeVoucherInfo, type WsfeVoucherInput, type WsfeVoucherLookupResult, createWsfeService };
268
+ declare const SUPPORTED_VAT_RATES: readonly [0, 2.5, 5, 10.5, 21, 27];
269
+ type SupportedVatRate = (typeof SUPPORTED_VAT_RATES)[number];
270
+
271
+ type WsfeBuilderCurrencyInput = {
272
+ currency?: "ARS";
273
+ exchangeRate?: never;
274
+ sameCurrencyForeignCancellation?: never;
275
+ } | {
276
+ currency: "USD";
277
+ exchangeRate: string;
278
+ sameCurrencyForeignCancellation?: false;
279
+ } | {
280
+ currency: "USD";
281
+ exchangeRate?: never;
282
+ sameCurrencyForeignCancellation: true;
283
+ };
284
+ type WsfeBuilderVatRate = SupportedVatRate;
285
+ type WsfeInvoiceBuilderBaseInput = {
286
+ salesPoint: number;
287
+ concept: number;
288
+ documentType: number;
289
+ documentNumber: number;
290
+ receiverVatConditionId: number;
291
+ voucherDate: WsfeDateInput;
292
+ serviceStartDate?: WsfeDateInput;
293
+ serviceEndDate?: WsfeDateInput;
294
+ paymentDueDate?: WsfeDateInput;
295
+ };
296
+ type BuildFacturaBInput = WsfeInvoiceBuilderBaseInput & WsfeBuilderCurrencyInput & {
297
+ /** Positive integer currency minor units forming the taxable base. */
298
+ taxableAmount: number;
299
+ vatRate: WsfeBuilderVatRate;
300
+ };
301
+ type BuildFacturaCInput = WsfeInvoiceBuilderBaseInput & WsfeBuilderCurrencyInput & {
302
+ amount: number;
303
+ };
304
+ /** Builds a narrow Factura B exact WSFE input from integer currency minor units. */
305
+ declare function buildFacturaB(input: BuildFacturaBInput): WsfeVoucherInput;
306
+ /** Builds a narrow Factura C exact WSFE input from integer currency minor units. */
307
+ declare function buildFacturaC(input: BuildFacturaCInput): WsfeVoucherInput;
308
+
309
+ export { type BuildFacturaBInput, type BuildFacturaCInput, type CreateWsfeServiceOptions, type WsfeActivity, type WsfeActivityType, type WsfeAssociatedPeriod, type WsfeAssociatedVoucher, type WsfeAuthorizationOutcome, type WsfeAuthorizationResult, type WsfeAuthorizeVoucherInput, type WsfeBuilderCurrencyInput, type WsfeBuilderVatRate, type WsfeBuyer, type WsfeCatalogEntry, type WsfeCurrencyType, type WsfeDateInput, type WsfeOptionalField, type WsfeQuotation, type WsfeReceiverVatCondition, type WsfeSalesPoint, type WsfeServerStatus, type WsfeService, type WsfeTax, type WsfeVatRate, type WsfeVoucherInfo, type WsfeVoucherInput, type WsfeVoucherLookupResult, buildFacturaB, buildFacturaC, createWsfeService };