@azzas/azzas-tracker-web 2.0.0-preview.8 → 2.0.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/mod.d.cts CHANGED
@@ -156,10 +156,10 @@ declare const EVENTS: {
156
156
  readonly requiredParams: readonly ["user_info"];
157
157
  };
158
158
  NOTIFY_ME: {
159
- name: string;
160
- hasEcommerce: boolean;
161
- destinations: string[];
162
- requiredParams: string[];
159
+ readonly name: "notify_me";
160
+ readonly hasEcommerce: false;
161
+ readonly destinations: readonly ["DataLayer"];
162
+ readonly requiredParams: readonly ["brand", "size", "item_ref"];
163
163
  };
164
164
  REFINE_RESULTS: {
165
165
  readonly name: "refine_results";
@@ -1357,6 +1357,7 @@ interface RatesAndBenefitsData {
1357
1357
  teaser: unknown[];
1358
1358
  }
1359
1359
  interface OrderForm {
1360
+ multipleRemove?: boolean;
1360
1361
  selected?: string;
1361
1362
  index?: number;
1362
1363
  item_list_name: string;
@@ -1396,6 +1397,130 @@ interface OrderForm {
1396
1397
  itemsOrdination: null;
1397
1398
  }
1398
1399
 
1400
+ interface SimilarItemSize {
1401
+ skuId: string;
1402
+ size: string;
1403
+ isAvailable: boolean;
1404
+ }
1405
+ interface SimilarItemMedia {
1406
+ src: string;
1407
+ type: string;
1408
+ }
1409
+ interface SimilarItemColor {
1410
+ colorId: string;
1411
+ colorLabel?: string | null;
1412
+ colorHex?: string | null;
1413
+ thumbUrl?: string | null;
1414
+ }
1415
+ interface SimilarItem {
1416
+ productId: string;
1417
+ categories: string[];
1418
+ color: SimilarItemColor;
1419
+ linkText?: string | null;
1420
+ tags?: string[] | null;
1421
+ sizes: SimilarItemSize[];
1422
+ media: SimilarItemMedia[];
1423
+ }
1424
+ type BestInstallment = {
1425
+ count: number;
1426
+ value: number;
1427
+ hasInterestRate: boolean;
1428
+ total: number;
1429
+ };
1430
+ type OfferWithInstallment = {
1431
+ availability?: string;
1432
+ price: number;
1433
+ listPrice: number;
1434
+ listPriceWithTaxes?: number;
1435
+ priceWithTaxes?: number;
1436
+ quantity?: number;
1437
+ seller?: {
1438
+ identifier: string;
1439
+ };
1440
+ bestInstallment?: BestInstallment | null;
1441
+ };
1442
+ type ProductOffers = {
1443
+ lowPrice?: number;
1444
+ lowPriceWithTaxes?: number;
1445
+ highPrice?: number;
1446
+ offers: OfferWithInstallment[];
1447
+ };
1448
+ type ProductAdditionalProperty = {
1449
+ propertyID?: string | null;
1450
+ name?: string | null;
1451
+ value?: unknown;
1452
+ valueReference?: string | null;
1453
+ };
1454
+ /** skuVariants fields shared by PLP (ProductSummary) and PDP (ProductDetails) fragments */
1455
+ type ProductSkuVariants = {
1456
+ activeVariations?: unknown | null;
1457
+ slugsMap?: unknown | null;
1458
+ availableVariations?: unknown | null;
1459
+ allVariantProducts?: Array<{
1460
+ name: string;
1461
+ productID: string;
1462
+ }> | null;
1463
+ /** PLP/search only (ProductSummary fragment) */
1464
+ allVariantsByName?: unknown | null;
1465
+ };
1466
+ /**
1467
+ * Shared product shape for PLP cards (ProductSummary) and PDP (ProductDetails).
1468
+ * Manual superset — both native GraphQL fragment types are assignable to it.
1469
+ */
1470
+ type ReservaProduct = {
1471
+ index?: number;
1472
+ item_list_name?: string;
1473
+ id: string;
1474
+ sku: string;
1475
+ name: string;
1476
+ isVariantOf: {
1477
+ productGroupID: string;
1478
+ name: string;
1479
+ skuVariants?: ProductSkuVariants | null;
1480
+ additionalProperty?: ProductAdditionalProperty[];
1481
+ };
1482
+ offers: ProductOffers;
1483
+ gtin?: string | null;
1484
+ unitMultiplier?: number | null;
1485
+ image?: Array<{
1486
+ url: string;
1487
+ alternateName?: string | null;
1488
+ }>;
1489
+ brand?: {
1490
+ name: string;
1491
+ brandName?: string;
1492
+ };
1493
+ additionalProperty?: ProductAdditionalProperty[];
1494
+ description?: string | null;
1495
+ slug?: string;
1496
+ hasSpecifications?: boolean | null;
1497
+ advertisement?: {
1498
+ adId: string;
1499
+ adResponseId: string;
1500
+ } | null;
1501
+ deliveryPromiseBadges?: Array<{
1502
+ typeName?: string | null;
1503
+ } | null> | null;
1504
+ breadcrumbList?: {
1505
+ itemListElement: Array<{
1506
+ name: string;
1507
+ position: number;
1508
+ item: string;
1509
+ }> | null;
1510
+ };
1511
+ mpn?: string | null;
1512
+ releaseDate?: string | null;
1513
+ seo?: {
1514
+ title?: string | null;
1515
+ description?: string | null;
1516
+ canonical?: string | null;
1517
+ };
1518
+ groupRefId?: string | null;
1519
+ similarItems?: SimilarItem[];
1520
+ otherLookProducts?: string | null;
1521
+ otherLookProductItems?: ReservaProduct[];
1522
+ };
1523
+
1399
1524
  declare const PROD_DOMAINS: Record<string, Record<string, string>>;
1400
1525
 
1401
1526
  declare global {
@@ -1421,7 +1546,7 @@ type ManuallyInfoContext = {
1421
1546
  email: string;
1422
1547
  email_optin?: boolean;
1423
1548
  };
1424
- type UserInfoContext = {
1549
+ type UserInfo = {
1425
1550
  account: keyof typeof PROD_DOMAINS;
1426
1551
  platform: 'store' | 'checkout';
1427
1552
  userEmail: string;
@@ -1435,6 +1560,10 @@ interface TrackMeta {
1435
1560
  type?: string;
1436
1561
  item_ref?: string;
1437
1562
  size?: string;
1563
+ color?: string;
1564
+ ordering?: string;
1565
+ price_range?: string;
1566
+ category?: string;
1438
1567
  search_term?: string;
1439
1568
  search_found?: boolean;
1440
1569
  search_quantity?: number;
@@ -1444,14 +1573,19 @@ interface TrackMeta {
1444
1573
  creative_name?: string;
1445
1574
  creative_slot?: string;
1446
1575
  coupon_code?: string;
1447
- user_info?: UserInfoContext;
1576
+ user_info?: UserInfo;
1448
1577
  }
1449
1578
  type CallOverrides = {
1450
1579
  brand?: string;
1451
1580
  };
1452
1581
  type AdapterPayload = ({
1582
+ adapter: 'META';
1583
+ } | {
1453
1584
  adapter: 'DECO';
1454
1585
  products: (Product & ProductMeta)[];
1586
+ } | {
1587
+ adapter: 'RESERVA';
1588
+ products: (ReservaProduct & ProductMeta)[];
1455
1589
  } | {
1456
1590
  adapter: 'ORDERFORM';
1457
1591
  orderForm: (OrderForm & ProductMeta)[];
@@ -1474,12 +1608,15 @@ type AdapterPayload = ({
1474
1608
  }) & CallOverrides;
1475
1609
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1476
1610
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1477
-
1478
- declare function initTracker(c: InitialConfig): void;
1479
- declare function trackWebEvent<E extends EventName>(event: E, context: AdapterPayload & {
1611
+ type PayloadFor<E extends EventName> = ('items' extends RequiredParamsOf<E> ? Exclude<AdapterPayload, {
1612
+ adapter: 'META';
1613
+ }> : AdapterPayload) & {
1480
1614
  meta: MetaForEvent<E>;
1481
1615
  window?: unknown;
1482
- }): Promise<void>;
1616
+ };
1617
+
1618
+ declare function initTracker(c: InitialConfig): void;
1619
+ declare function trackWebEvent<E extends EventName>(event: E, context: PayloadFor<E>): Promise<void>;
1483
1620
 
1484
1621
  declare const _default: {
1485
1622
  trackWebEvent: typeof trackWebEvent;
@@ -1641,10 +1778,10 @@ declare const _default: {
1641
1778
  readonly requiredParams: readonly ["user_info"];
1642
1779
  };
1643
1780
  NOTIFY_ME: {
1644
- name: string;
1645
- hasEcommerce: boolean;
1646
- destinations: string[];
1647
- requiredParams: string[];
1781
+ readonly name: "notify_me";
1782
+ readonly hasEcommerce: false;
1783
+ readonly destinations: readonly ["DataLayer"];
1784
+ readonly requiredParams: readonly ["brand", "size", "item_ref"];
1648
1785
  };
1649
1786
  REFINE_RESULTS: {
1650
1787
  readonly name: "refine_results";
package/dist/mod.d.ts CHANGED
@@ -156,10 +156,10 @@ declare const EVENTS: {
156
156
  readonly requiredParams: readonly ["user_info"];
157
157
  };
158
158
  NOTIFY_ME: {
159
- name: string;
160
- hasEcommerce: boolean;
161
- destinations: string[];
162
- requiredParams: string[];
159
+ readonly name: "notify_me";
160
+ readonly hasEcommerce: false;
161
+ readonly destinations: readonly ["DataLayer"];
162
+ readonly requiredParams: readonly ["brand", "size", "item_ref"];
163
163
  };
164
164
  REFINE_RESULTS: {
165
165
  readonly name: "refine_results";
@@ -1357,6 +1357,7 @@ interface RatesAndBenefitsData {
1357
1357
  teaser: unknown[];
1358
1358
  }
1359
1359
  interface OrderForm {
1360
+ multipleRemove?: boolean;
1360
1361
  selected?: string;
1361
1362
  index?: number;
1362
1363
  item_list_name: string;
@@ -1396,6 +1397,130 @@ interface OrderForm {
1396
1397
  itemsOrdination: null;
1397
1398
  }
1398
1399
 
1400
+ interface SimilarItemSize {
1401
+ skuId: string;
1402
+ size: string;
1403
+ isAvailable: boolean;
1404
+ }
1405
+ interface SimilarItemMedia {
1406
+ src: string;
1407
+ type: string;
1408
+ }
1409
+ interface SimilarItemColor {
1410
+ colorId: string;
1411
+ colorLabel?: string | null;
1412
+ colorHex?: string | null;
1413
+ thumbUrl?: string | null;
1414
+ }
1415
+ interface SimilarItem {
1416
+ productId: string;
1417
+ categories: string[];
1418
+ color: SimilarItemColor;
1419
+ linkText?: string | null;
1420
+ tags?: string[] | null;
1421
+ sizes: SimilarItemSize[];
1422
+ media: SimilarItemMedia[];
1423
+ }
1424
+ type BestInstallment = {
1425
+ count: number;
1426
+ value: number;
1427
+ hasInterestRate: boolean;
1428
+ total: number;
1429
+ };
1430
+ type OfferWithInstallment = {
1431
+ availability?: string;
1432
+ price: number;
1433
+ listPrice: number;
1434
+ listPriceWithTaxes?: number;
1435
+ priceWithTaxes?: number;
1436
+ quantity?: number;
1437
+ seller?: {
1438
+ identifier: string;
1439
+ };
1440
+ bestInstallment?: BestInstallment | null;
1441
+ };
1442
+ type ProductOffers = {
1443
+ lowPrice?: number;
1444
+ lowPriceWithTaxes?: number;
1445
+ highPrice?: number;
1446
+ offers: OfferWithInstallment[];
1447
+ };
1448
+ type ProductAdditionalProperty = {
1449
+ propertyID?: string | null;
1450
+ name?: string | null;
1451
+ value?: unknown;
1452
+ valueReference?: string | null;
1453
+ };
1454
+ /** skuVariants fields shared by PLP (ProductSummary) and PDP (ProductDetails) fragments */
1455
+ type ProductSkuVariants = {
1456
+ activeVariations?: unknown | null;
1457
+ slugsMap?: unknown | null;
1458
+ availableVariations?: unknown | null;
1459
+ allVariantProducts?: Array<{
1460
+ name: string;
1461
+ productID: string;
1462
+ }> | null;
1463
+ /** PLP/search only (ProductSummary fragment) */
1464
+ allVariantsByName?: unknown | null;
1465
+ };
1466
+ /**
1467
+ * Shared product shape for PLP cards (ProductSummary) and PDP (ProductDetails).
1468
+ * Manual superset — both native GraphQL fragment types are assignable to it.
1469
+ */
1470
+ type ReservaProduct = {
1471
+ index?: number;
1472
+ item_list_name?: string;
1473
+ id: string;
1474
+ sku: string;
1475
+ name: string;
1476
+ isVariantOf: {
1477
+ productGroupID: string;
1478
+ name: string;
1479
+ skuVariants?: ProductSkuVariants | null;
1480
+ additionalProperty?: ProductAdditionalProperty[];
1481
+ };
1482
+ offers: ProductOffers;
1483
+ gtin?: string | null;
1484
+ unitMultiplier?: number | null;
1485
+ image?: Array<{
1486
+ url: string;
1487
+ alternateName?: string | null;
1488
+ }>;
1489
+ brand?: {
1490
+ name: string;
1491
+ brandName?: string;
1492
+ };
1493
+ additionalProperty?: ProductAdditionalProperty[];
1494
+ description?: string | null;
1495
+ slug?: string;
1496
+ hasSpecifications?: boolean | null;
1497
+ advertisement?: {
1498
+ adId: string;
1499
+ adResponseId: string;
1500
+ } | null;
1501
+ deliveryPromiseBadges?: Array<{
1502
+ typeName?: string | null;
1503
+ } | null> | null;
1504
+ breadcrumbList?: {
1505
+ itemListElement: Array<{
1506
+ name: string;
1507
+ position: number;
1508
+ item: string;
1509
+ }> | null;
1510
+ };
1511
+ mpn?: string | null;
1512
+ releaseDate?: string | null;
1513
+ seo?: {
1514
+ title?: string | null;
1515
+ description?: string | null;
1516
+ canonical?: string | null;
1517
+ };
1518
+ groupRefId?: string | null;
1519
+ similarItems?: SimilarItem[];
1520
+ otherLookProducts?: string | null;
1521
+ otherLookProductItems?: ReservaProduct[];
1522
+ };
1523
+
1399
1524
  declare const PROD_DOMAINS: Record<string, Record<string, string>>;
1400
1525
 
1401
1526
  declare global {
@@ -1421,7 +1546,7 @@ type ManuallyInfoContext = {
1421
1546
  email: string;
1422
1547
  email_optin?: boolean;
1423
1548
  };
1424
- type UserInfoContext = {
1549
+ type UserInfo = {
1425
1550
  account: keyof typeof PROD_DOMAINS;
1426
1551
  platform: 'store' | 'checkout';
1427
1552
  userEmail: string;
@@ -1435,6 +1560,10 @@ interface TrackMeta {
1435
1560
  type?: string;
1436
1561
  item_ref?: string;
1437
1562
  size?: string;
1563
+ color?: string;
1564
+ ordering?: string;
1565
+ price_range?: string;
1566
+ category?: string;
1438
1567
  search_term?: string;
1439
1568
  search_found?: boolean;
1440
1569
  search_quantity?: number;
@@ -1444,14 +1573,19 @@ interface TrackMeta {
1444
1573
  creative_name?: string;
1445
1574
  creative_slot?: string;
1446
1575
  coupon_code?: string;
1447
- user_info?: UserInfoContext;
1576
+ user_info?: UserInfo;
1448
1577
  }
1449
1578
  type CallOverrides = {
1450
1579
  brand?: string;
1451
1580
  };
1452
1581
  type AdapterPayload = ({
1582
+ adapter: 'META';
1583
+ } | {
1453
1584
  adapter: 'DECO';
1454
1585
  products: (Product & ProductMeta)[];
1586
+ } | {
1587
+ adapter: 'RESERVA';
1588
+ products: (ReservaProduct & ProductMeta)[];
1455
1589
  } | {
1456
1590
  adapter: 'ORDERFORM';
1457
1591
  orderForm: (OrderForm & ProductMeta)[];
@@ -1474,12 +1608,15 @@ type AdapterPayload = ({
1474
1608
  }) & CallOverrides;
1475
1609
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1476
1610
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1477
-
1478
- declare function initTracker(c: InitialConfig): void;
1479
- declare function trackWebEvent<E extends EventName>(event: E, context: AdapterPayload & {
1611
+ type PayloadFor<E extends EventName> = ('items' extends RequiredParamsOf<E> ? Exclude<AdapterPayload, {
1612
+ adapter: 'META';
1613
+ }> : AdapterPayload) & {
1480
1614
  meta: MetaForEvent<E>;
1481
1615
  window?: unknown;
1482
- }): Promise<void>;
1616
+ };
1617
+
1618
+ declare function initTracker(c: InitialConfig): void;
1619
+ declare function trackWebEvent<E extends EventName>(event: E, context: PayloadFor<E>): Promise<void>;
1483
1620
 
1484
1621
  declare const _default: {
1485
1622
  trackWebEvent: typeof trackWebEvent;
@@ -1641,10 +1778,10 @@ declare const _default: {
1641
1778
  readonly requiredParams: readonly ["user_info"];
1642
1779
  };
1643
1780
  NOTIFY_ME: {
1644
- name: string;
1645
- hasEcommerce: boolean;
1646
- destinations: string[];
1647
- requiredParams: string[];
1781
+ readonly name: "notify_me";
1782
+ readonly hasEcommerce: false;
1783
+ readonly destinations: readonly ["DataLayer"];
1784
+ readonly requiredParams: readonly ["brand", "size", "item_ref"];
1648
1785
  };
1649
1786
  REFINE_RESULTS: {
1650
1787
  readonly name: "refine_results";