sinfactura-types 1.6.34 → 1.6.36
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/audit.d.ts +5 -3
- package/dist/auth.d.ts +5 -0
- package/dist/invoice.d.ts +129 -0
- package/dist/order.d.ts +2 -0
- package/dist/payment.d.ts +2 -0
- package/dist/store.d.ts +4 -0
- package/dist/supplier.d.ts +55 -0
- package/dist/user.d.ts +5 -0
- package/dist/userActivity.d.ts +8 -1
- package/dist/userActivity.js +1 -0
- package/package.json +1 -1
package/dist/audit.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare global {
|
|
|
31
31
|
newValue: unknown;
|
|
32
32
|
}
|
|
33
33
|
type OrderAuditAction = 'order_created' | 'order_edited' | 'order_ready' | 'order_delivered' | 'order_delivery_cancelled' | 'order_disabled' | 'order_enabled' | 'order_returned' | 'discount_changed' | 'payment_method_changed' | 'delivery_method_changed' | 'delivery_address_changed' | 'invoice_created' | 'credit_note_created';
|
|
34
|
-
/** One ARCA fiscal SOAP interaction (FECAESolicitar | FECompConsultar). Stored raw (CUIT unmasked) for 10y; masked at read. */
|
|
34
|
+
/** One ARCA fiscal SOAP interaction (FECAESolicitar | FECompConsultar | ConstatarComprobante). Stored raw (CUIT unmasked) for 10y; masked at read. */
|
|
35
35
|
interface FiscalAuditEvent {
|
|
36
36
|
/** Schema version for forward-compat (start at 1). */
|
|
37
37
|
schema_version: number;
|
|
@@ -41,8 +41,10 @@ declare global {
|
|
|
41
41
|
tenant_store_id: string;
|
|
42
42
|
/** Unix ms when the interaction completed. */
|
|
43
43
|
ts: number;
|
|
44
|
-
/** Which ARCA fiscal op.
|
|
45
|
-
|
|
44
|
+
/** Which ARCA fiscal op. `ConstatarComprobante` added for WSCDC
|
|
45
|
+
* third-party voucher verification (api#1500), which logs every check
|
|
46
|
+
* to this same table per its AC. */
|
|
47
|
+
operation: 'FECAESolicitar' | 'FECompConsultar' | 'ConstatarComprobante';
|
|
46
48
|
/** Issuer CUIT (RAW — masked only at display). */
|
|
47
49
|
cuit: string;
|
|
48
50
|
/** AFIP environment the call hit. */
|
package/dist/auth.d.ts
CHANGED
|
@@ -17,5 +17,10 @@ declare global {
|
|
|
17
17
|
interface Recover {
|
|
18
18
|
email: string;
|
|
19
19
|
}
|
|
20
|
+
type LoginErrorCode = 'WRONG_CREDENTIALS' | 'ACCOUNT_LOCKED' | 'ACCOUNT_DISABLED' | 'CAPTCHA_REQUIRED' | 'CAPTCHA_INVALID';
|
|
21
|
+
interface AccountLockedResponse {
|
|
22
|
+
error: 'ACCOUNT_LOCKED';
|
|
23
|
+
retryAfterSeconds: number;
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
export {};
|
package/dist/invoice.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ declare global {
|
|
|
34
34
|
caeExpiration: string;
|
|
35
35
|
observations?: string;
|
|
36
36
|
fiscalStatus?: FiscalStatus;
|
|
37
|
+
arcaError?: ArcaError;
|
|
38
|
+
arcaObservations?: InvoiceObservation[];
|
|
39
|
+
caea?: string;
|
|
40
|
+
caeaPeriod?: string;
|
|
41
|
+
export?: ExportInvoiceFields;
|
|
42
|
+
fce?: FceFields;
|
|
37
43
|
serviceStartDate?: number;
|
|
38
44
|
serviceEndDate?: number;
|
|
39
45
|
paymentDueDate?: number;
|
|
@@ -76,5 +82,128 @@ declare global {
|
|
|
76
82
|
BaseImp: number;
|
|
77
83
|
Importe: number;
|
|
78
84
|
}>;
|
|
85
|
+
/**
|
|
86
|
+
* `GET /reports?mode=libro-iva-digital&date=YYYYMM[&book=ventas|compras|all]`
|
|
87
|
+
* response (api#1501, RG 4597). Returns the four CRLF-terminated
|
|
88
|
+
* fixed-width payloads; an empty string means an empty period or a book
|
|
89
|
+
* not requested. See docs/LIBRO_IVA_DIGITAL.md.
|
|
90
|
+
*/
|
|
91
|
+
interface LibroIvaDigitalResponse {
|
|
92
|
+
period: string;
|
|
93
|
+
ventasCbte: string;
|
|
94
|
+
ventasAlicuotas: string;
|
|
95
|
+
comprasCbte: string;
|
|
96
|
+
comprasAlicuotas: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* ARCA Obs.Code/Obs.Msg pair, parsed from FECAESolicitar's Observaciones[]
|
|
100
|
+
* when Resultado='O' (approved-with-warnings). (api#1559)
|
|
101
|
+
*
|
|
102
|
+
* `code`/`msg` naming matches the already-shipped `FiscalAuditEvent.observaciones`
|
|
103
|
+
* / `.errores` shape (api#1498, audit.ts) rather than inventing a second
|
|
104
|
+
* convention for the same ARCA concept.
|
|
105
|
+
*/
|
|
106
|
+
interface InvoiceObservation {
|
|
107
|
+
code: number;
|
|
108
|
+
msg: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Structured ARCA rejection/observation error (api#1380). Reused by
|
|
112
|
+
* `CAEAInformResult.errors` below rather than inventing a second shape.
|
|
113
|
+
*/
|
|
114
|
+
interface ArcaError {
|
|
115
|
+
code: number;
|
|
116
|
+
msg: string;
|
|
117
|
+
category?: 'data_validation' | 'authorization' | 'fiscal_rules' | 'service' | 'infrastructure';
|
|
118
|
+
observations?: string[];
|
|
119
|
+
}
|
|
120
|
+
/** A single CAEA fortnightly period, requested and tracked per store. */
|
|
121
|
+
interface CAEAPeriod {
|
|
122
|
+
storeId: string;
|
|
123
|
+
period: string;
|
|
124
|
+
caea: string;
|
|
125
|
+
validFrom: string;
|
|
126
|
+
validTo: string;
|
|
127
|
+
status: 'active' | 'used' | 'informed' | 'expired';
|
|
128
|
+
invoiceCount: number;
|
|
129
|
+
informedAt?: string;
|
|
130
|
+
}
|
|
131
|
+
/** Result of requesting a new CAEA code for an upcoming period. */
|
|
132
|
+
interface CAEARequestResult {
|
|
133
|
+
period: CAEAPeriod;
|
|
134
|
+
requestedAt: string;
|
|
135
|
+
}
|
|
136
|
+
/** Result of informing ARCA of CAEA-stamped invoices for a period. */
|
|
137
|
+
interface CAEAInformResult {
|
|
138
|
+
period: string;
|
|
139
|
+
invoiceCount: number;
|
|
140
|
+
informedAt: string;
|
|
141
|
+
errors?: ArcaError[];
|
|
142
|
+
}
|
|
143
|
+
/** Export-invoice-specific fields, present only when Invoice.invoiceType === 19 (Factura E). */
|
|
144
|
+
interface ExportInvoiceFields {
|
|
145
|
+
dstCmp: number;
|
|
146
|
+
idImpositivo?: string;
|
|
147
|
+
monedaId: string;
|
|
148
|
+
monedaCtz: number;
|
|
149
|
+
incoterms?: string;
|
|
150
|
+
incotermsDs?: string;
|
|
151
|
+
permisoExistente?: 'S' | 'N';
|
|
152
|
+
permisoExistenteTipo?: string;
|
|
153
|
+
permisoExistenteNro?: string;
|
|
154
|
+
idiomaCbte: 1 | 2 | 3;
|
|
155
|
+
/** "Cancelación en Misma Moneda Extranjera" -- required only when settled in the same
|
|
156
|
+
* foreign currency the invoice was issued in (RG 5616/2024 FX-precision rule reaching
|
|
157
|
+
* voucher class E; added to the WSFEXV1 manual in v3.0.0, 2025-03-17). */
|
|
158
|
+
canMisMonExt?: boolean;
|
|
159
|
+
}
|
|
160
|
+
/** Reference data cached from WSFEXV1 `GetPARAM_*` operations, refreshed on a schedule. */
|
|
161
|
+
interface WsfexReferenceData {
|
|
162
|
+
currencies: {
|
|
163
|
+
id: string;
|
|
164
|
+
name: string;
|
|
165
|
+
}[];
|
|
166
|
+
countries: {
|
|
167
|
+
id: number;
|
|
168
|
+
name: string;
|
|
169
|
+
}[];
|
|
170
|
+
incoterms: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
}[];
|
|
174
|
+
languages: {
|
|
175
|
+
id: 1 | 2 | 3;
|
|
176
|
+
name: string;
|
|
177
|
+
}[];
|
|
178
|
+
voucherTypes: {
|
|
179
|
+
id: number;
|
|
180
|
+
name: string;
|
|
181
|
+
}[];
|
|
182
|
+
exportTypes: {
|
|
183
|
+
id: number;
|
|
184
|
+
name: string;
|
|
185
|
+
}[];
|
|
186
|
+
fetchedAt: string;
|
|
187
|
+
}
|
|
188
|
+
type FceStatus = 'emitted' | 'accepted' | 'rejected' | 'ceded';
|
|
189
|
+
/** FCE-specific fields, present only when Invoice.invoiceType is 201/202/203, 206/207/208, or 211/212/213. */
|
|
190
|
+
interface FceFields {
|
|
191
|
+
cbu: string;
|
|
192
|
+
sca: boolean;
|
|
193
|
+
status: FceStatus;
|
|
194
|
+
statusChangedAt?: string;
|
|
195
|
+
acceptanceDeadline: string;
|
|
196
|
+
cesionId?: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The annually/periodically-adjusted FCE threshold -- do not hard-code the
|
|
200
|
+
* amount anywhere else; read it from this single config source.
|
|
201
|
+
*/
|
|
202
|
+
interface FceThresholdConfig {
|
|
203
|
+
amountArs: number;
|
|
204
|
+
effectiveFrom: string;
|
|
205
|
+
acceptanceWindowDays: number;
|
|
206
|
+
acceptanceWindowValidThrough?: string;
|
|
207
|
+
}
|
|
79
208
|
}
|
|
80
209
|
export {};
|
package/dist/order.d.ts
CHANGED
package/dist/payment.d.ts
CHANGED
package/dist/store.d.ts
CHANGED
|
@@ -198,6 +198,7 @@ declare global {
|
|
|
198
198
|
interface SmsIntegration {
|
|
199
199
|
/** When true, the store may send SMS through the shared platform account. */
|
|
200
200
|
enabled?: boolean;
|
|
201
|
+
signature?: string;
|
|
201
202
|
}
|
|
202
203
|
interface Gmail {
|
|
203
204
|
connected?: boolean;
|
|
@@ -211,6 +212,8 @@ declare global {
|
|
|
211
212
|
disconnectedAt?: number;
|
|
212
213
|
lastTokenRefreshAt?: number;
|
|
213
214
|
tokenRefreshFailures?: number;
|
|
215
|
+
accessTokenEncrypted?: string;
|
|
216
|
+
accessTokenExpiresAt?: number;
|
|
214
217
|
}
|
|
215
218
|
type FxAutoUpdateStrategy = "overwrite" | "overwrite-if-stale" | "notify-only";
|
|
216
219
|
interface FxAutoUpdateBinding {
|
|
@@ -284,6 +287,7 @@ declare global {
|
|
|
284
287
|
accessTicket_RSF?: string;
|
|
285
288
|
hasCert?: boolean;
|
|
286
289
|
hasKey?: boolean;
|
|
290
|
+
facturaMLegend?: 'retencion' | 'cbu_informada';
|
|
287
291
|
certExpiry?: number;
|
|
288
292
|
}
|
|
289
293
|
type StoreAttributeNames = keyof Store;
|
package/dist/supplier.d.ts
CHANGED
|
@@ -40,6 +40,61 @@ declare global {
|
|
|
40
40
|
currencyValue: number;
|
|
41
41
|
currencyValueAt?: number;
|
|
42
42
|
search?: string;
|
|
43
|
+
neto10?: number;
|
|
44
|
+
neto21?: number;
|
|
45
|
+
neto27?: number;
|
|
46
|
+
iva27?: number;
|
|
47
|
+
noGravado?: number;
|
|
48
|
+
exento?: number;
|
|
49
|
+
cbteClass?: 'A' | 'B' | 'C';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* WSCDC `ConstatarComprobante` request (api#1500) -- verifies a
|
|
53
|
+
* third-party (supplier) voucher was genuinely authorized by ARCA before
|
|
54
|
+
* it's booked/credited as IVA input. Fields per the ticket's tech spec.
|
|
55
|
+
*/
|
|
56
|
+
interface VoucherVerificationRequest {
|
|
57
|
+
cuit: string;
|
|
58
|
+
pointOfSale: number;
|
|
59
|
+
invoiceType: number;
|
|
60
|
+
invoiceNumber: number;
|
|
61
|
+
dated: number;
|
|
62
|
+
total: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* WSCDC `ConstatarComprobante` result (api#1500). `result` mirrors the
|
|
66
|
+
* A/O/R convention already used for `FECAESolicitar`'s own `Resultado`
|
|
67
|
+
* and `FiscalAuditEvent` (Aceptado/Observado/Rechazado) -- every
|
|
68
|
+
* verification call is also logged to that same audit table per the
|
|
69
|
+
* ticket's AC (`FiscalAuditEvent.operation` includes `ConstatarComprobante`).
|
|
70
|
+
*/
|
|
71
|
+
interface VoucherVerificationResult {
|
|
72
|
+
result: 'A' | 'O' | 'R';
|
|
73
|
+
reason?: string;
|
|
74
|
+
observations?: InvoiceObservation[];
|
|
75
|
+
verifiedAt: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* `GET /reports?mode=supplier-invoices` per-date resume row (api#1550) --
|
|
79
|
+
* compras-side mirror of the ventas `mode=invoices` resume shape. Unlike
|
|
80
|
+
* ventas Invoice, SupplierInvoice has no CAE-authorization concept, so
|
|
81
|
+
* every row in range counts (no fiscalStatus filter).
|
|
82
|
+
*/
|
|
83
|
+
interface SupplierInvoicesResumeRow {
|
|
84
|
+
date: number;
|
|
85
|
+
quantity: number;
|
|
86
|
+
neto10: number;
|
|
87
|
+
neto21: number;
|
|
88
|
+
neto27: number;
|
|
89
|
+
iva10: number;
|
|
90
|
+
iva21: number;
|
|
91
|
+
iva27: number;
|
|
92
|
+
noGravado: number;
|
|
93
|
+
exento: number;
|
|
94
|
+
total: number;
|
|
95
|
+
}
|
|
96
|
+
interface ReportSupplierInvoicesResponse {
|
|
97
|
+
resume: SupplierInvoicesResumeRow[];
|
|
43
98
|
}
|
|
44
99
|
interface SupplierAccount {
|
|
45
100
|
storeId: string;
|
package/dist/user.d.ts
CHANGED
|
@@ -40,6 +40,11 @@ declare global {
|
|
|
40
40
|
lockedUntil?: number;
|
|
41
41
|
};
|
|
42
42
|
warnings?: StoreWarning[];
|
|
43
|
+
login?: {
|
|
44
|
+
failedAttempts?: number;
|
|
45
|
+
lockedUntil?: number;
|
|
46
|
+
lastFailedAt?: number;
|
|
47
|
+
};
|
|
43
48
|
}
|
|
44
49
|
type UserNotifications = Partial<Record<NotificationTypeEnum, boolean>>;
|
|
45
50
|
type UserPermissions = {
|
package/dist/userActivity.d.ts
CHANGED
|
@@ -390,7 +390,14 @@ declare global {
|
|
|
390
390
|
target_user_id: string;
|
|
391
391
|
initiator_role: string;
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
interface IntegrationTokenRefreshedEvent extends UserActivityEventBase {
|
|
394
|
+
event: 'Integration Token Refreshed';
|
|
395
|
+
provider: 'mercadopago' | 'gmail';
|
|
396
|
+
outcome: 'refreshed' | 'disconnected' | 'skipped' | 'error';
|
|
397
|
+
trigger: 'operator-single' | 'operator-global';
|
|
398
|
+
detail?: string;
|
|
399
|
+
}
|
|
400
|
+
type UserActivityEvent = UserLoggedInEvent | UserLoggedOutEvent | UserPasswordChangedEvent | UserSuspendedEvent | TwoFactorEnrolledEvent | TwoFactorDisabledEvent | TwoFactorResetEvent | TwoFactorRecoveryCodesGeneratedEvent | StorePaletteChangedEvent | StoreSettingsUpdatedEvent | PlanChangedEvent | InvoiceCreatedEvent | OrderCreatedEvent | OrderCancelledEvent | ProductPriceChangedEvent | CustomerCreatedEvent | CustomerEditedEvent | CashDrawerOpenedEvent | CashDrawerClosedEvent | TenantImpersonatedEvent | SecretRotatedEvent | UserCreatedEvent | UserUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | StockIncomeCreatedEvent | CategoryCreatedEvent | CategoryUpdatedEvent | BrandCreatedEvent | BrandUpdatedEvent | SupplierCreatedEvent | SupplierUpdatedEvent | SupplierInvoiceCreatedEvent | SupplierAccountCreatedEvent | SupplierAccountUpdatedEvent | AccountCreatedEvent | AccountDeletedEvent | BasketUpdatedEvent | BasketDeletedEvent | CashDrawerMovementEvent | PaymentCreatedEvent | PaymentLinkedEvent | PaymentUnlinkedEvent | PaymentLinkageUpdatedEvent | NotificationReadEvent | LogDeletedEvent | PlanCreatedEvent | StoreMaintenanceToggledEvent | PlatformMaintenanceToggledEvent | TenantCreatedEvent | LiteralUpdatedEvent | SupportTicketCreatedEvent | SupportTicketUpdatedEvent | AuditTrailViewedEvent | ReportViewedEvent | CustomerPiiViewedEvent | CashDrawerUiOpenedEvent | CashDrawerUiClosedEvent | ExportInitiatedEvent | ImpersonationUiStartedEvent | ImpersonationUiEndedEvent | PaymentViewedEvent | InvoiceViewedEvent | CustomerDetailViewedEvent | SupplierAccountViewedEvent | SearchPerformedEvent | ActionDeniedEvent | TwoFactorChallengeShownEvent | TwoFactorCodeValidationFailedEvent | TwoFactorEnrollmentStartedEvent | TwoFactorRecoveryCodesRevealedEvent | TwoFactorResetInitiatedEvent | IntegrationTokenRefreshedEvent;
|
|
394
401
|
}
|
|
395
402
|
/**
|
|
396
403
|
* Canonical whitelist of UI-only `UserActivityEvent` variant names — the 8
|
package/dist/userActivity.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
// - 1.6.20 (+1 variant) — operator 2FA reset, target_user_id (api#1335)
|
|
23
23
|
// - 1.6.21 (+1 variant) — TOTP recovery codes generated (api#1336); method += 'recovery'
|
|
24
24
|
// - 1.6.34 (+field) — LiteralUpdatedEvent gains `scope`; new `LiteralScope` contract (api#1484)
|
|
25
|
+
// - (+1 variant) — IntegrationTokenRefreshedEvent (types#91, api#1540)
|
|
25
26
|
/**
|
|
26
27
|
* Canonical whitelist of UI-only `UserActivityEvent` variant names — the 8
|
|
27
28
|
* Phase 3 verbs shipped in 1.6.13 (types#74). Imported by the api side
|