sinfactura-types 1.6.35 → 1.6.37

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 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
- operation: 'FECAESolicitar' | 'FECompConsultar';
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
@@ -22,5 +22,9 @@ declare global {
22
22
  error: 'ACCOUNT_LOCKED';
23
23
  retryAfterSeconds: number;
24
24
  }
25
+ interface WaitlistRegisterResponse {
26
+ waitlistId: string;
27
+ submittedAt: number;
28
+ }
25
29
  }
26
30
  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;
@@ -89,5 +95,115 @@ declare global {
89
95
  comprasCbte: string;
90
96
  comprasAlicuotas: string;
91
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
+ }
92
208
  }
93
209
  export {};
package/dist/order.d.ts CHANGED
@@ -20,6 +20,8 @@ declare global {
20
20
  condFiscalName: string;
21
21
  cuit: string;
22
22
  razonSocial: string;
23
+ docType?: number;
24
+ docNumber?: string;
23
25
  };
24
26
  cost: number;
25
27
  total: number;
package/dist/store.d.ts CHANGED
@@ -287,6 +287,7 @@ declare global {
287
287
  accessTicket_RSF?: string;
288
288
  hasCert?: boolean;
289
289
  hasKey?: boolean;
290
+ facturaMLegend?: 'retencion' | 'cbu_informada';
290
291
  certExpiry?: number;
291
292
  }
292
293
  type StoreAttributeNames = keyof Store;
@@ -48,6 +48,54 @@ declare global {
48
48
  exento?: number;
49
49
  cbteClass?: 'A' | 'B' | 'C';
50
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[];
98
+ }
51
99
  interface SupplierAccount {
52
100
  storeId: string;
53
101
  userId: string;
@@ -390,7 +390,14 @@ declare global {
390
390
  target_user_id: string;
391
391
  initiator_role: string;
392
392
  }
393
- 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;
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
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.6.35",
3
+ "version": "1.6.37",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",