@azzas/azzas-tracker-web 1.0.95 → 1.0.96
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 +70 -73
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.d.cts +2 -0
- package/dist/mod.d.ts +2 -0
- package/dist/mod.global.js +70 -73
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +70 -73
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +114 -114
- package/package.json +1 -1
package/dist/mod.vtex.global.js
CHANGED
|
@@ -1198,82 +1198,52 @@ var AzzasTracker = function() {
|
|
|
1198
1198
|
return null;
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
|
-
var
|
|
1201
|
+
var getUserInfo = // src/params/userInfo.ts
|
|
1202
|
+
function getUserInfo(context, eventName) {
|
|
1202
1203
|
return _async_to_generator(function() {
|
|
1203
|
-
var cpf, birthDate, phone, firstName, lastName, email, email_optin, document2, hashedDocument,
|
|
1204
|
+
var _PROD_DOMAINS_, PROD_DOMAINS, domain, _res_customer_document, _res_customer, api, response, _context_manuallyInfo, _context_manuallyInfo1, cpf, birthDate, phone, firstName, lastName, email, email_optin, document3, hashedDocument2, res, document2, hashedDocument, _, _context_manuallyInfo2, _context_manuallyInfo3, cpf1, birthDate1, phone1, firstName1, lastName1, email1, email_optin1, document21, hashedDocument1;
|
|
1204
1205
|
return _ts_generator(this, function(_state) {
|
|
1205
1206
|
switch(_state.label){
|
|
1206
1207
|
case 0:
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1208
|
+
PROD_DOMAINS = {
|
|
1209
|
+
"animale": {
|
|
1210
|
+
"store": "https://www.animale.com.br",
|
|
1211
|
+
"checkout": "https://secure.animale.com.br"
|
|
1212
|
+
},
|
|
1213
|
+
"farm": {
|
|
1214
|
+
"store": "https://lojafarm.myvtex.com"
|
|
1215
|
+
},
|
|
1216
|
+
"mariafilo": {
|
|
1217
|
+
"store": "https://mariafilo.myvtex.com",
|
|
1218
|
+
"checkout": "https://secure.mariafilo.com.br"
|
|
1219
|
+
},
|
|
1220
|
+
"lojacrisbarros": {
|
|
1221
|
+
"store": "https://lojacrisbarros.myvtex.com",
|
|
1222
|
+
"checkout": "https://secure.crisbarros.com.br"
|
|
1223
|
+
},
|
|
1224
|
+
"lojaoffpremium": {
|
|
1225
|
+
"store": "https://lojaoffpremium.myvtex.com",
|
|
1226
|
+
"checkout": "https://secure.lojaoffpremium.com.br"
|
|
1226
1227
|
}
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1228
|
+
};
|
|
1229
|
+
domain = (_PROD_DOMAINS_ = PROD_DOMAINS[context.account || "https://www.animale.com.br"]) === null || _PROD_DOMAINS_ === void 0 ? void 0 : _PROD_DOMAINS_[context.platform || "store"];
|
|
1230
|
+
if (!domain) return [
|
|
1229
1231
|
2,
|
|
1230
1232
|
{
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
lastName: lastName,
|
|
1237
|
-
birthDate: formattedBirthDate,
|
|
1238
|
-
firstName: firstName,
|
|
1239
|
-
homePhone: phone,
|
|
1240
|
-
cpf: hashedDocument
|
|
1241
|
-
}, email_optin && {
|
|
1242
|
-
email_optin: email_optin
|
|
1243
|
-
})
|
|
1233
|
+
customer: {
|
|
1234
|
+
email: context.userEmail,
|
|
1235
|
+
id: context === null || context === void 0 ? void 0 : context.userId
|
|
1236
|
+
},
|
|
1237
|
+
address: null
|
|
1244
1238
|
}
|
|
1245
1239
|
];
|
|
1246
|
-
}
|
|
1247
|
-
});
|
|
1248
|
-
})();
|
|
1249
|
-
};
|
|
1250
|
-
var getFallbackUserInfo = function getFallbackUserInfo(userEmail, userId) {
|
|
1251
|
-
return {
|
|
1252
|
-
customer: {
|
|
1253
|
-
email: userEmail,
|
|
1254
|
-
id: userId
|
|
1255
|
-
},
|
|
1256
|
-
address: null
|
|
1257
|
-
};
|
|
1258
|
-
};
|
|
1259
|
-
var getUserInfo = function getUserInfo(context, eventName) {
|
|
1260
|
-
return _async_to_generator(function() {
|
|
1261
|
-
var _PROD_DOMAINS_, domain, api, response, _res_customer_document, _res_customer, res, document2, hashedDocument, manuallyInfoResult, _, manuallyInfoResult1;
|
|
1262
|
-
return _ts_generator(this, function(_state) {
|
|
1263
|
-
switch(_state.label){
|
|
1264
|
-
case 0:
|
|
1265
|
-
domain = (_PROD_DOMAINS_ = PROD_DOMAINS[(context === null || context === void 0 ? void 0 : context.account) || "https://www.animale.com.br"]) === null || _PROD_DOMAINS_ === void 0 ? void 0 : _PROD_DOMAINS_[(context === null || context === void 0 ? void 0 : context.platform) || "store"];
|
|
1266
|
-
if (!domain) return [
|
|
1267
|
-
2,
|
|
1268
|
-
getFallbackUserInfo(context.userEmail, context === null || context === void 0 ? void 0 : context.userId)
|
|
1269
|
-
];
|
|
1270
1240
|
_state.label = 1;
|
|
1271
1241
|
case 1:
|
|
1272
1242
|
_state.trys.push([
|
|
1273
1243
|
1,
|
|
1274
|
-
|
|
1244
|
+
8,
|
|
1275
1245
|
,
|
|
1276
|
-
|
|
1246
|
+
11
|
|
1277
1247
|
]);
|
|
1278
1248
|
api = "".concat(domain, "/_v/user-info");
|
|
1279
1249
|
return [
|
|
@@ -1287,22 +1257,63 @@ var AzzasTracker = function() {
|
|
|
1287
1257
|
];
|
|
1288
1258
|
case 2:
|
|
1289
1259
|
response = _state.sent();
|
|
1290
|
-
if (!(response.status
|
|
1260
|
+
if (!(response.status !== 200)) return [
|
|
1291
1261
|
3,
|
|
1292
1262
|
5
|
|
1293
1263
|
];
|
|
1264
|
+
if (!((context === null || context === void 0 ? void 0 : context.manuallyInfo) && ((_context_manuallyInfo = context.manuallyInfo) === null || _context_manuallyInfo === void 0 ? void 0 : _context_manuallyInfo.cpf))) return [
|
|
1265
|
+
3,
|
|
1266
|
+
4
|
|
1267
|
+
];
|
|
1268
|
+
_context_manuallyInfo1 = context.manuallyInfo, cpf = _context_manuallyInfo1.cpf, birthDate = _context_manuallyInfo1.birthDate, phone = _context_manuallyInfo1.phone, firstName = _context_manuallyInfo1.firstName, lastName = _context_manuallyInfo1.lastName, email = _context_manuallyInfo1.email, email_optin = _context_manuallyInfo1.email_optin;
|
|
1269
|
+
document3 = cpf === null || cpf === void 0 ? void 0 : cpf.replace(/\D/g, "");
|
|
1294
1270
|
return [
|
|
1295
1271
|
4,
|
|
1296
|
-
|
|
1272
|
+
documentToHash(document3)
|
|
1297
1273
|
];
|
|
1298
1274
|
case 3:
|
|
1275
|
+
hashedDocument2 = _state.sent();
|
|
1276
|
+
return [
|
|
1277
|
+
2,
|
|
1278
|
+
{
|
|
1279
|
+
address: null,
|
|
1280
|
+
customer: {
|
|
1281
|
+
email: email,
|
|
1282
|
+
phone: phone,
|
|
1283
|
+
document: document3,
|
|
1284
|
+
lastName: lastName,
|
|
1285
|
+
birthDate: birthDate,
|
|
1286
|
+
firstName: firstName,
|
|
1287
|
+
email_optin: email_optin,
|
|
1288
|
+
homePhone: phone,
|
|
1289
|
+
cpf: hashedDocument2
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
];
|
|
1293
|
+
case 4:
|
|
1294
|
+
return [
|
|
1295
|
+
2,
|
|
1296
|
+
{
|
|
1297
|
+
customer: {
|
|
1298
|
+
email: context.userEmail,
|
|
1299
|
+
id: context === null || context === void 0 ? void 0 : context.userId
|
|
1300
|
+
},
|
|
1301
|
+
address: null
|
|
1302
|
+
}
|
|
1303
|
+
];
|
|
1304
|
+
case 5:
|
|
1305
|
+
return [
|
|
1306
|
+
4,
|
|
1307
|
+
response.json()
|
|
1308
|
+
];
|
|
1309
|
+
case 6:
|
|
1299
1310
|
res = _state.sent();
|
|
1300
1311
|
document2 = res === null || res === void 0 ? void 0 : (_res_customer = res.customer) === null || _res_customer === void 0 ? void 0 : (_res_customer_document = _res_customer.document) === null || _res_customer_document === void 0 ? void 0 : _res_customer_document.replace(/\D/g, "");
|
|
1301
1312
|
return [
|
|
1302
1313
|
4,
|
|
1303
1314
|
documentToHash(document2)
|
|
1304
1315
|
];
|
|
1305
|
-
case
|
|
1316
|
+
case 7:
|
|
1306
1317
|
hashedDocument = _state.sent();
|
|
1307
1318
|
return [
|
|
1308
1319
|
2,
|
|
@@ -1313,42 +1324,49 @@ var AzzasTracker = function() {
|
|
|
1313
1324
|
})
|
|
1314
1325
|
})
|
|
1315
1326
|
];
|
|
1316
|
-
case
|
|
1327
|
+
case 8:
|
|
1328
|
+
_ = _state.sent();
|
|
1329
|
+
if (!((context === null || context === void 0 ? void 0 : context.manuallyInfo) && ((_context_manuallyInfo2 = context.manuallyInfo) === null || _context_manuallyInfo2 === void 0 ? void 0 : _context_manuallyInfo2.cpf))) return [
|
|
1330
|
+
3,
|
|
1331
|
+
10
|
|
1332
|
+
];
|
|
1333
|
+
_context_manuallyInfo3 = context.manuallyInfo, cpf1 = _context_manuallyInfo3.cpf, birthDate1 = _context_manuallyInfo3.birthDate, phone1 = _context_manuallyInfo3.phone, firstName1 = _context_manuallyInfo3.firstName, lastName1 = _context_manuallyInfo3.lastName, email1 = _context_manuallyInfo3.email, email_optin1 = _context_manuallyInfo3.email_optin;
|
|
1334
|
+
document21 = cpf1 === null || cpf1 === void 0 ? void 0 : cpf1.replace(/\D/g, "");
|
|
1317
1335
|
return [
|
|
1318
1336
|
4,
|
|
1319
|
-
|
|
1337
|
+
documentToHash(document21)
|
|
1320
1338
|
];
|
|
1321
|
-
case
|
|
1322
|
-
|
|
1323
|
-
if (manuallyInfoResult) {
|
|
1324
|
-
return [
|
|
1325
|
-
2,
|
|
1326
|
-
manuallyInfoResult
|
|
1327
|
-
];
|
|
1328
|
-
}
|
|
1339
|
+
case 9:
|
|
1340
|
+
hashedDocument1 = _state.sent();
|
|
1329
1341
|
return [
|
|
1330
1342
|
2,
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1343
|
+
{
|
|
1344
|
+
address: null,
|
|
1345
|
+
customer: {
|
|
1346
|
+
email: email1,
|
|
1347
|
+
phone: phone1,
|
|
1348
|
+
document: document21,
|
|
1349
|
+
lastName: lastName1,
|
|
1350
|
+
birthDate: birthDate1,
|
|
1351
|
+
firstName: firstName1,
|
|
1352
|
+
email_optin: email_optin1,
|
|
1353
|
+
homePhone: phone1,
|
|
1354
|
+
cpf: hashedDocument1
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1338
1357
|
];
|
|
1339
|
-
case
|
|
1340
|
-
manuallyInfoResult1 = _state.sent();
|
|
1341
|
-
if (manuallyInfoResult1) {
|
|
1342
|
-
return [
|
|
1343
|
-
2,
|
|
1344
|
-
manuallyInfoResult1
|
|
1345
|
-
];
|
|
1346
|
-
}
|
|
1358
|
+
case 10:
|
|
1347
1359
|
return [
|
|
1348
1360
|
2,
|
|
1349
|
-
|
|
1361
|
+
{
|
|
1362
|
+
customer: {
|
|
1363
|
+
email: context.userEmail,
|
|
1364
|
+
id: context === null || context === void 0 ? void 0 : context.userId
|
|
1365
|
+
},
|
|
1366
|
+
address: null
|
|
1367
|
+
}
|
|
1350
1368
|
];
|
|
1351
|
-
case
|
|
1369
|
+
case 11:
|
|
1352
1370
|
return [
|
|
1353
1371
|
2
|
|
1354
1372
|
];
|
|
@@ -1769,6 +1787,9 @@ var AzzasTracker = function() {
|
|
|
1769
1787
|
hasEcommerce: false,
|
|
1770
1788
|
requiredParams: [
|
|
1771
1789
|
"region"
|
|
1790
|
+
],
|
|
1791
|
+
destinations: [
|
|
1792
|
+
"DataLayer"
|
|
1772
1793
|
]
|
|
1773
1794
|
},
|
|
1774
1795
|
ADD_PERSONAL_INFO: {
|
|
@@ -2021,28 +2042,6 @@ var AzzasTracker = function() {
|
|
|
2021
2042
|
var STORAGE_VIEWED = "last_viewed_item";
|
|
2022
2043
|
var CART_LIST_HISTORY_KEY = "cart_list_history";
|
|
2023
2044
|
var DAY_IN_MS = 24 * 60 * 60 * 1e3;
|
|
2024
|
-
// src/params/userInfo.ts
|
|
2025
|
-
var PROD_DOMAINS = {
|
|
2026
|
-
"animale": {
|
|
2027
|
-
"store": "https://www.animale.com.br",
|
|
2028
|
-
"checkout": "https://secure.animale.com.br"
|
|
2029
|
-
},
|
|
2030
|
-
"farm": {
|
|
2031
|
-
"store": "https://lojafarm.myvtex.com"
|
|
2032
|
-
},
|
|
2033
|
-
"mariafilo": {
|
|
2034
|
-
"store": "https://mariafilo.myvtex.com",
|
|
2035
|
-
"checkout": "https://secure.mariafilo.com.br"
|
|
2036
|
-
},
|
|
2037
|
-
"lojacrisbarros": {
|
|
2038
|
-
"store": "https://lojacrisbarros.myvtex.com",
|
|
2039
|
-
"checkout": "https://secure.crisbarros.com.br"
|
|
2040
|
-
},
|
|
2041
|
-
"lojaoffpremium": {
|
|
2042
|
-
"store": "https://lojaoffpremium.myvtex.com",
|
|
2043
|
-
"checkout": "https://secure.lojaoffpremium.com.br"
|
|
2044
|
-
}
|
|
2045
|
-
};
|
|
2046
2045
|
// src/params/index.ts
|
|
2047
2046
|
var paramGetters = {
|
|
2048
2047
|
brand: getBrand,
|
|
@@ -2050,6 +2049,7 @@ var AzzasTracker = function() {
|
|
|
2050
2049
|
payment_type: getPaymentType,
|
|
2051
2050
|
user_info: getUserInfo,
|
|
2052
2051
|
content_type: function(context, eventName) {
|
|
2052
|
+
if (context === null || context === void 0 ? void 0 : context.content_type) return context.content_type;
|
|
2053
2053
|
return "regiao".concat(":" + context.category).concat(context.subcategory ? ":" + context.subcategory : "").concat(":" + context.componentName) || null;
|
|
2054
2054
|
},
|
|
2055
2055
|
region: function(context, eventName) {
|