facturas 0.20.5 → 0.21.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/{chunk-B2M64SIK.mjs → chunk-4PSLYA2B.mjs} +2 -2
- package/dist/{chunk-VEKUMXHW.mjs → chunk-FQD2PZXE.mjs} +4 -4
- package/dist/{chunk-YPQJRSTA.mjs → chunk-HLSFMWRT.mjs} +2 -2
- package/dist/{chunk-EXJMG54W.mjs → chunk-HSGTCGUX.mjs} +4 -4
- package/dist/{chunk-NT2A6YMO.mjs → chunk-Q7IURW54.mjs} +12 -1
- package/dist/chunk-Q7IURW54.mjs.map +1 -0
- package/dist/{chunk-UOIZQMA6.mjs → chunk-QHNI4ZIA.mjs} +3 -3
- package/dist/{chunk-KBEV7QTU.mjs → chunk-WEEV76IC.mjs} +71 -36
- package/dist/chunk-WEEV76IC.mjs.map +1 -0
- package/dist/cli.d.ts +4 -4
- package/dist/cli.mjs +7 -7
- package/dist/{client-BgWH_jKT.d.ts → client-CP1PQD_j.d.ts} +2 -2
- package/dist/errors.d.ts +2 -2
- package/dist/errors.mjs +3 -1
- package/dist/{fiscal-evidence-Bg4o9nxt.d.ts → fiscal-evidence-Cp-ntg5p.d.ts} +20 -4
- package/dist/{index-DAC3edtw.d.ts → index-abxokwjJ.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +32 -13
- package/dist/index.mjs.map +1 -1
- package/dist/padron.d.ts +2 -2
- package/dist/padron.mjs +3 -3
- package/dist/{types-Su7QwloQ.d.ts → types-DhrPnj3r.d.ts} +12 -3
- package/dist/types.d.ts +1 -1
- package/dist/wsfe.d.ts +3 -3
- package/dist/wsfe.mjs +4 -4
- package/dist/wsmtxca.d.ts +3 -3
- package/dist/wsmtxca.mjs +4 -4
- package/package.json +1 -1
- package/dist/chunk-KBEV7QTU.mjs.map +0 -1
- package/dist/chunk-NT2A6YMO.mjs.map +0 -1
- /package/dist/{chunk-B2M64SIK.mjs.map → chunk-4PSLYA2B.mjs.map} +0 -0
- /package/dist/{chunk-VEKUMXHW.mjs.map → chunk-FQD2PZXE.mjs.map} +0 -0
- /package/dist/{chunk-YPQJRSTA.mjs.map → chunk-HLSFMWRT.mjs.map} +0 -0
- /package/dist/{chunk-EXJMG54W.mjs.map → chunk-HSGTCGUX.mjs.map} +0 -0
- /package/dist/{chunk-UOIZQMA6.mjs.map → chunk-QHNI4ZIA.mjs.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ArcaServiceError,
|
|
4
4
|
ArcaSoapFaultError,
|
|
5
5
|
isArcaAuthenticationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q7IURW54.mjs";
|
|
7
7
|
|
|
8
8
|
// src/internal/authentication.ts
|
|
9
9
|
var WSFE_AUTHENTICATION_CODES = {
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
createArcaAuthenticationEvidence,
|
|
177
177
|
executeWithAuthenticationRecovery
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-4PSLYA2B.mjs.map
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
parseLastAuthorizedNumber,
|
|
3
3
|
parseOptionalResponseInteger,
|
|
4
4
|
parseResponseInteger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HLSFMWRT.mjs";
|
|
6
6
|
import {
|
|
7
7
|
classifyArcaAuthenticationError,
|
|
8
8
|
classifyArcaAuthenticationIssues,
|
|
9
9
|
createArcaAuthenticationEvidence,
|
|
10
10
|
executeWithAuthenticationRecovery
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4PSLYA2B.mjs";
|
|
12
12
|
import {
|
|
13
13
|
ArcaInputError,
|
|
14
14
|
ArcaInvalidSoapResponseError,
|
|
15
15
|
ArcaServiceError,
|
|
16
16
|
ArcaSoapFaultError,
|
|
17
17
|
ArcaTransportError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Q7IURW54.mjs";
|
|
19
19
|
|
|
20
20
|
// src/internal/dates.ts
|
|
21
21
|
function toIsoDate(value) {
|
|
@@ -1532,4 +1532,4 @@ export {
|
|
|
1532
1532
|
normalizeWsfeVoucherInput,
|
|
1533
1533
|
normalizeWsfeDateInput
|
|
1534
1534
|
};
|
|
1535
|
-
//# sourceMappingURL=chunk-
|
|
1535
|
+
//# sourceMappingURL=chunk-FQD2PZXE.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ArcaInvalidSoapResponseError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q7IURW54.mjs";
|
|
4
4
|
|
|
5
5
|
// src/internal/response-integer.ts
|
|
6
6
|
function parseResponseInteger(value, { service, operation, field, min, max }) {
|
|
@@ -35,4 +35,4 @@ export {
|
|
|
35
35
|
parseOptionalResponseInteger,
|
|
36
36
|
parseLastAuthorizedNumber
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-HLSFMWRT.mjs.map
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
parseLastAuthorizedNumber,
|
|
3
3
|
parseOptionalResponseInteger,
|
|
4
4
|
parseResponseInteger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HLSFMWRT.mjs";
|
|
6
6
|
import {
|
|
7
7
|
classifyArcaAuthenticationError,
|
|
8
8
|
classifyArcaAuthenticationIssues,
|
|
9
9
|
createArcaAuthenticationEvidence,
|
|
10
10
|
executeWithAuthenticationRecovery
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4PSLYA2B.mjs";
|
|
12
12
|
import {
|
|
13
13
|
ArcaInputError,
|
|
14
14
|
ArcaInvalidSoapResponseError,
|
|
15
15
|
ArcaServiceError,
|
|
16
16
|
ArcaSoapFaultError,
|
|
17
17
|
ArcaTransportError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Q7IURW54.mjs";
|
|
19
19
|
|
|
20
20
|
// src/services/wsmtxca.ts
|
|
21
21
|
function createWsmtxcaService(options) {
|
|
@@ -677,4 +677,4 @@ function formatCompactDateToIso(dateValue) {
|
|
|
677
677
|
export {
|
|
678
678
|
createWsmtxcaService
|
|
679
679
|
};
|
|
680
|
-
//# sourceMappingURL=chunk-
|
|
680
|
+
//# sourceMappingURL=chunk-HSGTCGUX.mjs.map
|
|
@@ -94,6 +94,14 @@ var ArcaConfigurationError = class extends ArcaError {
|
|
|
94
94
|
super(message, "ARCA_CONFIGURATION_ERROR", options);
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
+
var ArcaLockTimeoutError = class extends ArcaError {
|
|
98
|
+
name = "ArcaLockTimeoutError";
|
|
99
|
+
reason;
|
|
100
|
+
constructor(message, options) {
|
|
101
|
+
super(message, "ARCA_LOCK_TIMEOUT", options);
|
|
102
|
+
this.reason = options.reason;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
97
105
|
var ArcaInputError = class extends ArcaError {
|
|
98
106
|
name = "ArcaInputError";
|
|
99
107
|
field;
|
|
@@ -226,6 +234,8 @@ function toArcaSafeErrorMetadata(error) {
|
|
|
226
234
|
reason: error.reason,
|
|
227
235
|
providerCode: error.providerCode
|
|
228
236
|
});
|
|
237
|
+
} else if (error instanceof ArcaLockTimeoutError) {
|
|
238
|
+
Object.assign(fields, { reason: error.reason });
|
|
229
239
|
} else if (error instanceof ArcaTransportError) {
|
|
230
240
|
Object.assign(fields, {
|
|
231
241
|
statusCode: error.statusCode,
|
|
@@ -262,6 +272,7 @@ export {
|
|
|
262
272
|
createSafeErrorDiagnostic,
|
|
263
273
|
ArcaError,
|
|
264
274
|
ArcaConfigurationError,
|
|
275
|
+
ArcaLockTimeoutError,
|
|
265
276
|
ArcaInputError,
|
|
266
277
|
ArcaAuthenticationError,
|
|
267
278
|
isArcaAuthenticationError,
|
|
@@ -271,4 +282,4 @@ export {
|
|
|
271
282
|
ArcaServiceError,
|
|
272
283
|
toArcaSafeErrorMetadata
|
|
273
284
|
};
|
|
274
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-Q7IURW54.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/redaction.ts","../src/errors.ts"],"sourcesContent":["export const MAX_DIAGNOSTIC_PREVIEW_LENGTH = 4096;\n\nconst MAX_DIAGNOSTIC_SCALAR_LENGTH = 512;\nconst SENSITIVE_XML_ELEMENT_NAME = \"((?:[A-Za-z_][\\\\w.-]*:)?(?:Token|Sign))\";\nconst PAIRED_SENSITIVE_XML_ELEMENT = new RegExp(\n `<${SENSITIVE_XML_ELEMENT_NAME}\\\\b[^>]*>[\\\\s\\\\S]*?<\\\\/\\\\1\\\\s*>`,\n \"gi\"\n);\nconst SELF_CLOSING_SENSITIVE_XML_ELEMENT = new RegExp(\n `<${SENSITIVE_XML_ELEMENT_NAME}\\\\b[^>]*\\\\/\\\\s*>`,\n \"gi\"\n);\nconst UNTERMINATED_SENSITIVE_XML_ELEMENT = new RegExp(\n `<${SENSITIVE_XML_ELEMENT_NAME}\\\\b[^>]*>[^<]*`,\n \"gi\"\n);\n\nexport type ResponseBodyDiagnostic = {\n responseBodyLength: number;\n responseBodyPreview: string;\n};\n\nexport type SafeErrorDiagnostic = {\n errorName?: string;\n errorCode?: string;\n statusCode?: number;\n contentType?: string;\n responseBodyLength?: number;\n responseBodyPreview?: string;\n faultCode?: string;\n};\n\n/** Redacts credential-bearing XML elements and applies the global preview bound. */\nexport function redactDiagnosticPreview(\n value: string,\n requestedMaxLength = MAX_DIAGNOSTIC_PREVIEW_LENGTH\n): string {\n const maxLength = normalizePreviewLength(requestedMaxLength);\n\n return value\n .replace(\n PAIRED_SENSITIVE_XML_ELEMENT,\n (_match, tagName: string) => `<${tagName}>[REDACTED]</${tagName}>`\n )\n .replace(\n SELF_CLOSING_SENSITIVE_XML_ELEMENT,\n (_match, tagName: string) => `<${tagName}>[REDACTED]</${tagName}>`\n )\n .replace(\n UNTERMINATED_SENSITIVE_XML_ELEMENT,\n (_match, tagName: string) => `<${tagName}>[REDACTED]`\n )\n .slice(0, maxLength);\n}\n\n/** Produces the only response-body shape allowed in errors and logs. */\nexport function createResponseBodyDiagnostic(\n responseBody: string,\n requestedMaxLength = MAX_DIAGNOSTIC_PREVIEW_LENGTH\n): ResponseBodyDiagnostic {\n return {\n responseBodyLength: responseBody.length,\n responseBodyPreview: redactDiagnosticPreview(\n responseBody,\n requestedMaxLength\n ),\n };\n}\n\n/** Extracts a scalar allowlist from an error without exposing the error or cause. */\nexport function createSafeErrorDiagnostic(error: unknown): SafeErrorDiagnostic {\n if (!(error && typeof error === \"object\")) {\n return {};\n }\n\n const candidate = error as Record<string, unknown>;\n const diagnostic: SafeErrorDiagnostic = {};\n\n assignSafeString(diagnostic, \"errorName\", candidate.name);\n assignSafeString(diagnostic, \"errorCode\", candidate.code);\n assignSafeNumber(diagnostic, \"statusCode\", candidate.statusCode);\n assignSafeString(diagnostic, \"contentType\", candidate.contentType);\n assignSafeNumber(\n diagnostic,\n \"responseBodyLength\",\n candidate.responseBodyLength\n );\n if (typeof candidate.responseBodyPreview === \"string\") {\n diagnostic.responseBodyPreview = redactDiagnosticPreview(\n candidate.responseBodyPreview\n );\n }\n assignSafeString(diagnostic, \"faultCode\", candidate.faultCode);\n\n return diagnostic;\n}\n\nfunction normalizePreviewLength(requestedMaxLength: number): number {\n if (!Number.isFinite(requestedMaxLength)) {\n return MAX_DIAGNOSTIC_PREVIEW_LENGTH;\n }\n\n return Math.max(\n 0,\n Math.min(Math.trunc(requestedMaxLength), MAX_DIAGNOSTIC_PREVIEW_LENGTH)\n );\n}\n\nfunction assignSafeString<\n TKey extends \"errorName\" | \"errorCode\" | \"contentType\" | \"faultCode\",\n>(target: SafeErrorDiagnostic, key: TKey, value: unknown): void {\n if (typeof value === \"string\") {\n target[key] = redactDiagnosticPreview(value, MAX_DIAGNOSTIC_SCALAR_LENGTH);\n }\n}\n\nfunction assignSafeNumber<TKey extends \"statusCode\" | \"responseBodyLength\">(\n target: SafeErrorDiagnostic,\n key: TKey,\n value: unknown\n): void {\n if (typeof value === \"number\" && Number.isFinite(value)) {\n target[key] = value;\n }\n}\n","import { redactDiagnosticPreview } from \"./internal/redaction\";\nimport 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/** Why a store lock was never taken: it stayed held, or the caller gave up. */\nexport type ArcaLockTimeoutReason = \"held\" | \"aborted\";\n\n/**\n * Thrown when a call gave up waiting for a store lock. Nothing was sent to\n * ARCA, and a call that waited for the sequence lock reserved nothing either,\n * so the same call can be repeated. `held` means another holder kept the lock\n * past the wait, `aborted` that the caller's `abortSignal` fired first.\n */\nexport class ArcaLockTimeoutError extends ArcaError {\n declare readonly code: \"ARCA_LOCK_TIMEOUT\";\n override readonly name: string = \"ArcaLockTimeoutError\";\n readonly reason: ArcaLockTimeoutReason;\n\n constructor(\n message: string,\n options: ErrorOptions & { reason: ArcaLockTimeoutReason }\n ) {\n super(message, \"ARCA_LOCK_TIMEOUT\", options);\n this.reason = options.reason;\n }\n}\n\n/** Stable routing codes for caller-provided input failures. */\nexport type ArcaInputErrorCode =\n | \"ARCA_INPUT_IDEMPOTENCY_MISMATCH\"\n | \"ARCA_INPUT_RESERVATION_NOT_FOUND\"\n | \"ARCA_INPUT_INVALID_DATE\"\n | \"ARCA_INPUT_DATE_OUTSIDE_WINDOW\"\n | \"ARCA_INPUT_INVALID_AMOUNT\"\n | \"ARCA_INPUT_AMOUNT_PRECISION\"\n | \"ARCA_INPUT_AMOUNT_MISMATCH\"\n | \"ARCA_INPUT_INVALID_EXCHANGE_RATE\"\n | \"ARCA_INPUT_INVALID_VALUE\"\n | \"ARCA_INPUT_MISSING_FIELD\"\n | \"ARCA_INPUT_RESERVED_FIELD\";\n\n/** The first and last day ARCA accepts, both `YYYY-MM-DD` and inclusive. */\nexport type VoucherDateWindow = { from: string; to: string };\n\nexport type ArcaInputErrorOptions = ErrorOptions & {\n code: ArcaInputErrorCode;\n field?: string;\n expected?: string;\n window?: VoucherDateWindow;\n};\n\n/**\n * Thrown when caller-provided input data is missing or invalid. From\n * `issue()`, `issueCreditNote()` or `issueDebitNote()` it means that call sent\n * no authorization request, so ARCA issued nothing for it.\n */\nexport class ArcaInputError extends ArcaError {\n declare readonly code: ArcaInputErrorCode;\n override readonly name: string = \"ArcaInputError\";\n readonly field?: string;\n readonly expected?: string;\n /** With `ARCA_INPUT_DATE_OUTSIDE_WINDOW`, the dates ARCA accepts today. */\n readonly window?: VoucherDateWindow;\n\n constructor(message: string, options: ArcaInputErrorOptions) {\n super(message, options.code, options);\n this.field = options.field;\n this.expected = options.expected;\n this.window = options.window;\n }\n}\n\n/** Stable reasons exposed for explicit ARCA authentication rejections. */\nexport type ArcaAuthenticationReason =\n | \"invalid_token\"\n | \"unauthorized_computer\"\n | \"missing_relationship\"\n | \"authentication_rejected\";\n\nexport type ArcaAuthenticationErrorOptions = ErrorOptions & {\n reason: ArcaAuthenticationReason;\n service: ArcaServiceName;\n operation: string;\n providerCode?: string | number;\n};\n\n/** Thrown when ARCA explicitly rejects credentials before an operation runs. */\nexport class ArcaAuthenticationError extends ArcaError {\n declare readonly code: \"ARCA_AUTHENTICATION_ERROR\";\n override readonly name: string = \"ArcaAuthenticationError\";\n readonly reason: ArcaAuthenticationReason;\n readonly service: ArcaServiceName;\n readonly operation: string;\n readonly providerCode?: string | number;\n\n constructor(message: string, options: ArcaAuthenticationErrorOptions) {\n super(\n redactDiagnosticPreview(message),\n \"ARCA_AUTHENTICATION_ERROR\",\n options\n );\n this.reason = options.reason;\n this.service = options.service;\n this.operation = options.operation;\n this.providerCode = normalizeProviderCode(options.providerCode);\n }\n}\n\n/** Narrows unknown failures to the explicit authentication error contract. */\nexport function isArcaAuthenticationError(\n error: unknown\n): error is ArcaAuthenticationError {\n return error instanceof ArcaAuthenticationError;\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 responseBodyLength?: number;\n readonly responseBodyPreview?: string;\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n statusCode?: number;\n contentType?: string;\n responseBodyLength?: number;\n responseBodyPreview?: string;\n }\n ) {\n super(message, \"ARCA_TRANSPORT_ERROR\", options);\n this.statusCode = options?.statusCode;\n this.contentType = options?.contentType;\n this.responseBodyLength = options?.responseBodyLength;\n this.responseBodyPreview =\n options?.responseBodyPreview === undefined\n ? undefined\n : redactDiagnosticPreview(options.responseBodyPreview);\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\n constructor(\n message: string,\n options?: ErrorOptions & {\n faultCode?: string;\n }\n ) {\n super(redactDiagnosticPreview(message), \"ARCA_SOAP_FAULT\", options);\n this.faultCode =\n options?.faultCode === undefined\n ? undefined\n : redactDiagnosticPreview(options.faultCode);\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\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 }\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 =\n options?.responseBodyPreview === undefined\n ? undefined\n : redactDiagnosticPreview(options.responseBodyPreview);\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\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 }\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 }\n}\n\nfunction normalizeProviderCode(\n providerCode: string | number | undefined\n): string | number | undefined {\n if (typeof providerCode === \"number\") {\n return Number.isFinite(providerCode) ? providerCode : undefined;\n }\n if (typeof providerCode === \"string\") {\n return redactDiagnosticPreview(providerCode, 512);\n }\n return undefined;\n}\n\n/**\n * Narrow error evidence, safe to log or store: the typed fields the error\n * classes declare, never a cause, stack, raw response, response body preview,\n * endpoint URL, fiscal issues or CAE.\n */\nexport type ArcaSafeErrorMetadata = {\n name: string;\n message: string;\n code?: string;\n statusCode?: number;\n contentType?: string;\n service?: ArcaServiceName;\n operation?: string;\n /** ArcaAuthenticationError's or ArcaLockTimeoutError's stable reason. */\n reason?: ArcaAuthenticationReason | ArcaLockTimeoutReason;\n providerCode?: string | number;\n faultCode?: string;\n field?: string;\n expected?: string;\n window?: VoucherDateWindow;\n /** ArcaServiceError's provider code, always as a string. */\n serviceCode?: string;\n result?: string;\n resultLevel?: ArcaFiscalResultLevel;\n};\n\nexport function toArcaSafeErrorMetadata(error: unknown): ArcaSafeErrorMetadata {\n if (!(error instanceof Error)) {\n return { name: \"UnknownError\", message: String(error) };\n }\n const metadata: ArcaSafeErrorMetadata = {\n name: error.name,\n message: error.message,\n };\n if (!(error instanceof ArcaError)) {\n return metadata;\n }\n const fields: Partial<ArcaSafeErrorMetadata> = { code: error.code };\n if (error instanceof ArcaInputError) {\n Object.assign(fields, {\n field: error.field,\n expected: error.expected,\n window: error.window,\n });\n } else if (error instanceof ArcaAuthenticationError) {\n Object.assign(fields, {\n service: error.service,\n operation: error.operation,\n reason: error.reason,\n providerCode: error.providerCode,\n });\n } else if (error instanceof ArcaLockTimeoutError) {\n Object.assign(fields, { reason: error.reason });\n } else if (error instanceof ArcaTransportError) {\n Object.assign(fields, {\n statusCode: error.statusCode,\n contentType: error.contentType,\n });\n } else if (error instanceof ArcaSoapFaultError) {\n Object.assign(fields, { faultCode: error.faultCode });\n } else if (error instanceof ArcaInvalidSoapResponseError) {\n Object.assign(fields, {\n service: error.service,\n operation: error.operation,\n statusCode: error.statusCode,\n contentType: error.contentType,\n });\n } else if (error instanceof ArcaServiceError) {\n Object.assign(fields, {\n service: error.service,\n operation: error.operation,\n serviceCode:\n error.serviceCode === undefined ? undefined : String(error.serviceCode),\n result: error.result,\n resultLevel: error.resultLevel,\n });\n }\n for (const [key, value] of Object.entries(fields)) {\n if (value !== undefined) {\n (metadata as Record<string, unknown>)[key] = value;\n }\n }\n return metadata;\n}\n"],"mappings":";AAAO,IAAM,gCAAgC;AAE7C,IAAM,+BAA+B;AACrC,IAAM,6BAA6B;AACnC,IAAM,+BAA+B,IAAI;AAAA,EACvC,IAAI,0BAA0B;AAAA,EAC9B;AACF;AACA,IAAM,qCAAqC,IAAI;AAAA,EAC7C,IAAI,0BAA0B;AAAA,EAC9B;AACF;AACA,IAAM,qCAAqC,IAAI;AAAA,EAC7C,IAAI,0BAA0B;AAAA,EAC9B;AACF;AAkBO,SAAS,wBACd,OACA,qBAAqB,+BACb;AACR,QAAM,YAAY,uBAAuB,kBAAkB;AAE3D,SAAO,MACJ;AAAA,IACC;AAAA,IACA,CAAC,QAAQ,YAAoB,IAAI,OAAO,gBAAgB,OAAO;AAAA,EACjE,EACC;AAAA,IACC;AAAA,IACA,CAAC,QAAQ,YAAoB,IAAI,OAAO,gBAAgB,OAAO;AAAA,EACjE,EACC;AAAA,IACC;AAAA,IACA,CAAC,QAAQ,YAAoB,IAAI,OAAO;AAAA,EAC1C,EACC,MAAM,GAAG,SAAS;AACvB;AAGO,SAAS,6BACd,cACA,qBAAqB,+BACG;AACxB,SAAO;AAAA,IACL,oBAAoB,aAAa;AAAA,IACjC,qBAAqB;AAAA,MACnB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAGO,SAAS,0BAA0B,OAAqC;AAC7E,MAAI,EAAE,SAAS,OAAO,UAAU,WAAW;AACzC,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,YAAY;AAClB,QAAM,aAAkC,CAAC;AAEzC,mBAAiB,YAAY,aAAa,UAAU,IAAI;AACxD,mBAAiB,YAAY,aAAa,UAAU,IAAI;AACxD,mBAAiB,YAAY,cAAc,UAAU,UAAU;AAC/D,mBAAi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{
|
|
2
2
|
classifyArcaAuthenticationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4PSLYA2B.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ArcaSoapFaultError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q7IURW54.mjs";
|
|
7
7
|
|
|
8
8
|
// src/services/padron.ts
|
|
9
9
|
function createPadronService(options) {
|
|
@@ -248,4 +248,4 @@ async function executePadronOperation(options, service, operation, body) {
|
|
|
248
248
|
export {
|
|
249
249
|
createPadronService
|
|
250
250
|
};
|
|
251
|
-
//# sourceMappingURL=chunk-
|
|
251
|
+
//# sourceMappingURL=chunk-QHNI4ZIA.mjs.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-C2KX652X.mjs";
|
|
11
11
|
import {
|
|
12
12
|
createPadronService
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QHNI4ZIA.mjs";
|
|
14
14
|
import {
|
|
15
15
|
arcaMinorUnitsToNumber,
|
|
16
16
|
assertArcaMinorUnits,
|
|
@@ -22,22 +22,23 @@ import {
|
|
|
22
22
|
roundHalfEvenRatio,
|
|
23
23
|
serializeArcaExchangeRate,
|
|
24
24
|
toIsoDate
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FQD2PZXE.mjs";
|
|
26
26
|
import {
|
|
27
27
|
createWsmtxcaService
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HSGTCGUX.mjs";
|
|
29
29
|
import {
|
|
30
30
|
ArcaConfigurationError,
|
|
31
31
|
ArcaError,
|
|
32
32
|
ArcaInputError,
|
|
33
33
|
ArcaInvalidSoapResponseError,
|
|
34
|
+
ArcaLockTimeoutError,
|
|
34
35
|
ArcaServiceError,
|
|
35
36
|
ArcaSoapFaultError,
|
|
36
37
|
ArcaTransportError,
|
|
37
38
|
createResponseBodyDiagnostic,
|
|
38
39
|
createSafeErrorDiagnostic,
|
|
39
40
|
toArcaSafeErrorMetadata
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-Q7IURW54.mjs";
|
|
41
42
|
|
|
42
43
|
// src/config.ts
|
|
43
44
|
var ARCA_ENVIRONMENTS = ["production", "test"];
|
|
@@ -2701,7 +2702,7 @@ async function withWsaaSessionStoreLock(config, key, service, fn) {
|
|
|
2701
2702
|
if (entered) {
|
|
2702
2703
|
throw error;
|
|
2703
2704
|
}
|
|
2704
|
-
if (error instanceof ArcaConfigurationError) {
|
|
2705
|
+
if (error instanceof ArcaConfigurationError || error instanceof ArcaLockTimeoutError) {
|
|
2705
2706
|
throw error;
|
|
2706
2707
|
}
|
|
2707
2708
|
throw new ArcaConfigurationError(
|
|
@@ -3884,27 +3885,32 @@ async function runOperation(wsfe, operation, input, prepare, options, context, r
|
|
|
3884
3885
|
if (!store.withLock) {
|
|
3885
3886
|
return await claim();
|
|
3886
3887
|
}
|
|
3887
|
-
return await store.withLock(
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3888
|
+
return await store.withLock(
|
|
3889
|
+
sequence.lock,
|
|
3890
|
+
async () => {
|
|
3891
|
+
const prior = await storeCall(() => store.get(key));
|
|
3892
|
+
if (prior !== null) {
|
|
3893
|
+
return await replay(prior, true);
|
|
3894
|
+
}
|
|
3895
|
+
const barrier = await runSequenceBarrier({
|
|
3896
|
+
store,
|
|
3897
|
+
environment,
|
|
3898
|
+
taxId,
|
|
3899
|
+
sequence: sequence.marker,
|
|
3900
|
+
sequenceTaxId: sequence.taxId,
|
|
3901
|
+
select: select ?? (() => wsfe),
|
|
3902
|
+
options,
|
|
3903
|
+
supersededBy: idempotencyKey,
|
|
3904
|
+
readNext: () => nextNumber(wsfe, prepared.data, { ...options, number: void 0 })
|
|
3905
|
+
});
|
|
3906
|
+
return "blocked" in barrier ? {
|
|
3907
|
+
...barrier.blocked,
|
|
3908
|
+
...requestEvidence(prepared.data, void 0, options)
|
|
3909
|
+
} : await claim(barrier.reserved);
|
|
3910
|
+
},
|
|
3911
|
+
// The deadline also bounds the wait: giving up there reserved nothing.
|
|
3912
|
+
{ signal: options.abortSignal }
|
|
3913
|
+
);
|
|
3908
3914
|
function reservation(number) {
|
|
3909
3915
|
const service = options.service ?? "wsfe";
|
|
3910
3916
|
const versioned = service === "wsmtxca" || prepared.data.lines !== void 0;
|
|
@@ -4112,7 +4118,8 @@ async function consultKey({ store, environment, taxId, idempotencyKey }, stored,
|
|
|
4112
4118
|
() => store.get(attemptKey(environment, taxId, idempotencyKey))
|
|
4113
4119
|
);
|
|
4114
4120
|
return await consult(json === null ? stored : readRecord(json));
|
|
4115
|
-
}
|
|
4121
|
+
},
|
|
4122
|
+
{ signal: options.abortSignal }
|
|
4116
4123
|
);
|
|
4117
4124
|
}
|
|
4118
4125
|
async function recordConflict(store, key, outcome, durable = true) {
|
|
@@ -5432,19 +5439,26 @@ var ARCA_LEASE_MS = 6e4;
|
|
|
5432
5439
|
var RENEW_MS = 2e4;
|
|
5433
5440
|
var POLL_MS = 50;
|
|
5434
5441
|
var MAX_WAIT_MS = 2 * ARCA_LEASE_MS;
|
|
5435
|
-
async function withLease(key, driver, fn) {
|
|
5442
|
+
async function withLease(key, driver, fn, { signal } = {}) {
|
|
5436
5443
|
const owner = randomUUID();
|
|
5437
5444
|
const deadline = Date.now() + MAX_WAIT_MS;
|
|
5445
|
+
throwIfAborted(key, signal);
|
|
5438
5446
|
let held = await driver.acquire(owner);
|
|
5439
5447
|
while (!held) {
|
|
5440
5448
|
if (Date.now() >= deadline) {
|
|
5441
|
-
throw new
|
|
5442
|
-
`ARCA store lock ${key} stayed held; no work was attempted
|
|
5449
|
+
throw new ArcaLockTimeoutError(
|
|
5450
|
+
`ARCA store lock ${key} stayed held; no work was attempted.`,
|
|
5451
|
+
{ reason: "held" }
|
|
5443
5452
|
);
|
|
5444
5453
|
}
|
|
5445
|
-
await delay2(POLL_MS + Math.floor(Math.random() * POLL_MS));
|
|
5454
|
+
await delay2(POLL_MS + Math.floor(Math.random() * POLL_MS), signal);
|
|
5455
|
+
throwIfAborted(key, signal);
|
|
5446
5456
|
held = await driver.acquire(owner);
|
|
5447
5457
|
}
|
|
5458
|
+
if (signal?.aborted) {
|
|
5459
|
+
await driver.release(owner).catch(() => void 0);
|
|
5460
|
+
throwIfAborted(key, signal);
|
|
5461
|
+
}
|
|
5448
5462
|
const renewal = setInterval(() => {
|
|
5449
5463
|
driver.renew(owner).catch(() => void 0);
|
|
5450
5464
|
}, RENEW_MS);
|
|
@@ -5456,10 +5470,29 @@ async function withLease(key, driver, fn) {
|
|
|
5456
5470
|
await driver.release(owner).catch(() => void 0);
|
|
5457
5471
|
}
|
|
5458
5472
|
}
|
|
5459
|
-
function
|
|
5473
|
+
function throwIfAborted(key, signal) {
|
|
5474
|
+
if (signal?.aborted) {
|
|
5475
|
+
throw new ArcaLockTimeoutError(
|
|
5476
|
+
`Stopped waiting for ARCA store lock ${key}: the caller's signal aborted; no work was attempted.`,
|
|
5477
|
+
{ reason: "aborted", cause: signal.reason }
|
|
5478
|
+
);
|
|
5479
|
+
}
|
|
5480
|
+
}
|
|
5481
|
+
function delay2(ms, signal) {
|
|
5482
|
+
if (signal?.aborted) {
|
|
5483
|
+
return Promise.resolve();
|
|
5484
|
+
}
|
|
5460
5485
|
return new Promise((resolve) => {
|
|
5461
|
-
const
|
|
5486
|
+
const wake = () => {
|
|
5487
|
+
clearTimeout(timer);
|
|
5488
|
+
resolve();
|
|
5489
|
+
};
|
|
5490
|
+
const timer = setTimeout(() => {
|
|
5491
|
+
signal?.removeEventListener("abort", wake);
|
|
5492
|
+
resolve();
|
|
5493
|
+
}, ms);
|
|
5462
5494
|
timer.unref?.();
|
|
5495
|
+
signal?.addEventListener("abort", wake, { once: true });
|
|
5463
5496
|
});
|
|
5464
5497
|
}
|
|
5465
5498
|
|
|
@@ -5509,10 +5542,10 @@ function createFileStore(directory) {
|
|
|
5509
5542
|
}
|
|
5510
5543
|
}
|
|
5511
5544
|
}),
|
|
5512
|
-
withLock: (key, fn) => (
|
|
5545
|
+
withLock: (key, fn, options) => (
|
|
5513
5546
|
// A lock directory: mkdir is the atomic claim on every POSIX filesystem
|
|
5514
5547
|
// and on Windows, and the holder file inside carries the lease.
|
|
5515
|
-
withLease(key, fileLease(`${path(key)}.lock`, ensure), fn)
|
|
5548
|
+
withLease(key, fileLease(`${path(key)}.lock`, ensure), fn, options)
|
|
5516
5549
|
)
|
|
5517
5550
|
};
|
|
5518
5551
|
}
|
|
@@ -5688,12 +5721,14 @@ export {
|
|
|
5688
5721
|
arcaQrPayload,
|
|
5689
5722
|
voucherDateWindow,
|
|
5690
5723
|
matchWsfeVoucherIdentity,
|
|
5724
|
+
abortable,
|
|
5691
5725
|
createMemoryWsaaSessionStore,
|
|
5692
5726
|
createWsaaAuthModule,
|
|
5693
5727
|
createWsaaStoreAdapter,
|
|
5694
5728
|
createArcaClient,
|
|
5695
5729
|
ARCA_LEASE_MS,
|
|
5696
5730
|
withLease,
|
|
5731
|
+
throwIfAborted,
|
|
5697
5732
|
createFileStore
|
|
5698
5733
|
};
|
|
5699
|
-
//# sourceMappingURL=chunk-
|
|
5734
|
+
//# sourceMappingURL=chunk-WEEV76IC.mjs.map
|