@azzas/azzas-tracker-web 2.0.0-preview.6 → 2.0.0-preview.7

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
@@ -1409,25 +1409,6 @@ type ProductMeta = {
1409
1409
  index?: number;
1410
1410
  item_list_name?: string | undefined | null;
1411
1411
  };
1412
- type AdapterPayload = {
1413
- adapter: 'HEADLESS';
1414
- zone: 'PDP';
1415
- products: (ProductType_PDP & ProductMeta)[];
1416
- } | {
1417
- adapter: 'HEADLESS';
1418
- zone: 'PDC';
1419
- products: (ProductType_PDC & ProductMeta)[];
1420
- } | {
1421
- adapter: 'HEADLESS';
1422
- zone: 'Minicart';
1423
- products: (ProductType_Minicart & ProductMeta)[];
1424
- } | {
1425
- adapter: 'DECO';
1426
- products: (Product & ProductMeta)[];
1427
- } | {
1428
- adapter: 'ORDERFORM';
1429
- orderForm: (OrderForm & ProductMeta)[];
1430
- };
1431
1412
  interface TrackMeta {
1432
1413
  region?: string;
1433
1414
  pre_filled?: boolean;
@@ -1444,6 +1425,28 @@ interface TrackMeta {
1444
1425
  creative_slot?: string;
1445
1426
  coupon_code?: string;
1446
1427
  }
1428
+ type CallOverrides = {
1429
+ brand?: string;
1430
+ };
1431
+ type AdapterPayload = ({
1432
+ adapter: 'DECO';
1433
+ products: (Product & ProductMeta)[];
1434
+ } | {
1435
+ adapter: 'ORDERFORM';
1436
+ orderForm: (OrderForm & ProductMeta)[];
1437
+ } | {
1438
+ adapter: 'HEADLESS';
1439
+ zone: 'PDP';
1440
+ products: (ProductType_PDP & ProductMeta)[];
1441
+ } | {
1442
+ adapter: 'HEADLESS';
1443
+ zone: 'PDC';
1444
+ products: (ProductType_PDC & ProductMeta)[];
1445
+ } | {
1446
+ adapter: 'HEADLESS';
1447
+ zone: 'Minicart';
1448
+ products: (ProductType_Minicart & ProductMeta)[];
1449
+ }) & CallOverrides;
1447
1450
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1448
1451
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1449
1452
 
package/dist/mod.d.ts CHANGED
@@ -1409,25 +1409,6 @@ type ProductMeta = {
1409
1409
  index?: number;
1410
1410
  item_list_name?: string | undefined | null;
1411
1411
  };
1412
- type AdapterPayload = {
1413
- adapter: 'HEADLESS';
1414
- zone: 'PDP';
1415
- products: (ProductType_PDP & ProductMeta)[];
1416
- } | {
1417
- adapter: 'HEADLESS';
1418
- zone: 'PDC';
1419
- products: (ProductType_PDC & ProductMeta)[];
1420
- } | {
1421
- adapter: 'HEADLESS';
1422
- zone: 'Minicart';
1423
- products: (ProductType_Minicart & ProductMeta)[];
1424
- } | {
1425
- adapter: 'DECO';
1426
- products: (Product & ProductMeta)[];
1427
- } | {
1428
- adapter: 'ORDERFORM';
1429
- orderForm: (OrderForm & ProductMeta)[];
1430
- };
1431
1412
  interface TrackMeta {
1432
1413
  region?: string;
1433
1414
  pre_filled?: boolean;
@@ -1444,6 +1425,28 @@ interface TrackMeta {
1444
1425
  creative_slot?: string;
1445
1426
  coupon_code?: string;
1446
1427
  }
1428
+ type CallOverrides = {
1429
+ brand?: string;
1430
+ };
1431
+ type AdapterPayload = ({
1432
+ adapter: 'DECO';
1433
+ products: (Product & ProductMeta)[];
1434
+ } | {
1435
+ adapter: 'ORDERFORM';
1436
+ orderForm: (OrderForm & ProductMeta)[];
1437
+ } | {
1438
+ adapter: 'HEADLESS';
1439
+ zone: 'PDP';
1440
+ products: (ProductType_PDP & ProductMeta)[];
1441
+ } | {
1442
+ adapter: 'HEADLESS';
1443
+ zone: 'PDC';
1444
+ products: (ProductType_PDC & ProductMeta)[];
1445
+ } | {
1446
+ adapter: 'HEADLESS';
1447
+ zone: 'Minicart';
1448
+ products: (ProductType_Minicart & ProductMeta)[];
1449
+ }) & CallOverrides;
1447
1450
  type RequiredMetaKeys<E extends EventName> = Extract<RequiredParamsOf<E>, keyof TrackMeta>;
1448
1451
  type MetaForEvent<E extends EventName> = Required<Pick<TrackMeta, RequiredMetaKeys<E>>> & Omit<TrackMeta, RequiredMetaKeys<E>>;
1449
1452
 
@@ -1358,9 +1358,6 @@ var AzzasTracker = (() => {
1358
1358
  // src/params/adapters/meta/index.ts
1359
1359
  var metaAdapters = {
1360
1360
  user_info: getUserInfo,
1361
- // brand: (context: MetaBrandContext) => {
1362
- // return context.meta.brand || null;
1363
- // },
1364
1361
  content_type: (context) => {
1365
1362
  return context.meta.content_type || null;
1366
1363
  },
@@ -1515,6 +1512,7 @@ var AzzasTracker = (() => {
1515
1512
  },
1516
1513
  brand: (context, config2) => {
1517
1514
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1515
+ if (context == null ? void 0 : context.brand) return context.brand;
1518
1516
  if (context == null ? void 0 : context.products) {
1519
1517
  return normalizeBrand2(context.products.map((p) => {
1520
1518
  var _a;
@@ -1641,6 +1639,7 @@ var AzzasTracker = (() => {
1641
1639
  },
1642
1640
  brand: (context, config2) => {
1643
1641
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1642
+ if (context == null ? void 0 : context.brand) return context.brand;
1644
1643
  if (context == null ? void 0 : context.products) {
1645
1644
  return context.products.map((p) => p.brand).join().trim();
1646
1645
  }
@@ -1699,6 +1698,7 @@ var AzzasTracker = (() => {
1699
1698
  },
1700
1699
  brand: (context, config2) => {
1701
1700
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1701
+ if (context == null ? void 0 : context.brand) return context.brand;
1702
1702
  if (context == null ? void 0 : context.products) {
1703
1703
  return context.products.map((p) => p.brand.name).join().trim();
1704
1704
  }
@@ -1866,6 +1866,7 @@ var AzzasTracker = (() => {
1866
1866
  brand: (context, config2) => {
1867
1867
  var _a;
1868
1868
  if (config2 == null ? void 0 : config2.brand) return config2.brand;
1869
+ if (context == null ? void 0 : context.brand) return context.brand;
1869
1870
  if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
1870
1871
  const brands = getOrderFormItems(context.orderForm).map((item) => item.additionalInfo.brandName);
1871
1872
  return normalizeBrand2(brands);