sinfactura-types 1.7.12 → 1.8.1

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/invoice.d.ts CHANGED
@@ -1,5 +1,26 @@
1
1
  declare global {
2
2
  type FiscalStatus = 'pending_cae' | 'authorized_cae' | 'authorized_caea' | 'caea_reported' | 'rejected' | 'voided';
3
+ /**
4
+ * One discriminated IVA alicuota on an issued voucher (api#1961).
5
+ *
6
+ * `id` is AFIP's WSFE `Iva[].Id`, which is ALSO the Libro IVA Digital alicuota
7
+ * code once 4-padded — verified against ARCA's *Tablas del SISTEMA* section 1:
8
+ * 0003 = 0,00 % · 0004 = 10,50 % · 0005 = 21,00 % · 0006 = 27,00 % ·
9
+ * 0008 = 5,00 % · 0009 = 2,50 %. Those six are the whole valid domain; Ids 1
10
+ * and 2 (No Gravado / Exento) are Codigos de Operacion, not alicuotas, and
11
+ * WSFEv1 rejects them inside `Iva[]`.
12
+ *
13
+ * A bucket is meaningful when `baseImp !== 0`: a 0 %-rated line has
14
+ * `importe === 0` but is still a real, declarable alicuota.
15
+ */
16
+ interface InvoiceAlicuota {
17
+ /** AFIP WSFE `Iva[].Id` — one of 3, 4, 5, 6, 8, 9. */
18
+ id: number;
19
+ /** Neto gravado at this rate. */
20
+ baseImp: number;
21
+ /** IVA liquidado at this rate; `0` for the 0 % rate. */
22
+ importe: number;
23
+ }
3
24
  interface Invoice {
4
25
  storeId: string;
5
26
  invoiceId: string;
@@ -28,6 +49,21 @@ declare global {
28
49
  neto21: number;
29
50
  iva10: number;
30
51
  iva21: number;
52
+ /**
53
+ * api#1961 — the FULL per-alicuota IVA breakdown, one entry per declared rate.
54
+ *
55
+ * The `neto10`/`neto21`/`iva10`/`iva21` quartet above only ever captured AFIP
56
+ * Iva Ids 4 (10,5 %) and 5 (21 %). The catalog has SIX rates, so the other
57
+ * four (0 %, 2,5 %, 5 %, 27 %) were declared to ARCA yet dropped from the row,
58
+ * while `total` included every bucket — silently under-reporting the Libro IVA
59
+ * Digital, the RG 3685 export, the F.2051 apertura and the invoice PDF.
60
+ *
61
+ * Forward-only, no backfill: absent on every row issued before api#1961, and
62
+ * never set on the WSFEX export path. Consumers MUST fall back to the legacy
63
+ * quartet when it is absent rather than treating an empty result as "no IVA".
64
+ * The quartet is retained, not deprecated — still written on every new row.
65
+ */
66
+ alicuotas?: InvoiceAlicuota[];
31
67
  discount?: number;
32
68
  total: number;
33
69
  cae: string;
package/dist/store.d.ts CHANGED
@@ -48,55 +48,21 @@ declare global {
48
48
  appVersion?: number;
49
49
  stats?: Record<string, string>;
50
50
  }
51
- interface FeatureFlags {
52
- navbar?: {
53
- show?: boolean;
54
- };
55
- sidebar?: {
56
- show?: boolean;
57
- customerFinder?: {
58
- show?: boolean;
59
- showPicture?: boolean;
60
- showEditButton?: boolean;
61
- showStatsButton?: boolean;
62
- showExitButton?: boolean;
63
- showBalance?: boolean;
64
- showPaymentButton?: boolean;
65
- };
66
- showHome?: boolean;
67
- showCash?: boolean;
68
- showOrders?: boolean;
69
- showInvoices?: boolean;
70
- showBaskets?: boolean;
71
- showCustomers?: boolean;
72
- showProducts?: boolean;
73
- showReports?: boolean;
74
- store?: {
75
- show?: boolean;
76
- showConfig?: boolean;
77
- showCategories?: boolean;
78
- showBrands?: boolean;
79
- showProviders?: boolean;
80
- showUsers?: boolean;
81
- showIntegrations?: boolean;
82
- };
83
- showBalance?: boolean;
84
- };
85
- footer?: {
86
- desktopNavigation?: {
87
- show?: boolean;
88
- showCopyright?: boolean;
89
- showPrivacy?: boolean;
90
- showAppVersion?: boolean;
91
- };
92
- mobileNavigation?: {
93
- show?: boolean;
94
- showOrders?: boolean;
95
- showInvoices?: boolean;
96
- showBasket?: boolean;
97
- showFavorites?: boolean;
98
- };
99
- };
51
+ /**
52
+ * Platform globals forwarded to a tenant session on `GET /store` (api#1955).
53
+ *
54
+ * A read-time projection of the `GLOBALS`/`PLATFORM` row, never a stored
55
+ * attribute of the STORE row: the api decides per registered key whether it
56
+ * crosses this boundary (`forwardToTenants` in `globalsDefaults.ts`), so
57
+ * operator-only keys — the AI spend ceilings — are absent by construction.
58
+ * Every member is optional: a key the api has not registered, or has not
59
+ * marked forwardable, simply will not be here.
60
+ */
61
+ interface StoreGlobals {
62
+ /** ARCA/AFIP "Consumidor Final" DNI threshold, in pesos. */
63
+ minWithDni?: number;
64
+ /** Cmd-K usage telemetry collection (api#1007). */
65
+ commandPaletteTelemetry?: boolean;
100
66
  }
101
67
  interface Store {
102
68
  storeId: string;
@@ -167,7 +133,6 @@ declare global {
167
133
  skipped: boolean;
168
134
  };
169
135
  };
170
- features: FeatureFlags;
171
136
  ecommerce?: Ecommerce;
172
137
  photoURL: string;
173
138
  photoData?: string;
@@ -201,7 +166,7 @@ declare global {
201
166
  appVersion: number;
202
167
  fiscalConditions: FiscalCondition[];
203
168
  ivaTypes: Method[];
204
- minWithDni: number;
169
+ globals?: StoreGlobals;
205
170
  maintenance?: MaintenanceInfo;
206
171
  afipCertAlert?: {
207
172
  expiry: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.7.12",
3
+ "version": "1.8.1",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",