@azzas/azzas-tracker-web 2.0.0-preview.9 → 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;
@@ -1448,14 +1573,19 @@ interface TrackMeta {
1448
1573
  creative_name?: string;
1449
1574
  creative_slot?: string;
1450
1575
  coupon_code?: string;
1451
- user_info?: UserInfoContext;
1576
+ user_info?: UserInfo;
1452
1577
  }
1453
1578
  type CallOverrides = {
1454
1579
  brand?: string;
1455
1580
  };
1456
1581
  type AdapterPayload = ({
1582
+ adapter: 'META';
1583
+ } | {
1457
1584
  adapter: 'DECO';
1458
1585
  products: (Product & ProductMeta)[];
1586
+ } | {
1587
+ adapter: 'RESERVA';
1588
+ products: (ReservaProduct & ProductMeta)[];
1459
1589
  } | {
1460
1590
  adapter: 'ORDERFORM';
1461
1591
  orderForm: (OrderForm & ProductMeta)[];
@@ -1478,12 +1608,15 @@ type AdapterPayload = ({
1478
1608
  }) & CallOverrides;
1479
1609
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1480
1610
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1481
-
1482
- declare function initTracker(c: InitialConfig): void;
1483
- 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) & {
1484
1614
  meta: MetaForEvent<E>;
1485
1615
  window?: unknown;
1486
- }): 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>;
1487
1620
 
1488
1621
  declare const _default: {
1489
1622
  trackWebEvent: typeof trackWebEvent;
@@ -1645,10 +1778,10 @@ declare const _default: {
1645
1778
  readonly requiredParams: readonly ["user_info"];
1646
1779
  };
1647
1780
  NOTIFY_ME: {
1648
- name: string;
1649
- hasEcommerce: boolean;
1650
- destinations: string[];
1651
- requiredParams: string[];
1781
+ readonly name: "notify_me";
1782
+ readonly hasEcommerce: false;
1783
+ readonly destinations: readonly ["DataLayer"];
1784
+ readonly requiredParams: readonly ["brand", "size", "item_ref"];
1652
1785
  };
1653
1786
  REFINE_RESULTS: {
1654
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;
@@ -1448,14 +1573,19 @@ interface TrackMeta {
1448
1573
  creative_name?: string;
1449
1574
  creative_slot?: string;
1450
1575
  coupon_code?: string;
1451
- user_info?: UserInfoContext;
1576
+ user_info?: UserInfo;
1452
1577
  }
1453
1578
  type CallOverrides = {
1454
1579
  brand?: string;
1455
1580
  };
1456
1581
  type AdapterPayload = ({
1582
+ adapter: 'META';
1583
+ } | {
1457
1584
  adapter: 'DECO';
1458
1585
  products: (Product & ProductMeta)[];
1586
+ } | {
1587
+ adapter: 'RESERVA';
1588
+ products: (ReservaProduct & ProductMeta)[];
1459
1589
  } | {
1460
1590
  adapter: 'ORDERFORM';
1461
1591
  orderForm: (OrderForm & ProductMeta)[];
@@ -1478,12 +1608,15 @@ type AdapterPayload = ({
1478
1608
  }) & CallOverrides;
1479
1609
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1480
1610
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1481
-
1482
- declare function initTracker(c: InitialConfig): void;
1483
- 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) & {
1484
1614
  meta: MetaForEvent<E>;
1485
1615
  window?: unknown;
1486
- }): 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>;
1487
1620
 
1488
1621
  declare const _default: {
1489
1622
  trackWebEvent: typeof trackWebEvent;
@@ -1645,10 +1778,10 @@ declare const _default: {
1645
1778
  readonly requiredParams: readonly ["user_info"];
1646
1779
  };
1647
1780
  NOTIFY_ME: {
1648
- name: string;
1649
- hasEcommerce: boolean;
1650
- destinations: string[];
1651
- requiredParams: string[];
1781
+ readonly name: "notify_me";
1782
+ readonly hasEcommerce: false;
1783
+ readonly destinations: readonly ["DataLayer"];
1784
+ readonly requiredParams: readonly ["brand", "size", "item_ref"];
1652
1785
  };
1653
1786
  REFINE_RESULTS: {
1654
1787
  readonly name: "refine_results";