facturas 0.16.1 → 0.18.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/README.md +19 -19
- package/dist/{chunk-WN62NMUJ.mjs → chunk-4RD5VQWC.mjs} +5 -29
- package/dist/chunk-4RD5VQWC.mjs.map +1 -0
- package/dist/{chunk-BYEP3ABS.mjs → chunk-EZ4HA3LC.mjs} +45 -5
- package/dist/{chunk-BYEP3ABS.mjs.map → chunk-EZ4HA3LC.mjs.map} +1 -1
- package/dist/{chunk-5O2FESHA.mjs → chunk-JP5IBMVI.mjs} +58 -25
- package/dist/chunk-JP5IBMVI.mjs.map +1 -0
- package/dist/{chunk-EXECWJEC.mjs → chunk-MRBFLBWX.mjs} +66 -6
- package/dist/chunk-MRBFLBWX.mjs.map +1 -0
- package/dist/{chunk-VJ2ICMSA.mjs → chunk-OORNZFI5.mjs} +32 -19
- package/dist/chunk-OORNZFI5.mjs.map +1 -0
- package/dist/{chunk-PHXH34L6.mjs → chunk-WPHD2GQJ.mjs} +2 -2
- package/dist/cli.d.ts +2 -2
- package/dist/cli.mjs +16 -16
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-C7lhfLGY.d.ts → client-COK5u3oz.d.ts} +15 -7
- package/dist/errors.d.ts +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/{fiscal-evidence-DaCyGd5o.d.ts → fiscal-evidence-B6UTFGmY.d.ts} +25 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.mjs +6 -8
- package/dist/index.mjs.map +1 -1
- package/dist/padron.d.ts +28 -1
- package/dist/padron.mjs +2 -2
- package/dist/wsfe.d.ts +23 -27
- package/dist/wsfe.mjs +3 -3
- package/dist/wsmtxca.d.ts +6 -21
- package/dist/wsmtxca.mjs +3 -3
- package/package.json +10 -5
- package/dist/chunk-5O2FESHA.mjs.map +0 -1
- package/dist/chunk-EXECWJEC.mjs.map +0 -1
- package/dist/chunk-VJ2ICMSA.mjs.map +0 -1
- package/dist/chunk-WN62NMUJ.mjs.map +0 -1
- /package/dist/{chunk-PHXH34L6.mjs.map → chunk-WPHD2GQJ.mjs.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h as ArcaEnvironment, A as ArcaClientOptions } from './types-Su7QwloQ.js';
|
|
2
2
|
import { PadronService } from './padron.js';
|
|
3
|
+
import { e as ArcaAuthorizationOutcome, I as IssuanceService, h as ArcaFiscalIssue, o as ArcaSafeErrorMetadata } from './fiscal-evidence-B6UTFGmY.js';
|
|
3
4
|
import { WsfeVoucherInput, WsfeVoucherInfo, WsfeDateInput, WsfeService } from './wsfe.js';
|
|
4
5
|
import { VoucherClass, ReceiverCondition, IssuerCondition } from './constants.js';
|
|
5
|
-
import { e as ArcaAuthorizationOutcome, h as ArcaFiscalIssue, p as ArcaSafeErrorMetadata } from './fiscal-evidence-DaCyGd5o.js';
|
|
6
6
|
import { WsmtxcaService } from './wsmtxca.js';
|
|
7
7
|
|
|
8
8
|
type VoucherCoordinates = {
|
|
@@ -275,19 +275,19 @@ type IssuedVoucher = VoucherCoordinates & {
|
|
|
275
275
|
*/
|
|
276
276
|
qr?: string;
|
|
277
277
|
};
|
|
278
|
-
/** The provider a call targets. It is chosen explicitly, never switched. */
|
|
279
|
-
type IssuanceService = "wsfe" | "wsmtxca";
|
|
280
278
|
type ServiceFor<O extends IssueOptions> = "service" extends keyof O ? "wsmtxca" extends O["service"] ? O extends {
|
|
281
279
|
service: "wsmtxca";
|
|
282
280
|
} ? "wsmtxca" : IssuanceService : "wsfe" : "wsfe";
|
|
283
281
|
type IssueRequest<S extends IssuanceService = "wsfe"> = S extends "wsmtxca" ? WsmtxcaIssueRequest : WsfeVoucherInput;
|
|
284
282
|
/**
|
|
285
283
|
* What issue() would send, derived with zero I/O. The voucher number is absent
|
|
286
|
-
* because it is only known when the number is reserved at issuance.
|
|
284
|
+
* because it is only known when the number is reserved at issuance. `date` is
|
|
285
|
+
* the voucher date as `YYYY-MM-DD`, the same value issue() returns.
|
|
287
286
|
*/
|
|
288
287
|
type IssuePreview<S extends IssuanceService = "wsfe"> = {
|
|
289
288
|
voucherClass: VoucherClass;
|
|
290
289
|
voucherType: number;
|
|
290
|
+
date: string;
|
|
291
291
|
header: FiscalHeader;
|
|
292
292
|
amounts: IssueAmounts;
|
|
293
293
|
request: IssueRequest<S>;
|
|
@@ -509,6 +509,12 @@ type NotePreview<S extends IssuanceService = "wsfe"> = IssuePreview<S> & {
|
|
|
509
509
|
};
|
|
510
510
|
type RecoveryOptions = Pick<IssueOptions, "representedTaxId" | "forceRefresh" | "include" | "abortSignal">;
|
|
511
511
|
type VouchersService = {
|
|
512
|
+
/**
|
|
513
|
+
* Consults one authorized voucher by its coordinates, the same shape a
|
|
514
|
+
* credit note's `for` takes. Returns `null` when ARCA has no such voucher and
|
|
515
|
+
* throws on any other provider error. Reads only: no store and no reserve.
|
|
516
|
+
*/
|
|
517
|
+
lookup(voucher: VoucherCoordinates, options?: PreviewOptions): Promise<VoucherSummary | null>;
|
|
512
518
|
/** Consults a durable reservation. Never allocates or authorizes a voucher. */
|
|
513
519
|
recover<O extends RecoveryOptions = {
|
|
514
520
|
include?: never;
|
|
@@ -604,6 +610,8 @@ type ArcaClient = {
|
|
|
604
610
|
previewCreditNote: VouchersService["previewCreditNote"];
|
|
605
611
|
/** Derives a debit note; reads the original but reserves no number. */
|
|
606
612
|
previewDebitNote: VouchersService["previewDebitNote"];
|
|
613
|
+
/** Consults one authorized voucher; `null` when ARCA has no such voucher. */
|
|
614
|
+
lookup: VouchersService["lookup"];
|
|
607
615
|
wsfe: WsfeService;
|
|
608
616
|
wsmtxca: WsmtxcaService;
|
|
609
617
|
padron: PadronService;
|
|
@@ -612,11 +620,11 @@ type ArcaClient = {
|
|
|
612
620
|
* Creates an ARCA client from the given configuration.
|
|
613
621
|
* Validates the config, wires WSAA authentication and SOAP transport,
|
|
614
622
|
* and returns an object with `issue()`, `preview()`, `issueCreditNote()`,
|
|
615
|
-
* `issueDebitNote()`, `previewCreditNote()`, `previewDebitNote()`, `recover()
|
|
616
|
-
* and the `.wsfe`, `.wsmtxca`, and `.padron` service modules.
|
|
623
|
+
* `issueDebitNote()`, `previewCreditNote()`, `previewDebitNote()`, `recover()`,
|
|
624
|
+
* `lookup()` and the `.wsfe`, `.wsmtxca`, and `.padron` service modules.
|
|
617
625
|
*
|
|
618
626
|
* @throws {ArcaConfigurationError} When the config is missing or invalid.
|
|
619
627
|
*/
|
|
620
628
|
declare function createArcaClient(config?: ArcaClientOptions): ArcaClient;
|
|
621
629
|
|
|
622
|
-
export { type ArcaClient as A, type CreditNoteInput as C, type DebitNoteInput as D, type FceOptions as F, type InvoiceFamily as I, type NotePreview as N, type PeriodNoteInput as P, type Receiver as R, type Tribute as T, type VatItem as V, type WsfeIdentityMatch as W, type AmountItem as a, type ArcaClientConfigView as b, type FiscalHeader as c, type IssuanceFields as d, type
|
|
630
|
+
export { type ArcaClient as A, type CreditNoteInput as C, type DebitNoteInput as D, type FceOptions as F, type InvoiceFamily as I, type NotePreview as N, type PeriodNoteInput as P, type Receiver as R, type Tribute as T, type VatItem as V, type WsfeIdentityMatch as W, type AmountItem as a, type ArcaClientConfigView as b, type FiscalHeader as c, type IssuanceFields as d, type IssueAmounts as e, type IssueCommon as f, type IssueInput as g, type IssueOptions as h, type IssueOutcome as i, type IssuePreview as j, type IssueRequest as k, type IssuedVoucher as l, type ItemLine as m, type PreviewOptions as n, type RecoveryOptions as o, type VatRate as p, type VoucherAmounts as q, type VoucherCoordinates as r, type VoucherSummary as s, type VouchersService as t, type WsmtxcaIssueRequest as u, type WsmtxcaLine as v, createArcaClient as w, matchWsfeVoucherIdentity as x };
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './types-Su7QwloQ.js';
|
|
2
|
-
export { A as ArcaAuthenticationError, a as ArcaAuthenticationErrorOptions, c as ArcaAuthenticationReason, f as ArcaConfigurationError, g as ArcaError,
|
|
2
|
+
export { A as ArcaAuthenticationError, a as ArcaAuthenticationErrorOptions, c as ArcaAuthenticationReason, f as ArcaConfigurationError, g as ArcaError, k as ArcaInputError, l as ArcaInputErrorCode, m as ArcaInputErrorOptions, n as ArcaInvalidSoapResponseError, o as ArcaSafeErrorMetadata, p as ArcaServiceError, q as ArcaSoapFaultError, r as ArcaTransportError, t as isArcaAuthenticationError, u as toArcaSafeErrorMetadata } from './fiscal-evidence-B6UTFGmY.js';
|
package/dist/errors.mjs
CHANGED
|
@@ -110,17 +110,34 @@ declare class ArcaServiceError extends ArcaError {
|
|
|
110
110
|
issues?: readonly ArcaFiscalIssue[];
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Narrow error evidence, safe to log or store: the typed fields the error
|
|
115
|
+
* classes declare, never a cause, stack, raw response, response body preview,
|
|
116
|
+
* endpoint URL, fiscal issues or CAE.
|
|
117
|
+
*/
|
|
114
118
|
type ArcaSafeErrorMetadata = {
|
|
115
119
|
name: string;
|
|
116
120
|
message: string;
|
|
117
121
|
code?: string;
|
|
118
122
|
statusCode?: number;
|
|
123
|
+
contentType?: string;
|
|
124
|
+
service?: ArcaServiceName;
|
|
125
|
+
operation?: string;
|
|
126
|
+
/** ArcaAuthenticationError's stable reason. */
|
|
127
|
+
reason?: ArcaAuthenticationReason;
|
|
128
|
+
providerCode?: string | number;
|
|
129
|
+
faultCode?: string;
|
|
130
|
+
field?: string;
|
|
131
|
+
expected?: string;
|
|
132
|
+
/** ArcaServiceError's provider code, always as a string. */
|
|
133
|
+
serviceCode?: string;
|
|
134
|
+
result?: string;
|
|
135
|
+
resultLevel?: ArcaFiscalResultLevel;
|
|
119
136
|
};
|
|
120
137
|
declare function toArcaSafeErrorMetadata(error: unknown): ArcaSafeErrorMetadata;
|
|
121
138
|
|
|
122
|
-
/** ARCA
|
|
123
|
-
type
|
|
139
|
+
/** The ARCA service a call targets. It is chosen explicitly, never switched. */
|
|
140
|
+
type IssuanceService = "wsfe" | "wsmtxca";
|
|
124
141
|
/** Location of a structured authorization result in the service response. */
|
|
125
142
|
type ArcaFiscalResultLevel = "header" | "detail" | "operation";
|
|
126
143
|
/** Every structured result field exposed by one provider response. */
|
|
@@ -131,7 +148,7 @@ type ArcaFiscalResults = {
|
|
|
131
148
|
};
|
|
132
149
|
/** Source and meaning of one provider issue. */
|
|
133
150
|
type ArcaFiscalIssue = {
|
|
134
|
-
service:
|
|
151
|
+
service: IssuanceService;
|
|
135
152
|
operation: string;
|
|
136
153
|
source: "error" | "observation";
|
|
137
154
|
category: "business" | "infrastructure" | "observation" | "unknown";
|
|
@@ -147,7 +164,7 @@ type ArcaAuthenticationEvidence = {
|
|
|
147
164
|
reason: ArcaAuthenticationReason;
|
|
148
165
|
providerCode?: string | number;
|
|
149
166
|
};
|
|
150
|
-
type ArcaAuthorizationEvidenceBase<TService extends
|
|
167
|
+
type ArcaAuthorizationEvidenceBase<TService extends IssuanceService = IssuanceService> = {
|
|
151
168
|
service: TService;
|
|
152
169
|
operation: string;
|
|
153
170
|
results: ArcaFiscalResults;
|
|
@@ -156,7 +173,7 @@ type ArcaAuthorizationEvidenceBase<TService extends ArcaFiscalService = ArcaFisc
|
|
|
156
173
|
raw?: Record<string, unknown>;
|
|
157
174
|
};
|
|
158
175
|
/** Structured evidence returned by one exact voucher authorization attempt. */
|
|
159
|
-
type ArcaAuthorizationOutcome<TService extends
|
|
176
|
+
type ArcaAuthorizationOutcome<TService extends IssuanceService = IssuanceService> = (ArcaAuthorizationEvidenceBase<TService> & {
|
|
160
177
|
kind: "authorized";
|
|
161
178
|
result: "A" | "O";
|
|
162
179
|
resultLevel: ArcaFiscalResultLevel;
|
|
@@ -178,7 +195,7 @@ type ArcaAuthorizationOutcome<TService extends ArcaFiscalService = ArcaFiscalSer
|
|
|
178
195
|
voucherNumber?: number;
|
|
179
196
|
});
|
|
180
197
|
/** Structured result of consulting one exact voucher number. */
|
|
181
|
-
type ArcaVoucherLookupResult<TVoucher, TService extends
|
|
198
|
+
type ArcaVoucherLookupResult<TVoucher, TService extends IssuanceService = IssuanceService> = {
|
|
182
199
|
kind: "found";
|
|
183
200
|
service: TService;
|
|
184
201
|
operation: string;
|
|
@@ -194,4 +211,4 @@ type ArcaVoucherLookupResult<TVoucher, TService extends ArcaFiscalService = Arca
|
|
|
194
211
|
raw: Record<string, unknown>;
|
|
195
212
|
};
|
|
196
213
|
|
|
197
|
-
export { ArcaAuthenticationError as A, type ArcaAuthenticationErrorOptions as a, type ArcaAuthenticationEvidence as b, type ArcaAuthenticationReason as c, type ArcaAuthorizationIndeterminateReason as d, type ArcaAuthorizationOutcome as e, ArcaConfigurationError as f, ArcaError as g, type ArcaFiscalIssue as h, type ArcaFiscalResultLevel as i, type ArcaFiscalResults as j,
|
|
214
|
+
export { ArcaAuthenticationError as A, type IssuanceService as I, type ArcaAuthenticationErrorOptions as a, type ArcaAuthenticationEvidence as b, type ArcaAuthenticationReason as c, type ArcaAuthorizationIndeterminateReason as d, type ArcaAuthorizationOutcome as e, ArcaConfigurationError as f, ArcaError as g, type ArcaFiscalIssue as h, type ArcaFiscalResultLevel as i, type ArcaFiscalResults as j, ArcaInputError as k, type ArcaInputErrorCode as l, type ArcaInputErrorOptions as m, ArcaInvalidSoapResponseError as n, type ArcaSafeErrorMetadata as o, ArcaServiceError as p, ArcaSoapFaultError as q, ArcaTransportError as r, type ArcaVoucherLookupResult as s, isArcaAuthenticationError as t, toArcaSafeErrorMetadata as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { a as AmountItem, A as ArcaClient, b as ArcaClientConfigView, C as CreditNoteInput, D as DebitNoteInput, F as FceOptions, c as FiscalHeader, I as InvoiceFamily, d as IssuanceFields, e as
|
|
1
|
+
export { a as AmountItem, A as ArcaClient, b as ArcaClientConfigView, C as CreditNoteInput, D as DebitNoteInput, F as FceOptions, c as FiscalHeader, I as InvoiceFamily, d as IssuanceFields, e as IssueAmounts, f as IssueCommon, g as IssueInput, h as IssueOptions, i as IssueOutcome, j as IssuePreview, k as IssueRequest, l as IssuedVoucher, m as ItemLine, N as NotePreview, P as PeriodNoteInput, n as PreviewOptions, R as Receiver, o as RecoveryOptions, T as Tribute, V as VatItem, p as VatRate, q as VoucherAmounts, r as VoucherCoordinates, s as VoucherSummary, t as VouchersService, W as WsfeIdentityMatch, u as WsmtxcaIssueRequest, v as WsmtxcaLine, w as createArcaClient, x as matchWsfeVoucherIdentity } from './client-COK5u3oz.js';
|
|
2
2
|
import { h as ArcaEnvironment, a as ArcaClientConfig, i as ArcaStore, j as ArcaWsaaSessionStore } from './types-Su7QwloQ.js';
|
|
3
3
|
export { g as ArcaAuthCredentials, f as ArcaAuthOptions, A as ArcaClientConfig, k as ArcaLogLevel, l as ArcaLoggerConfig, m as ArcaPadronServiceName, n as ArcaRepresentedTaxId, b as ArcaServiceName, o as ArcaServiceTarget, e as ArcaWsaaServiceId, p as ArcaWsaaSessionKey } from './types-Su7QwloQ.js';
|
|
4
4
|
export { ARCA_FINAL_CONSUMER_IDENTIFICATION_THRESHOLD_MINOR_UNITS, ARCA_INVOICE_CLASS_BY_ISSUER, ARCA_ISSUER_CONDITION_IDS, ARCA_RECEIVER_CONDITION_IDS, IssuerCondition, ReceiverCondition, VoucherClass } from './constants.js';
|
|
5
|
-
export { A as ArcaAuthenticationError, a as ArcaAuthenticationErrorOptions, b as ArcaAuthenticationEvidence, c as ArcaAuthenticationReason, d as ArcaAuthorizationIndeterminateReason, e as ArcaAuthorizationOutcome, f as ArcaConfigurationError, g as ArcaError, h as ArcaFiscalIssue, i as ArcaFiscalResultLevel, j as ArcaFiscalResults, k as
|
|
6
|
-
export { CreatePadronServiceOptions, PadronService, PadronTax, PadronTaxIdLookupResult, PadronTaxpayerResult, createPadronService } from './padron.js';
|
|
7
|
-
export { CreateWsfeServiceOptions, WsfeActivity, WsfeActivityType, WsfeAssociatedPeriod, WsfeAssociatedVoucher, WsfeAuthorizationOutcome,
|
|
8
|
-
export { CreateWsmtxcaServiceOptions, WsmtxcaAuthorizationOutcome,
|
|
5
|
+
export { A as ArcaAuthenticationError, a as ArcaAuthenticationErrorOptions, b as ArcaAuthenticationEvidence, c as ArcaAuthenticationReason, d as ArcaAuthorizationIndeterminateReason, e as ArcaAuthorizationOutcome, f as ArcaConfigurationError, g as ArcaError, h as ArcaFiscalIssue, i as ArcaFiscalResultLevel, j as ArcaFiscalResults, k as ArcaInputError, l as ArcaInputErrorCode, m as ArcaInputErrorOptions, n as ArcaInvalidSoapResponseError, o as ArcaSafeErrorMetadata, p as ArcaServiceError, q as ArcaSoapFaultError, r as ArcaTransportError, s as ArcaVoucherLookupResult, I as IssuanceService, t as isArcaAuthenticationError, u as toArcaSafeErrorMetadata } from './fiscal-evidence-B6UTFGmY.js';
|
|
6
|
+
export { CreatePadronServiceOptions, PadronActivity, PadronAddress, PadronService, PadronTax, PadronTaxIdLookupResult, PadronTaxpayerResult, createPadronService } from './padron.js';
|
|
7
|
+
export { CreateWsfeServiceOptions, WsfeActivity, WsfeActivityType, WsfeAssociatedPeriod, WsfeAssociatedVoucher, WsfeAuthorizationOutcome, WsfeBuyer, WsfeCatalogEntry, WsfeCurrencyType, WsfeDateInput, WsfeIssueInput, WsfeOptionalField, WsfeQuotation, WsfeReceiverVatCondition, WsfeSalesPoint, WsfeServerStatus, WsfeService, WsfeTax, WsfeVatRate, WsfeVoucherInfo, WsfeVoucherInput, WsfeVoucherLookupResult, createWsfeService } from './wsfe.js';
|
|
8
|
+
export { CreateWsmtxcaServiceOptions, WsmtxcaAuthorizationOutcome, WsmtxcaIssueInput, WsmtxcaLastAuthorizedVoucherResult, WsmtxcaSalesPoint, WsmtxcaSalesPointsResult, WsmtxcaService, WsmtxcaVoucherInfo, WsmtxcaVoucherLookupOutcome, createWsmtxcaService } from './wsmtxca.js';
|
|
9
9
|
import './index-DAC3edtw.js';
|
|
10
10
|
|
|
11
11
|
/** Valid ARCA environment names. */
|
|
@@ -24,8 +24,6 @@ type CreateArcaClientConfigFromEnvOptions = {
|
|
|
24
24
|
defaultEnvironment?: ArcaEnvironment;
|
|
25
25
|
variableNames?: Partial<typeof ARCA_ENV_VARIABLES>;
|
|
26
26
|
};
|
|
27
|
-
/** Returns `"production"` or `"test"` based on the boolean flag. */
|
|
28
|
-
declare function resolveArcaEnvironment(production: boolean): ArcaEnvironment;
|
|
29
27
|
/**
|
|
30
28
|
* Builds an {@link ArcaClientConfig} from environment variables.
|
|
31
29
|
* Reads `process.env` by default; override with `options.env`.
|
|
@@ -117,4 +115,4 @@ declare function createRedisStore(client: RedisClient, options?: {
|
|
|
117
115
|
|
|
118
116
|
declare function createMemoryWsaaSessionStore(): ArcaWsaaSessionStore;
|
|
119
117
|
|
|
120
|
-
export { ARCA_ENVIRONMENTS, ARCA_ENV_VARIABLES, ARCA_QR_URL, ArcaEnvironment, type ArcaQrInput, type ArcaQrPayload, ArcaStore, ArcaWsaaSessionStore, type CreateArcaClientConfigFromEnvOptions, arcaQrPayload, arcaQrUrl, assertArcaClientConfig, createArcaClientConfigFromEnv, createFileStore, createMemoryStore, createMemoryWsaaSessionStore, createPostgresStore, createRedisStore
|
|
118
|
+
export { ARCA_ENVIRONMENTS, ARCA_ENV_VARIABLES, ARCA_QR_URL, ArcaEnvironment, type ArcaQrInput, type ArcaQrPayload, ArcaStore, ArcaWsaaSessionStore, type CreateArcaClientConfigFromEnvOptions, arcaQrPayload, arcaQrUrl, assertArcaClientConfig, createArcaClientConfigFromEnv, createFileStore, createMemoryStore, createMemoryWsaaSessionStore, createPostgresStore, createRedisStore };
|
package/dist/index.mjs
CHANGED
|
@@ -11,10 +11,9 @@ import {
|
|
|
11
11
|
createFileStore,
|
|
12
12
|
createMemoryWsaaSessionStore,
|
|
13
13
|
matchWsfeVoucherIdentity,
|
|
14
|
-
resolveArcaEnvironment,
|
|
15
14
|
storeCall,
|
|
16
15
|
withLease
|
|
17
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JP5IBMVI.mjs";
|
|
18
17
|
import {
|
|
19
18
|
ARCA_FINAL_CONSUMER_IDENTIFICATION_THRESHOLD_MINOR_UNITS,
|
|
20
19
|
ARCA_INVOICE_CLASS_BY_ISSUER,
|
|
@@ -23,14 +22,14 @@ import {
|
|
|
23
22
|
} from "./chunk-DHN6OQJP.mjs";
|
|
24
23
|
import {
|
|
25
24
|
createPadronService
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MRBFLBWX.mjs";
|
|
27
26
|
import {
|
|
28
27
|
createWsfeService
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-OORNZFI5.mjs";
|
|
30
29
|
import {
|
|
31
30
|
createWsmtxcaService
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-4RD5VQWC.mjs";
|
|
32
|
+
import "./chunk-WPHD2GQJ.mjs";
|
|
34
33
|
import {
|
|
35
34
|
ArcaAuthenticationError,
|
|
36
35
|
ArcaConfigurationError,
|
|
@@ -42,7 +41,7 @@ import {
|
|
|
42
41
|
ArcaTransportError,
|
|
43
42
|
isArcaAuthenticationError,
|
|
44
43
|
toArcaSafeErrorMetadata
|
|
45
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-EZ4HA3LC.mjs";
|
|
46
45
|
|
|
47
46
|
// src/store/memory.ts
|
|
48
47
|
function createMemoryStore() {
|
|
@@ -250,7 +249,6 @@ export {
|
|
|
250
249
|
createWsmtxcaService,
|
|
251
250
|
isArcaAuthenticationError,
|
|
252
251
|
matchWsfeVoucherIdentity,
|
|
253
|
-
resolveArcaEnvironment,
|
|
254
252
|
toArcaSafeErrorMetadata
|
|
255
253
|
};
|
|
256
254
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/store/memory.ts","../src/store/postgres.ts","../src/store/redis.ts"],"sourcesContent":["import type { ArcaStore } from \"./types\";\n\n/** In-process store for tests; reservations do not survive a restart. */\nexport function createMemoryStore(): ArcaStore {\n const values = new Map<string, string>();\n const locks = new Map<string, Promise<void>>();\n return {\n get: (key) => Promise.resolve(values.get(key) ?? null),\n set(key, value) {\n values.set(key, value);\n return Promise.resolve();\n },\n add(key, value) {\n if (values.has(key)) {\n return Promise.resolve(false);\n }\n values.set(key, value);\n return Promise.resolve(true);\n },\n delete(key) {\n values.delete(key);\n return Promise.resolve();\n },\n async withLock(key, fn) {\n const previous = locks.get(key) ?? Promise.resolve();\n let release: () => void = () => undefined;\n const current = new Promise<void>((resolve) => {\n release = resolve;\n });\n const queued = previous.catch(() => undefined).then(() => current);\n locks.set(key, queued);\n await previous.catch(() => undefined);\n try {\n return await fn();\n } finally {\n release();\n if (locks.get(key) === queued) {\n locks.delete(key);\n }\n }\n },\n };\n}\n","import { ArcaConfigurationError } from \"../errors\";\nimport { ARCA_LEASE_MS, withLease } from \"./lock\";\nimport { type ArcaStore, storeCall } from \"./types\";\n\ntype Row = { key?: string; value?: string };\n/** Uses the caller's SQL client; provision the table before use. */\nexport function createPostgresStore({\n query,\n table = \"arca_store\",\n}: {\n query: (text: string, params: string[]) => Promise<Row[] | { rows: Row[] }>;\n table?: string;\n}): ArcaStore {\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(table)) {\n throw new ArcaConfigurationError(\"Invalid ARCA store table identifier.\");\n }\n const name = `\"${table}\"`;\n const lease = Math.round(ARCA_LEASE_MS / 1000);\n const run = (text: string, params: string[]) =>\n storeCall(async () => {\n const result = await query(text, params);\n return Array.isArray(result) ? result : result.rows;\n });\n return {\n async get(key) {\n return (\n (await run(`SELECT value FROM ${name} WHERE key = $1`, [key]))[0]\n ?.value ?? null\n );\n },\n async set(key, value) {\n await run(\n `INSERT INTO ${name} (key, value) VALUES ($1, $2) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = now()`,\n [key, value]\n );\n },\n async add(key, value) {\n return (\n (\n await run(\n `INSERT INTO ${name} (key, value) VALUES ($1, $2) ON CONFLICT DO NOTHING RETURNING key`,\n [key, value]\n )\n ).length > 0\n );\n },\n async delete(key) {\n await run(`DELETE FROM ${name} WHERE key = $1`, [key]);\n },\n withLock(key, fn) {\n // A lease row, not an advisory lock: it survives a transaction-mode\n // pooler, where a session-scoped lock would be taken on another backend.\n return withLease(\n key,\n {\n async acquire(owner) {\n const taken = await run(\n `INSERT INTO ${name} (key, value) VALUES ($1, $2) ON CONFLICT DO NOTHING RETURNING key`,\n [key, owner]\n );\n if (taken.length > 0) {\n return true;\n }\n const expired = await run(\n `UPDATE ${name} SET value = $2, updated_at = now() WHERE key = $1 AND updated_at < now() - interval '${lease} seconds' RETURNING key`,\n [key, owner]\n );\n return expired.length > 0;\n },\n async renew(owner) {\n await run(\n `UPDATE ${name} SET updated_at = now() WHERE key = $1 AND value = $2`,\n [key, owner]\n );\n },\n async release(owner) {\n await run(`DELETE FROM ${name} WHERE key = $1 AND value = $2`, [\n key,\n owner,\n ]);\n },\n },\n fn\n );\n },\n };\n}\n","import { ArcaConfigurationError } from \"../errors\";\nimport { ARCA_LEASE_MS, withLease } from \"./lock\";\nimport { type ArcaStore, storeCall } from \"./types\";\n\ntype RedisClient = {\n get(key: string): Promise<unknown>;\n set(key: string, value: string): Promise<unknown>;\n call?(...args: string[]): Promise<unknown>;\n del?(key: string): Promise<unknown>;\n};\n/** Uses ioredis or Upstash without importing either driver. */\nexport function createRedisStore(\n client: RedisClient,\n options: { flavor?: \"ioredis\" | \"upstash\" } = {}\n): ArcaStore {\n const flavor =\n options.flavor ??\n (typeof client.call === \"function\" ? \"ioredis\" : \"upstash\");\n if (flavor === \"ioredis\" && !client.call) {\n throw new ArcaConfigurationError(\n \"ARCA Redis ioredis flavor requires client.call.\"\n );\n }\n // The public structural type accepts ioredis's overloaded set method.\n // Only the Upstash flavor invokes its options-object overload.\n const upstashSet = client.set as (\n key: string,\n value: string,\n options: { nx?: true; xx?: true; px?: number }\n ) => Promise<unknown>;\n const read = async (key: string) => {\n const value = await client.get(key);\n if (value === null || value === undefined) {\n return null;\n }\n // Upstash can deserialize stored JSON automatically.\n return typeof value === \"string\" ? value : JSON.stringify(value);\n };\n // A lease, so a crashed holder frees the key; a renewal keeps a live one.\n const lease = (key: string, owner: string, mode: \"nx\" | \"xx\") =>\n storeCall(\n async () =>\n (flavor === \"ioredis\"\n ? await client.call?.(\n \"SET\",\n key,\n owner,\n mode.toUpperCase(),\n \"PX\",\n String(ARCA_LEASE_MS)\n )\n : await upstashSet.call(client, key, owner, {\n [mode]: true,\n px: ARCA_LEASE_MS,\n })) === \"OK\"\n );\n return {\n get: (key) => storeCall(() => read(key)),\n set: (key, value) =>\n storeCall(async () => {\n await client.set(key, value);\n }),\n add: (key, value) =>\n storeCall(\n async () =>\n (flavor === \"ioredis\"\n ? await client.call?.(\"SET\", key, value, \"NX\")\n : await upstashSet.call(client, key, value, { nx: true })) === \"OK\"\n ),\n ...(client.del\n ? {\n delete: (key: string) =>\n storeCall(async () => {\n await client.del?.(key);\n }),\n withLock: <T>(key: string, fn: () => Promise<T>) =>\n withLease(\n key,\n {\n acquire: (owner) => lease(key, owner, \"nx\"),\n renew: async (owner) => {\n // Check and set: only the holder extends its own lease.\n if ((await storeCall(() => read(key))) === owner) {\n await lease(key, owner, \"xx\");\n }\n },\n release: async (owner) => {\n await storeCall(async () => {\n if ((await read(key)) === owner) {\n await client.del?.(key);\n }\n });\n },\n },\n fn\n ),\n }\n : {}),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,oBAA+B;AAC7C,QAAM,SAAS,oBAAI,IAAoB;AACvC,QAAM,QAAQ,oBAAI,IAA2B;AAC7C,SAAO;AAAA,IACL,KAAK,CAAC,QAAQ,QAAQ,QAAQ,OAAO,IAAI,GAAG,KAAK,IAAI;AAAA,IACrD,IAAI,KAAK,OAAO;AACd,aAAO,IAAI,KAAK,KAAK;AACrB,aAAO,QAAQ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AC1C,OAAO,OAAO,UAAU;AAEtB,gBAAK,MAAM,UAAU,MAAM,KAAK,GAAG,CAAC,MAAO,OAAO;AAChD,oBAAM,MAAM,KAAK,OAAO,IAAI;AAAA,YAC9B;AAAA,UACF;AAAA,UACA,SAAS,OAAO,UAAU;AACxB,kBAAM,UAAU,YAAY;AAC1B,kBAAK,MAAM,KAAK,GAAG,MAAO,OAAO;AAC/B,sBAAM,OAAO,MAAM,GAAG;AAAA,cACxB;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF;AAAA,QACA;AAAA,MACF;AAAA,IACJ,IACA,CAAC;AAAA,EACP;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/store/memory.ts","../src/store/postgres.ts","../src/store/redis.ts"],"sourcesContent":["import type { ArcaStore } from \"./types\";\n\n/** In-process store for tests; reservations do not survive a restart. */\nexport function createMemoryStore(): ArcaStore {\n const values = new Map<string, string>();\n const locks = new Map<string, Promise<void>>();\n return {\n get: (key) => Promise.resolve(values.get(key) ?? null),\n set(key, value) {\n values.set(key, value);\n return Promise.resolve();\n },\n add(key, value) {\n if (values.has(key)) {\n return Promise.resolve(false);\n }\n values.set(key, value);\n return Promise.resolve(true);\n },\n delete(key) {\n values.delete(key);\n return Promise.resolve();\n },\n async withLock(key, fn) {\n const previous = locks.get(key) ?? Promise.resolve();\n let release: () => void = () => undefined;\n const current = new Promise<void>((resolve) => {\n release = resolve;\n });\n const queued = previous.catch(() => undefined).then(() => current);\n locks.set(key, queued);\n await previous.catch(() => undefined);\n try {\n return await fn();\n } finally {\n release();\n if (locks.get(key) === queued) {\n locks.delete(key);\n }\n }\n },\n };\n}\n","import { ArcaConfigurationError } from \"../errors\";\nimport { ARCA_LEASE_MS, withLease } from \"./lock\";\nimport { type ArcaStore, storeCall } from \"./types\";\n\ntype Row = { key?: string; value?: string };\n/** Uses the caller's SQL client; provision the table before use. */\nexport function createPostgresStore({\n query,\n table = \"arca_store\",\n}: {\n query: (text: string, params: string[]) => Promise<Row[] | { rows: Row[] }>;\n table?: string;\n}): ArcaStore {\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(table)) {\n throw new ArcaConfigurationError(\"Invalid ARCA store table identifier.\");\n }\n const name = `\"${table}\"`;\n const lease = Math.round(ARCA_LEASE_MS / 1000);\n const run = (text: string, params: string[]) =>\n storeCall(async () => {\n const result = await query(text, params);\n return Array.isArray(result) ? result : result.rows;\n });\n return {\n async get(key) {\n return (\n (await run(`SELECT value FROM ${name} WHERE key = $1`, [key]))[0]\n ?.value ?? null\n );\n },\n async set(key, value) {\n await run(\n `INSERT INTO ${name} (key, value) VALUES ($1, $2) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = now()`,\n [key, value]\n );\n },\n async add(key, value) {\n return (\n (\n await run(\n `INSERT INTO ${name} (key, value) VALUES ($1, $2) ON CONFLICT DO NOTHING RETURNING key`,\n [key, value]\n )\n ).length > 0\n );\n },\n async delete(key) {\n await run(`DELETE FROM ${name} WHERE key = $1`, [key]);\n },\n withLock(key, fn) {\n // A lease row, not an advisory lock: it survives a transaction-mode\n // pooler, where a session-scoped lock would be taken on another backend.\n return withLease(\n key,\n {\n async acquire(owner) {\n const taken = await run(\n `INSERT INTO ${name} (key, value) VALUES ($1, $2) ON CONFLICT DO NOTHING RETURNING key`,\n [key, owner]\n );\n if (taken.length > 0) {\n return true;\n }\n const expired = await run(\n `UPDATE ${name} SET value = $2, updated_at = now() WHERE key = $1 AND updated_at < now() - interval '${lease} seconds' RETURNING key`,\n [key, owner]\n );\n return expired.length > 0;\n },\n async renew(owner) {\n await run(\n `UPDATE ${name} SET updated_at = now() WHERE key = $1 AND value = $2`,\n [key, owner]\n );\n },\n async release(owner) {\n await run(`DELETE FROM ${name} WHERE key = $1 AND value = $2`, [\n key,\n owner,\n ]);\n },\n },\n fn\n );\n },\n };\n}\n","import { ArcaConfigurationError } from \"../errors\";\nimport { ARCA_LEASE_MS, withLease } from \"./lock\";\nimport { type ArcaStore, storeCall } from \"./types\";\n\ntype RedisClient = {\n get(key: string): Promise<unknown>;\n set(key: string, value: string): Promise<unknown>;\n call?(...args: string[]): Promise<unknown>;\n del?(key: string): Promise<unknown>;\n};\n/** Uses ioredis or Upstash without importing either driver. */\nexport function createRedisStore(\n client: RedisClient,\n options: { flavor?: \"ioredis\" | \"upstash\" } = {}\n): ArcaStore {\n const flavor =\n options.flavor ??\n (typeof client.call === \"function\" ? \"ioredis\" : \"upstash\");\n if (flavor === \"ioredis\" && !client.call) {\n throw new ArcaConfigurationError(\n \"ARCA Redis ioredis flavor requires client.call.\"\n );\n }\n // The public structural type accepts ioredis's overloaded set method.\n // Only the Upstash flavor invokes its options-object overload.\n const upstashSet = client.set as (\n key: string,\n value: string,\n options: { nx?: true; xx?: true; px?: number }\n ) => Promise<unknown>;\n const read = async (key: string) => {\n const value = await client.get(key);\n if (value === null || value === undefined) {\n return null;\n }\n // Upstash can deserialize stored JSON automatically.\n return typeof value === \"string\" ? value : JSON.stringify(value);\n };\n // A lease, so a crashed holder frees the key; a renewal keeps a live one.\n const lease = (key: string, owner: string, mode: \"nx\" | \"xx\") =>\n storeCall(\n async () =>\n (flavor === \"ioredis\"\n ? await client.call?.(\n \"SET\",\n key,\n owner,\n mode.toUpperCase(),\n \"PX\",\n String(ARCA_LEASE_MS)\n )\n : await upstashSet.call(client, key, owner, {\n [mode]: true,\n px: ARCA_LEASE_MS,\n })) === \"OK\"\n );\n return {\n get: (key) => storeCall(() => read(key)),\n set: (key, value) =>\n storeCall(async () => {\n await client.set(key, value);\n }),\n add: (key, value) =>\n storeCall(\n async () =>\n (flavor === \"ioredis\"\n ? await client.call?.(\"SET\", key, value, \"NX\")\n : await upstashSet.call(client, key, value, { nx: true })) === \"OK\"\n ),\n ...(client.del\n ? {\n delete: (key: string) =>\n storeCall(async () => {\n await client.del?.(key);\n }),\n withLock: <T>(key: string, fn: () => Promise<T>) =>\n withLease(\n key,\n {\n acquire: (owner) => lease(key, owner, \"nx\"),\n renew: async (owner) => {\n // Check and set: only the holder extends its own lease.\n if ((await storeCall(() => read(key))) === owner) {\n await lease(key, owner, \"xx\");\n }\n },\n release: async (owner) => {\n await storeCall(async () => {\n if ((await read(key)) === owner) {\n await client.del?.(key);\n }\n });\n },\n },\n fn\n ),\n }\n : {}),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,oBAA+B;AAC7C,QAAM,SAAS,oBAAI,IAAoB;AACvC,QAAM,QAAQ,oBAAI,IAA2B;AAC7C,SAAO;AAAA,IACL,KAAK,CAAC,QAAQ,QAAQ,QAAQ,OAAO,IAAI,GAAG,KAAK,IAAI;AAAA,IACrD,IAAI,KAAK,OAAO;AACd,aAAO,IAAI,KAAK,KAAK;AACrB,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAAA,IACA,IAAI,KAAK,OAAO;AACd,UAAI,OAAO,IAAI,GAAG,GAAG;AACnB,eAAO,QAAQ,QAAQ,KAAK;AAAA,MAC9B;AACA,aAAO,IAAI,KAAK,KAAK;AACrB,aAAO,QAAQ,QAAQ,IAAI;AAAA,IAC7B;AAAA,IACA,OAAO,KAAK;AACV,aAAO,OAAO,GAAG;AACjB,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAAA,IACA,MAAM,SAAS,KAAK,IAAI;AACtB,YAAM,WAAW,MAAM,IAAI,GAAG,KAAK,QAAQ,QAAQ;AACnD,UAAI,UAAsB,MAAM;AAChC,YAAM,UAAU,IAAI,QAAc,CAAC,YAAY;AAC7C,kBAAU;AAAA,MACZ,CAAC;AACD,YAAM,SAAS,SAAS,MAAM,MAAM,MAAS,EAAE,KAAK,MAAM,OAAO;AACjE,YAAM,IAAI,KAAK,MAAM;AACrB,YAAM,SAAS,MAAM,MAAM,MAAS;AACpC,UAAI;AACF,eAAO,MAAM,GAAG;AAAA,MAClB,UAAE;AACA,gBAAQ;AACR,YAAI,MAAM,IAAI,GAAG,MAAM,QAAQ;AAC7B,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AAC,KAAK,UACT,UAAU,YAAY;AACpB,YAAM,OAAO,IAAI,KAAK,KAAK;AAAA,IAC7B,CAAC;AAAA,IACH,KAAK,CAAC,KAAK,UACT;AAAA,MACE,aACG,WAAW,YACR,MAAM,OAAO,OAAO,OAAO,KAAK,OAAO,IAAI,IAC3C,MAAM,WAAW,KAAK,QAAQ,KAAK,OAAO,EAAE,IAAI,KAAK,CAAC,OAAO;AAAA,IACrE;AAAA,IACF,GAAI,OAAO,MACP;AAAA,MACE,QAAQ,CAAC,QACP,UAAU,YAAY;AACpB,cAAM,OAAO,MAAM,GAAG;AAAA,MACxB,CAAC;AAAA,MACH,UAAU,CAAI,KAAa,OACzB;AAAA,QACE;AAAA,QACA;AAAA,UACE,SAAS,CAAC,UAAU,MAAM,KAAK,OAAO,IAAI;AAAA,UAC1C,OAAO,OAAO,UAAU;AAEtB,gBAAK,MAAM,UAAU,MAAM,KAAK,GAAG,CAAC,MAAO,OAAO;AAChD,oBAAM,MAAM,KAAK,OAAO,IAAI;AAAA,YAC9B;AAAA,UACF;AAAA,UACA,SAAS,OAAO,UAAU;AACxB,kBAAM,UAAU,YAAY;AAC1B,kBAAK,MAAM,KAAK,GAAG,MAAO,OAAO;AAC/B,sBAAM,OAAO,MAAM,GAAG;AAAA,cACxB;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF;AAAA,QACA;AAAA,MACF;AAAA,IACJ,IACA,CAAC;AAAA,EACP;AACF;","names":[]}
|
package/dist/padron.d.ts
CHANGED
|
@@ -10,11 +10,32 @@ type PadronTax = {
|
|
|
10
10
|
state?: string;
|
|
11
11
|
regime: "general" | "monotributo";
|
|
12
12
|
};
|
|
13
|
+
/** The domicilio fiscal. A field ARCA omits is absent. */
|
|
14
|
+
type PadronAddress = {
|
|
15
|
+
street?: string;
|
|
16
|
+
city?: string;
|
|
17
|
+
postalCode?: string;
|
|
18
|
+
/** ARCA's province code, the one invoices and IIBB registrations use. */
|
|
19
|
+
provinceId?: number;
|
|
20
|
+
province?: string;
|
|
21
|
+
};
|
|
22
|
+
/** One economic activity registered under a regime. */
|
|
23
|
+
type PadronActivity = {
|
|
24
|
+
/** The six-digit NAES code, zero-padded, such as `011211`. */
|
|
25
|
+
id: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
/** ARCA's ordering; `1` is the main activity. */
|
|
28
|
+
order?: number;
|
|
29
|
+
/** The period the activity starts, as `YYYY-MM`. */
|
|
30
|
+
since?: string;
|
|
31
|
+
regime: "general" | "monotributo";
|
|
32
|
+
};
|
|
13
33
|
/** Result of a taxpayer lookup via Padron A5. */
|
|
14
34
|
type PadronTaxpayerResult = {
|
|
15
35
|
taxId: string;
|
|
16
36
|
personType?: string;
|
|
17
37
|
name?: string;
|
|
38
|
+
address?: PadronAddress;
|
|
18
39
|
/**
|
|
19
40
|
* The receiver condition to invoice this taxpayer under, derived from its
|
|
20
41
|
* active IVA registrations: 30 is responsable inscripto, 20 monotributo, 32
|
|
@@ -24,6 +45,12 @@ type PadronTaxpayerResult = {
|
|
|
24
45
|
*/
|
|
25
46
|
condition?: ReceiverCondition;
|
|
26
47
|
taxes: PadronTax[];
|
|
48
|
+
activities: PadronActivity[];
|
|
49
|
+
/**
|
|
50
|
+
* The constancia's own errors, such as an unresolved domicilio. Empty when
|
|
51
|
+
* there are none. A taxpayer with errors has no `condition`.
|
|
52
|
+
*/
|
|
53
|
+
errors: string[];
|
|
27
54
|
raw: Record<string, unknown>;
|
|
28
55
|
};
|
|
29
56
|
/** Result of a tax ID lookup by document number via Padron A13. */
|
|
@@ -46,4 +73,4 @@ type CreatePadronServiceOptions = {
|
|
|
46
73
|
/** Creates a Padron service instance wired with authentication and SOAP transport. */
|
|
47
74
|
declare function createPadronService(options: CreatePadronServiceOptions): PadronService;
|
|
48
75
|
|
|
49
|
-
export { type CreatePadronServiceOptions, type PadronService, type PadronTax, type PadronTaxIdLookupResult, type PadronTaxpayerResult, createPadronService };
|
|
76
|
+
export { type CreatePadronServiceOptions, type PadronActivity, type PadronAddress, type PadronService, type PadronTax, type PadronTaxIdLookupResult, type PadronTaxpayerResult, createPadronService };
|
package/dist/padron.mjs
CHANGED
package/dist/wsfe.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ArcaClientConfig } from './types-Su7QwloQ.js';
|
|
2
2
|
import { W as WsaaAuthModule, S as SoapTransport } from './index-DAC3edtw.js';
|
|
3
|
-
import { e as ArcaAuthorizationOutcome,
|
|
3
|
+
import { e as ArcaAuthorizationOutcome, s as ArcaVoucherLookupResult } from './fiscal-evidence-B6UTFGmY.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}`;
|
|
@@ -75,8 +75,8 @@ type WsfeVoucherInput = {
|
|
|
75
75
|
buyers?: WsfeBuyer[];
|
|
76
76
|
activities?: WsfeActivity[];
|
|
77
77
|
};
|
|
78
|
-
/** Input for
|
|
79
|
-
type
|
|
78
|
+
/** Input for {@link WsfeService.issue}: one voucher with an explicit number. */
|
|
79
|
+
type WsfeIssueInput = {
|
|
80
80
|
representedTaxId?: number | string;
|
|
81
81
|
data: WsfeVoucherInput;
|
|
82
82
|
voucherNumber: number;
|
|
@@ -86,14 +86,18 @@ type WsfeAuthorizeVoucherInput = {
|
|
|
86
86
|
};
|
|
87
87
|
/** Structured evidence from one exact WSFE authorization attempt. */
|
|
88
88
|
type WsfeAuthorizationOutcome = ArcaAuthorizationOutcome<"wsfe">;
|
|
89
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* A point-of-sale entry returned by {@link WsfeService.getSalesPoints}, in the
|
|
91
|
+
* same shape as a WSMTXCA one. `deletedAt` is `YYYY-MM-DD` and absent while the
|
|
92
|
+
* point is active.
|
|
93
|
+
*/
|
|
90
94
|
type WsfeSalesPoint = {
|
|
91
95
|
number: number;
|
|
92
96
|
emissionType?: string;
|
|
93
|
-
blocked
|
|
94
|
-
|
|
97
|
+
blocked: boolean;
|
|
98
|
+
deletedAt?: string;
|
|
95
99
|
};
|
|
96
|
-
/** Voucher details returned by {@link WsfeService.
|
|
100
|
+
/** Voucher details returned by {@link WsfeService.lookupVoucher}. */
|
|
97
101
|
type WsfeVoucherInfo = {
|
|
98
102
|
voucherNumber: number;
|
|
99
103
|
voucherDate?: string;
|
|
@@ -162,7 +166,7 @@ type WsfeService = {
|
|
|
162
166
|
* `voucherNumber`, without transport retries, returning structured evidence
|
|
163
167
|
* (`authorized`, `rejected` or `indeterminate`) instead of throwing.
|
|
164
168
|
*/
|
|
165
|
-
issue(input:
|
|
169
|
+
issue(input: WsfeIssueInput): Promise<WsfeAuthorizationOutcome>;
|
|
166
170
|
/** Returns the next available voucher number for the given sales point and type. */
|
|
167
171
|
getNextVoucherNumber(input: {
|
|
168
172
|
representedTaxId?: number | string;
|
|
@@ -172,52 +176,52 @@ type WsfeService = {
|
|
|
172
176
|
abortSignal?: AbortSignal;
|
|
173
177
|
}): Promise<number>;
|
|
174
178
|
/** Lists all configured points of sale for the taxpayer. */
|
|
175
|
-
getSalesPoints(input
|
|
179
|
+
getSalesPoints(input?: {
|
|
176
180
|
representedTaxId?: number | string;
|
|
177
181
|
forceRefresh?: boolean;
|
|
178
182
|
}): Promise<WsfeSalesPoint[]>;
|
|
179
183
|
/** Lists voucher types accepted by WSFE. */
|
|
180
|
-
getVoucherTypes(input
|
|
184
|
+
getVoucherTypes(input?: {
|
|
181
185
|
representedTaxId?: number | string;
|
|
182
186
|
forceRefresh?: boolean;
|
|
183
187
|
}): Promise<WsfeCatalogEntry[]>;
|
|
184
188
|
/** Lists document types accepted by WSFE. */
|
|
185
|
-
getDocumentTypes(input
|
|
189
|
+
getDocumentTypes(input?: {
|
|
186
190
|
representedTaxId?: number | string;
|
|
187
191
|
forceRefresh?: boolean;
|
|
188
192
|
}): Promise<WsfeCatalogEntry[]>;
|
|
189
193
|
/** Lists concept types accepted by WSFE. */
|
|
190
|
-
getConceptTypes(input
|
|
194
|
+
getConceptTypes(input?: {
|
|
191
195
|
representedTaxId?: number | string;
|
|
192
196
|
forceRefresh?: boolean;
|
|
193
197
|
}): Promise<WsfeCatalogEntry[]>;
|
|
194
198
|
/** Lists live ARCA currency identifiers such as PES and DOL, not ISO codes. */
|
|
195
|
-
getCurrencyTypes(input
|
|
199
|
+
getCurrencyTypes(input?: {
|
|
196
200
|
representedTaxId?: number | string;
|
|
197
201
|
forceRefresh?: boolean;
|
|
198
202
|
}): Promise<WsfeCurrencyType[]>;
|
|
199
203
|
/** Lists VAT rates accepted by WSFE. */
|
|
200
|
-
getVatRates(input
|
|
204
|
+
getVatRates(input?: {
|
|
201
205
|
representedTaxId?: number | string;
|
|
202
206
|
forceRefresh?: boolean;
|
|
203
207
|
}): Promise<WsfeCatalogEntry[]>;
|
|
204
208
|
/** Lists tax types accepted by WSFE. */
|
|
205
|
-
getTaxTypes(input
|
|
209
|
+
getTaxTypes(input?: {
|
|
206
210
|
representedTaxId?: number | string;
|
|
207
211
|
forceRefresh?: boolean;
|
|
208
212
|
}): Promise<WsfeCatalogEntry[]>;
|
|
209
213
|
/** Lists optional field types accepted by WSFE. */
|
|
210
|
-
getOptionalTypes(input
|
|
214
|
+
getOptionalTypes(input?: {
|
|
211
215
|
representedTaxId?: number | string;
|
|
212
216
|
forceRefresh?: boolean;
|
|
213
217
|
}): Promise<WsfeCatalogEntry[]>;
|
|
214
218
|
/** Lists activities enabled for the taxpayer. */
|
|
215
|
-
getActivities(input
|
|
219
|
+
getActivities(input?: {
|
|
216
220
|
representedTaxId?: number | string;
|
|
217
221
|
forceRefresh?: boolean;
|
|
218
222
|
}): Promise<WsfeActivityType[]>;
|
|
219
223
|
/** Lists receiver VAT condition values accepted by WSFE. */
|
|
220
|
-
getReceiverVatConditions(input
|
|
224
|
+
getReceiverVatConditions(input?: {
|
|
221
225
|
representedTaxId?: number | string;
|
|
222
226
|
voucherClass?: string;
|
|
223
227
|
forceRefresh?: boolean;
|
|
@@ -230,14 +234,6 @@ type WsfeService = {
|
|
|
230
234
|
representedTaxId?: number | string;
|
|
231
235
|
forceRefresh?: boolean;
|
|
232
236
|
}): Promise<WsfeQuotation>;
|
|
233
|
-
/** Retrieves details for a specific voucher. Returns `null` if not found. */
|
|
234
|
-
getVoucherInfo(input: {
|
|
235
|
-
representedTaxId?: number | string;
|
|
236
|
-
number: number;
|
|
237
|
-
salesPoint: number;
|
|
238
|
-
voucherType: number;
|
|
239
|
-
forceRefresh?: boolean;
|
|
240
|
-
}): Promise<WsfeVoucherInfo | null>;
|
|
241
237
|
/** Consults one exact voucher and normalizes WSFE error 602 to `not_found`. */
|
|
242
238
|
lookupVoucher(input: {
|
|
243
239
|
representedTaxId?: number | string;
|
|
@@ -256,4 +252,4 @@ type CreateWsfeServiceOptions = {
|
|
|
256
252
|
/** Creates a WSFE service instance wired with authentication and SOAP transport. */
|
|
257
253
|
declare function createWsfeService(options: CreateWsfeServiceOptions): WsfeService;
|
|
258
254
|
|
|
259
|
-
export { type CreateWsfeServiceOptions, type WsfeActivity, type WsfeActivityType, type WsfeAssociatedPeriod, type WsfeAssociatedVoucher, type WsfeAuthorizationOutcome, type
|
|
255
|
+
export { type CreateWsfeServiceOptions, type WsfeActivity, type WsfeActivityType, type WsfeAssociatedPeriod, type WsfeAssociatedVoucher, type WsfeAuthorizationOutcome, type WsfeBuyer, type WsfeCatalogEntry, type WsfeCurrencyType, type WsfeDateInput, type WsfeIssueInput, type WsfeOptionalField, type WsfeQuotation, type WsfeReceiverVatCondition, type WsfeSalesPoint, type WsfeServerStatus, type WsfeService, type WsfeTax, type WsfeVatRate, type WsfeVoucherInfo, type WsfeVoucherInput, type WsfeVoucherLookupResult, createWsfeService };
|
package/dist/wsfe.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWsfeService
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-OORNZFI5.mjs";
|
|
4
|
+
import "./chunk-WPHD2GQJ.mjs";
|
|
5
|
+
import "./chunk-EZ4HA3LC.mjs";
|
|
6
6
|
export {
|
|
7
7
|
createWsfeService
|
|
8
8
|
};
|
package/dist/wsmtxca.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as ArcaRepresentedTaxId, a as ArcaClientConfig } from './types-Su7QwloQ.js';
|
|
2
2
|
import { W as WsaaAuthModule, S as SoapTransport } from './index-DAC3edtw.js';
|
|
3
|
-
import { e as ArcaAuthorizationOutcome,
|
|
3
|
+
import { e as ArcaAuthorizationOutcome, s as ArcaVoucherLookupResult } from './fiscal-evidence-B6UTFGmY.js';
|
|
4
4
|
|
|
5
|
-
/** Input
|
|
6
|
-
type
|
|
5
|
+
/** Input for {@link WsmtxcaService.issue}: one WSMTXCA voucher request. */
|
|
6
|
+
type WsmtxcaIssueInput = {
|
|
7
7
|
representedTaxId?: ArcaRepresentedTaxId;
|
|
8
8
|
data: Record<string, unknown>;
|
|
9
9
|
forceRefresh?: boolean;
|
|
@@ -53,20 +53,13 @@ type WsmtxcaVoucherInfo = {
|
|
|
53
53
|
};
|
|
54
54
|
/** Typed exact-voucher consultation result for WSMTXCA. */
|
|
55
55
|
type WsmtxcaVoucherLookupOutcome = ArcaVoucherLookupResult<WsmtxcaVoucherInfo, "wsmtxca">;
|
|
56
|
-
/** Result of looking up a specific WSMTXCA voucher. */
|
|
57
|
-
type WsmtxcaVoucherLookupResult = {
|
|
58
|
-
invoiceDate: string;
|
|
59
|
-
voucher: Record<string, unknown>;
|
|
60
|
-
messages: string[];
|
|
61
|
-
raw: Record<string, unknown>;
|
|
62
|
-
};
|
|
63
56
|
/** WSMTXCA electronic invoicing service (Factura de Crédito Electrónica). */
|
|
64
57
|
type WsmtxcaService = {
|
|
65
58
|
/**
|
|
66
59
|
* Issues one exact voucher: a single autorizarComprobante without transport
|
|
67
60
|
* retries, returning structured evidence instead of throwing.
|
|
68
61
|
*/
|
|
69
|
-
issue(input:
|
|
62
|
+
issue(input: WsmtxcaIssueInput): Promise<WsmtxcaAuthorizationOutcome>;
|
|
70
63
|
/** Returns the last authorized voucher number for the given sales point and type. */
|
|
71
64
|
getLastAuthorizedVoucher(input: {
|
|
72
65
|
representedTaxId?: ArcaRepresentedTaxId;
|
|
@@ -76,7 +69,7 @@ type WsmtxcaService = {
|
|
|
76
69
|
abortSignal?: AbortSignal;
|
|
77
70
|
}): Promise<WsmtxcaLastAuthorizedVoucherResult>;
|
|
78
71
|
/** Returns the points of sale enabled for WSMTXCA. */
|
|
79
|
-
getSalesPoints(input
|
|
72
|
+
getSalesPoints(input?: {
|
|
80
73
|
representedTaxId?: ArcaRepresentedTaxId;
|
|
81
74
|
forceRefresh?: boolean;
|
|
82
75
|
}): Promise<WsmtxcaSalesPointsResult>;
|
|
@@ -89,14 +82,6 @@ type WsmtxcaService = {
|
|
|
89
82
|
forceRefresh?: boolean;
|
|
90
83
|
abortSignal?: AbortSignal;
|
|
91
84
|
}): Promise<WsmtxcaVoucherLookupOutcome>;
|
|
92
|
-
/** Retrieves details for a specific voucher. */
|
|
93
|
-
getVoucher(input: {
|
|
94
|
-
representedTaxId?: ArcaRepresentedTaxId;
|
|
95
|
-
voucherType: number;
|
|
96
|
-
salesPoint: number;
|
|
97
|
-
voucherNumber: number;
|
|
98
|
-
forceRefresh?: boolean;
|
|
99
|
-
}): Promise<WsmtxcaVoucherLookupResult>;
|
|
100
85
|
};
|
|
101
86
|
type CreateWsmtxcaServiceOptions = {
|
|
102
87
|
config: ArcaClientConfig;
|
|
@@ -106,4 +91,4 @@ type CreateWsmtxcaServiceOptions = {
|
|
|
106
91
|
/** Creates a WSMTXCA service instance wired with authentication and SOAP transport. */
|
|
107
92
|
declare function createWsmtxcaService(options: CreateWsmtxcaServiceOptions): WsmtxcaService;
|
|
108
93
|
|
|
109
|
-
export { type CreateWsmtxcaServiceOptions, type WsmtxcaAuthorizationOutcome, type
|
|
94
|
+
export { type CreateWsmtxcaServiceOptions, type WsmtxcaAuthorizationOutcome, type WsmtxcaIssueInput, type WsmtxcaLastAuthorizedVoucherResult, type WsmtxcaSalesPoint, type WsmtxcaSalesPointsResult, type WsmtxcaService, type WsmtxcaVoucherInfo, type WsmtxcaVoucherLookupOutcome, createWsmtxcaService };
|
package/dist/wsmtxca.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWsmtxcaService
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-4RD5VQWC.mjs";
|
|
4
|
+
import "./chunk-WPHD2GQJ.mjs";
|
|
5
|
+
import "./chunk-EZ4HA3LC.mjs";
|
|
6
6
|
export {
|
|
7
7
|
createWsmtxcaService
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "facturas",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "SDK de facturación electrónica con ARCA / AFIP
|
|
3
|
+
"version": "0.18.0",
|
|
4
|
+
"description": "SDK de TypeScript para facturación electrónica con ARCA / AFIP: facturas, notas de crédito y débito, y Padrón con una sola API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"author": "
|
|
8
|
-
"homepage": "https://
|
|
7
|
+
"author": "LaPyme",
|
|
8
|
+
"homepage": "https://facturas-sdk.dev",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/LaPyme/facturas.git"
|
|
@@ -21,7 +21,12 @@
|
|
|
21
21
|
"wsfe",
|
|
22
22
|
"wsmtxca",
|
|
23
23
|
"padron",
|
|
24
|
-
"facturacion-electronica"
|
|
24
|
+
"facturacion-electronica",
|
|
25
|
+
"factura",
|
|
26
|
+
"facturacion",
|
|
27
|
+
"cae",
|
|
28
|
+
"typescript",
|
|
29
|
+
"sdk"
|
|
25
30
|
],
|
|
26
31
|
"engines": {
|
|
27
32
|
"node": ">=22"
|