@aranova/tracking-react 0.10.0 → 0.11.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/index.d.mts CHANGED
@@ -1505,12 +1505,32 @@ declare const saleItemSchema: z.ZodObject<{
1505
1505
  category?: string | null | undefined;
1506
1506
  unit_cost_cents?: number | null | undefined;
1507
1507
  }>;
1508
- declare const saleCreateSchema: z.ZodObject<{
1508
+ declare const saleServiceSchema: z.ZodObject<{
1509
+ service: z.ZodString;
1510
+ amount_cents: z.ZodNumber;
1511
+ }, "strict", z.ZodTypeAny, {
1512
+ service: string;
1513
+ amount_cents: number;
1514
+ }, {
1515
+ service: string;
1516
+ amount_cents: number;
1517
+ }>;
1518
+ declare const saleCreateSchema: z.ZodEffects<z.ZodObject<{
1509
1519
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1510
1520
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1511
1521
  service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1522
+ services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1523
+ service: z.ZodString;
1524
+ amount_cents: z.ZodNumber;
1525
+ }, "strict", z.ZodTypeAny, {
1526
+ service: string;
1527
+ amount_cents: number;
1528
+ }, {
1529
+ service: string;
1530
+ amount_cents: number;
1531
+ }>, "many">>>;
1512
1532
  currency: z.ZodEnum<["USD", "CAD"]>;
1513
- amount_total_cents: z.ZodNumber;
1533
+ amount_total_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1514
1534
  occurred_at: z.ZodString;
1515
1535
  environment: z.ZodDefault<z.ZodEnum<["production", "development"]>>;
1516
1536
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1541,7 +1561,6 @@ declare const saleCreateSchema: z.ZodObject<{
1541
1561
  customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1542
1562
  }, "strict", z.ZodTypeAny, {
1543
1563
  currency: "USD" | "CAD";
1544
- amount_total_cents: number;
1545
1564
  occurred_at: string;
1546
1565
  environment: "production" | "development";
1547
1566
  items: {
@@ -1553,20 +1572,77 @@ declare const saleCreateSchema: z.ZodObject<{
1553
1572
  unit_cost_cents?: number | null | undefined;
1554
1573
  }[];
1555
1574
  metadata?: Record<string, unknown> | null | undefined;
1575
+ service?: string | null | undefined;
1576
+ services?: {
1577
+ service: string;
1578
+ amount_cents: number;
1579
+ }[] | null | undefined;
1580
+ amount_total_cents?: number | null | undefined;
1556
1581
  external_id?: string | null | undefined;
1557
1582
  description?: string | null | undefined;
1558
- service?: string | null | undefined;
1559
1583
  customer_name?: string | null | undefined;
1560
1584
  customer_phone?: string | null | undefined;
1561
1585
  customer_email?: string | null | undefined;
1562
1586
  }, {
1563
1587
  currency: "USD" | "CAD";
1564
- amount_total_cents: number;
1565
1588
  occurred_at: string;
1566
1589
  metadata?: Record<string, unknown> | null | undefined;
1590
+ service?: string | null | undefined;
1591
+ services?: {
1592
+ service: string;
1593
+ amount_cents: number;
1594
+ }[] | null | undefined;
1595
+ amount_total_cents?: number | null | undefined;
1596
+ external_id?: string | null | undefined;
1597
+ description?: string | null | undefined;
1598
+ environment?: "production" | "development" | undefined;
1599
+ items?: {
1600
+ quantity: string;
1601
+ unit_price_cents: number;
1602
+ name?: string | null | undefined;
1603
+ external_item_id?: string | null | undefined;
1604
+ category?: string | null | undefined;
1605
+ unit_cost_cents?: number | null | undefined;
1606
+ }[] | undefined;
1607
+ customer_name?: string | null | undefined;
1608
+ customer_phone?: string | null | undefined;
1609
+ customer_email?: string | null | undefined;
1610
+ }>, {
1611
+ currency: "USD" | "CAD";
1612
+ occurred_at: string;
1613
+ environment: "production" | "development";
1614
+ items: {
1615
+ quantity: string;
1616
+ unit_price_cents: number;
1617
+ name?: string | null | undefined;
1618
+ external_item_id?: string | null | undefined;
1619
+ category?: string | null | undefined;
1620
+ unit_cost_cents?: number | null | undefined;
1621
+ }[];
1622
+ metadata?: Record<string, unknown> | null | undefined;
1623
+ service?: string | null | undefined;
1624
+ services?: {
1625
+ service: string;
1626
+ amount_cents: number;
1627
+ }[] | null | undefined;
1628
+ amount_total_cents?: number | null | undefined;
1567
1629
  external_id?: string | null | undefined;
1568
1630
  description?: string | null | undefined;
1631
+ customer_name?: string | null | undefined;
1632
+ customer_phone?: string | null | undefined;
1633
+ customer_email?: string | null | undefined;
1634
+ }, {
1635
+ currency: "USD" | "CAD";
1636
+ occurred_at: string;
1637
+ metadata?: Record<string, unknown> | null | undefined;
1569
1638
  service?: string | null | undefined;
1639
+ services?: {
1640
+ service: string;
1641
+ amount_cents: number;
1642
+ }[] | null | undefined;
1643
+ amount_total_cents?: number | null | undefined;
1644
+ external_id?: string | null | undefined;
1645
+ description?: string | null | undefined;
1570
1646
  environment?: "production" | "development" | undefined;
1571
1647
  items?: {
1572
1648
  quantity: string;
@@ -1580,9 +1656,19 @@ declare const saleCreateSchema: z.ZodObject<{
1580
1656
  customer_phone?: string | null | undefined;
1581
1657
  customer_email?: string | null | undefined;
1582
1658
  }>;
1583
- declare const saleUpdateSchema: z.ZodObject<{
1659
+ declare const saleUpdateSchema: z.ZodEffects<z.ZodObject<{
1584
1660
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1585
1661
  service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1662
+ services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1663
+ service: z.ZodString;
1664
+ amount_cents: z.ZodNumber;
1665
+ }, "strict", z.ZodTypeAny, {
1666
+ service: string;
1667
+ amount_cents: number;
1668
+ }, {
1669
+ service: string;
1670
+ amount_cents: number;
1671
+ }>, "many">>>;
1586
1672
  currency: z.ZodOptional<z.ZodEnum<["USD", "CAD"]>>;
1587
1673
  amount_total_cents: z.ZodOptional<z.ZodNumber>;
1588
1674
  occurred_at: z.ZodOptional<z.ZodString>;
@@ -1614,10 +1700,14 @@ declare const saleUpdateSchema: z.ZodObject<{
1614
1700
  customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1615
1701
  }, "strict", z.ZodTypeAny, {
1616
1702
  metadata?: Record<string, unknown> | null | undefined;
1617
- description?: string | null | undefined;
1618
1703
  service?: string | null | undefined;
1619
- currency?: "USD" | "CAD" | undefined;
1704
+ services?: {
1705
+ service: string;
1706
+ amount_cents: number;
1707
+ }[] | null | undefined;
1620
1708
  amount_total_cents?: number | undefined;
1709
+ description?: string | null | undefined;
1710
+ currency?: "USD" | "CAD" | undefined;
1621
1711
  occurred_at?: string | undefined;
1622
1712
  items?: {
1623
1713
  quantity: string;
@@ -1632,10 +1722,58 @@ declare const saleUpdateSchema: z.ZodObject<{
1632
1722
  customer_email?: string | null | undefined;
1633
1723
  }, {
1634
1724
  metadata?: Record<string, unknown> | null | undefined;
1725
+ service?: string | null | undefined;
1726
+ services?: {
1727
+ service: string;
1728
+ amount_cents: number;
1729
+ }[] | null | undefined;
1730
+ amount_total_cents?: number | undefined;
1635
1731
  description?: string | null | undefined;
1732
+ currency?: "USD" | "CAD" | undefined;
1733
+ occurred_at?: string | undefined;
1734
+ items?: {
1735
+ quantity: string;
1736
+ unit_price_cents: number;
1737
+ name?: string | null | undefined;
1738
+ external_item_id?: string | null | undefined;
1739
+ category?: string | null | undefined;
1740
+ unit_cost_cents?: number | null | undefined;
1741
+ }[] | undefined;
1742
+ customer_name?: string | null | undefined;
1743
+ customer_phone?: string | null | undefined;
1744
+ customer_email?: string | null | undefined;
1745
+ }>, {
1746
+ metadata?: Record<string, unknown> | null | undefined;
1636
1747
  service?: string | null | undefined;
1748
+ services?: {
1749
+ service: string;
1750
+ amount_cents: number;
1751
+ }[] | null | undefined;
1752
+ amount_total_cents?: number | undefined;
1753
+ description?: string | null | undefined;
1637
1754
  currency?: "USD" | "CAD" | undefined;
1755
+ occurred_at?: string | undefined;
1756
+ items?: {
1757
+ quantity: string;
1758
+ unit_price_cents: number;
1759
+ name?: string | null | undefined;
1760
+ external_item_id?: string | null | undefined;
1761
+ category?: string | null | undefined;
1762
+ unit_cost_cents?: number | null | undefined;
1763
+ }[] | undefined;
1764
+ customer_name?: string | null | undefined;
1765
+ customer_phone?: string | null | undefined;
1766
+ customer_email?: string | null | undefined;
1767
+ }, {
1768
+ metadata?: Record<string, unknown> | null | undefined;
1769
+ service?: string | null | undefined;
1770
+ services?: {
1771
+ service: string;
1772
+ amount_cents: number;
1773
+ }[] | null | undefined;
1638
1774
  amount_total_cents?: number | undefined;
1775
+ description?: string | null | undefined;
1776
+ currency?: "USD" | "CAD" | undefined;
1639
1777
  occurred_at?: string | undefined;
1640
1778
  items?: {
1641
1779
  quantity: string;
@@ -1650,6 +1788,7 @@ declare const saleUpdateSchema: z.ZodObject<{
1650
1788
  customer_email?: string | null | undefined;
1651
1789
  }>;
1652
1790
  type SaleItemInput = z.input<typeof saleItemSchema>;
1791
+ type SaleServiceInput = z.input<typeof saleServiceSchema>;
1653
1792
  type SaleInput = z.input<typeof saleCreateSchema>;
1654
1793
  type SaleUpdateInput = z.input<typeof saleUpdateSchema>;
1655
1794
  interface SaleItem {
@@ -1661,6 +1800,13 @@ interface SaleItem {
1661
1800
  unit_price_cents: number;
1662
1801
  unit_cost_cents: number | null;
1663
1802
  }
1803
+ interface SaleService {
1804
+ id: string;
1805
+ service_id: string;
1806
+ service_key: string;
1807
+ service_label: string;
1808
+ amount_cents: number;
1809
+ }
1664
1810
  interface Sale {
1665
1811
  id: string;
1666
1812
  business_id: string;
@@ -1672,6 +1818,7 @@ interface Sale {
1672
1818
  service_id: string | null;
1673
1819
  service_key?: string | null;
1674
1820
  service_label?: string | null;
1821
+ services: SaleService[];
1675
1822
  occurred_at: string;
1676
1823
  environment: (typeof TRACKING_ENVIRONMENTS)[number];
1677
1824
  metadata: Record<string, unknown> | null;
@@ -1813,8 +1960,12 @@ interface SalesClientConfig extends SalesTransportConfig {
1813
1960
  * `@aranova/tracking-cli gen` for compile-time-checked `service` values.
1814
1961
  */
1815
1962
  interface SalesClient<TService extends string = string> {
1816
- record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service'> & {
1963
+ record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service' | 'services'> & {
1817
1964
  service?: TService | null;
1965
+ services?: Array<{
1966
+ service: TService;
1967
+ amount_cents: number;
1968
+ }>;
1818
1969
  currency?: SupportedCurrency;
1819
1970
  occurred_at?: string;
1820
1971
  }): Promise<Sale>;
@@ -1826,8 +1977,12 @@ interface SalesClient<TService extends string = string> {
1826
1977
  */
1827
1978
  summary(query: SaleSummaryQuery): Promise<SaleSummary>;
1828
1979
  get(id: string): Promise<Sale>;
1829
- update(id: string, patch: Omit<SaleUpdateInput, 'service'> & {
1980
+ update(id: string, patch: Omit<SaleUpdateInput, 'service' | 'services'> & {
1830
1981
  service?: TService | null;
1982
+ services?: Array<{
1983
+ service: TService;
1984
+ amount_cents: number;
1985
+ }>;
1831
1986
  }): Promise<Sale>;
1832
1987
  delete(id: string): Promise<void>;
1833
1988
  }
@@ -2024,4 +2179,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
2024
2179
  }
2025
2180
  declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
2026
2181
 
2027
- export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, type ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type CurrencyRevenue, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type JsonValue, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type PublicServiceItem, type RegisteredAutomaticEvents, type RegisteredManualEvents, type Sale, type SaleCursorPage, type SaleInput, type SaleItem, type SaleItemInput, type SaleListPage, type SaleListQuery, type SaleSummary, type SaleSummaryQuery, type SaleUpdateInput, type SalesCategoryBreakdown, type SalesClient, type SalesClientConfig, type SalesServiceBreakdown, type SalesTransportConfig, type SalesTrendPoint, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, type SupportedCurrency, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, type TrackingClientContext, type TrackingEventCreatePayload, type TrackingInitConfig, type TrackingInstallSurface, type TrackingOverviewRange, type TrackingParams, type TrackingProviderProps, type TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, captureTrackingParamsFromLocation, createSalesClient, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, fetchServices, formatMoney, fromMinor, getConsentState, resetConsent, setConsentState, toMinor, useConsent, useConsentState, useGclid, useTrackingParams };
2182
+ export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, type ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type CurrencyRevenue, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type JsonValue, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type PublicServiceItem, type RegisteredAutomaticEvents, type RegisteredManualEvents, type Sale, type SaleCursorPage, type SaleInput, type SaleItem, type SaleItemInput, type SaleListPage, type SaleListQuery, type SaleService, type SaleServiceInput, type SaleSummary, type SaleSummaryQuery, type SaleUpdateInput, type SalesCategoryBreakdown, type SalesClient, type SalesClientConfig, type SalesServiceBreakdown, type SalesTransportConfig, type SalesTrendPoint, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, type SupportedCurrency, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, type TrackingClientContext, type TrackingEventCreatePayload, type TrackingInitConfig, type TrackingInstallSurface, type TrackingOverviewRange, type TrackingParams, type TrackingProviderProps, type TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, captureTrackingParamsFromLocation, createSalesClient, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, fetchServices, formatMoney, fromMinor, getConsentState, resetConsent, setConsentState, toMinor, useConsent, useConsentState, useGclid, useTrackingParams };
package/dist/index.d.ts CHANGED
@@ -1505,12 +1505,32 @@ declare const saleItemSchema: z.ZodObject<{
1505
1505
  category?: string | null | undefined;
1506
1506
  unit_cost_cents?: number | null | undefined;
1507
1507
  }>;
1508
- declare const saleCreateSchema: z.ZodObject<{
1508
+ declare const saleServiceSchema: z.ZodObject<{
1509
+ service: z.ZodString;
1510
+ amount_cents: z.ZodNumber;
1511
+ }, "strict", z.ZodTypeAny, {
1512
+ service: string;
1513
+ amount_cents: number;
1514
+ }, {
1515
+ service: string;
1516
+ amount_cents: number;
1517
+ }>;
1518
+ declare const saleCreateSchema: z.ZodEffects<z.ZodObject<{
1509
1519
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1510
1520
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1511
1521
  service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1522
+ services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1523
+ service: z.ZodString;
1524
+ amount_cents: z.ZodNumber;
1525
+ }, "strict", z.ZodTypeAny, {
1526
+ service: string;
1527
+ amount_cents: number;
1528
+ }, {
1529
+ service: string;
1530
+ amount_cents: number;
1531
+ }>, "many">>>;
1512
1532
  currency: z.ZodEnum<["USD", "CAD"]>;
1513
- amount_total_cents: z.ZodNumber;
1533
+ amount_total_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1514
1534
  occurred_at: z.ZodString;
1515
1535
  environment: z.ZodDefault<z.ZodEnum<["production", "development"]>>;
1516
1536
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1541,7 +1561,6 @@ declare const saleCreateSchema: z.ZodObject<{
1541
1561
  customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1542
1562
  }, "strict", z.ZodTypeAny, {
1543
1563
  currency: "USD" | "CAD";
1544
- amount_total_cents: number;
1545
1564
  occurred_at: string;
1546
1565
  environment: "production" | "development";
1547
1566
  items: {
@@ -1553,20 +1572,77 @@ declare const saleCreateSchema: z.ZodObject<{
1553
1572
  unit_cost_cents?: number | null | undefined;
1554
1573
  }[];
1555
1574
  metadata?: Record<string, unknown> | null | undefined;
1575
+ service?: string | null | undefined;
1576
+ services?: {
1577
+ service: string;
1578
+ amount_cents: number;
1579
+ }[] | null | undefined;
1580
+ amount_total_cents?: number | null | undefined;
1556
1581
  external_id?: string | null | undefined;
1557
1582
  description?: string | null | undefined;
1558
- service?: string | null | undefined;
1559
1583
  customer_name?: string | null | undefined;
1560
1584
  customer_phone?: string | null | undefined;
1561
1585
  customer_email?: string | null | undefined;
1562
1586
  }, {
1563
1587
  currency: "USD" | "CAD";
1564
- amount_total_cents: number;
1565
1588
  occurred_at: string;
1566
1589
  metadata?: Record<string, unknown> | null | undefined;
1590
+ service?: string | null | undefined;
1591
+ services?: {
1592
+ service: string;
1593
+ amount_cents: number;
1594
+ }[] | null | undefined;
1595
+ amount_total_cents?: number | null | undefined;
1596
+ external_id?: string | null | undefined;
1597
+ description?: string | null | undefined;
1598
+ environment?: "production" | "development" | undefined;
1599
+ items?: {
1600
+ quantity: string;
1601
+ unit_price_cents: number;
1602
+ name?: string | null | undefined;
1603
+ external_item_id?: string | null | undefined;
1604
+ category?: string | null | undefined;
1605
+ unit_cost_cents?: number | null | undefined;
1606
+ }[] | undefined;
1607
+ customer_name?: string | null | undefined;
1608
+ customer_phone?: string | null | undefined;
1609
+ customer_email?: string | null | undefined;
1610
+ }>, {
1611
+ currency: "USD" | "CAD";
1612
+ occurred_at: string;
1613
+ environment: "production" | "development";
1614
+ items: {
1615
+ quantity: string;
1616
+ unit_price_cents: number;
1617
+ name?: string | null | undefined;
1618
+ external_item_id?: string | null | undefined;
1619
+ category?: string | null | undefined;
1620
+ unit_cost_cents?: number | null | undefined;
1621
+ }[];
1622
+ metadata?: Record<string, unknown> | null | undefined;
1623
+ service?: string | null | undefined;
1624
+ services?: {
1625
+ service: string;
1626
+ amount_cents: number;
1627
+ }[] | null | undefined;
1628
+ amount_total_cents?: number | null | undefined;
1567
1629
  external_id?: string | null | undefined;
1568
1630
  description?: string | null | undefined;
1631
+ customer_name?: string | null | undefined;
1632
+ customer_phone?: string | null | undefined;
1633
+ customer_email?: string | null | undefined;
1634
+ }, {
1635
+ currency: "USD" | "CAD";
1636
+ occurred_at: string;
1637
+ metadata?: Record<string, unknown> | null | undefined;
1569
1638
  service?: string | null | undefined;
1639
+ services?: {
1640
+ service: string;
1641
+ amount_cents: number;
1642
+ }[] | null | undefined;
1643
+ amount_total_cents?: number | null | undefined;
1644
+ external_id?: string | null | undefined;
1645
+ description?: string | null | undefined;
1570
1646
  environment?: "production" | "development" | undefined;
1571
1647
  items?: {
1572
1648
  quantity: string;
@@ -1580,9 +1656,19 @@ declare const saleCreateSchema: z.ZodObject<{
1580
1656
  customer_phone?: string | null | undefined;
1581
1657
  customer_email?: string | null | undefined;
1582
1658
  }>;
1583
- declare const saleUpdateSchema: z.ZodObject<{
1659
+ declare const saleUpdateSchema: z.ZodEffects<z.ZodObject<{
1584
1660
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1585
1661
  service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1662
+ services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1663
+ service: z.ZodString;
1664
+ amount_cents: z.ZodNumber;
1665
+ }, "strict", z.ZodTypeAny, {
1666
+ service: string;
1667
+ amount_cents: number;
1668
+ }, {
1669
+ service: string;
1670
+ amount_cents: number;
1671
+ }>, "many">>>;
1586
1672
  currency: z.ZodOptional<z.ZodEnum<["USD", "CAD"]>>;
1587
1673
  amount_total_cents: z.ZodOptional<z.ZodNumber>;
1588
1674
  occurred_at: z.ZodOptional<z.ZodString>;
@@ -1614,10 +1700,14 @@ declare const saleUpdateSchema: z.ZodObject<{
1614
1700
  customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1615
1701
  }, "strict", z.ZodTypeAny, {
1616
1702
  metadata?: Record<string, unknown> | null | undefined;
1617
- description?: string | null | undefined;
1618
1703
  service?: string | null | undefined;
1619
- currency?: "USD" | "CAD" | undefined;
1704
+ services?: {
1705
+ service: string;
1706
+ amount_cents: number;
1707
+ }[] | null | undefined;
1620
1708
  amount_total_cents?: number | undefined;
1709
+ description?: string | null | undefined;
1710
+ currency?: "USD" | "CAD" | undefined;
1621
1711
  occurred_at?: string | undefined;
1622
1712
  items?: {
1623
1713
  quantity: string;
@@ -1632,10 +1722,58 @@ declare const saleUpdateSchema: z.ZodObject<{
1632
1722
  customer_email?: string | null | undefined;
1633
1723
  }, {
1634
1724
  metadata?: Record<string, unknown> | null | undefined;
1725
+ service?: string | null | undefined;
1726
+ services?: {
1727
+ service: string;
1728
+ amount_cents: number;
1729
+ }[] | null | undefined;
1730
+ amount_total_cents?: number | undefined;
1635
1731
  description?: string | null | undefined;
1732
+ currency?: "USD" | "CAD" | undefined;
1733
+ occurred_at?: string | undefined;
1734
+ items?: {
1735
+ quantity: string;
1736
+ unit_price_cents: number;
1737
+ name?: string | null | undefined;
1738
+ external_item_id?: string | null | undefined;
1739
+ category?: string | null | undefined;
1740
+ unit_cost_cents?: number | null | undefined;
1741
+ }[] | undefined;
1742
+ customer_name?: string | null | undefined;
1743
+ customer_phone?: string | null | undefined;
1744
+ customer_email?: string | null | undefined;
1745
+ }>, {
1746
+ metadata?: Record<string, unknown> | null | undefined;
1636
1747
  service?: string | null | undefined;
1748
+ services?: {
1749
+ service: string;
1750
+ amount_cents: number;
1751
+ }[] | null | undefined;
1752
+ amount_total_cents?: number | undefined;
1753
+ description?: string | null | undefined;
1637
1754
  currency?: "USD" | "CAD" | undefined;
1755
+ occurred_at?: string | undefined;
1756
+ items?: {
1757
+ quantity: string;
1758
+ unit_price_cents: number;
1759
+ name?: string | null | undefined;
1760
+ external_item_id?: string | null | undefined;
1761
+ category?: string | null | undefined;
1762
+ unit_cost_cents?: number | null | undefined;
1763
+ }[] | undefined;
1764
+ customer_name?: string | null | undefined;
1765
+ customer_phone?: string | null | undefined;
1766
+ customer_email?: string | null | undefined;
1767
+ }, {
1768
+ metadata?: Record<string, unknown> | null | undefined;
1769
+ service?: string | null | undefined;
1770
+ services?: {
1771
+ service: string;
1772
+ amount_cents: number;
1773
+ }[] | null | undefined;
1638
1774
  amount_total_cents?: number | undefined;
1775
+ description?: string | null | undefined;
1776
+ currency?: "USD" | "CAD" | undefined;
1639
1777
  occurred_at?: string | undefined;
1640
1778
  items?: {
1641
1779
  quantity: string;
@@ -1650,6 +1788,7 @@ declare const saleUpdateSchema: z.ZodObject<{
1650
1788
  customer_email?: string | null | undefined;
1651
1789
  }>;
1652
1790
  type SaleItemInput = z.input<typeof saleItemSchema>;
1791
+ type SaleServiceInput = z.input<typeof saleServiceSchema>;
1653
1792
  type SaleInput = z.input<typeof saleCreateSchema>;
1654
1793
  type SaleUpdateInput = z.input<typeof saleUpdateSchema>;
1655
1794
  interface SaleItem {
@@ -1661,6 +1800,13 @@ interface SaleItem {
1661
1800
  unit_price_cents: number;
1662
1801
  unit_cost_cents: number | null;
1663
1802
  }
1803
+ interface SaleService {
1804
+ id: string;
1805
+ service_id: string;
1806
+ service_key: string;
1807
+ service_label: string;
1808
+ amount_cents: number;
1809
+ }
1664
1810
  interface Sale {
1665
1811
  id: string;
1666
1812
  business_id: string;
@@ -1672,6 +1818,7 @@ interface Sale {
1672
1818
  service_id: string | null;
1673
1819
  service_key?: string | null;
1674
1820
  service_label?: string | null;
1821
+ services: SaleService[];
1675
1822
  occurred_at: string;
1676
1823
  environment: (typeof TRACKING_ENVIRONMENTS)[number];
1677
1824
  metadata: Record<string, unknown> | null;
@@ -1813,8 +1960,12 @@ interface SalesClientConfig extends SalesTransportConfig {
1813
1960
  * `@aranova/tracking-cli gen` for compile-time-checked `service` values.
1814
1961
  */
1815
1962
  interface SalesClient<TService extends string = string> {
1816
- record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service'> & {
1963
+ record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service' | 'services'> & {
1817
1964
  service?: TService | null;
1965
+ services?: Array<{
1966
+ service: TService;
1967
+ amount_cents: number;
1968
+ }>;
1818
1969
  currency?: SupportedCurrency;
1819
1970
  occurred_at?: string;
1820
1971
  }): Promise<Sale>;
@@ -1826,8 +1977,12 @@ interface SalesClient<TService extends string = string> {
1826
1977
  */
1827
1978
  summary(query: SaleSummaryQuery): Promise<SaleSummary>;
1828
1979
  get(id: string): Promise<Sale>;
1829
- update(id: string, patch: Omit<SaleUpdateInput, 'service'> & {
1980
+ update(id: string, patch: Omit<SaleUpdateInput, 'service' | 'services'> & {
1830
1981
  service?: TService | null;
1982
+ services?: Array<{
1983
+ service: TService;
1984
+ amount_cents: number;
1985
+ }>;
1831
1986
  }): Promise<Sale>;
1832
1987
  delete(id: string): Promise<void>;
1833
1988
  }
@@ -2024,4 +2179,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
2024
2179
  }
2025
2180
  declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
2026
2181
 
2027
- export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, type ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type CurrencyRevenue, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type JsonValue, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type PublicServiceItem, type RegisteredAutomaticEvents, type RegisteredManualEvents, type Sale, type SaleCursorPage, type SaleInput, type SaleItem, type SaleItemInput, type SaleListPage, type SaleListQuery, type SaleSummary, type SaleSummaryQuery, type SaleUpdateInput, type SalesCategoryBreakdown, type SalesClient, type SalesClientConfig, type SalesServiceBreakdown, type SalesTransportConfig, type SalesTrendPoint, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, type SupportedCurrency, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, type TrackingClientContext, type TrackingEventCreatePayload, type TrackingInitConfig, type TrackingInstallSurface, type TrackingOverviewRange, type TrackingParams, type TrackingProviderProps, type TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, captureTrackingParamsFromLocation, createSalesClient, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, fetchServices, formatMoney, fromMinor, getConsentState, resetConsent, setConsentState, toMinor, useConsent, useConsentState, useGclid, useTrackingParams };
2182
+ export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, type ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type CurrencyRevenue, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type JsonValue, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type PublicServiceItem, type RegisteredAutomaticEvents, type RegisteredManualEvents, type Sale, type SaleCursorPage, type SaleInput, type SaleItem, type SaleItemInput, type SaleListPage, type SaleListQuery, type SaleService, type SaleServiceInput, type SaleSummary, type SaleSummaryQuery, type SaleUpdateInput, type SalesCategoryBreakdown, type SalesClient, type SalesClientConfig, type SalesServiceBreakdown, type SalesTransportConfig, type SalesTrendPoint, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, type SupportedCurrency, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, type TrackingClientContext, type TrackingEventCreatePayload, type TrackingInitConfig, type TrackingInstallSurface, type TrackingOverviewRange, type TrackingParams, type TrackingProviderProps, type TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, captureTrackingParamsFromLocation, createSalesClient, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, fetchServices, formatMoney, fromMinor, getConsentState, resetConsent, setConsentState, toMinor, useConsent, useConsentState, useGclid, useTrackingParams };
package/dist/index.js CHANGED
@@ -1691,7 +1691,7 @@ function GoogleAdsTracking(props) {
1691
1691
  var import_react4 = require("react");
1692
1692
 
1693
1693
  // package.json
1694
- var version = "0.10.0";
1694
+ var version = "0.11.0";
1695
1695
 
1696
1696
  // src/factory.tsx
1697
1697
  var import_jsx_runtime2 = require("react/jsx-runtime");