@azzas/azzas-tracker-web 1.0.91 → 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 -19
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +38 -19
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +38 -19
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +88 -55
- package/package.json +1 -1
package/dist/mod.vtex.global.js
CHANGED
|
@@ -1201,38 +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
|
-
document: hashedDocument
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
];
|
|
1235
|
-
case 2:
|
|
1236
1208
|
PROD_DOMAINS = {
|
|
1237
1209
|
"animale": {
|
|
1238
1210
|
"store": "https://www.animale.com.br",
|
|
@@ -1265,13 +1237,13 @@ var AzzasTracker = function() {
|
|
|
1265
1237
|
address: null
|
|
1266
1238
|
}
|
|
1267
1239
|
];
|
|
1268
|
-
_state.label =
|
|
1269
|
-
case
|
|
1240
|
+
_state.label = 1;
|
|
1241
|
+
case 1:
|
|
1270
1242
|
_state.trys.push([
|
|
1271
|
-
|
|
1272
|
-
|
|
1243
|
+
1,
|
|
1244
|
+
8,
|
|
1273
1245
|
,
|
|
1274
|
-
|
|
1246
|
+
11
|
|
1275
1247
|
]);
|
|
1276
1248
|
api = "".concat(domain, "/_v/user-info");
|
|
1277
1249
|
return [
|
|
@@ -1283,44 +1255,105 @@ var AzzasTracker = function() {
|
|
|
1283
1255
|
})
|
|
1284
1256
|
})
|
|
1285
1257
|
];
|
|
1286
|
-
case
|
|
1258
|
+
case 2:
|
|
1287
1259
|
response = _state.sent();
|
|
1288
|
-
if (response.status !== 200)
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
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
|
|
1297
1289
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
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:
|
|
1300
1304
|
return [
|
|
1301
1305
|
4,
|
|
1302
1306
|
response.json()
|
|
1303
1307
|
];
|
|
1304
|
-
case
|
|
1308
|
+
case 6:
|
|
1305
1309
|
res = _state.sent();
|
|
1306
|
-
|
|
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, "");
|
|
1307
1311
|
return [
|
|
1308
1312
|
4,
|
|
1309
|
-
documentToHash(
|
|
1313
|
+
documentToHash(document2)
|
|
1310
1314
|
];
|
|
1311
|
-
case
|
|
1312
|
-
|
|
1315
|
+
case 7:
|
|
1316
|
+
hashedDocument = _state.sent();
|
|
1313
1317
|
return [
|
|
1314
1318
|
2,
|
|
1315
1319
|
_object_spread_props(_object_spread({}, res), {
|
|
1316
1320
|
customer: _object_spread_props(_object_spread({}, res.customer), {
|
|
1317
|
-
cpf:
|
|
1318
|
-
document:
|
|
1321
|
+
cpf: hashedDocument,
|
|
1322
|
+
document: document2
|
|
1319
1323
|
})
|
|
1320
1324
|
})
|
|
1321
1325
|
];
|
|
1322
|
-
case
|
|
1326
|
+
case 8:
|
|
1323
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:
|
|
1324
1357
|
return [
|
|
1325
1358
|
2,
|
|
1326
1359
|
{
|
|
@@ -1331,7 +1364,7 @@ var AzzasTracker = function() {
|
|
|
1331
1364
|
address: null
|
|
1332
1365
|
}
|
|
1333
1366
|
];
|
|
1334
|
-
case
|
|
1367
|
+
case 11:
|
|
1335
1368
|
return [
|
|
1336
1369
|
2
|
|
1337
1370
|
];
|