@azzas/azzas-tracker-web 2.0.2-preview.5 → 2.0.2
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 +17 -12
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +17 -12
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +17 -12
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +8 -3
- package/package.json +1 -1
package/dist/mod.js
CHANGED
|
@@ -1102,6 +1102,10 @@ var PROD_DOMAINS = {
|
|
|
1102
1102
|
"lojafabula": {
|
|
1103
1103
|
"store": "https://lojafabula.myvtex.com",
|
|
1104
1104
|
"checkout": "https://secure.lojafabula.com.br"
|
|
1105
|
+
},
|
|
1106
|
+
"lojausereserva": {
|
|
1107
|
+
"store": "https://lojausereserva.myvtex.com",
|
|
1108
|
+
"checkout": "https://lojausereserva.myvtex.com"
|
|
1105
1109
|
}
|
|
1106
1110
|
};
|
|
1107
1111
|
async function getUserInfo(context) {
|
|
@@ -1114,6 +1118,7 @@ async function getUserInfo(context) {
|
|
|
1114
1118
|
method: "POST",
|
|
1115
1119
|
body: JSON.stringify({ email: (_k = (_j = context == null ? void 0 : context.meta) == null ? void 0 : _j.user_info) == null ? void 0 : _k.userEmail })
|
|
1116
1120
|
});
|
|
1121
|
+
console.log("[DT] status info: ", response.status);
|
|
1117
1122
|
if (response.status !== 200) {
|
|
1118
1123
|
if (((_m = (_l = context == null ? void 0 : context.meta) == null ? void 0 : _l.user_info) == null ? void 0 : _m.manuallyInfo) && ((_p = (_o = (_n = context == null ? void 0 : context.meta) == null ? void 0 : _n.user_info) == null ? void 0 : _o.manuallyInfo) == null ? void 0 : _p.cpf)) {
|
|
1119
1124
|
const { cpf, birthDate, phone, firstName, lastName, email, email_optin } = (_r = (_q = context == null ? void 0 : context.meta) == null ? void 0 : _q.user_info) == null ? void 0 : _r.manuallyInfo;
|
|
@@ -1944,7 +1949,7 @@ var getItemCategory7 = (item) => {
|
|
|
1944
1949
|
};
|
|
1945
1950
|
var getItemCategory25 = (item) => {
|
|
1946
1951
|
var _a, _b;
|
|
1947
|
-
const AVOID_CATEGORIES = /outlet|bazar|sale/i;
|
|
1952
|
+
const AVOID_CATEGORIES = /outlet|bazar|sale|coleção|promoção/i;
|
|
1948
1953
|
const categories = Object.values((_a = item == null ? void 0 : item.productCategories) != null ? _a : {});
|
|
1949
1954
|
const validHierarchy = categories.map((c) => c.trim()).filter((c) => c && !AVOID_CATEGORIES.test(c));
|
|
1950
1955
|
const deepest = (_b = validHierarchy[validHierarchy.length - 1]) != null ? _b : "";
|
|
@@ -1983,28 +1988,28 @@ var orderFormAdapter = {
|
|
|
1983
1988
|
if (context == null ? void 0 : context.items) return context.items;
|
|
1984
1989
|
if ((context == null ? void 0 : context.orderForm) && (context == null ? void 0 : context.orderForm.items)) {
|
|
1985
1990
|
return getOrderFormItems(context.orderForm).map((item, index) => {
|
|
1986
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
1991
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
1987
1992
|
const color = context.brand === "carolbassi" ? null : (_c = (_b = (_a = item == null ? void 0 : item.skuName) == null ? void 0 : _a.split(" - ")[0]) == null ? void 0 : _b.split("_").pop()) == null ? void 0 : _c.trim();
|
|
1988
1993
|
const size = context.brand === "carolbassi" ? item == null ? void 0 : item.skuName : (_e = (_d = item == null ? void 0 : item.skuName) == null ? void 0 : _d.split(" - ")[1]) == null ? void 0 : _e.trim();
|
|
1989
1994
|
return {
|
|
1990
1995
|
quantity: (_f = item == null ? void 0 : item.quantity) != null ? _f : 1,
|
|
1991
1996
|
index: (_h = (_g = context == null ? void 0 : context.orderForm) == null ? void 0 : _g.index) != null ? _h : index + 1,
|
|
1992
|
-
item_brand: (_j = (_i = item.additionalInfo) == null ? void 0 : _i.brandName)
|
|
1993
|
-
item_name: (
|
|
1997
|
+
item_brand: (_k = (_j = (_i = item.additionalInfo) == null ? void 0 : _i.brandName) == null ? void 0 : _j.toLowerCase()) != null ? _k : null,
|
|
1998
|
+
item_name: (_l = item == null ? void 0 : item.name.replace(item == null ? void 0 : item.skuName, "").trim()) != null ? _l : null,
|
|
1994
1999
|
price: (item == null ? void 0 : item.sellingPrice) / 100,
|
|
1995
2000
|
discount: ((item == null ? void 0 : item.listPrice) - (item == null ? void 0 : item.sellingPrice)) / 100,
|
|
1996
2001
|
item_variant: color != null ? color : null,
|
|
1997
2002
|
item_variant2: size != null ? size : null,
|
|
1998
2003
|
item_shipping_tier: getItemShippingTier2(context.orderForm, item),
|
|
1999
2004
|
item_ref: (item == null ? void 0 : item.productRefId) || (item == null ? void 0 : item.refId.replace(/_\d+$/, "")) || null,
|
|
2000
|
-
item_category: (
|
|
2001
|
-
item_category2: (
|
|
2002
|
-
item_id: (
|
|
2003
|
-
item_sku: (
|
|
2004
|
-
item_url: (
|
|
2005
|
-
image_url: (
|
|
2006
|
-
seller_id: (
|
|
2007
|
-
item_list_name: (
|
|
2005
|
+
item_category: (_m = getItemCategory7(item)) != null ? _m : null,
|
|
2006
|
+
item_category2: (_n = getItemCategory25(item)) != null ? _n : null,
|
|
2007
|
+
item_id: (_o = item == null ? void 0 : item.productId) != null ? _o : null,
|
|
2008
|
+
item_sku: (_p = item == null ? void 0 : item.id) != null ? _p : null,
|
|
2009
|
+
item_url: (_q = item.detailUrl) != null ? _q : null,
|
|
2010
|
+
image_url: (_r = resizeVtexImage2(item.imageUrl)) != null ? _r : null,
|
|
2011
|
+
seller_id: (_s = item == null ? void 0 : item.seller) != null ? _s : null,
|
|
2012
|
+
item_list_name: (_u = (_t = context == null ? void 0 : context.orderForm) == null ? void 0 : _t.item_list_name) != null ? _u : null
|
|
2008
2013
|
};
|
|
2009
2014
|
});
|
|
2010
2015
|
}
|