@aranova/tracking-react 0.8.0 → 0.9.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
@@ -1464,6 +1464,9 @@ declare const saleCreateSchema: z.ZodObject<{
1464
1464
  unit_cost_cents?: number | null | undefined;
1465
1465
  }>, "many">>;
1466
1466
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1467
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1468
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1469
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1467
1470
  }, "strict", z.ZodTypeAny, {
1468
1471
  currency: "USD" | "CAD";
1469
1472
  amount_total_cents: number;
@@ -1481,6 +1484,9 @@ declare const saleCreateSchema: z.ZodObject<{
1481
1484
  external_id?: string | null | undefined;
1482
1485
  description?: string | null | undefined;
1483
1486
  service?: string | null | undefined;
1487
+ customer_name?: string | null | undefined;
1488
+ customer_phone?: string | null | undefined;
1489
+ customer_email?: string | null | undefined;
1484
1490
  }, {
1485
1491
  currency: "USD" | "CAD";
1486
1492
  amount_total_cents: number;
@@ -1498,6 +1504,9 @@ declare const saleCreateSchema: z.ZodObject<{
1498
1504
  category?: string | null | undefined;
1499
1505
  unit_cost_cents?: number | null | undefined;
1500
1506
  }[] | undefined;
1507
+ customer_name?: string | null | undefined;
1508
+ customer_phone?: string | null | undefined;
1509
+ customer_email?: string | null | undefined;
1501
1510
  }>;
1502
1511
  declare const saleUpdateSchema: z.ZodObject<{
1503
1512
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1528,6 +1537,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1528
1537
  unit_cost_cents?: number | null | undefined;
1529
1538
  }>, "many">>;
1530
1539
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1540
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1541
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1542
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1531
1543
  }, "strict", z.ZodTypeAny, {
1532
1544
  metadata?: Record<string, unknown> | null | undefined;
1533
1545
  description?: string | null | undefined;
@@ -1543,6 +1555,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1543
1555
  category?: string | null | undefined;
1544
1556
  unit_cost_cents?: number | null | undefined;
1545
1557
  }[] | undefined;
1558
+ customer_name?: string | null | undefined;
1559
+ customer_phone?: string | null | undefined;
1560
+ customer_email?: string | null | undefined;
1546
1561
  }, {
1547
1562
  metadata?: Record<string, unknown> | null | undefined;
1548
1563
  description?: string | null | undefined;
@@ -1558,6 +1573,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1558
1573
  category?: string | null | undefined;
1559
1574
  unit_cost_cents?: number | null | undefined;
1560
1575
  }[] | undefined;
1576
+ customer_name?: string | null | undefined;
1577
+ customer_phone?: string | null | undefined;
1578
+ customer_email?: string | null | undefined;
1561
1579
  }>;
1562
1580
  type SaleItemInput = z.input<typeof saleItemSchema>;
1563
1581
  type SaleInput = z.input<typeof saleCreateSchema>;
@@ -1585,6 +1603,9 @@ interface Sale {
1585
1603
  occurred_at: string;
1586
1604
  environment: (typeof TRACKING_ENVIRONMENTS)[number];
1587
1605
  metadata: Record<string, unknown> | null;
1606
+ customer_name: string | null;
1607
+ customer_phone: string | null;
1608
+ customer_email: string | null;
1588
1609
  created_at: string;
1589
1610
  updated_at: string;
1590
1611
  items: SaleItem[];
@@ -1597,13 +1618,38 @@ interface SaleCursorPage {
1597
1618
  items: Sale[];
1598
1619
  next_cursor: string | null;
1599
1620
  }
1600
- interface SaleListQuery {
1621
+ /**
1622
+ * Comprehensive filter shape mirrored from the backend's `SaleQueryFilters`.
1623
+ *
1624
+ * `search` runs case-insensitively across `customer_name`, `customer_phone`,
1625
+ * `customer_email`, `description`, and `external_id` — the human-facing
1626
+ * columns. `service_id` is the resolved per-business service UUID (different
1627
+ * from the create-time `service` *key*).
1628
+ */
1629
+ interface SaleFilters {
1601
1630
  business_id?: string;
1602
1631
  external_id?: string;
1632
+ service_id?: string;
1603
1633
  currency?: SupportedCurrency;
1604
1634
  environment?: (typeof TRACKING_ENVIRONMENTS)[number];
1605
1635
  since?: string;
1606
1636
  until?: string;
1637
+ min_amount_cents?: number;
1638
+ max_amount_cents?: number;
1639
+ search?: string;
1640
+ }
1641
+ /**
1642
+ * Full query input for `SalesClient.list()` — filters + pagination.
1643
+ *
1644
+ * Pagination is **keyset (cursor)**: `next_cursor` returned by one page is
1645
+ * passed back as `cursor` on the next. `null` / undefined cursor = first page.
1646
+ *
1647
+ * Ordering on this endpoint is fixed at **`occurred_at DESC, id DESC`** — the
1648
+ * cursor encodes a position in that index, so a different sort would
1649
+ * invalidate cursors mid-pagination. For ad-hoc sorted reads use the
1650
+ * dashboard admin endpoint, which is offset-paginated.
1651
+ */
1652
+ interface SaleListQuery extends SaleFilters {
1607
1653
  limit?: number;
1608
1654
  cursor?: string | null;
1609
1655
  }
package/dist/index.d.ts CHANGED
@@ -1464,6 +1464,9 @@ declare const saleCreateSchema: z.ZodObject<{
1464
1464
  unit_cost_cents?: number | null | undefined;
1465
1465
  }>, "many">>;
1466
1466
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1467
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1468
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1469
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1467
1470
  }, "strict", z.ZodTypeAny, {
1468
1471
  currency: "USD" | "CAD";
1469
1472
  amount_total_cents: number;
@@ -1481,6 +1484,9 @@ declare const saleCreateSchema: z.ZodObject<{
1481
1484
  external_id?: string | null | undefined;
1482
1485
  description?: string | null | undefined;
1483
1486
  service?: string | null | undefined;
1487
+ customer_name?: string | null | undefined;
1488
+ customer_phone?: string | null | undefined;
1489
+ customer_email?: string | null | undefined;
1484
1490
  }, {
1485
1491
  currency: "USD" | "CAD";
1486
1492
  amount_total_cents: number;
@@ -1498,6 +1504,9 @@ declare const saleCreateSchema: z.ZodObject<{
1498
1504
  category?: string | null | undefined;
1499
1505
  unit_cost_cents?: number | null | undefined;
1500
1506
  }[] | undefined;
1507
+ customer_name?: string | null | undefined;
1508
+ customer_phone?: string | null | undefined;
1509
+ customer_email?: string | null | undefined;
1501
1510
  }>;
1502
1511
  declare const saleUpdateSchema: z.ZodObject<{
1503
1512
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1528,6 +1537,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1528
1537
  unit_cost_cents?: number | null | undefined;
1529
1538
  }>, "many">>;
1530
1539
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1540
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1541
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1542
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1531
1543
  }, "strict", z.ZodTypeAny, {
1532
1544
  metadata?: Record<string, unknown> | null | undefined;
1533
1545
  description?: string | null | undefined;
@@ -1543,6 +1555,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1543
1555
  category?: string | null | undefined;
1544
1556
  unit_cost_cents?: number | null | undefined;
1545
1557
  }[] | undefined;
1558
+ customer_name?: string | null | undefined;
1559
+ customer_phone?: string | null | undefined;
1560
+ customer_email?: string | null | undefined;
1546
1561
  }, {
1547
1562
  metadata?: Record<string, unknown> | null | undefined;
1548
1563
  description?: string | null | undefined;
@@ -1558,6 +1573,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1558
1573
  category?: string | null | undefined;
1559
1574
  unit_cost_cents?: number | null | undefined;
1560
1575
  }[] | undefined;
1576
+ customer_name?: string | null | undefined;
1577
+ customer_phone?: string | null | undefined;
1578
+ customer_email?: string | null | undefined;
1561
1579
  }>;
1562
1580
  type SaleItemInput = z.input<typeof saleItemSchema>;
1563
1581
  type SaleInput = z.input<typeof saleCreateSchema>;
@@ -1585,6 +1603,9 @@ interface Sale {
1585
1603
  occurred_at: string;
1586
1604
  environment: (typeof TRACKING_ENVIRONMENTS)[number];
1587
1605
  metadata: Record<string, unknown> | null;
1606
+ customer_name: string | null;
1607
+ customer_phone: string | null;
1608
+ customer_email: string | null;
1588
1609
  created_at: string;
1589
1610
  updated_at: string;
1590
1611
  items: SaleItem[];
@@ -1597,13 +1618,38 @@ interface SaleCursorPage {
1597
1618
  items: Sale[];
1598
1619
  next_cursor: string | null;
1599
1620
  }
1600
- interface SaleListQuery {
1621
+ /**
1622
+ * Comprehensive filter shape mirrored from the backend's `SaleQueryFilters`.
1623
+ *
1624
+ * `search` runs case-insensitively across `customer_name`, `customer_phone`,
1625
+ * `customer_email`, `description`, and `external_id` — the human-facing
1626
+ * columns. `service_id` is the resolved per-business service UUID (different
1627
+ * from the create-time `service` *key*).
1628
+ */
1629
+ interface SaleFilters {
1601
1630
  business_id?: string;
1602
1631
  external_id?: string;
1632
+ service_id?: string;
1603
1633
  currency?: SupportedCurrency;
1604
1634
  environment?: (typeof TRACKING_ENVIRONMENTS)[number];
1605
1635
  since?: string;
1606
1636
  until?: string;
1637
+ min_amount_cents?: number;
1638
+ max_amount_cents?: number;
1639
+ search?: string;
1640
+ }
1641
+ /**
1642
+ * Full query input for `SalesClient.list()` — filters + pagination.
1643
+ *
1644
+ * Pagination is **keyset (cursor)**: `next_cursor` returned by one page is
1645
+ * passed back as `cursor` on the next. `null` / undefined cursor = first page.
1646
+ *
1647
+ * Ordering on this endpoint is fixed at **`occurred_at DESC, id DESC`** — the
1648
+ * cursor encodes a position in that index, so a different sort would
1649
+ * invalidate cursors mid-pagination. For ad-hoc sorted reads use the
1650
+ * dashboard admin endpoint, which is offset-paginated.
1651
+ */
1652
+ interface SaleListQuery extends SaleFilters {
1607
1653
  limit?: number;
1608
1654
  cursor?: string | null;
1609
1655
  }
package/dist/index.js CHANGED
@@ -1510,7 +1510,7 @@ function useConsentState() {
1510
1510
  var import_react4 = require("react");
1511
1511
 
1512
1512
  // package.json
1513
- var version = "0.8.0";
1513
+ var version = "0.9.0";
1514
1514
 
1515
1515
  // src/factory.tsx
1516
1516
  var import_jsx_runtime2 = require("react/jsx-runtime");