sinfactura-types 1.6.7 → 1.6.10

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.ts CHANGED
@@ -21,6 +21,7 @@ export * from "./product";
21
21
  export * from "./return";
22
22
  export * from "./stock";
23
23
  export * from "./store";
24
+ export * from "./storefrontEvent";
24
25
  export * from "./subscription";
25
26
  export * from "./supplier";
26
27
  export * from "./user";
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ export * from "./product";
21
21
  export * from "./return";
22
22
  export * from "./stock";
23
23
  export * from "./store";
24
+ export * from "./storefrontEvent";
24
25
  export * from "./subscription";
25
26
  export * from "./supplier";
26
27
  export * from "./user";
package/dist/invoice.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare global {
2
+ type FiscalStatus = 'pending_cae' | 'authorized_cae' | 'authorized_caea' | 'caea_reported' | 'rejected' | 'voided';
2
3
  interface Invoice {
3
4
  storeId: string;
4
5
  invoiceId: string;
@@ -32,6 +33,7 @@ declare global {
32
33
  cae: string;
33
34
  caeExpiration: string;
34
35
  observations?: string;
36
+ fiscalStatus?: FiscalStatus;
35
37
  }
36
38
  interface InvoiceItem {
37
39
  code: string;
package/dist/store.d.ts CHANGED
@@ -119,13 +119,6 @@ declare global {
119
119
  priceDecimals: 0 | 1 | 2 | 3;
120
120
  stock: boolean;
121
121
  changePrice: boolean;
122
- /**
123
- * @deprecated since app#1539 — alias of `displayCurrency`. Kept
124
- * during the migration so unmigrated readers stay correct.
125
- * Removed once every FE read-site has switched to
126
- * `displayCurrency`.
127
- */
128
- currency: string;
129
122
  /**
130
123
  * Back-office display currency (catalogId). The single currency
131
124
  * the operator's screens are framed in — distinct from the
@@ -152,6 +145,7 @@ declare global {
152
145
  photoData?: string;
153
146
  newPhotoURL?: string;
154
147
  removePhotoURL?: string;
148
+ mercadopagoUserId?: string;
155
149
  currencies: StoreCurrencySubscription[];
156
150
  cashInMethods: Method[];
157
151
  cashOutMethods: Method[];
@@ -0,0 +1,99 @@
1
+ declare global {
2
+ interface StorefrontEventBase {
3
+ anonymous_id: string;
4
+ customer_id?: string;
5
+ tenant_store_id: string;
6
+ schema_version: 1;
7
+ event_id: string;
8
+ screen_type: 'desktop' | 'mobile';
9
+ app_version: number;
10
+ ts: string;
11
+ }
12
+ interface ProductViewedEvent extends StorefrontEventBase {
13
+ event: 'Product Viewed';
14
+ product_id: string;
15
+ product_name: string;
16
+ price: number;
17
+ currency: string;
18
+ }
19
+ interface ProductListViewedEvent extends StorefrontEventBase {
20
+ event: 'Product List Viewed';
21
+ list_name: string;
22
+ products: Array<{
23
+ product_id: string;
24
+ product_name: string;
25
+ price: number;
26
+ }>;
27
+ }
28
+ interface CartItemAddedEvent extends StorefrontEventBase {
29
+ event: 'Cart Item Added';
30
+ product_id: string;
31
+ product_name: string;
32
+ quantity: number;
33
+ price: number;
34
+ currency: string;
35
+ }
36
+ interface CartItemRemovedEvent extends StorefrontEventBase {
37
+ event: 'Cart Item Removed';
38
+ product_id: string;
39
+ product_name: string;
40
+ quantity: number;
41
+ }
42
+ interface CartViewedEvent extends StorefrontEventBase {
43
+ event: 'Cart Viewed';
44
+ cart_total: number;
45
+ items_count: number;
46
+ currency: string;
47
+ }
48
+ interface SearchSubmittedEvent extends StorefrontEventBase {
49
+ event: 'Search Submitted';
50
+ query: string;
51
+ results_count: number;
52
+ }
53
+ interface CheckoutStartedEvent extends StorefrontEventBase {
54
+ event: 'Checkout Started';
55
+ cart_total: number;
56
+ items_count: number;
57
+ currency: string;
58
+ }
59
+ interface CheckoutStepCompletedEvent extends StorefrontEventBase {
60
+ event: 'Checkout Step Completed';
61
+ step: number;
62
+ step_name: string;
63
+ }
64
+ interface PaymentInfoEnteredEvent extends StorefrontEventBase {
65
+ event: 'Payment Info Entered';
66
+ payment_type: string;
67
+ }
68
+ interface OrderCompletedEvent extends StorefrontEventBase {
69
+ event: 'Order Completed';
70
+ transaction_id: string;
71
+ revenue: number;
72
+ currency: string;
73
+ items_count: number;
74
+ }
75
+ interface CustomerLoggedInEvent extends StorefrontEventBase {
76
+ event: 'Customer Logged In';
77
+ method: 'email' | 'google' | 'facebook';
78
+ }
79
+ interface CustomerSignedUpEvent extends StorefrontEventBase {
80
+ event: 'Customer Signed Up';
81
+ method: 'email' | 'google' | 'facebook';
82
+ }
83
+ interface CustomerLoggedOutEvent extends StorefrontEventBase {
84
+ event: 'Customer Logged Out';
85
+ }
86
+ interface CustomerIdentifiedEvent extends StorefrontEventBase {
87
+ event: 'Customer Identified';
88
+ customer_id: string;
89
+ }
90
+ type StorefrontEvent = ProductViewedEvent | ProductListViewedEvent | CartItemAddedEvent | CartItemRemovedEvent | CartViewedEvent | SearchSubmittedEvent | CheckoutStartedEvent | CheckoutStepCompletedEvent | PaymentInfoEnteredEvent | OrderCompletedEvent | CustomerLoggedInEvent | CustomerSignedUpEvent | CustomerLoggedOutEvent | CustomerIdentifiedEvent;
91
+ interface IdentityLink {
92
+ tenant_store_id: string;
93
+ anonymous_id: string;
94
+ customer_id: string;
95
+ linked_at: string;
96
+ link_event_id: string;
97
+ }
98
+ }
99
+ export {};
@@ -0,0 +1,16 @@
1
+ // Typed storefront events pipeline (types#69, api#1239/#1240,
2
+ // storefront#425/#429, app#1638). Schema-validated discriminated union
3
+ // emitted by `sinfactura/storefront` (via the `track()` wrapper in
4
+ // `src/utils/track.ts`), validated and persisted by `sinfactura/api`
5
+ // (Zod mirror in `stacks/helpers/storefrontEvents/schema.ts`), rendered
6
+ // by `sinfactura/app` (typed activity feed in `<ActivityFeed>`).
7
+ //
8
+ // Naming follows Segment Spec: Title Case Object + Past-Tense Action
9
+ // for event names; snake_case for properties so the GA4 / Segment
10
+ // vocabulary on the wire maps without translation.
11
+ //
12
+ // 14 variants — the 4 storefront-only events (`Page Viewed`,
13
+ // `Favorite Toggled`, `Whatsapp Clicked`, `Error Captured`) currently
14
+ // emitted by storefront are NOT in this taxonomy yet; they ride the
15
+ // legacy `Log` path and are tracked for a follow-up types release.
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.6.7",
3
+ "version": "1.6.10",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",