@azzas/azzas-tracker-web 1.0.92 → 1.0.93
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 +38 -20
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +38 -20
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +38 -20
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +88 -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, document3, hashedDocument2, res, document2, hashedDocument, _, _context_manuallyInfo2, _context_manuallyInfo3, cpf1, birthDate1, phone1, firstName1, lastName1, email1, 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,105 @@ 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;
|
|
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
|
+
homePhone: phone,
|
|
1288
|
+
cpf: hashedDocument2
|
|
1298
1289
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1290
|
+
}
|
|
1291
|
+
];
|
|
1292
|
+
case 4:
|
|
1293
|
+
return [
|
|
1294
|
+
2,
|
|
1295
|
+
{
|
|
1296
|
+
customer: {
|
|
1297
|
+
email: context.userEmail,
|
|
1298
|
+
id: context === null || context === void 0 ? void 0 : context.userId
|
|
1299
|
+
},
|
|
1300
|
+
address: null
|
|
1301
|
+
}
|
|
1302
|
+
];
|
|
1303
|
+
case 5:
|
|
1301
1304
|
return [
|
|
1302
1305
|
4,
|
|
1303
1306
|
response.json()
|
|
1304
1307
|
];
|
|
1305
|
-
case
|
|
1308
|
+
case 6:
|
|
1306
1309
|
res = _state.sent();
|
|
1307
|
-
|
|
1310
|
+
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
1311
|
return [
|
|
1309
1312
|
4,
|
|
1310
|
-
documentToHash(
|
|
1313
|
+
documentToHash(document2)
|
|
1311
1314
|
];
|
|
1312
|
-
case
|
|
1313
|
-
|
|
1315
|
+
case 7:
|
|
1316
|
+
hashedDocument = _state.sent();
|
|
1314
1317
|
return [
|
|
1315
1318
|
2,
|
|
1316
1319
|
_object_spread_props(_object_spread({}, res), {
|
|
1317
1320
|
customer: _object_spread_props(_object_spread({}, res.customer), {
|
|
1318
|
-
cpf:
|
|
1319
|
-
document:
|
|
1321
|
+
cpf: hashedDocument,
|
|
1322
|
+
document: document2
|
|
1320
1323
|
})
|
|
1321
1324
|
})
|
|
1322
1325
|
];
|
|
1323
|
-
case
|
|
1326
|
+
case 8:
|
|
1324
1327
|
_ = _state.sent();
|
|
1328
|
+
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 [
|
|
1329
|
+
3,
|
|
1330
|
+
10
|
|
1331
|
+
];
|
|
1332
|
+
_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;
|
|
1333
|
+
document21 = cpf1 === null || cpf1 === void 0 ? void 0 : cpf1.replace(/\D/g, "");
|
|
1334
|
+
return [
|
|
1335
|
+
4,
|
|
1336
|
+
documentToHash(document21)
|
|
1337
|
+
];
|
|
1338
|
+
case 9:
|
|
1339
|
+
hashedDocument1 = _state.sent();
|
|
1340
|
+
return [
|
|
1341
|
+
2,
|
|
1342
|
+
{
|
|
1343
|
+
address: null,
|
|
1344
|
+
customer: {
|
|
1345
|
+
email: email1,
|
|
1346
|
+
phone: phone1,
|
|
1347
|
+
document: document21,
|
|
1348
|
+
lastName: lastName1,
|
|
1349
|
+
birthDate: birthDate1,
|
|
1350
|
+
firstName: firstName1,
|
|
1351
|
+
homePhone: phone1,
|
|
1352
|
+
cpf: hashedDocument1
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
];
|
|
1356
|
+
case 10:
|
|
1325
1357
|
return [
|
|
1326
1358
|
2,
|
|
1327
1359
|
{
|
|
@@ -1332,7 +1364,7 @@ var AzzasTracker = function() {
|
|
|
1332
1364
|
address: null
|
|
1333
1365
|
}
|
|
1334
1366
|
];
|
|
1335
|
-
case
|
|
1367
|
+
case 11:
|
|
1336
1368
|
return [
|
|
1337
1369
|
2
|
|
1338
1370
|
];
|