@aranova/tracking-next 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 +166 -11
- package/dist/index.d.ts +166 -11
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1283,12 +1283,32 @@ declare const saleItemSchema: z.ZodObject<{
|
|
|
1283
1283
|
category?: string | null | undefined;
|
|
1284
1284
|
unit_cost_cents?: number | null | undefined;
|
|
1285
1285
|
}>;
|
|
1286
|
-
declare const
|
|
1286
|
+
declare const saleServiceSchema: z.ZodObject<{
|
|
1287
|
+
service: z.ZodString;
|
|
1288
|
+
amount_cents: z.ZodNumber;
|
|
1289
|
+
}, "strict", z.ZodTypeAny, {
|
|
1290
|
+
service: string;
|
|
1291
|
+
amount_cents: number;
|
|
1292
|
+
}, {
|
|
1293
|
+
service: string;
|
|
1294
|
+
amount_cents: number;
|
|
1295
|
+
}>;
|
|
1296
|
+
declare const saleCreateSchema: z.ZodEffects<z.ZodObject<{
|
|
1287
1297
|
external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1288
1298
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1289
1299
|
service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1300
|
+
services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1301
|
+
service: z.ZodString;
|
|
1302
|
+
amount_cents: z.ZodNumber;
|
|
1303
|
+
}, "strict", z.ZodTypeAny, {
|
|
1304
|
+
service: string;
|
|
1305
|
+
amount_cents: number;
|
|
1306
|
+
}, {
|
|
1307
|
+
service: string;
|
|
1308
|
+
amount_cents: number;
|
|
1309
|
+
}>, "many">>>;
|
|
1290
1310
|
currency: z.ZodEnum<["USD", "CAD"]>;
|
|
1291
|
-
amount_total_cents: z.ZodNumber
|
|
1311
|
+
amount_total_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1292
1312
|
occurred_at: z.ZodString;
|
|
1293
1313
|
environment: z.ZodDefault<z.ZodEnum<["production", "development"]>>;
|
|
1294
1314
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -1319,7 +1339,6 @@ declare const saleCreateSchema: z.ZodObject<{
|
|
|
1319
1339
|
customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1320
1340
|
}, "strict", z.ZodTypeAny, {
|
|
1321
1341
|
currency: "USD" | "CAD";
|
|
1322
|
-
amount_total_cents: number;
|
|
1323
1342
|
occurred_at: string;
|
|
1324
1343
|
environment: "production" | "development";
|
|
1325
1344
|
items: {
|
|
@@ -1331,20 +1350,77 @@ declare const saleCreateSchema: z.ZodObject<{
|
|
|
1331
1350
|
unit_cost_cents?: number | null | undefined;
|
|
1332
1351
|
}[];
|
|
1333
1352
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1353
|
+
service?: string | null | undefined;
|
|
1354
|
+
services?: {
|
|
1355
|
+
service: string;
|
|
1356
|
+
amount_cents: number;
|
|
1357
|
+
}[] | null | undefined;
|
|
1358
|
+
amount_total_cents?: number | null | undefined;
|
|
1334
1359
|
external_id?: string | null | undefined;
|
|
1335
1360
|
description?: string | null | undefined;
|
|
1336
|
-
service?: string | null | undefined;
|
|
1337
1361
|
customer_name?: string | null | undefined;
|
|
1338
1362
|
customer_phone?: string | null | undefined;
|
|
1339
1363
|
customer_email?: string | null | undefined;
|
|
1340
1364
|
}, {
|
|
1341
1365
|
currency: "USD" | "CAD";
|
|
1342
|
-
amount_total_cents: number;
|
|
1343
1366
|
occurred_at: string;
|
|
1344
1367
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1368
|
+
service?: string | null | undefined;
|
|
1369
|
+
services?: {
|
|
1370
|
+
service: string;
|
|
1371
|
+
amount_cents: number;
|
|
1372
|
+
}[] | null | undefined;
|
|
1373
|
+
amount_total_cents?: number | null | undefined;
|
|
1374
|
+
external_id?: string | null | undefined;
|
|
1375
|
+
description?: string | null | undefined;
|
|
1376
|
+
environment?: "production" | "development" | undefined;
|
|
1377
|
+
items?: {
|
|
1378
|
+
quantity: string;
|
|
1379
|
+
unit_price_cents: number;
|
|
1380
|
+
name?: string | null | undefined;
|
|
1381
|
+
external_item_id?: string | null | undefined;
|
|
1382
|
+
category?: string | null | undefined;
|
|
1383
|
+
unit_cost_cents?: number | null | undefined;
|
|
1384
|
+
}[] | undefined;
|
|
1385
|
+
customer_name?: string | null | undefined;
|
|
1386
|
+
customer_phone?: string | null | undefined;
|
|
1387
|
+
customer_email?: string | null | undefined;
|
|
1388
|
+
}>, {
|
|
1389
|
+
currency: "USD" | "CAD";
|
|
1390
|
+
occurred_at: string;
|
|
1391
|
+
environment: "production" | "development";
|
|
1392
|
+
items: {
|
|
1393
|
+
quantity: string;
|
|
1394
|
+
unit_price_cents: number;
|
|
1395
|
+
name?: string | null | undefined;
|
|
1396
|
+
external_item_id?: string | null | undefined;
|
|
1397
|
+
category?: string | null | undefined;
|
|
1398
|
+
unit_cost_cents?: number | null | undefined;
|
|
1399
|
+
}[];
|
|
1400
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1401
|
+
service?: string | null | undefined;
|
|
1402
|
+
services?: {
|
|
1403
|
+
service: string;
|
|
1404
|
+
amount_cents: number;
|
|
1405
|
+
}[] | null | undefined;
|
|
1406
|
+
amount_total_cents?: number | null | undefined;
|
|
1345
1407
|
external_id?: string | null | undefined;
|
|
1346
1408
|
description?: string | null | undefined;
|
|
1409
|
+
customer_name?: string | null | undefined;
|
|
1410
|
+
customer_phone?: string | null | undefined;
|
|
1411
|
+
customer_email?: string | null | undefined;
|
|
1412
|
+
}, {
|
|
1413
|
+
currency: "USD" | "CAD";
|
|
1414
|
+
occurred_at: string;
|
|
1415
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1347
1416
|
service?: string | null | undefined;
|
|
1417
|
+
services?: {
|
|
1418
|
+
service: string;
|
|
1419
|
+
amount_cents: number;
|
|
1420
|
+
}[] | null | undefined;
|
|
1421
|
+
amount_total_cents?: number | null | undefined;
|
|
1422
|
+
external_id?: string | null | undefined;
|
|
1423
|
+
description?: string | null | undefined;
|
|
1348
1424
|
environment?: "production" | "development" | undefined;
|
|
1349
1425
|
items?: {
|
|
1350
1426
|
quantity: string;
|
|
@@ -1358,9 +1434,19 @@ declare const saleCreateSchema: z.ZodObject<{
|
|
|
1358
1434
|
customer_phone?: string | null | undefined;
|
|
1359
1435
|
customer_email?: string | null | undefined;
|
|
1360
1436
|
}>;
|
|
1361
|
-
declare const saleUpdateSchema: z.ZodObject<{
|
|
1437
|
+
declare const saleUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
1362
1438
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1363
1439
|
service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1440
|
+
services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1441
|
+
service: z.ZodString;
|
|
1442
|
+
amount_cents: z.ZodNumber;
|
|
1443
|
+
}, "strict", z.ZodTypeAny, {
|
|
1444
|
+
service: string;
|
|
1445
|
+
amount_cents: number;
|
|
1446
|
+
}, {
|
|
1447
|
+
service: string;
|
|
1448
|
+
amount_cents: number;
|
|
1449
|
+
}>, "many">>>;
|
|
1364
1450
|
currency: z.ZodOptional<z.ZodEnum<["USD", "CAD"]>>;
|
|
1365
1451
|
amount_total_cents: z.ZodOptional<z.ZodNumber>;
|
|
1366
1452
|
occurred_at: z.ZodOptional<z.ZodString>;
|
|
@@ -1392,10 +1478,14 @@ declare const saleUpdateSchema: z.ZodObject<{
|
|
|
1392
1478
|
customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1393
1479
|
}, "strict", z.ZodTypeAny, {
|
|
1394
1480
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1395
|
-
description?: string | null | undefined;
|
|
1396
1481
|
service?: string | null | undefined;
|
|
1397
|
-
|
|
1482
|
+
services?: {
|
|
1483
|
+
service: string;
|
|
1484
|
+
amount_cents: number;
|
|
1485
|
+
}[] | null | undefined;
|
|
1398
1486
|
amount_total_cents?: number | undefined;
|
|
1487
|
+
description?: string | null | undefined;
|
|
1488
|
+
currency?: "USD" | "CAD" | undefined;
|
|
1399
1489
|
occurred_at?: string | undefined;
|
|
1400
1490
|
items?: {
|
|
1401
1491
|
quantity: string;
|
|
@@ -1410,10 +1500,58 @@ declare const saleUpdateSchema: z.ZodObject<{
|
|
|
1410
1500
|
customer_email?: string | null | undefined;
|
|
1411
1501
|
}, {
|
|
1412
1502
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1503
|
+
service?: string | null | undefined;
|
|
1504
|
+
services?: {
|
|
1505
|
+
service: string;
|
|
1506
|
+
amount_cents: number;
|
|
1507
|
+
}[] | null | undefined;
|
|
1508
|
+
amount_total_cents?: number | undefined;
|
|
1413
1509
|
description?: string | null | undefined;
|
|
1510
|
+
currency?: "USD" | "CAD" | undefined;
|
|
1511
|
+
occurred_at?: string | undefined;
|
|
1512
|
+
items?: {
|
|
1513
|
+
quantity: string;
|
|
1514
|
+
unit_price_cents: number;
|
|
1515
|
+
name?: string | null | undefined;
|
|
1516
|
+
external_item_id?: string | null | undefined;
|
|
1517
|
+
category?: string | null | undefined;
|
|
1518
|
+
unit_cost_cents?: number | null | undefined;
|
|
1519
|
+
}[] | undefined;
|
|
1520
|
+
customer_name?: string | null | undefined;
|
|
1521
|
+
customer_phone?: string | null | undefined;
|
|
1522
|
+
customer_email?: string | null | undefined;
|
|
1523
|
+
}>, {
|
|
1524
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1414
1525
|
service?: string | null | undefined;
|
|
1526
|
+
services?: {
|
|
1527
|
+
service: string;
|
|
1528
|
+
amount_cents: number;
|
|
1529
|
+
}[] | null | undefined;
|
|
1530
|
+
amount_total_cents?: number | undefined;
|
|
1531
|
+
description?: string | null | undefined;
|
|
1415
1532
|
currency?: "USD" | "CAD" | undefined;
|
|
1533
|
+
occurred_at?: string | undefined;
|
|
1534
|
+
items?: {
|
|
1535
|
+
quantity: string;
|
|
1536
|
+
unit_price_cents: number;
|
|
1537
|
+
name?: string | null | undefined;
|
|
1538
|
+
external_item_id?: string | null | undefined;
|
|
1539
|
+
category?: string | null | undefined;
|
|
1540
|
+
unit_cost_cents?: number | null | undefined;
|
|
1541
|
+
}[] | undefined;
|
|
1542
|
+
customer_name?: string | null | undefined;
|
|
1543
|
+
customer_phone?: string | null | undefined;
|
|
1544
|
+
customer_email?: string | null | undefined;
|
|
1545
|
+
}, {
|
|
1546
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1547
|
+
service?: string | null | undefined;
|
|
1548
|
+
services?: {
|
|
1549
|
+
service: string;
|
|
1550
|
+
amount_cents: number;
|
|
1551
|
+
}[] | null | undefined;
|
|
1416
1552
|
amount_total_cents?: number | undefined;
|
|
1553
|
+
description?: string | null | undefined;
|
|
1554
|
+
currency?: "USD" | "CAD" | undefined;
|
|
1417
1555
|
occurred_at?: string | undefined;
|
|
1418
1556
|
items?: {
|
|
1419
1557
|
quantity: string;
|
|
@@ -1428,6 +1566,7 @@ declare const saleUpdateSchema: z.ZodObject<{
|
|
|
1428
1566
|
customer_email?: string | null | undefined;
|
|
1429
1567
|
}>;
|
|
1430
1568
|
type SaleItemInput = z.input<typeof saleItemSchema>;
|
|
1569
|
+
type SaleServiceInput = z.input<typeof saleServiceSchema>;
|
|
1431
1570
|
type SaleInput = z.input<typeof saleCreateSchema>;
|
|
1432
1571
|
type SaleUpdateInput = z.input<typeof saleUpdateSchema>;
|
|
1433
1572
|
interface SaleItem {
|
|
@@ -1439,6 +1578,13 @@ interface SaleItem {
|
|
|
1439
1578
|
unit_price_cents: number;
|
|
1440
1579
|
unit_cost_cents: number | null;
|
|
1441
1580
|
}
|
|
1581
|
+
interface SaleService {
|
|
1582
|
+
id: string;
|
|
1583
|
+
service_id: string;
|
|
1584
|
+
service_key: string;
|
|
1585
|
+
service_label: string;
|
|
1586
|
+
amount_cents: number;
|
|
1587
|
+
}
|
|
1442
1588
|
interface Sale {
|
|
1443
1589
|
id: string;
|
|
1444
1590
|
business_id: string;
|
|
@@ -1450,6 +1596,7 @@ interface Sale {
|
|
|
1450
1596
|
service_id: string | null;
|
|
1451
1597
|
service_key?: string | null;
|
|
1452
1598
|
service_label?: string | null;
|
|
1599
|
+
services: SaleService[];
|
|
1453
1600
|
occurred_at: string;
|
|
1454
1601
|
environment: (typeof TRACKING_ENVIRONMENTS)[number];
|
|
1455
1602
|
metadata: Record<string, unknown> | null;
|
|
@@ -1591,8 +1738,12 @@ interface SalesClientConfig extends SalesTransportConfig {
|
|
|
1591
1738
|
* `@aranova/tracking-cli gen` for compile-time-checked `service` values.
|
|
1592
1739
|
*/
|
|
1593
1740
|
interface SalesClient<TService extends string = string> {
|
|
1594
|
-
record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service'> & {
|
|
1741
|
+
record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service' | 'services'> & {
|
|
1595
1742
|
service?: TService | null;
|
|
1743
|
+
services?: Array<{
|
|
1744
|
+
service: TService;
|
|
1745
|
+
amount_cents: number;
|
|
1746
|
+
}>;
|
|
1596
1747
|
currency?: SupportedCurrency;
|
|
1597
1748
|
occurred_at?: string;
|
|
1598
1749
|
}): Promise<Sale>;
|
|
@@ -1604,8 +1755,12 @@ interface SalesClient<TService extends string = string> {
|
|
|
1604
1755
|
*/
|
|
1605
1756
|
summary(query: SaleSummaryQuery): Promise<SaleSummary>;
|
|
1606
1757
|
get(id: string): Promise<Sale>;
|
|
1607
|
-
update(id: string, patch: Omit<SaleUpdateInput, 'service'> & {
|
|
1758
|
+
update(id: string, patch: Omit<SaleUpdateInput, 'service' | 'services'> & {
|
|
1608
1759
|
service?: TService | null;
|
|
1760
|
+
services?: Array<{
|
|
1761
|
+
service: TService;
|
|
1762
|
+
amount_cents: number;
|
|
1763
|
+
}>;
|
|
1609
1764
|
}): Promise<Sale>;
|
|
1610
1765
|
delete(id: string): Promise<void>;
|
|
1611
1766
|
}
|
|
@@ -1864,4 +2019,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
|
|
|
1864
2019
|
*/
|
|
1865
2020
|
declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
|
|
1866
2021
|
|
|
1867
|
-
export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, 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, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, type TrackingOverviewRange, TrackingParams, type TrackingProviderProps, 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 };
|
|
2022
|
+
export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, 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, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, type TrackingOverviewRange, TrackingParams, type TrackingProviderProps, 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
|
@@ -1283,12 +1283,32 @@ declare const saleItemSchema: z.ZodObject<{
|
|
|
1283
1283
|
category?: string | null | undefined;
|
|
1284
1284
|
unit_cost_cents?: number | null | undefined;
|
|
1285
1285
|
}>;
|
|
1286
|
-
declare const
|
|
1286
|
+
declare const saleServiceSchema: z.ZodObject<{
|
|
1287
|
+
service: z.ZodString;
|
|
1288
|
+
amount_cents: z.ZodNumber;
|
|
1289
|
+
}, "strict", z.ZodTypeAny, {
|
|
1290
|
+
service: string;
|
|
1291
|
+
amount_cents: number;
|
|
1292
|
+
}, {
|
|
1293
|
+
service: string;
|
|
1294
|
+
amount_cents: number;
|
|
1295
|
+
}>;
|
|
1296
|
+
declare const saleCreateSchema: z.ZodEffects<z.ZodObject<{
|
|
1287
1297
|
external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1288
1298
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1289
1299
|
service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1300
|
+
services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1301
|
+
service: z.ZodString;
|
|
1302
|
+
amount_cents: z.ZodNumber;
|
|
1303
|
+
}, "strict", z.ZodTypeAny, {
|
|
1304
|
+
service: string;
|
|
1305
|
+
amount_cents: number;
|
|
1306
|
+
}, {
|
|
1307
|
+
service: string;
|
|
1308
|
+
amount_cents: number;
|
|
1309
|
+
}>, "many">>>;
|
|
1290
1310
|
currency: z.ZodEnum<["USD", "CAD"]>;
|
|
1291
|
-
amount_total_cents: z.ZodNumber
|
|
1311
|
+
amount_total_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1292
1312
|
occurred_at: z.ZodString;
|
|
1293
1313
|
environment: z.ZodDefault<z.ZodEnum<["production", "development"]>>;
|
|
1294
1314
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -1319,7 +1339,6 @@ declare const saleCreateSchema: z.ZodObject<{
|
|
|
1319
1339
|
customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1320
1340
|
}, "strict", z.ZodTypeAny, {
|
|
1321
1341
|
currency: "USD" | "CAD";
|
|
1322
|
-
amount_total_cents: number;
|
|
1323
1342
|
occurred_at: string;
|
|
1324
1343
|
environment: "production" | "development";
|
|
1325
1344
|
items: {
|
|
@@ -1331,20 +1350,77 @@ declare const saleCreateSchema: z.ZodObject<{
|
|
|
1331
1350
|
unit_cost_cents?: number | null | undefined;
|
|
1332
1351
|
}[];
|
|
1333
1352
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1353
|
+
service?: string | null | undefined;
|
|
1354
|
+
services?: {
|
|
1355
|
+
service: string;
|
|
1356
|
+
amount_cents: number;
|
|
1357
|
+
}[] | null | undefined;
|
|
1358
|
+
amount_total_cents?: number | null | undefined;
|
|
1334
1359
|
external_id?: string | null | undefined;
|
|
1335
1360
|
description?: string | null | undefined;
|
|
1336
|
-
service?: string | null | undefined;
|
|
1337
1361
|
customer_name?: string | null | undefined;
|
|
1338
1362
|
customer_phone?: string | null | undefined;
|
|
1339
1363
|
customer_email?: string | null | undefined;
|
|
1340
1364
|
}, {
|
|
1341
1365
|
currency: "USD" | "CAD";
|
|
1342
|
-
amount_total_cents: number;
|
|
1343
1366
|
occurred_at: string;
|
|
1344
1367
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1368
|
+
service?: string | null | undefined;
|
|
1369
|
+
services?: {
|
|
1370
|
+
service: string;
|
|
1371
|
+
amount_cents: number;
|
|
1372
|
+
}[] | null | undefined;
|
|
1373
|
+
amount_total_cents?: number | null | undefined;
|
|
1374
|
+
external_id?: string | null | undefined;
|
|
1375
|
+
description?: string | null | undefined;
|
|
1376
|
+
environment?: "production" | "development" | undefined;
|
|
1377
|
+
items?: {
|
|
1378
|
+
quantity: string;
|
|
1379
|
+
unit_price_cents: number;
|
|
1380
|
+
name?: string | null | undefined;
|
|
1381
|
+
external_item_id?: string | null | undefined;
|
|
1382
|
+
category?: string | null | undefined;
|
|
1383
|
+
unit_cost_cents?: number | null | undefined;
|
|
1384
|
+
}[] | undefined;
|
|
1385
|
+
customer_name?: string | null | undefined;
|
|
1386
|
+
customer_phone?: string | null | undefined;
|
|
1387
|
+
customer_email?: string | null | undefined;
|
|
1388
|
+
}>, {
|
|
1389
|
+
currency: "USD" | "CAD";
|
|
1390
|
+
occurred_at: string;
|
|
1391
|
+
environment: "production" | "development";
|
|
1392
|
+
items: {
|
|
1393
|
+
quantity: string;
|
|
1394
|
+
unit_price_cents: number;
|
|
1395
|
+
name?: string | null | undefined;
|
|
1396
|
+
external_item_id?: string | null | undefined;
|
|
1397
|
+
category?: string | null | undefined;
|
|
1398
|
+
unit_cost_cents?: number | null | undefined;
|
|
1399
|
+
}[];
|
|
1400
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1401
|
+
service?: string | null | undefined;
|
|
1402
|
+
services?: {
|
|
1403
|
+
service: string;
|
|
1404
|
+
amount_cents: number;
|
|
1405
|
+
}[] | null | undefined;
|
|
1406
|
+
amount_total_cents?: number | null | undefined;
|
|
1345
1407
|
external_id?: string | null | undefined;
|
|
1346
1408
|
description?: string | null | undefined;
|
|
1409
|
+
customer_name?: string | null | undefined;
|
|
1410
|
+
customer_phone?: string | null | undefined;
|
|
1411
|
+
customer_email?: string | null | undefined;
|
|
1412
|
+
}, {
|
|
1413
|
+
currency: "USD" | "CAD";
|
|
1414
|
+
occurred_at: string;
|
|
1415
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1347
1416
|
service?: string | null | undefined;
|
|
1417
|
+
services?: {
|
|
1418
|
+
service: string;
|
|
1419
|
+
amount_cents: number;
|
|
1420
|
+
}[] | null | undefined;
|
|
1421
|
+
amount_total_cents?: number | null | undefined;
|
|
1422
|
+
external_id?: string | null | undefined;
|
|
1423
|
+
description?: string | null | undefined;
|
|
1348
1424
|
environment?: "production" | "development" | undefined;
|
|
1349
1425
|
items?: {
|
|
1350
1426
|
quantity: string;
|
|
@@ -1358,9 +1434,19 @@ declare const saleCreateSchema: z.ZodObject<{
|
|
|
1358
1434
|
customer_phone?: string | null | undefined;
|
|
1359
1435
|
customer_email?: string | null | undefined;
|
|
1360
1436
|
}>;
|
|
1361
|
-
declare const saleUpdateSchema: z.ZodObject<{
|
|
1437
|
+
declare const saleUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
1362
1438
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1363
1439
|
service: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1440
|
+
services: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1441
|
+
service: z.ZodString;
|
|
1442
|
+
amount_cents: z.ZodNumber;
|
|
1443
|
+
}, "strict", z.ZodTypeAny, {
|
|
1444
|
+
service: string;
|
|
1445
|
+
amount_cents: number;
|
|
1446
|
+
}, {
|
|
1447
|
+
service: string;
|
|
1448
|
+
amount_cents: number;
|
|
1449
|
+
}>, "many">>>;
|
|
1364
1450
|
currency: z.ZodOptional<z.ZodEnum<["USD", "CAD"]>>;
|
|
1365
1451
|
amount_total_cents: z.ZodOptional<z.ZodNumber>;
|
|
1366
1452
|
occurred_at: z.ZodOptional<z.ZodString>;
|
|
@@ -1392,10 +1478,14 @@ declare const saleUpdateSchema: z.ZodObject<{
|
|
|
1392
1478
|
customer_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1393
1479
|
}, "strict", z.ZodTypeAny, {
|
|
1394
1480
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1395
|
-
description?: string | null | undefined;
|
|
1396
1481
|
service?: string | null | undefined;
|
|
1397
|
-
|
|
1482
|
+
services?: {
|
|
1483
|
+
service: string;
|
|
1484
|
+
amount_cents: number;
|
|
1485
|
+
}[] | null | undefined;
|
|
1398
1486
|
amount_total_cents?: number | undefined;
|
|
1487
|
+
description?: string | null | undefined;
|
|
1488
|
+
currency?: "USD" | "CAD" | undefined;
|
|
1399
1489
|
occurred_at?: string | undefined;
|
|
1400
1490
|
items?: {
|
|
1401
1491
|
quantity: string;
|
|
@@ -1410,10 +1500,58 @@ declare const saleUpdateSchema: z.ZodObject<{
|
|
|
1410
1500
|
customer_email?: string | null | undefined;
|
|
1411
1501
|
}, {
|
|
1412
1502
|
metadata?: Record<string, unknown> | null | undefined;
|
|
1503
|
+
service?: string | null | undefined;
|
|
1504
|
+
services?: {
|
|
1505
|
+
service: string;
|
|
1506
|
+
amount_cents: number;
|
|
1507
|
+
}[] | null | undefined;
|
|
1508
|
+
amount_total_cents?: number | undefined;
|
|
1413
1509
|
description?: string | null | undefined;
|
|
1510
|
+
currency?: "USD" | "CAD" | undefined;
|
|
1511
|
+
occurred_at?: string | undefined;
|
|
1512
|
+
items?: {
|
|
1513
|
+
quantity: string;
|
|
1514
|
+
unit_price_cents: number;
|
|
1515
|
+
name?: string | null | undefined;
|
|
1516
|
+
external_item_id?: string | null | undefined;
|
|
1517
|
+
category?: string | null | undefined;
|
|
1518
|
+
unit_cost_cents?: number | null | undefined;
|
|
1519
|
+
}[] | undefined;
|
|
1520
|
+
customer_name?: string | null | undefined;
|
|
1521
|
+
customer_phone?: string | null | undefined;
|
|
1522
|
+
customer_email?: string | null | undefined;
|
|
1523
|
+
}>, {
|
|
1524
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1414
1525
|
service?: string | null | undefined;
|
|
1526
|
+
services?: {
|
|
1527
|
+
service: string;
|
|
1528
|
+
amount_cents: number;
|
|
1529
|
+
}[] | null | undefined;
|
|
1530
|
+
amount_total_cents?: number | undefined;
|
|
1531
|
+
description?: string | null | undefined;
|
|
1415
1532
|
currency?: "USD" | "CAD" | undefined;
|
|
1533
|
+
occurred_at?: string | undefined;
|
|
1534
|
+
items?: {
|
|
1535
|
+
quantity: string;
|
|
1536
|
+
unit_price_cents: number;
|
|
1537
|
+
name?: string | null | undefined;
|
|
1538
|
+
external_item_id?: string | null | undefined;
|
|
1539
|
+
category?: string | null | undefined;
|
|
1540
|
+
unit_cost_cents?: number | null | undefined;
|
|
1541
|
+
}[] | undefined;
|
|
1542
|
+
customer_name?: string | null | undefined;
|
|
1543
|
+
customer_phone?: string | null | undefined;
|
|
1544
|
+
customer_email?: string | null | undefined;
|
|
1545
|
+
}, {
|
|
1546
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
1547
|
+
service?: string | null | undefined;
|
|
1548
|
+
services?: {
|
|
1549
|
+
service: string;
|
|
1550
|
+
amount_cents: number;
|
|
1551
|
+
}[] | null | undefined;
|
|
1416
1552
|
amount_total_cents?: number | undefined;
|
|
1553
|
+
description?: string | null | undefined;
|
|
1554
|
+
currency?: "USD" | "CAD" | undefined;
|
|
1417
1555
|
occurred_at?: string | undefined;
|
|
1418
1556
|
items?: {
|
|
1419
1557
|
quantity: string;
|
|
@@ -1428,6 +1566,7 @@ declare const saleUpdateSchema: z.ZodObject<{
|
|
|
1428
1566
|
customer_email?: string | null | undefined;
|
|
1429
1567
|
}>;
|
|
1430
1568
|
type SaleItemInput = z.input<typeof saleItemSchema>;
|
|
1569
|
+
type SaleServiceInput = z.input<typeof saleServiceSchema>;
|
|
1431
1570
|
type SaleInput = z.input<typeof saleCreateSchema>;
|
|
1432
1571
|
type SaleUpdateInput = z.input<typeof saleUpdateSchema>;
|
|
1433
1572
|
interface SaleItem {
|
|
@@ -1439,6 +1578,13 @@ interface SaleItem {
|
|
|
1439
1578
|
unit_price_cents: number;
|
|
1440
1579
|
unit_cost_cents: number | null;
|
|
1441
1580
|
}
|
|
1581
|
+
interface SaleService {
|
|
1582
|
+
id: string;
|
|
1583
|
+
service_id: string;
|
|
1584
|
+
service_key: string;
|
|
1585
|
+
service_label: string;
|
|
1586
|
+
amount_cents: number;
|
|
1587
|
+
}
|
|
1442
1588
|
interface Sale {
|
|
1443
1589
|
id: string;
|
|
1444
1590
|
business_id: string;
|
|
@@ -1450,6 +1596,7 @@ interface Sale {
|
|
|
1450
1596
|
service_id: string | null;
|
|
1451
1597
|
service_key?: string | null;
|
|
1452
1598
|
service_label?: string | null;
|
|
1599
|
+
services: SaleService[];
|
|
1453
1600
|
occurred_at: string;
|
|
1454
1601
|
environment: (typeof TRACKING_ENVIRONMENTS)[number];
|
|
1455
1602
|
metadata: Record<string, unknown> | null;
|
|
@@ -1591,8 +1738,12 @@ interface SalesClientConfig extends SalesTransportConfig {
|
|
|
1591
1738
|
* `@aranova/tracking-cli gen` for compile-time-checked `service` values.
|
|
1592
1739
|
*/
|
|
1593
1740
|
interface SalesClient<TService extends string = string> {
|
|
1594
|
-
record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service'> & {
|
|
1741
|
+
record(input: Omit<SaleInput, 'currency' | 'occurred_at' | 'service' | 'services'> & {
|
|
1595
1742
|
service?: TService | null;
|
|
1743
|
+
services?: Array<{
|
|
1744
|
+
service: TService;
|
|
1745
|
+
amount_cents: number;
|
|
1746
|
+
}>;
|
|
1596
1747
|
currency?: SupportedCurrency;
|
|
1597
1748
|
occurred_at?: string;
|
|
1598
1749
|
}): Promise<Sale>;
|
|
@@ -1604,8 +1755,12 @@ interface SalesClient<TService extends string = string> {
|
|
|
1604
1755
|
*/
|
|
1605
1756
|
summary(query: SaleSummaryQuery): Promise<SaleSummary>;
|
|
1606
1757
|
get(id: string): Promise<Sale>;
|
|
1607
|
-
update(id: string, patch: Omit<SaleUpdateInput, 'service'> & {
|
|
1758
|
+
update(id: string, patch: Omit<SaleUpdateInput, 'service' | 'services'> & {
|
|
1608
1759
|
service?: TService | null;
|
|
1760
|
+
services?: Array<{
|
|
1761
|
+
service: TService;
|
|
1762
|
+
amount_cents: number;
|
|
1763
|
+
}>;
|
|
1609
1764
|
}): Promise<Sale>;
|
|
1610
1765
|
delete(id: string): Promise<void>;
|
|
1611
1766
|
}
|
|
@@ -1864,4 +2019,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
|
|
|
1864
2019
|
*/
|
|
1865
2020
|
declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
|
|
1866
2021
|
|
|
1867
|
-
export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, 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, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, type TrackingOverviewRange, TrackingParams, type TrackingProviderProps, 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 };
|
|
2022
|
+
export { AranovaApiError, type AutomaticEventName, ConsentBanner, type ConsentBannerProps, 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, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, type TrackingOverviewRange, TrackingParams, type TrackingProviderProps, 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
|
@@ -1504,7 +1504,7 @@ function GoogleAdsTracking(props) {
|
|
|
1504
1504
|
var import_navigation = require("next/navigation");
|
|
1505
1505
|
|
|
1506
1506
|
// package.json
|
|
1507
|
-
var version = "0.
|
|
1507
|
+
var version = "0.11.0";
|
|
1508
1508
|
|
|
1509
1509
|
// src/factory.tsx
|
|
1510
1510
|
var import_react3 = require("react");
|