@azzas/azzas-tracker-web 2.0.0-preview.7 → 2.0.0-preview.8
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.cjs +27 -20
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.d.cts +26 -1
- package/dist/mod.d.ts +26 -1
- package/dist/mod.global.js +27 -20
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +27 -20
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +15 -9
- package/package.json +1 -1
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;
|
|
@@ -1419,11 +1438,13 @@ interface TrackMeta {
|
|
|
1419
1438
|
search_term?: string;
|
|
1420
1439
|
search_found?: boolean;
|
|
1421
1440
|
search_quantity?: number;
|
|
1422
|
-
|
|
1441
|
+
zipcode?: string;
|
|
1442
|
+
content_type?: string;
|
|
1423
1443
|
promotion_name?: string;
|
|
1424
1444
|
creative_name?: string;
|
|
1425
1445
|
creative_slot?: string;
|
|
1426
1446
|
coupon_code?: string;
|
|
1447
|
+
user_info?: UserInfoContext;
|
|
1427
1448
|
}
|
|
1428
1449
|
type CallOverrides = {
|
|
1429
1450
|
brand?: string;
|
|
@@ -1434,6 +1455,10 @@ type AdapterPayload = ({
|
|
|
1434
1455
|
} | {
|
|
1435
1456
|
adapter: 'ORDERFORM';
|
|
1436
1457
|
orderForm: (OrderForm & ProductMeta)[];
|
|
1458
|
+
} | {
|
|
1459
|
+
adapter: 'PICKUP';
|
|
1460
|
+
flag_pickup: boolean;
|
|
1461
|
+
shippings: Sla[];
|
|
1437
1462
|
} | {
|
|
1438
1463
|
adapter: 'HEADLESS';
|
|
1439
1464
|
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;
|
|
@@ -1419,11 +1438,13 @@ interface TrackMeta {
|
|
|
1419
1438
|
search_term?: string;
|
|
1420
1439
|
search_found?: boolean;
|
|
1421
1440
|
search_quantity?: number;
|
|
1422
|
-
|
|
1441
|
+
zipcode?: string;
|
|
1442
|
+
content_type?: string;
|
|
1423
1443
|
promotion_name?: string;
|
|
1424
1444
|
creative_name?: string;
|
|
1425
1445
|
creative_slot?: string;
|
|
1426
1446
|
coupon_code?: string;
|
|
1447
|
+
user_info?: UserInfoContext;
|
|
1427
1448
|
}
|
|
1428
1449
|
type CallOverrides = {
|
|
1429
1450
|
brand?: string;
|
|
@@ -1434,6 +1455,10 @@ type AdapterPayload = ({
|
|
|
1434
1455
|
} | {
|
|
1435
1456
|
adapter: 'ORDERFORM';
|
|
1436
1457
|
orderForm: (OrderForm & ProductMeta)[];
|
|
1458
|
+
} | {
|
|
1459
|
+
adapter: 'PICKUP';
|
|
1460
|
+
flag_pickup: boolean;
|
|
1461
|
+
shippings: Sla[];
|
|
1437
1462
|
} | {
|
|
1438
1463
|
adapter: 'HEADLESS';
|
|
1439
1464
|
zone: 'PDP';
|
package/dist/mod.global.js
CHANGED
|
@@ -1419,24 +1419,7 @@ var AzzasTracker = (() => {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
1421
|
|
|
1422
|
-
// src/
|
|
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;
|