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

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
@@ -1215,6 +1215,7 @@ interface Sla {
1215
1215
  pickupDistance: number | null;
1216
1216
  polygonName: string;
1217
1217
  transitTime: string;
1218
+ line_items?: string;
1218
1219
  }
1219
1220
  interface LogisticsInfo {
1220
1221
  itemIndex: number;
@@ -1395,6 +1396,8 @@ interface OrderForm {
1395
1396
  itemsOrdination: null;
1396
1397
  }
1397
1398
 
1399
+ declare const PROD_DOMAINS: Record<string, Record<string, string>>;
1400
+
1398
1401
  declare global {
1399
1402
  interface Window {
1400
1403
  dataLayer: any[];
@@ -1409,6 +1412,22 @@ type ProductMeta = {
1409
1412
  index?: number;
1410
1413
  item_list_name?: string | undefined | null;
1411
1414
  };
1415
+ type ManuallyInfoContext = {
1416
+ cpf: string;
1417
+ birthDate: string;
1418
+ phone: string;
1419
+ firstName: string;
1420
+ lastName: string;
1421
+ email: string;
1422
+ email_optin?: boolean;
1423
+ };
1424
+ type UserInfoContext = {
1425
+ account: keyof typeof PROD_DOMAINS;
1426
+ platform: 'store' | 'checkout';
1427
+ userEmail: string;
1428
+ userId?: string;
1429
+ manuallyInfo?: ManuallyInfoContext;
1430
+ };
1412
1431
  interface TrackMeta {
1413
1432
  region?: string;
1414
1433
  pre_filled?: boolean;
@@ -1416,14 +1435,20 @@ interface TrackMeta {
1416
1435
  type?: string;
1417
1436
  item_ref?: string;
1418
1437
  size?: string;
1438
+ color?: string;
1439
+ ordering?: string;
1440
+ price_range?: string;
1441
+ category?: string;
1419
1442
  search_term?: string;
1420
1443
  search_found?: boolean;
1421
1444
  search_quantity?: number;
1422
- zip_code?: string;
1445
+ zipcode?: string;
1446
+ content_type?: string;
1423
1447
  promotion_name?: string;
1424
1448
  creative_name?: string;
1425
1449
  creative_slot?: string;
1426
1450
  coupon_code?: string;
1451
+ user_info?: UserInfoContext;
1427
1452
  }
1428
1453
  type CallOverrides = {
1429
1454
  brand?: string;
@@ -1434,6 +1459,10 @@ type AdapterPayload = ({
1434
1459
  } | {
1435
1460
  adapter: 'ORDERFORM';
1436
1461
  orderForm: (OrderForm & ProductMeta)[];
1462
+ } | {
1463
+ adapter: 'PICKUP';
1464
+ flag_pickup: boolean;
1465
+ shippings: Sla[];
1437
1466
  } | {
1438
1467
  adapter: 'HEADLESS';
1439
1468
  zone: 'PDP';
package/dist/mod.d.ts CHANGED
@@ -1215,6 +1215,7 @@ interface Sla {
1215
1215
  pickupDistance: number | null;
1216
1216
  polygonName: string;
1217
1217
  transitTime: string;
1218
+ line_items?: string;
1218
1219
  }
1219
1220
  interface LogisticsInfo {
1220
1221
  itemIndex: number;
@@ -1395,6 +1396,8 @@ interface OrderForm {
1395
1396
  itemsOrdination: null;
1396
1397
  }
1397
1398
 
1399
+ declare const PROD_DOMAINS: Record<string, Record<string, string>>;
1400
+
1398
1401
  declare global {
1399
1402
  interface Window {
1400
1403
  dataLayer: any[];
@@ -1409,6 +1412,22 @@ type ProductMeta = {
1409
1412
  index?: number;
1410
1413
  item_list_name?: string | undefined | null;
1411
1414
  };
1415
+ type ManuallyInfoContext = {
1416
+ cpf: string;
1417
+ birthDate: string;
1418
+ phone: string;
1419
+ firstName: string;
1420
+ lastName: string;
1421
+ email: string;
1422
+ email_optin?: boolean;
1423
+ };
1424
+ type UserInfoContext = {
1425
+ account: keyof typeof PROD_DOMAINS;
1426
+ platform: 'store' | 'checkout';
1427
+ userEmail: string;
1428
+ userId?: string;
1429
+ manuallyInfo?: ManuallyInfoContext;
1430
+ };
1412
1431
  interface TrackMeta {
1413
1432
  region?: string;
1414
1433
  pre_filled?: boolean;
@@ -1416,14 +1435,20 @@ interface TrackMeta {
1416
1435
  type?: string;
1417
1436
  item_ref?: string;
1418
1437
  size?: string;
1438
+ color?: string;
1439
+ ordering?: string;
1440
+ price_range?: string;
1441
+ category?: string;
1419
1442
  search_term?: string;
1420
1443
  search_found?: boolean;
1421
1444
  search_quantity?: number;
1422
- zip_code?: string;
1445
+ zipcode?: string;
1446
+ content_type?: string;
1423
1447
  promotion_name?: string;
1424
1448
  creative_name?: string;
1425
1449
  creative_slot?: string;
1426
1450
  coupon_code?: string;
1451
+ user_info?: UserInfoContext;
1427
1452
  }
1428
1453
  type CallOverrides = {
1429
1454
  brand?: string;
@@ -1434,6 +1459,10 @@ type AdapterPayload = ({
1434
1459
  } | {
1435
1460
  adapter: 'ORDERFORM';
1436
1461
  orderForm: (OrderForm & ProductMeta)[];
1462
+ } | {
1463
+ adapter: 'PICKUP';
1464
+ flag_pickup: boolean;
1465
+ shippings: Sla[];
1437
1466
  } | {
1438
1467
  adapter: 'HEADLESS';
1439
1468
  zone: 'PDP';
@@ -1071,7 +1071,7 @@ var AzzasTracker = (() => {
1071
1071
  "store": "https://www.animale.com.br",
1072
1072
  "checkout": "https://secure.animale.com.br"
1073
1073
  },
1074
- "farm": {
1074
+ "lojafarm": {
1075
1075
  "store": "https://lojafarm.myvtex.com"
1076
1076
  },
1077
1077
  "mariafilo": {
@@ -1089,7 +1089,7 @@ var AzzasTracker = (() => {
1089
1089
  "bynv": {
1090
1090
  "store": "https://bynv.myvtex.com"
1091
1091
  },
1092
- "fabula": {
1092
+ "lojafabula": {
1093
1093
  "store": "https://lojafabula.myvtex.com"
1094
1094
  }
1095
1095
  };
@@ -1393,9 +1393,6 @@ var AzzasTracker = (() => {
1393
1393
  creative_slot: (context) => {
1394
1394
  return context.meta.creative_slot || null;
1395
1395
  },
1396
- size: (context) => {
1397
- return context.size || null;
1398
- },
1399
1396
  item_ref: (context) => {
1400
1397
  return context.itemRef || null;
1401
1398
  },
@@ -1416,27 +1413,13 @@ var AzzasTracker = (() => {
1416
1413
  },
1417
1414
  ordering: (context) => {
1418
1415
  return context.meta.ordering || null;
1416
+ },
1417
+ size: (context) => {
1418
+ return context.meta.size || null;
1419
1419
  }
1420
1420
  };
1421
1421
 
1422
- // src/params/adapters/deco/utils.ts
1423
- var getItemCategory3 = (item) => {
1424
- var _a;
1425
- const value = item == null ? void 0 : item.category;
1426
- if (!value) return "Cole\xE7\xE3o";
1427
- const text = Array.isArray(value) ? value.join(" ") : String(value);
1428
- const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
1429
- return match != null ? match : "Cole\xE7\xE3o";
1430
- };
1431
- var getItemCategory22 = (item) => {
1432
- var _a, _b, _c, _d;
1433
- const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
1434
- const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
1435
- const last = (_c = categories[categories.length - 1]) != null ? _c : "";
1436
- const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
1437
- const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
1438
- return capitalize(deepest);
1439
- };
1422
+ // src/core/farm.ts
1440
1423
  var BRAND_CODES2 = {
1441
1424
  farm: "farmrio",
1442
1425
  "farm etc": "farmetc",
@@ -1469,6 +1452,25 @@ var AzzasTracker = (() => {
1469
1452
  return uniqueSortedCodes.length > 0 ? uniqueSortedCodes.join("_") : null;
1470
1453
  }
1471
1454
 
1455
+ // src/params/adapters/deco/utils.ts
1456
+ var getItemCategory3 = (item) => {
1457
+ var _a;
1458
+ const value = item == null ? void 0 : item.category;
1459
+ if (!value) return "Cole\xE7\xE3o";
1460
+ const text = Array.isArray(value) ? value.join(" ") : String(value);
1461
+ const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
1462
+ return match != null ? match : "Cole\xE7\xE3o";
1463
+ };
1464
+ var getItemCategory22 = (item) => {
1465
+ var _a, _b, _c, _d;
1466
+ const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
1467
+ const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
1468
+ const last = (_c = categories[categories.length - 1]) != null ? _c : "";
1469
+ const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
1470
+ const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
1471
+ return capitalize(deepest);
1472
+ };
1473
+
1472
1474
  // src/params/adapters/deco/index.ts
1473
1475
  var IN_STOCK_SCHEMA = "https://schema.org/InStock";
1474
1476
  var LIST_PRICE_SCHEMA = "https://schema.org/ListPrice";
@@ -1795,9 +1797,14 @@ var AzzasTracker = (() => {
1795
1797
  }
1796
1798
  return null;
1797
1799
  },
1800
+ brand: (context, config2) => {
1801
+ if (config2 == null ? void 0 : config2.brand) return config2.brand;
1802
+ if (context == null ? void 0 : context.brand) return context.brand;
1803
+ return null;
1804
+ },
1798
1805
  zipcode: (context) => {
1799
1806
  var _a;
1800
- return (_a = context.zipcode) != null ? _a : null;
1807
+ return (_a = context.meta.zipcode) != null ? _a : null;
1801
1808
  }
1802
1809
  };
1803
1810
 
@@ -1915,7 +1922,7 @@ var AzzasTracker = (() => {
1915
1922
  },
1916
1923
  zipcode: (context) => {
1917
1924
  var _a;
1918
- return (_a = context.zipcode) != null ? _a : null;
1925
+ return (_a = context.meta.zipcode) != null ? _a : null;
1919
1926
  },
1920
1927
  flag_pickup: (context) => {
1921
1928
  var _a;