@aranova/tracking-next 0.25.0 → 0.27.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/blog-server.js.map +1 -1
- package/dist/blog-server.mjs.map +1 -1
- package/dist/blog.js.map +1 -1
- package/dist/blog.mjs.map +1 -1
- package/dist/calendar-server.js.map +1 -1
- package/dist/calendar-server.mjs.map +1 -1
- package/dist/calendar.js.map +1 -1
- package/dist/calendar.mjs.map +1 -1
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +15 -9
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +15 -9
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{ingest-typed-BioxtBJD.d.mts → ingest-typed-BxLFlZ7N.d.mts} +6 -0
- package/dist/{ingest-typed-C-SPiigr.d.ts → ingest-typed-ByQVRMvP.d.ts} +6 -0
- package/dist/middleware.js +3 -1
- package/dist/middleware.js.map +1 -1
- package/dist/middleware.mjs +3 -1
- package/dist/middleware.mjs.map +1 -1
- package/dist/phone.js +3 -1
- package/dist/phone.js.map +1 -1
- package/dist/phone.mjs +3 -1
- package/dist/phone.mjs.map +1 -1
- package/dist/{sales-Xs375f6t.d.mts → sales-DQGzXSgL.d.mts} +53 -13
- package/dist/{sales-Bv1tihaB.d.ts → sales-IGC2tq4J.d.ts} +53 -13
- package/dist/sales.d.mts +2 -2
- package/dist/sales.d.ts +2 -2
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs.map +1 -1
- package/dist/server.js +3 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +3 -1
- package/dist/server.mjs.map +1 -1
- package/dist/{tracking-config-runtime-BnUlS_Ae.d.mts → tracking-config-runtime-D7prdTE1.d.mts} +6 -0
- package/dist/{tracking-config-runtime-BnUlS_Ae.d.ts → tracking-config-runtime-D7prdTE1.d.ts} +6 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as ConversionConfigStore, c as TrackingConfigRuntime } from './tracking-config-runtime-
|
|
2
|
+
import { a as ConversionConfigStore, c as TrackingConfigRuntime } from './tracking-config-runtime-D7prdTE1.js';
|
|
3
3
|
import { CountryCode } from 'libphonenumber-js';
|
|
4
4
|
import { A as ApiTransportConfig, a as apiRequest } from './request-Doq36Rt0.js';
|
|
5
5
|
import './date-BHetnL7s.js';
|
|
@@ -396,6 +396,12 @@ interface Sale {
|
|
|
396
396
|
updated_at: string;
|
|
397
397
|
items: SaleItem[];
|
|
398
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* The offset page shape returned by the internal admin list, which this client
|
|
401
|
+
* never calls (`list()` is keyset and returns {@link SaleCursorPage}).
|
|
402
|
+
*
|
|
403
|
+
* @deprecated Unused by this client — no verb returns or accepts it. Kept for one release; removed in the next major.
|
|
404
|
+
*/
|
|
399
405
|
interface SaleListPage {
|
|
400
406
|
items: Sale[];
|
|
401
407
|
total: number;
|
|
@@ -408,9 +414,10 @@ interface SaleCursorPage {
|
|
|
408
414
|
has_more?: boolean;
|
|
409
415
|
}
|
|
410
416
|
/**
|
|
411
|
-
* Sortable columns on the
|
|
412
|
-
*
|
|
413
|
-
*
|
|
417
|
+
* Sortable columns on the internal admin (offset) list. `list()` is typed to
|
|
418
|
+
* {@link SaleKeysetSortField}, which omits `customer_name` and `business_name`.
|
|
419
|
+
*
|
|
420
|
+
* @deprecated Unused by this client — no verb returns or accepts it. Kept for one release; removed in the next major.
|
|
414
421
|
*/
|
|
415
422
|
type SaleSortField = "occurred_at" | "created_at" | "amount_total_cents" | "customer_name" | "business_name";
|
|
416
423
|
type SaleSortOrder = "asc" | "desc";
|
|
@@ -442,10 +449,13 @@ interface SaleFilters {
|
|
|
442
449
|
* Pagination is **keyset (cursor)**: `next_cursor` returned by one page is
|
|
443
450
|
* passed back as `cursor` on the next. `null` / undefined cursor = first page.
|
|
444
451
|
*
|
|
445
|
-
* Ordering
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
|
|
452
|
+
* Ordering is selectable via `sort`/`order` on {@link SaleListQueryV2}. A cursor
|
|
453
|
+
* encodes a position under the sort it was minted with, so replaying it under a
|
|
454
|
+
* different sort is rejected (422) — page with the sort you started with.
|
|
455
|
+
*/
|
|
456
|
+
/**
|
|
457
|
+
* @deprecated Superseded by {@link SaleListQueryV2}, which is what `list()` accepts.
|
|
458
|
+
* Its ordering note was also stale — `sort`/`order` are supported. Removed in the next major.
|
|
449
459
|
*/
|
|
450
460
|
interface SaleListQuery extends SaleFilters {
|
|
451
461
|
limit?: number;
|
|
@@ -463,6 +473,10 @@ interface SaleListQueryV2 extends SaleListQuery {
|
|
|
463
473
|
declare const TRACKING_RANGES: readonly ["24h", "7d", "30d"];
|
|
464
474
|
type TrackingOverviewRange = (typeof TRACKING_RANGES)[number];
|
|
465
475
|
/** Query input for `SalesClient.summary()` — filters + range + options. */
|
|
476
|
+
/**
|
|
477
|
+
* @deprecated The v1 summary query. `summary()` accepts {@link SaleSummaryQueryV2};
|
|
478
|
+
* the v1 endpoint no longer exists. Removed in the next major.
|
|
479
|
+
*/
|
|
466
480
|
interface SaleSummaryQuery extends SaleFilters {
|
|
467
481
|
range: TrackingOverviewRange;
|
|
468
482
|
/** Include the per-category line-item breakdown (extra join; default false). */
|
|
@@ -502,6 +516,10 @@ interface SalesTrendPoint {
|
|
|
502
516
|
sale_count: number;
|
|
503
517
|
revenue_cents: number;
|
|
504
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* @deprecated The v1 summary response. `summary()` returns {@link SaleSummaryV2};
|
|
521
|
+
* the v1 endpoint no longer exists. Removed in the next major.
|
|
522
|
+
*/
|
|
505
523
|
interface SaleSummary {
|
|
506
524
|
range: TrackingOverviewRange;
|
|
507
525
|
business_id: string | null;
|
|
@@ -674,6 +692,23 @@ interface BusinessConfigFeatures {
|
|
|
674
692
|
comparisons: boolean;
|
|
675
693
|
retention: boolean;
|
|
676
694
|
}
|
|
695
|
+
/** A built-in customer field a business can require on every sale. */
|
|
696
|
+
type SaleBuiltinRequirableField = "customer_name" | "customer_phone" | "customer_email" | "description";
|
|
697
|
+
/** v1 value types. `enum` is single-select over the property's `options`. */
|
|
698
|
+
type SalePropertyType = "string" | "number" | "boolean" | "enum" | "date";
|
|
699
|
+
interface SalePropertyOption {
|
|
700
|
+
key: string;
|
|
701
|
+
label: string;
|
|
702
|
+
}
|
|
703
|
+
/** One custom sale property as the sale form sees it: overrides applied, options
|
|
704
|
+
* already filtered to the business's enabled subset. */
|
|
705
|
+
interface EffectiveSaleProperty {
|
|
706
|
+
key: string;
|
|
707
|
+
label: string;
|
|
708
|
+
type: SalePropertyType;
|
|
709
|
+
required: boolean;
|
|
710
|
+
options?: SalePropertyOption[] | null;
|
|
711
|
+
}
|
|
677
712
|
interface BusinessConfig {
|
|
678
713
|
business_id: string;
|
|
679
714
|
display_name: string;
|
|
@@ -683,6 +718,11 @@ interface BusinessConfig {
|
|
|
683
718
|
default_phone_country: string | null;
|
|
684
719
|
services: BusinessConfigService[];
|
|
685
720
|
features: BusinessConfigFeatures;
|
|
721
|
+
builtin_required: SaleBuiltinRequirableField[];
|
|
722
|
+
properties: EffectiveSaleProperty[];
|
|
723
|
+
/** Whether the form should pre-tick the SMS consent box. A form default only —
|
|
724
|
+
* the per-sale `sms_consent` attestation is what every send path gates on. */
|
|
725
|
+
sms_consent_default_opt_in: boolean;
|
|
686
726
|
}
|
|
687
727
|
|
|
688
728
|
type SalesTransportConfig = ApiTransportConfig;
|
|
@@ -733,10 +773,10 @@ interface SalesClient<TService extends string = string, TConversion extends stri
|
|
|
733
773
|
occurred_at?: string;
|
|
734
774
|
}): Promise<Sale>;
|
|
735
775
|
/**
|
|
736
|
-
* Record a revenue sale — the intent-revealing alias of {@link record}
|
|
737
|
-
*
|
|
738
|
-
* WEBPAGE-mapped. Use
|
|
739
|
-
* non-revenue on-page event.
|
|
776
|
+
* Record a revenue sale — the intent-revealing alias of {@link record}. Identical
|
|
777
|
+
* behavior (same function reference): POSTs `/sales` and fires the on-site conversion
|
|
778
|
+
* when the sale-goal is WEBPAGE-mapped. Use either for real revenue; use
|
|
779
|
+
* {@link trackConversion} for a non-revenue on-page event.
|
|
740
780
|
*/
|
|
741
781
|
recordSale(input: Omit<SaleInput, "currency" | "occurred_at" | "service" | "services"> & {
|
|
742
782
|
service?: TService | null;
|
|
@@ -817,4 +857,4 @@ interface PublicServiceItem {
|
|
|
817
857
|
*/
|
|
818
858
|
declare function fetchServices(config: SalesTransportConfig): Promise<PublicServiceItem[]>;
|
|
819
859
|
|
|
820
|
-
export { type
|
|
860
|
+
export { type SalesClient as $, type SaleItemInput as A, type BusinessConfig as B, type CompareTo as C, type DistinctCustomersByCurrency as D, type EffectiveSaleProperty as E, type SaleKeysetSortField as F, type Granularity as G, type SaleListPage as H, type SaleListQuery as I, type SaleListQueryV2 as J, type SalePropertyOption as K, type SalePropertyType as L, type SaleService as M, NAMED_RANGES as N, type SaleServiceInput as O, type PublicServiceItem as P, type SaleSortField as Q, type SaleSortOrder as R, SUPPORTED_CURRENCIES as S, type SaleSummary as T, type SaleSummaryPrevious as U, type SaleSummaryQuery as V, type SaleSummaryQueryV2 as W, type SaleSummaryV2 as X, type SaleUpdateInput as Y, type SalesBusinessClient as Z, type SalesCategoryBreakdown as _, type BusinessConfigFeatures as a, type SalesClientConfig as a0, type SalesCustomersClient as a1, type SalesServiceBreakdown as a2, type SalesTransportConfig as a3, type SalesTrendPoint as a4, type SummaryCurrencyDelta as a5, type SummaryDeltas as a6, type SummaryWindow as a7, type SupportedCurrency as a8, TRACKING_RANGES as a9, type TrackingOverviewRange as aa, clearStashedUserData as ab, createSalesClient as ac, fetchServices as ad, formatMoney as ae, fromMinor as af, saleCreateSchema as ag, saleItemSchema as ah, saleServiceSchema as ai, saleUpdateSchema as aj, salesRequest as ak, stashUserData as al, toMinor as am, type BusinessConfigService as b, type ConversionUserData as c, type CurrencyRevenue as d, type CustomerCurrencyDelta as e, type CustomerCurrencyTotal as f, type CustomerGetOptions as g, type CustomerGetResult as h, type CustomerKpis as i, type CustomerKpisDeltas as j, type CustomerKpisPrevious as k, type CustomerListPage as l, type CustomerListQuery as m, type CustomerProfile as n, type CustomerSegment as o, type CustomerSegmentCount as p, type CustomerSortField as q, type CustomerSummary as r, type CustomerSummaryQuery as s, type NamedRange as t, type Sale as u, type SaleBuiltinRequirableField as v, type SaleCursorPage as w, type SaleFilters as x, type SaleInput as y, type SaleItem as z };
|
package/dist/sales.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, u as Sale, v as
|
|
1
|
+
export { B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, u as Sale, v as SaleBuiltinRequirableField, w as SaleCursorPage, x as SaleFilters, y as SaleInput, z as SaleItem, A as SaleItemInput, F as SaleKeysetSortField, H as SaleListPage, I as SaleListQuery, J as SaleListQueryV2, K as SalePropertyOption, L as SalePropertyType, M as SaleService, O as SaleServiceInput, Q as SaleSortField, R as SaleSortOrder, T as SaleSummary, U as SaleSummaryPrevious, V as SaleSummaryQuery, W as SaleSummaryQueryV2, X as SaleSummaryV2, Y as SaleUpdateInput, Z as SalesBusinessClient, _ as SalesCategoryBreakdown, $ as SalesClient, a0 as SalesClientConfig, a1 as SalesCustomersClient, a2 as SalesServiceBreakdown, a3 as SalesTransportConfig, a4 as SalesTrendPoint, a5 as SummaryCurrencyDelta, a6 as SummaryDeltas, a7 as SummaryWindow, a8 as SupportedCurrency, a9 as TRACKING_RANGES, aa as TrackingOverviewRange, ac as createSalesClient, ad as fetchServices, ae as formatMoney, af as fromMinor, ag as saleCreateSchema, ah as saleItemSchema, ai as saleServiceSchema, aj as saleUpdateSchema, ak as salesRequest, am as toMinor } from './sales-DQGzXSgL.mjs';
|
|
2
2
|
export { A as AranovaApiError, f as formatDateInTz } from './date-BHetnL7s.mjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import './tracking-config-runtime-
|
|
4
|
+
import './tracking-config-runtime-D7prdTE1.mjs';
|
|
5
5
|
import 'libphonenumber-js';
|
|
6
6
|
import './request-Doq36Rt0.mjs';
|
package/dist/sales.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, u as Sale, v as
|
|
1
|
+
export { B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, u as Sale, v as SaleBuiltinRequirableField, w as SaleCursorPage, x as SaleFilters, y as SaleInput, z as SaleItem, A as SaleItemInput, F as SaleKeysetSortField, H as SaleListPage, I as SaleListQuery, J as SaleListQueryV2, K as SalePropertyOption, L as SalePropertyType, M as SaleService, O as SaleServiceInput, Q as SaleSortField, R as SaleSortOrder, T as SaleSummary, U as SaleSummaryPrevious, V as SaleSummaryQuery, W as SaleSummaryQueryV2, X as SaleSummaryV2, Y as SaleUpdateInput, Z as SalesBusinessClient, _ as SalesCategoryBreakdown, $ as SalesClient, a0 as SalesClientConfig, a1 as SalesCustomersClient, a2 as SalesServiceBreakdown, a3 as SalesTransportConfig, a4 as SalesTrendPoint, a5 as SummaryCurrencyDelta, a6 as SummaryDeltas, a7 as SummaryWindow, a8 as SupportedCurrency, a9 as TRACKING_RANGES, aa as TrackingOverviewRange, ac as createSalesClient, ad as fetchServices, ae as formatMoney, af as fromMinor, ag as saleCreateSchema, ah as saleItemSchema, ai as saleServiceSchema, aj as saleUpdateSchema, ak as salesRequest, am as toMinor } from './sales-IGC2tq4J.js';
|
|
2
2
|
export { A as AranovaApiError, f as formatDateInTz } from './date-BHetnL7s.js';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import './tracking-config-runtime-
|
|
4
|
+
import './tracking-config-runtime-D7prdTE1.js';
|
|
5
5
|
import 'libphonenumber-js';
|
|
6
6
|
import './request-Doq36Rt0.js';
|