arca-sdk 1.2.2 → 1.3.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/index.d.cts CHANGED
@@ -635,6 +635,10 @@ declare class WsfeService {
635
635
  * Valida que todos los items tengan alícuota IVA definida
636
636
  */
637
637
  private validateItemsWithVAT;
638
+ /**
639
+ * Valida obligatoriamente al comprador cuando el monto es mayor o igual a $10.000.000 para consumidor final
640
+ */
641
+ private validateBuyer;
638
642
  /**
639
643
  * Calcula el IVA agrupado por alícuota (requerido por ARCA para Factura A/B)
640
644
  */
@@ -710,8 +714,10 @@ interface Taxpayer {
710
714
  mainActivity?: string;
711
715
  /** ¿Está inscripto en IVA? */
712
716
  isVATRegistered: boolean;
713
- /** ¿Es monotributista? */
717
+ /** ¿Es monotributista (Régimen General o Social)? */
714
718
  isMonotax: boolean;
719
+ /** ¿Es exclusivamente Monotributista Social / Autónomo / Promovido? */
720
+ isSocialMonotax: boolean;
715
721
  /** ¿Es exento de IVA? */
716
722
  isVATExempt: boolean;
717
723
  }
@@ -767,6 +773,123 @@ declare class PadronService {
767
773
  private toArray;
768
774
  }
769
775
 
776
+ /**
777
+ * Configuration for CaeaService (identical to WsfeConfig)
778
+ */
779
+ type CaeaConfig = WsfeConfig;
780
+ /**
781
+ * Request parameter for soliciting a CAEA
782
+ */
783
+ interface CAEASolicitarRequest {
784
+ /** Period in AAAAMM format (e.g. '202606') */
785
+ period: string;
786
+ /** Quinzena order (1 for days 1-15, 2 for days 16-end) */
787
+ order: number;
788
+ }
789
+ /**
790
+ * Response representing a solicited CAEA
791
+ */
792
+ interface CAEASolicitarResponse {
793
+ /** The obtained CAEA code */
794
+ caea: string;
795
+ /** The period (AAAAMM) */
796
+ period: number;
797
+ /** The order of the fortnight (1 or 2) */
798
+ order: number;
799
+ /** Expiry date of the CAEA (YYYYMMDD) */
800
+ expiryDate: string;
801
+ /** Actual date of processing (YYYYMMDD) */
802
+ actualDate: string;
803
+ /** Reception date (YYYYMMDD) */
804
+ receptionDate: string;
805
+ /** Limit date for reporting invoices under this CAEA (YYYYMMDD) */
806
+ limitDate: string;
807
+ }
808
+ /**
809
+ * Response for querying a CAEA (same fields as CAEASolicitarResponse)
810
+ */
811
+ type CAEAConsultarResponse = CAEASolicitarResponse;
812
+ /**
813
+ * Invoice emitted under contingency that needs to be reported in batch
814
+ */
815
+ interface CaeaInvoice {
816
+ /** Type of invoice (e.g. InvoiceType.FACTURA_A, FACTURA_B, etc.) */
817
+ invoiceType: InvoiceType;
818
+ /** Concept (e.g. BillingConcept.PRODUCTS, SERVICES, etc.) */
819
+ concept: BillingConcept;
820
+ /** Invoice number (correlative) */
821
+ invoiceNumber: number;
822
+ /** Date of the invoice (default: today) */
823
+ date?: Date;
824
+ /** Buyer information */
825
+ buyer?: Buyer;
826
+ /** Items included in the invoice */
827
+ items: InvoiceItem[];
828
+ /** Associated invoices (required for Credit/Debit Notes) */
829
+ associatedInvoices?: AssociatedInvoice[];
830
+ /** Optional parameters (e.g., VatCondition RG 5616) */
831
+ optionals?: InvoiceOptional[];
832
+ /** Prices already include VAT (default: false) */
833
+ includesVAT?: boolean;
834
+ }
835
+ /**
836
+ * Response for reporting CAEA invoices
837
+ */
838
+ interface CAEARegInformativoResponse {
839
+ /** The reported CAEA */
840
+ caea: string;
841
+ /** The status result ('A' = Approved, 'R' = Rejected) */
842
+ result: 'A' | 'R';
843
+ /** Point of sale */
844
+ pointOfSale: number;
845
+ /** Invoice type reported */
846
+ invoiceType: number;
847
+ /** Any observations/warnings returned by ARCA */
848
+ observations?: string[];
849
+ }
850
+
851
+ /**
852
+ * Servicio de Código de Autorización Electrónico Anticipado (CAEA)
853
+ *
854
+ * Provee soporte para el esquema de contingencia obligatorio de ARCA
855
+ * según Resoluciones Generales RG 5782/2025 y RG 5785/2025.
856
+ */
857
+ declare class CaeaService {
858
+ private config;
859
+ constructor(config: CaeaConfig);
860
+ private validateConfig;
861
+ /**
862
+ * Solicita un CAEA (Código de Autorización Electrónico Anticipado) para una quincena específica (FECAEASolicitar).
863
+ */
864
+ solicitCAEA(params: CAEASolicitarRequest): Promise<CAEASolicitarResponse>;
865
+ /**
866
+ * Consulta un CAEA ya emitido (FECAEAConsultar).
867
+ */
868
+ getCAEA(caea: string): Promise<CAEAConsultarResponse>;
869
+ /**
870
+ * Rinde/registra informativamente los comprobantes emitidos en contingencia local bajo un CAEA específico (FECAEARegInformativo).
871
+ * Soporta el envío en lotes de comprobantes homogéneos del mismo tipo de factura y punto de venta.
872
+ */
873
+ reportCAEAPeriod(params: {
874
+ caea: string;
875
+ invoices: CaeaInvoice[];
876
+ }): Promise<CAEARegInformativoResponse>;
877
+ /**
878
+ * Informa que un CAEA no tuvo movimientos en la quincena (FECAEASinMovimientoInformar).
879
+ */
880
+ reportCAEANoMovement(params: {
881
+ caea: string;
882
+ }): Promise<void>;
883
+ /**
884
+ * Consulta si se informó la falta de movimientos de un CAEA (FECAEASinMovimientoConsultar).
885
+ */
886
+ getCAEANoMovement(caea: string): Promise<any>;
887
+ /**
888
+ * Mapea alícuotas numéricas a los códigos internos de ARCA
889
+ */
890
+ private getVATCode;
891
+ }
892
+
770
893
  /**
771
894
  * Genera la URL completa con el código QR para un comprobante emitido.
772
895
  * Implementa la versión oficial con orden estricto de campos según spec de ARCA.
@@ -779,4 +902,4 @@ declare class PadronService {
779
902
  */
780
903
  declare function generateQRUrl(caeResponse: CAEResponse, issuerCUIT: string, total: number, buyer?: Buyer): string;
781
904
 
782
- export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEResponse, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, VatCondition, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
905
+ export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEAConsultarResponse, type CAEARegInformativoResponse, type CAEASolicitarRequest, type CAEASolicitarResponse, type CAEResponse, type CaeaConfig, type CaeaInvoice, CaeaService, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, VatCondition, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
package/dist/index.d.ts CHANGED
@@ -635,6 +635,10 @@ declare class WsfeService {
635
635
  * Valida que todos los items tengan alícuota IVA definida
636
636
  */
637
637
  private validateItemsWithVAT;
638
+ /**
639
+ * Valida obligatoriamente al comprador cuando el monto es mayor o igual a $10.000.000 para consumidor final
640
+ */
641
+ private validateBuyer;
638
642
  /**
639
643
  * Calcula el IVA agrupado por alícuota (requerido por ARCA para Factura A/B)
640
644
  */
@@ -710,8 +714,10 @@ interface Taxpayer {
710
714
  mainActivity?: string;
711
715
  /** ¿Está inscripto en IVA? */
712
716
  isVATRegistered: boolean;
713
- /** ¿Es monotributista? */
717
+ /** ¿Es monotributista (Régimen General o Social)? */
714
718
  isMonotax: boolean;
719
+ /** ¿Es exclusivamente Monotributista Social / Autónomo / Promovido? */
720
+ isSocialMonotax: boolean;
715
721
  /** ¿Es exento de IVA? */
716
722
  isVATExempt: boolean;
717
723
  }
@@ -767,6 +773,123 @@ declare class PadronService {
767
773
  private toArray;
768
774
  }
769
775
 
776
+ /**
777
+ * Configuration for CaeaService (identical to WsfeConfig)
778
+ */
779
+ type CaeaConfig = WsfeConfig;
780
+ /**
781
+ * Request parameter for soliciting a CAEA
782
+ */
783
+ interface CAEASolicitarRequest {
784
+ /** Period in AAAAMM format (e.g. '202606') */
785
+ period: string;
786
+ /** Quinzena order (1 for days 1-15, 2 for days 16-end) */
787
+ order: number;
788
+ }
789
+ /**
790
+ * Response representing a solicited CAEA
791
+ */
792
+ interface CAEASolicitarResponse {
793
+ /** The obtained CAEA code */
794
+ caea: string;
795
+ /** The period (AAAAMM) */
796
+ period: number;
797
+ /** The order of the fortnight (1 or 2) */
798
+ order: number;
799
+ /** Expiry date of the CAEA (YYYYMMDD) */
800
+ expiryDate: string;
801
+ /** Actual date of processing (YYYYMMDD) */
802
+ actualDate: string;
803
+ /** Reception date (YYYYMMDD) */
804
+ receptionDate: string;
805
+ /** Limit date for reporting invoices under this CAEA (YYYYMMDD) */
806
+ limitDate: string;
807
+ }
808
+ /**
809
+ * Response for querying a CAEA (same fields as CAEASolicitarResponse)
810
+ */
811
+ type CAEAConsultarResponse = CAEASolicitarResponse;
812
+ /**
813
+ * Invoice emitted under contingency that needs to be reported in batch
814
+ */
815
+ interface CaeaInvoice {
816
+ /** Type of invoice (e.g. InvoiceType.FACTURA_A, FACTURA_B, etc.) */
817
+ invoiceType: InvoiceType;
818
+ /** Concept (e.g. BillingConcept.PRODUCTS, SERVICES, etc.) */
819
+ concept: BillingConcept;
820
+ /** Invoice number (correlative) */
821
+ invoiceNumber: number;
822
+ /** Date of the invoice (default: today) */
823
+ date?: Date;
824
+ /** Buyer information */
825
+ buyer?: Buyer;
826
+ /** Items included in the invoice */
827
+ items: InvoiceItem[];
828
+ /** Associated invoices (required for Credit/Debit Notes) */
829
+ associatedInvoices?: AssociatedInvoice[];
830
+ /** Optional parameters (e.g., VatCondition RG 5616) */
831
+ optionals?: InvoiceOptional[];
832
+ /** Prices already include VAT (default: false) */
833
+ includesVAT?: boolean;
834
+ }
835
+ /**
836
+ * Response for reporting CAEA invoices
837
+ */
838
+ interface CAEARegInformativoResponse {
839
+ /** The reported CAEA */
840
+ caea: string;
841
+ /** The status result ('A' = Approved, 'R' = Rejected) */
842
+ result: 'A' | 'R';
843
+ /** Point of sale */
844
+ pointOfSale: number;
845
+ /** Invoice type reported */
846
+ invoiceType: number;
847
+ /** Any observations/warnings returned by ARCA */
848
+ observations?: string[];
849
+ }
850
+
851
+ /**
852
+ * Servicio de Código de Autorización Electrónico Anticipado (CAEA)
853
+ *
854
+ * Provee soporte para el esquema de contingencia obligatorio de ARCA
855
+ * según Resoluciones Generales RG 5782/2025 y RG 5785/2025.
856
+ */
857
+ declare class CaeaService {
858
+ private config;
859
+ constructor(config: CaeaConfig);
860
+ private validateConfig;
861
+ /**
862
+ * Solicita un CAEA (Código de Autorización Electrónico Anticipado) para una quincena específica (FECAEASolicitar).
863
+ */
864
+ solicitCAEA(params: CAEASolicitarRequest): Promise<CAEASolicitarResponse>;
865
+ /**
866
+ * Consulta un CAEA ya emitido (FECAEAConsultar).
867
+ */
868
+ getCAEA(caea: string): Promise<CAEAConsultarResponse>;
869
+ /**
870
+ * Rinde/registra informativamente los comprobantes emitidos en contingencia local bajo un CAEA específico (FECAEARegInformativo).
871
+ * Soporta el envío en lotes de comprobantes homogéneos del mismo tipo de factura y punto de venta.
872
+ */
873
+ reportCAEAPeriod(params: {
874
+ caea: string;
875
+ invoices: CaeaInvoice[];
876
+ }): Promise<CAEARegInformativoResponse>;
877
+ /**
878
+ * Informa que un CAEA no tuvo movimientos en la quincena (FECAEASinMovimientoInformar).
879
+ */
880
+ reportCAEANoMovement(params: {
881
+ caea: string;
882
+ }): Promise<void>;
883
+ /**
884
+ * Consulta si se informó la falta de movimientos de un CAEA (FECAEASinMovimientoConsultar).
885
+ */
886
+ getCAEANoMovement(caea: string): Promise<any>;
887
+ /**
888
+ * Mapea alícuotas numéricas a los códigos internos de ARCA
889
+ */
890
+ private getVATCode;
891
+ }
892
+
770
893
  /**
771
894
  * Genera la URL completa con el código QR para un comprobante emitido.
772
895
  * Implementa la versión oficial con orden estricto de campos según spec de ARCA.
@@ -779,4 +902,4 @@ declare class PadronService {
779
902
  */
780
903
  declare function generateQRUrl(caeResponse: CAEResponse, issuerCUIT: string, total: number, buyer?: Buyer): string;
781
904
 
782
- export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEResponse, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, VatCondition, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
905
+ export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEAConsultarResponse, type CAEARegInformativoResponse, type CAEASolicitarRequest, type CAEASolicitarResponse, type CAEResponse, type CaeaConfig, type CaeaInvoice, CaeaService, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, VatCondition, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };