@azzas/azzas-tracker-web 1.0.92 → 1.0.94
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 +40 -20
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +40 -20
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +40 -20
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +90 -56
- package/package.json +1 -1
package/dist/mod.vtex.global.js
CHANGED
|
@@ -1201,39 +1201,10 @@ var AzzasTracker = function() {
|
|
|
1201
1201
|
var getUserInfo = // src/params/userInfo.ts
|
|
1202
1202
|
function getUserInfo(context, eventName) {
|
|
1203
1203
|
return _async_to_generator(function() {
|
|
1204
|
-
var
|
|
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;
|
|
1205
1205
|
return _ts_generator(this, function(_state) {
|
|
1206
1206
|
switch(_state.label){
|
|
1207
1207
|
case 0:
|
|
1208
|
-
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 [
|
|
1209
|
-
3,
|
|
1210
|
-
2
|
|
1211
|
-
];
|
|
1212
|
-
_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;
|
|
1213
|
-
document2 = cpf === null || cpf === void 0 ? void 0 : cpf.replace(/\D/g, "");
|
|
1214
|
-
return [
|
|
1215
|
-
4,
|
|
1216
|
-
documentToHash(document2)
|
|
1217
|
-
];
|
|
1218
|
-
case 1:
|
|
1219
|
-
hashedDocument = _state.sent();
|
|
1220
|
-
return [
|
|
1221
|
-
2,
|
|
1222
|
-
{
|
|
1223
|
-
address: null,
|
|
1224
|
-
customer: {
|
|
1225
|
-
email: email,
|
|
1226
|
-
phone: phone,
|
|
1227
|
-
lastName: lastName,
|
|
1228
|
-
birthDate: birthDate,
|
|
1229
|
-
firstName: firstName,
|
|
1230
|
-
homePhone: phone,
|
|
1231
|
-
cpf: hashedDocument,
|
|
1232
|
-
document: document2
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
];
|
|
1236
|
-
case 2:
|
|
1237
1208
|
PROD_DOMAINS = {
|
|
1238
1209
|
"animale": {
|
|
1239
1210
|
"store": "https://www.animale.com.br",
|
|
@@ -1266,13 +1237,13 @@ var AzzasTracker = function() {
|
|
|
1266
1237
|
address: null
|
|
1267
1238
|
}
|
|
1268
1239
|
];
|
|
1269
|
-
_state.label =
|
|
1270
|
-
case
|
|
1240
|
+
_state.label = 1;
|
|
1241
|
+
case 1:
|
|
1271
1242
|
_state.trys.push([
|
|
1272
|
-
|
|
1273
|
-
|
|
1243
|
+
1,
|
|
1244
|
+
8,
|
|
1274
1245
|
,
|
|
1275
|
-
|
|
1246
|
+
11
|
|
1276
1247
|
]);
|
|
1277
1248
|
api = "".concat(domain, "/_v/user-info");
|
|
1278
1249
|
return [
|
|
@@ -1284,44 +1255,107 @@ var AzzasTracker = function() {
|
|
|
1284
1255
|
})
|
|
1285
1256
|
})
|
|
1286
1257
|
];
|
|
1287
|
-
case
|
|
1258
|
+
case 2:
|
|
1288
1259
|
response = _state.sent();
|
|
1289
|
-
if (response.status !== 200)
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1260
|
+
if (!(response.status !== 200)) return [
|
|
1261
|
+
3,
|
|
1262
|
+
5
|
|
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, "");
|
|
1270
|
+
return [
|
|
1271
|
+
4,
|
|
1272
|
+
documentToHash(document3)
|
|
1273
|
+
];
|
|
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
|
|
1298
1290
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
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:
|
|
1301
1305
|
return [
|
|
1302
1306
|
4,
|
|
1303
1307
|
response.json()
|
|
1304
1308
|
];
|
|
1305
|
-
case
|
|
1309
|
+
case 6:
|
|
1306
1310
|
res = _state.sent();
|
|
1307
|
-
|
|
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, "");
|
|
1308
1312
|
return [
|
|
1309
1313
|
4,
|
|
1310
|
-
documentToHash(
|
|
1314
|
+
documentToHash(document2)
|
|
1311
1315
|
];
|
|
1312
|
-
case
|
|
1313
|
-
|
|
1316
|
+
case 7:
|
|
1317
|
+
hashedDocument = _state.sent();
|
|
1314
1318
|
return [
|
|
1315
1319
|
2,
|
|
1316
1320
|
_object_spread_props(_object_spread({}, res), {
|
|
1317
1321
|
customer: _object_spread_props(_object_spread({}, res.customer), {
|
|
1318
|
-
cpf:
|
|
1319
|
-
document:
|
|
1322
|
+
cpf: hashedDocument,
|
|
1323
|
+
document: document2
|
|
1320
1324
|
})
|
|
1321
1325
|
})
|
|
1322
1326
|
];
|
|
1323
|
-
case
|
|
1327
|
+
case 8:
|
|
1324
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, "");
|
|
1335
|
+
return [
|
|
1336
|
+
4,
|
|
1337
|
+
documentToHash(document21)
|
|
1338
|
+
];
|
|
1339
|
+
case 9:
|
|
1340
|
+
hashedDocument1 = _state.sent();
|
|
1341
|
+
return [
|
|
1342
|
+
2,
|
|
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
|
+
}
|
|
1357
|
+
];
|
|
1358
|
+
case 10:
|
|
1325
1359
|
return [
|
|
1326
1360
|
2,
|
|
1327
1361
|
{
|
|
@@ -1332,7 +1366,7 @@ var AzzasTracker = function() {
|
|
|
1332
1366
|
address: null
|
|
1333
1367
|
}
|
|
1334
1368
|
];
|
|
1335
|
-
case
|
|
1369
|
+
case 11:
|
|
1336
1370
|
return [
|
|
1337
1371
|
2
|
|
1338
1372
|
];
|