@ramiidv/arca-fecred 0.2.0 → 0.4.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/CHANGELOG.md +124 -0
- package/README.md +125 -286
- package/dist/arca-fecred.d.ts +63 -109
- package/dist/arca-fecred.d.ts.map +1 -1
- package/dist/arca-fecred.js +107 -315
- package/dist/arca-fecred.js.map +1 -1
- package/dist/constants.d.ts +73 -75
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +65 -95
- package/dist/constants.js.map +1 -1
- package/dist/fecred-client.d.ts +86 -89
- package/dist/fecred-client.d.ts.map +1 -1
- package/dist/fecred-client.js +166 -162
- package/dist/fecred-client.js.map +1 -1
- package/dist/index.d.ts +6 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -13
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +165 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +376 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +401 -198
- package/dist/types.d.ts.map +1 -1
- package/llms.txt +65 -142
- package/package.json +20 -21
- package/dist/validation.d.ts +0 -26
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -161
- package/dist/validation.js.map +0 -1
package/dist/arca-fecred.d.ts
CHANGED
|
@@ -1,129 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ServerStatus } from '@ramiidv/arca-common';
|
|
1
|
+
import { ArcaSdkBase } from '@ramiidv/arca-common';
|
|
2
|
+
import type { CallOptions, ServerStatus } from '@ramiidv/arca-common';
|
|
3
3
|
import { FecredClient } from './fecred-client.js';
|
|
4
|
-
import type { ArcaFecredConfig,
|
|
4
|
+
import type { AceptarFecredParams, ArcaFecredConfig, CodigoDescripcion, ConsultarComprobantesParams, ConsultarComprobantesResult, ConsultarCtaCteResult, ConsultarCtasCtesParams, ConsultarCtasCtesResult, ConsultarCuentasEnAgtDptoCltvResult, ConsultarFacturasAgtDptoCltvParams, ConsultarFacturasAgtDptoCltvResult, ConsultarMontoObligadoRecepcionParams, HistorialEstadosComprobanteResult, HistorialEstadosCtaCteResult, IdComprobante, IdComprobanteInput, IdCtaCteInput, InformarCancelacionTotalParams, InformarFacturaAgtDptoCltvParams, ModificarOpcionTransferenciaParams, MontoObligadoRecepcionResult, ObligadoRecepcionResult, OperacionFecredResult, RechazarFecredParams, RechazarNotaDCParams, RechazarNotaDCResult, TipoRetencion } from './types.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Provides high-level methods that handle WSAA authentication automatically
|
|
9
|
-
* and expose results from the WSFECRED web service for managing FCE
|
|
10
|
-
* (Electronic Credit Invoices) under Law 27440.
|
|
6
|
+
* Cliente de alto nivel de WSFECRED (Factura de Crédito Electrónica MiPyME,
|
|
7
|
+
* Ley 27.440). Obtiene y cachea el Ticket de Acceso de WSAA automáticamente.
|
|
11
8
|
*
|
|
12
9
|
* @example
|
|
13
10
|
* ```ts
|
|
14
|
-
* import { ArcaFecred } from '@ramiidv/arca-fecred';
|
|
15
|
-
* import { readFileSync } from 'fs';
|
|
16
|
-
*
|
|
17
11
|
* const fecred = new ArcaFecred({
|
|
18
12
|
* cert: readFileSync('cert.pem', 'utf-8'),
|
|
19
13
|
* key: readFileSync('key.pem', 'utf-8'),
|
|
20
|
-
* cuit: '
|
|
21
|
-
* production: false,
|
|
14
|
+
* cuit: '20123456786',
|
|
22
15
|
* });
|
|
23
16
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
17
|
+
* const { obligado, montoDesde } = await fecred.consultarMontoObligadoRecepcion({
|
|
18
|
+
* cuitConsultada: '30712345674',
|
|
19
|
+
* fechaEmision: '2026-11-01',
|
|
20
|
+
* });
|
|
27
21
|
*
|
|
28
|
-
*
|
|
29
|
-
* const cuentas = await fecred.consultarCtasCtes({
|
|
22
|
+
* const { ctasCtes, hayMas } = await fecred.consultarCtasCtes({
|
|
30
23
|
* rol: 'Receptor',
|
|
31
|
-
*
|
|
32
|
-
* fechaHasta: '2026-03-31',
|
|
24
|
+
* fecha: { tipo: 'Emision', desde: '2026-10-01', hasta: '2026-10-31' },
|
|
33
25
|
* });
|
|
34
26
|
* ```
|
|
35
27
|
*/
|
|
36
|
-
export declare class ArcaFecred {
|
|
37
|
-
/**
|
|
38
|
-
readonly
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
private readonly cuit;
|
|
42
|
-
private readonly onEvent?;
|
|
28
|
+
export declare class ArcaFecred extends ArcaSdkBase<'wsfecred'> {
|
|
29
|
+
/** Cliente de bajo nivel de FECredService. */
|
|
30
|
+
readonly client: FecredClient;
|
|
31
|
+
/** @deprecated Usá `client` (mismo objeto; mismo nombre que en el resto de los SDKs). */
|
|
32
|
+
get fecred(): FecredClient;
|
|
43
33
|
constructor(config: ArcaFecredConfig);
|
|
34
|
+
/** Estado de los servidores de WSFECRED (`dummy`, sin autenticación). */
|
|
35
|
+
status(opts?: CallOptions): Promise<ServerStatus>;
|
|
36
|
+
/** Si una CUIT está obligada a recibir FCE para una fecha de emisión, y desde qué monto. */
|
|
37
|
+
consultarMontoObligadoRecepcion(params: ConsultarMontoObligadoRecepcionParams, opts?: CallOptions): Promise<MontoObligadoRecepcionResult>;
|
|
38
|
+
/** Si una CUIT está obligada a recibir FCE y desde qué fecha. */
|
|
39
|
+
consultarObligadoRecepcion(cuitConsultada: number | string, opts?: CallOptions): Promise<ObligadoRecepcionResult>;
|
|
40
|
+
/** Cuentas corrientes de FCE (paginado: ver `hayMas` / `nroPagina`). */
|
|
41
|
+
consultarCtasCtes(params: ConsultarCtasCtesParams, opts?: CallOptions): Promise<ConsultarCtasCtesResult>;
|
|
42
|
+
/** Detalle de una cuenta corriente. */
|
|
43
|
+
consultarCtaCte(idCtaCte: IdCtaCteInput, opts?: CallOptions): Promise<ConsultarCtaCteResult>;
|
|
44
|
+
/** Comprobantes FCE (paginado: ver `hayMas` / `nroPagina`). */
|
|
45
|
+
consultarComprobantes(params: ConsultarComprobantesParams, opts?: CallOptions): Promise<ConsultarComprobantesResult>;
|
|
46
|
+
/** Historial de estados de un comprobante. */
|
|
47
|
+
consultarHistorialEstadosComprobante(idComprobante: IdComprobanteInput, opts?: CallOptions): Promise<HistorialEstadosComprobanteResult>;
|
|
48
|
+
/** Historial de estados de una cuenta corriente. */
|
|
49
|
+
consultarHistorialEstadosCtaCte(idCtaCte: IdCtaCteInput, opts?: CallOptions): Promise<HistorialEstadosCtaCteResult>;
|
|
50
|
+
/** Remitos asociados a un comprobante. */
|
|
51
|
+
obtenerRemitos(idComprobante: IdComprobanteInput, opts?: CallOptions): Promise<IdComprobante[]>;
|
|
44
52
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
status(): Promise<ServerStatus>;
|
|
49
|
-
/**
|
|
50
|
-
* Check if a CUIT is obligated to receive FCE (Factura de Credito Electronica).
|
|
51
|
-
* Authenticates automatically via WSAA.
|
|
52
|
-
*
|
|
53
|
-
* @param cuitConsultada - CUIT to check
|
|
54
|
-
* @returns Result indicating if the CUIT is obligated and the threshold amount
|
|
55
|
-
*/
|
|
56
|
-
consultarMontoObligadoRecepcion(cuitConsultada: string): Promise<MontoObligadoResult>;
|
|
57
|
-
/**
|
|
58
|
-
* Query current accounts from FCE activity.
|
|
59
|
-
* Authenticates automatically via WSAA.
|
|
60
|
-
*
|
|
61
|
-
* @param params - Query filters (role, CUITs, date range)
|
|
62
|
-
* @returns Array of current account records
|
|
63
|
-
*/
|
|
64
|
-
consultarCtasCtes(params: ConsultarCtasCtesParams): Promise<CtaCte[]>;
|
|
65
|
-
/**
|
|
66
|
-
* Search FCE invoices by filters.
|
|
67
|
-
* Authenticates automatically via WSAA.
|
|
68
|
-
*
|
|
69
|
-
* @param params - Query filters
|
|
70
|
-
* @returns Array of FCE invoice records
|
|
71
|
-
*/
|
|
72
|
-
consultarComprobantes(params: ConsultarComprobantesParams): Promise<ComprobanteFecred[]>;
|
|
73
|
-
/**
|
|
74
|
-
* Accept an FCE (Factura de Credito Electronica).
|
|
75
|
-
* Authenticates automatically via WSAA.
|
|
76
|
-
*
|
|
77
|
-
* @param codCtaCte - Current account code of the FCE to accept
|
|
78
|
-
* @returns Result of the acceptance operation
|
|
79
|
-
*/
|
|
80
|
-
aceptarFECred(codCtaCte: number): Promise<AceptarFecredResult>;
|
|
81
|
-
/**
|
|
82
|
-
* Reject an FCE (Factura de Credito Electronica).
|
|
83
|
-
* Authenticates automatically via WSAA.
|
|
84
|
-
*
|
|
85
|
-
* @param codCtaCte - Current account code of the FCE to reject
|
|
86
|
-
* @param codMotivoRechazo - Rejection reason code (use MotivoRechazo enum)
|
|
87
|
-
* @returns Result of the rejection operation
|
|
88
|
-
*/
|
|
89
|
-
rechazarFECred(codCtaCte: number, codMotivoRechazo: number): Promise<RechazarFecredResult>;
|
|
90
|
-
/**
|
|
91
|
-
* Inform that an accepted FCE was paid/cancelled.
|
|
92
|
-
* Authenticates automatically via WSAA.
|
|
93
|
-
*
|
|
94
|
-
* @param params - Cancellation details (account code, payment method, optional observations)
|
|
95
|
-
* @returns Result of the cancellation notification
|
|
96
|
-
*/
|
|
97
|
-
informarFacturaAceptadaCancelada(params: InformarCanceladaParams): Promise<InformarCanceladaResult>;
|
|
98
|
-
/**
|
|
99
|
-
* Query available retention types.
|
|
100
|
-
* Authenticates automatically via WSAA.
|
|
101
|
-
*/
|
|
102
|
-
consultarTiposRetenciones(): Promise<TipoRetencionItem[]>;
|
|
103
|
-
/**
|
|
104
|
-
* Query available payment method types for cancelling accepted FCE.
|
|
105
|
-
* Authenticates automatically via WSAA.
|
|
106
|
-
*/
|
|
107
|
-
consultarTiposFormasCancelacion(): Promise<TipoFormaCancelacionItem[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Query available operation adjustment types.
|
|
110
|
-
* Authenticates automatically via WSAA.
|
|
111
|
-
*/
|
|
112
|
-
consultarTiposAjustesOperacion(): Promise<TipoAjusteOperacionItem[]>;
|
|
113
|
-
/**
|
|
114
|
-
* Query available rejection reason types.
|
|
115
|
-
* Authenticates automatically via WSAA.
|
|
116
|
-
*/
|
|
117
|
-
consultarTiposMotivoRechazo(): Promise<TipoMotivoRechazoItem[]>;
|
|
118
|
-
/** Invalidate the cached WSAA access ticket for WSFECRED. */
|
|
119
|
-
clearAuthCache(): void;
|
|
120
|
-
private getAuth;
|
|
121
|
-
private parseCtaCte;
|
|
122
|
-
private parseComprobante;
|
|
123
|
-
/**
|
|
124
|
-
* Generic parser for parameter arrays from WSFECRED responses.
|
|
125
|
-
* Handles varying SOAP response structures (different key names, namespaces).
|
|
53
|
+
* Acepta una FCE. Un rechazo de ARCA (errores o `resultado = 'R'`) se lanza
|
|
54
|
+
* como `ArcaServiceError`. Si la respuesta se pierde (`ArcaSoapError` con
|
|
55
|
+
* `uncertain`), consultá el estado con `consultarCtaCte` antes de reintentar.
|
|
126
56
|
*/
|
|
127
|
-
|
|
57
|
+
aceptarFECred(params: AceptarFecredParams, opts?: CallOptions): Promise<OperacionFecredResult>;
|
|
58
|
+
/** Rechaza una FCE (motivos de `consultarTiposMotivosRechazo`). */
|
|
59
|
+
rechazarFECred(params: RechazarFecredParams, opts?: CallOptions): Promise<OperacionFecredResult>;
|
|
60
|
+
/** Informa la cancelación total de una FCE aceptada. */
|
|
61
|
+
informarCancelacionTotalFECred(params: InformarCancelacionTotalParams, opts?: CallOptions): Promise<OperacionFecredResult>;
|
|
62
|
+
/** Rechaza una nota de débito/crédito asociada a una FCE. */
|
|
63
|
+
rechazarNotaDC(params: RechazarNotaDCParams, opts?: CallOptions): Promise<RechazarNotaDCResult>;
|
|
64
|
+
/** Cambia la opción de transferencia (SCA/ADC) de una cuenta corriente. */
|
|
65
|
+
modificarOpcionTransferencia(params: ModificarOpcionTransferenciaParams, opts?: CallOptions): Promise<OperacionFecredResult>;
|
|
66
|
+
/** Informa una factura a un Agente de Depósito Colectivo. */
|
|
67
|
+
informarFacturaAgtDptoCltv(params: InformarFacturaAgtDptoCltvParams, opts?: CallOptions): Promise<OperacionFecredResult>;
|
|
68
|
+
/** Cuentas de la CUIT representada en Agentes de Depósito Colectivo. */
|
|
69
|
+
consultarCuentasEnAgtDptoCltv(opts?: CallOptions): Promise<ConsultarCuentasEnAgtDptoCltvResult>;
|
|
70
|
+
/** Facturas informadas a Agentes de Depósito Colectivo. */
|
|
71
|
+
consultarFacturasAgtDptoCltv(params?: ConsultarFacturasAgtDptoCltvParams, opts?: CallOptions): Promise<ConsultarFacturasAgtDptoCltvResult>;
|
|
72
|
+
/** Tipos de retenciones (jurisdicción y porcentaje). */
|
|
73
|
+
consultarTiposRetenciones(opts?: CallOptions): Promise<TipoRetencion[]>;
|
|
74
|
+
/** Formas de cancelación (para `aceptarFECred` / `informarCancelacionTotalFECred`). */
|
|
75
|
+
consultarTiposFormasCancelacion(opts?: CallOptions): Promise<CodigoDescripcion[]>;
|
|
76
|
+
/** Motivos de rechazo (para `rechazarFECred` / `rechazarNotaDC`). */
|
|
77
|
+
consultarTiposMotivosRechazo(opts?: CallOptions): Promise<CodigoDescripcion[]>;
|
|
78
|
+
/** Tipos de ajustes de operación (para `aceptarFECred`). */
|
|
79
|
+
consultarTiposAjustesOperacion(opts?: CallOptions): Promise<CodigoDescripcion[]>;
|
|
80
|
+
/** Credenciales diferidas: el cliente las pide después de validar los parámetros. */
|
|
81
|
+
private auth;
|
|
128
82
|
}
|
|
129
83
|
//# sourceMappingURL=arca-fecred.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arca-fecred.d.ts","sourceRoot":"","sources":["../src/arca-fecred.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"arca-fecred.d.ts","sourceRoot":"","sources":["../src/arca-fecred.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,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