@aranova/tracking-next 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
@@ -1298,6 +1298,9 @@ declare const saleCreateSchema: z.ZodObject<{
1298
1298
  unit_cost_cents?: number | null | undefined;
1299
1299
  }>, "many">>;
1300
1300
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1301
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1302
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1303
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1301
1304
  }, "strict", z.ZodTypeAny, {
1302
1305
  currency: "USD" | "CAD";
1303
1306
  amount_total_cents: number;
@@ -1315,6 +1318,9 @@ declare const saleCreateSchema: z.ZodObject<{
1315
1318
  external_id?: string | null | undefined;
1316
1319
  description?: string | null | undefined;
1317
1320
  service?: string | null | undefined;
1321
+ customer_name?: string | null | undefined;
1322
+ customer_phone?: string | null | undefined;
1323
+ customer_email?: string | null | undefined;
1318
1324
  }, {
1319
1325
  currency: "USD" | "CAD";
1320
1326
  amount_total_cents: number;
@@ -1332,6 +1338,9 @@ declare const saleCreateSchema: z.ZodObject<{
1332
1338
  category?: string | null | undefined;
1333
1339
  unit_cost_cents?: number | null | undefined;
1334
1340
  }[] | undefined;
1341
+ customer_name?: string | null | undefined;
1342
+ customer_phone?: string | null | undefined;
1343
+ customer_email?: string | null | undefined;
1335
1344
  }>;
1336
1345
  declare const saleUpdateSchema: z.ZodObject<{
1337
1346
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1362,6 +1371,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1362
1371
  unit_cost_cents?: number | null | undefined;
1363
1372
  }>, "many">>;
1364
1373
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1374
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1375
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1376
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1365
1377
  }, "strict", z.ZodTypeAny, {
1366
1378
  metadata?: Record<string, unknown> | null | undefined;
1367
1379
  description?: string | null | undefined;
@@ -1377,6 +1389,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1377
1389
  category?: string | null | undefined;
1378
1390
  unit_cost_cents?: number | null | undefined;
1379
1391
  }[] | undefined;
1392
+ customer_name?: string | null | undefined;
1393
+ customer_phone?: string | null | undefined;
1394
+ customer_email?: string | null | undefined;
1380
1395
  }, {
1381
1396
  metadata?: Record<string, unknown> | null | undefined;
1382
1397
  description?: string | null | undefined;
@@ -1392,6 +1407,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1392
1407
  category?: string | null | undefined;
1393
1408
  unit_cost_cents?: number | null | undefined;
1394
1409
  }[] | undefined;
1410
+ customer_name?: string | null | undefined;
1411
+ customer_phone?: string | null | undefined;
1412
+ customer_email?: string | null | undefined;
1395
1413
  }>;
1396
1414
  type SaleItemInput = z.input<typeof saleItemSchema>;
1397
1415
  type SaleInput = z.input<typeof saleCreateSchema>;
@@ -1419,6 +1437,9 @@ interface Sale {
1419
1437
  occurred_at: string;
1420
1438
  environment: (typeof TRACKING_ENVIRONMENTS)[number];
1421
1439
  metadata: Record<string, unknown> | null;
1440
+ customer_name: string | null;
1441
+ customer_phone: string | null;
1442
+ customer_email: string | null;
1422
1443
  created_at: string;
1423
1444
  updated_at: string;
1424
1445
  items: SaleItem[];
@@ -1431,13 +1452,38 @@ interface SaleCursorPage {
1431
1452
  items: Sale[];
1432
1453
  next_cursor: string | null;
1433
1454
  }
1434
- interface SaleListQuery {
1455
+ /**
1456
+ * Comprehensive filter shape mirrored from the backend's `SaleQueryFilters`.
1457
+ *
1458
+ * `search` runs case-insensitively across `customer_name`, `customer_phone`,
1459
+ * `customer_email`, `description`, and `external_id` — the human-facing
1460
+ * columns. `service_id` is the resolved per-business service UUID (different
1461
+ * from the create-time `service` *key*).
1462
+ */
1463
+ interface SaleFilters {
1435
1464
  business_id?: string;
1436
1465
  external_id?: string;
1466
+ service_id?: string;
1437
1467
  currency?: SupportedCurrency;
1438
1468
  environment?: (typeof TRACKING_ENVIRONMENTS)[number];
1439
1469
  since?: string;
1440
1470
  until?: string;
1471
+ min_amount_cents?: number;
1472
+ max_amount_cents?: number;
1473
+ search?: string;
1474
+ }
1475
+ /**
1476
+ * Full query input for `SalesClient.list()` — filters + pagination.
1477
+ *
1478
+ * Pagination is **keyset (cursor)**: `next_cursor` returned by one page is
1479
+ * passed back as `cursor` on the next. `null` / undefined cursor = first page.
1480
+ *
1481
+ * Ordering on this endpoint is fixed at **`occurred_at DESC, id DESC`** — the
1482
+ * cursor encodes a position in that index, so a different sort would
1483
+ * invalidate cursors mid-pagination. For ad-hoc sorted reads use the
1484
+ * dashboard admin endpoint, which is offset-paginated.
1485
+ */
1486
+ interface SaleListQuery extends SaleFilters {
1441
1487
  limit?: number;
1442
1488
  cursor?: string | null;
1443
1489
  }
package/dist/index.d.ts CHANGED
@@ -1298,6 +1298,9 @@ declare const saleCreateSchema: z.ZodObject<{
1298
1298
  unit_cost_cents?: number | null | undefined;
1299
1299
  }>, "many">>;
1300
1300
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1301
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1302
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1303
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1301
1304
  }, "strict", z.ZodTypeAny, {
1302
1305
  currency: "USD" | "CAD";
1303
1306
  amount_total_cents: number;
@@ -1315,6 +1318,9 @@ declare const saleCreateSchema: z.ZodObject<{
1315
1318
  external_id?: string | null | undefined;
1316
1319
  description?: string | null | undefined;
1317
1320
  service?: string | null | undefined;
1321
+ customer_name?: string | null | undefined;
1322
+ customer_phone?: string | null | undefined;
1323
+ customer_email?: string | null | undefined;
1318
1324
  }, {
1319
1325
  currency: "USD" | "CAD";
1320
1326
  amount_total_cents: number;
@@ -1332,6 +1338,9 @@ declare const saleCreateSchema: z.ZodObject<{
1332
1338
  category?: string | null | undefined;
1333
1339
  unit_cost_cents?: number | null | undefined;
1334
1340
  }[] | undefined;
1341
+ customer_name?: string | null | undefined;
1342
+ customer_phone?: string | null | undefined;
1343
+ customer_email?: string | null | undefined;
1335
1344
  }>;
1336
1345
  declare const saleUpdateSchema: z.ZodObject<{
1337
1346
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1362,6 +1371,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1362
1371
  unit_cost_cents?: number | null | undefined;
1363
1372
  }>, "many">>;
1364
1373
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1374
+ customer_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1375
+ customer_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1376
+ customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1365
1377
  }, "strict", z.ZodTypeAny, {
1366
1378
  metadata?: Record<string, unknown> | null | undefined;
1367
1379
  description?: string | null | undefined;
@@ -1377,6 +1389,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1377
1389
  category?: string | null | undefined;
1378
1390
  unit_cost_cents?: number | null | undefined;
1379
1391
  }[] | undefined;
1392
+ customer_name?: string | null | undefined;
1393
+ customer_phone?: string | null | undefined;
1394
+ customer_email?: string | null | undefined;
1380
1395
  }, {
1381
1396
  metadata?: Record<string, unknown> | null | undefined;
1382
1397
  description?: string | null | undefined;
@@ -1392,6 +1407,9 @@ declare const saleUpdateSchema: z.ZodObject<{
1392
1407
  category?: string | null | undefined;
1393
1408
  unit_cost_cents?: number | null | undefined;
1394
1409
  }[] | undefined;
1410
+ customer_name?: string | null | undefined;
1411
+ customer_phone?: string | null | undefined;
1412
+ customer_email?: string | null | undefined;
1395
1413
  }>;
1396
1414
  type SaleItemInput = z.input<typeof saleItemSchema>;
1397
1415
  type SaleInput = z.input<typeof saleCreateSchema>;
@@ -1419,6 +1437,9 @@ interface Sale {
1419
1437
  occurred_at: string;
1420
1438
  environment: (typeof TRACKING_ENVIRONMENTS)[number];
1421
1439
  metadata: Record<string, unknown> | null;
1440
+ customer_name: string | null;
1441
+ customer_phone: string | null;
1442
+ customer_email: string | null;
1422
1443
  created_at: string;
1423
1444
  updated_at: string;
1424
1445
  items: SaleItem[];
@@ -1431,13 +1452,38 @@ interface SaleCursorPage {
1431
1452
  items: Sale[];
1432
1453
  next_cursor: string | null;
1433
1454
  }
1434
- interface SaleListQuery {
1455
+ /**
1456
+ * Comprehensive filter shape mirrored from the backend's `SaleQueryFilters`.
1457
+ *
1458
+ * `search` runs case-insensitively across `customer_name`, `customer_phone`,
1459
+ * `customer_email`, `description`, and `external_id` — the human-facing
1460
+ * columns. `service_id` is the resolved per-business service UUID (different
1461
+ * from the create-time `service` *key*).
1462
+ */
1463
+ interface SaleFilters {
1435
1464
  business_id?: string;
1436
1465
  external_id?: string;
1466
+ service_id?: string;
1437
1467
  currency?: SupportedCurrency;
1438
1468
  environment?: (typeof TRACKING_ENVIRONMENTS)[number];
1439
1469
  since?: string;
1440
1470
  until?: string;
1471
+ min_amount_cents?: number;
1472
+ max_amount_cents?: number;
1473
+ search?: string;
1474
+ }
1475
+ /**
1476
+ * Full query input for `SalesClient.list()` — filters + pagination.
1477
+ *
1478
+ * Pagination is **keyset (cursor)**: `next_cursor` returned by one page is
1479
+ * passed back as `cursor` on the next. `null` / undefined cursor = first page.
1480
+ *
1481
+ * Ordering on this endpoint is fixed at **`occurred_at DESC, id DESC`** — the
1482
+ * cursor encodes a position in that index, so a different sort would
1483
+ * invalidate cursors mid-pagination. For ad-hoc sorted reads use the
1484
+ * dashboard admin endpoint, which is offset-paginated.
1485
+ */
1486
+ interface SaleListQuery extends SaleFilters {
1441
1487
  limit?: number;
1442
1488
  cursor?: string | null;
1443
1489
  }
package/dist/index.js CHANGED
@@ -1323,7 +1323,7 @@ function GoogleAdsTracking(props) {
1323
1323
  var import_navigation = require("next/navigation");
1324
1324
 
1325
1325
  // package.json
1326
- var version = "0.8.0";
1326
+ var version = "0.9.0";
1327
1327
 
1328
1328
  // src/factory.tsx
1329
1329
  var import_react3 = require("react");