facturas 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/dist/wsfe.d.ts ADDED
@@ -0,0 +1,228 @@
1
+ import { A as ArcaClientConfig } from './types-SloiIQkT.js';
2
+ import { W as WsaaAuthModule, S as SoapTransport } from './index-BLq3d6xg.js';
3
+
4
+ /** Accepted public date inputs for WSFE request fields. */
5
+ type WsfeDateInput = `${number}${number}${number}${number}-${number}${number}-${number}${number}` | `${number}${number}${number}${number}${number}${number}${number}${number}`;
6
+ /** An associated voucher referenced by a WSFE invoice request. */
7
+ type WsfeAssociatedVoucher = {
8
+ type: number;
9
+ salesPoint: number;
10
+ number: number;
11
+ taxId?: string;
12
+ voucherDate?: WsfeDateInput;
13
+ };
14
+ /** An associated period used by WSFE credit/debit notes without associated vouchers. */
15
+ type WsfeAssociatedPeriod = {
16
+ startDate: WsfeDateInput;
17
+ endDate: WsfeDateInput;
18
+ };
19
+ /** A tax (tributo) item in a WSFE invoice request. */
20
+ type WsfeTax = {
21
+ id: number;
22
+ description?: string;
23
+ baseAmount: number;
24
+ rate: number;
25
+ amount: number;
26
+ };
27
+ /** A VAT rate (alícuota IVA) item in a WSFE invoice request. */
28
+ type WsfeVatRate = {
29
+ id: number;
30
+ baseAmount: number;
31
+ amount: number;
32
+ };
33
+ /** An optional field (campo opcional) in a WSFE invoice request. */
34
+ type WsfeOptionalField = {
35
+ id: string;
36
+ value: string;
37
+ };
38
+ /** A buyer (comprador) in a WSFE invoice request. */
39
+ type WsfeBuyer = {
40
+ documentType: number;
41
+ documentNumber: number;
42
+ percentage: number;
43
+ };
44
+ /** An activity associated with a WSFE invoice request. */
45
+ type WsfeActivity = {
46
+ id: number;
47
+ };
48
+ /** Input data for creating a new WSFE voucher via {@link WsfeService.createNextVoucher}. */
49
+ type WsfeVoucherInput = {
50
+ salesPoint: number;
51
+ voucherType: number;
52
+ concept: number;
53
+ documentType: number;
54
+ documentNumber: number;
55
+ receiverVatConditionId?: number;
56
+ voucherDate: WsfeDateInput;
57
+ totalAmount: number;
58
+ nonTaxableAmount: number;
59
+ netAmount: number;
60
+ exemptAmount: number;
61
+ taxAmount: number;
62
+ vatAmount: number;
63
+ currencyId: string;
64
+ exchangeRate: number;
65
+ sameCurrencyForeignCancellation?: "S" | "N";
66
+ serviceStartDate?: WsfeDateInput;
67
+ serviceEndDate?: WsfeDateInput;
68
+ paymentDueDate?: WsfeDateInput;
69
+ associatedVouchers?: WsfeAssociatedVoucher[];
70
+ associatedPeriod?: WsfeAssociatedPeriod;
71
+ taxes?: WsfeTax[];
72
+ vatRates?: WsfeVatRate[];
73
+ optionalFields?: WsfeOptionalField[];
74
+ buyers?: WsfeBuyer[];
75
+ activities?: WsfeActivity[];
76
+ };
77
+ /** Result of a successful WSFE voucher authorization. */
78
+ type WsfeAuthorizationResult = {
79
+ cae: string;
80
+ caeExpiry: string;
81
+ voucherNumber: number;
82
+ raw: Record<string, unknown>;
83
+ };
84
+ /** A point-of-sale entry returned by {@link WsfeService.getSalesPoints}. */
85
+ type WsfeSalesPoint = {
86
+ number: number;
87
+ emissionType?: string;
88
+ blocked?: string;
89
+ deletedSince?: string;
90
+ };
91
+ /** Voucher details returned by {@link WsfeService.getVoucherInfo}. */
92
+ type WsfeVoucherInfo = {
93
+ voucherNumber: number;
94
+ voucherDate?: string;
95
+ salesPoint?: number;
96
+ voucherType?: number;
97
+ totalAmount?: number;
98
+ result?: string;
99
+ cae?: string;
100
+ caeExpiry?: string;
101
+ raw: Record<string, unknown>;
102
+ };
103
+ type WsfeCatalogEntry = {
104
+ id: number;
105
+ description: string;
106
+ };
107
+ type WsfeActivityType = WsfeCatalogEntry & {
108
+ order: number;
109
+ };
110
+ type WsfeReceiverVatCondition = WsfeCatalogEntry & {
111
+ voucherClass: string;
112
+ };
113
+ type WsfeCurrencyType = {
114
+ id: string;
115
+ description: string;
116
+ validFrom: string;
117
+ validTo: string;
118
+ };
119
+ type WsfeServerStatus = {
120
+ appServer: string;
121
+ dbServer: string;
122
+ authServer: string;
123
+ };
124
+ type WsfeQuotation = {
125
+ currencyId: string;
126
+ rate: number;
127
+ date: string;
128
+ };
129
+ /** WSFE electronic invoicing service. */
130
+ type WsfeService = {
131
+ /** Authorizes a new voucher by fetching the next number and requesting a CAE. */
132
+ createNextVoucher(input: {
133
+ representedTaxId?: number | string;
134
+ data: WsfeVoucherInput;
135
+ }): Promise<WsfeAuthorizationResult>;
136
+ /** Returns the next available voucher number for the given sales point and type. */
137
+ getNextVoucherNumber(input: {
138
+ representedTaxId?: number | string;
139
+ salesPoint: number;
140
+ voucherType: number;
141
+ forceAuthRefresh?: boolean;
142
+ }): Promise<number>;
143
+ /**
144
+ * @deprecated Use `getNextVoucherNumber()` instead.
145
+ * Returns the next available voucher number, not the last authorized one.
146
+ */
147
+ getLastVoucher(input: {
148
+ representedTaxId?: number | string;
149
+ salesPoint: number;
150
+ voucherType: number;
151
+ forceAuthRefresh?: boolean;
152
+ }): Promise<number>;
153
+ /** Lists all configured points of sale for the taxpayer. */
154
+ getSalesPoints(input: {
155
+ representedTaxId?: number | string;
156
+ forceAuthRefresh?: boolean;
157
+ }): Promise<WsfeSalesPoint[]>;
158
+ /** Lists voucher types accepted by WSFE. */
159
+ getVoucherTypes(input: {
160
+ representedTaxId?: number | string;
161
+ forceAuthRefresh?: boolean;
162
+ }): Promise<WsfeCatalogEntry[]>;
163
+ /** Lists document types accepted by WSFE. */
164
+ getDocumentTypes(input: {
165
+ representedTaxId?: number | string;
166
+ forceAuthRefresh?: boolean;
167
+ }): Promise<WsfeCatalogEntry[]>;
168
+ /** Lists concept types accepted by WSFE. */
169
+ getConceptTypes(input: {
170
+ representedTaxId?: number | string;
171
+ forceAuthRefresh?: boolean;
172
+ }): Promise<WsfeCatalogEntry[]>;
173
+ /** Lists supported currency types. */
174
+ getCurrencyTypes(input: {
175
+ representedTaxId?: number | string;
176
+ forceAuthRefresh?: boolean;
177
+ }): Promise<WsfeCurrencyType[]>;
178
+ /** Lists VAT rates accepted by WSFE. */
179
+ getVatRates(input: {
180
+ representedTaxId?: number | string;
181
+ forceAuthRefresh?: boolean;
182
+ }): Promise<WsfeCatalogEntry[]>;
183
+ /** Lists tax types accepted by WSFE. */
184
+ getTaxTypes(input: {
185
+ representedTaxId?: number | string;
186
+ forceAuthRefresh?: boolean;
187
+ }): Promise<WsfeCatalogEntry[]>;
188
+ /** Lists optional field types accepted by WSFE. */
189
+ getOptionalTypes(input: {
190
+ representedTaxId?: number | string;
191
+ forceAuthRefresh?: boolean;
192
+ }): Promise<WsfeCatalogEntry[]>;
193
+ /** Lists activities enabled for the taxpayer. */
194
+ getActivities(input: {
195
+ representedTaxId?: number | string;
196
+ forceAuthRefresh?: boolean;
197
+ }): Promise<WsfeActivityType[]>;
198
+ /** Lists receiver VAT condition values accepted by WSFE. */
199
+ getReceiverVatConditions(input: {
200
+ representedTaxId?: number | string;
201
+ voucherClass?: string;
202
+ forceAuthRefresh?: boolean;
203
+ }): Promise<WsfeReceiverVatCondition[]>;
204
+ /** Reports WSFE backend status without requiring taxpayer authorization. */
205
+ getServerStatus(): Promise<WsfeServerStatus>;
206
+ /** Returns the exchange rate for a given currency. */
207
+ getQuotation(input: {
208
+ currencyId: string;
209
+ representedTaxId?: number | string;
210
+ forceAuthRefresh?: boolean;
211
+ }): Promise<WsfeQuotation>;
212
+ /** Retrieves details for a specific voucher. Returns `null` if not found. */
213
+ getVoucherInfo(input: {
214
+ representedTaxId?: number | string;
215
+ number: number;
216
+ salesPoint: number;
217
+ voucherType: number;
218
+ }): Promise<WsfeVoucherInfo | null>;
219
+ };
220
+ type CreateWsfeServiceOptions = {
221
+ config: ArcaClientConfig;
222
+ auth: WsaaAuthModule;
223
+ soap: SoapTransport;
224
+ };
225
+ /** Creates a WSFE service instance wired with authentication and SOAP transport. */
226
+ declare function createWsfeService(options: CreateWsfeServiceOptions): WsfeService;
227
+
228
+ export { type CreateWsfeServiceOptions, type WsfeActivity, type WsfeActivityType, type WsfeAssociatedPeriod, type WsfeAssociatedVoucher, type WsfeAuthorizationResult, type WsfeBuyer, type WsfeCatalogEntry, type WsfeCurrencyType, type WsfeDateInput, type WsfeOptionalField, type WsfeQuotation, type WsfeReceiverVatCondition, type WsfeSalesPoint, type WsfeServerStatus, type WsfeService, type WsfeTax, type WsfeVatRate, type WsfeVoucherInfo, type WsfeVoucherInput, createWsfeService };