@auxcode/auxta 1.3.62 → 1.3.63
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.
|
@@ -113,6 +113,7 @@ class AuxGoogleAuth {
|
|
|
113
113
|
if (TOKEN) {
|
|
114
114
|
oAuth2Client.setCredentials(TOKEN);
|
|
115
115
|
this._oAuth2Client = oAuth2Client;
|
|
116
|
+
code_helper_1.default.log('Then', 'Getting the existing token', status_of_step_1.default.PASSED);
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
119
|
yield this.getNewTokenHeadless(oAuth2Client);
|
|
@@ -22,7 +22,9 @@ class EmailHelper {
|
|
|
22
22
|
verifyEmail(from_name, from_email, subject, body, link = false) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
try {
|
|
25
|
+
log_service_1.default.push('Then', `Logging in two google or getting the token`, AuxTA_1.StepStatus.PASSED);
|
|
25
26
|
yield AuxGoogleAuth_1.AuxGoogleAuth.setupHeadless();
|
|
27
|
+
log_service_1.default.push('Then', `Done logging in and waiting 35 seconds`, AuxTA_1.StepStatus.PASSED);
|
|
26
28
|
yield new Promise(r => setTimeout(r, 35000));
|
|
27
29
|
let timeoutCount = 12000;
|
|
28
30
|
while (timeoutCount <= 60000) {
|
|
@@ -30,6 +32,7 @@ class EmailHelper {
|
|
|
30
32
|
userId: "me",
|
|
31
33
|
maxResults: 20
|
|
32
34
|
});
|
|
35
|
+
log_service_1.default.push('Then', `Getting the last 20 emails`, AuxTA_1.StepStatus.PASSED);
|
|
33
36
|
const messagesIds = res.data.messages;
|
|
34
37
|
if (!messagesIds || messagesIds.length === 0) {
|
|
35
38
|
throw new Error('No messagesIds found.');
|
|
@@ -45,6 +48,7 @@ class EmailHelper {
|
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
yield Promise.all(runs);
|
|
51
|
+
log_service_1.default.push('Then', `Getting the full details of the emails`, AuxTA_1.StepStatus.PASSED);
|
|
48
52
|
for (const gmailResponse of runs) {
|
|
49
53
|
if (gmailResponse) {
|
|
50
54
|
if (gmailResponse.data.payload && gmailResponse.data.id && gmailResponse.data.threadId) {
|
|
@@ -79,6 +83,7 @@ class EmailHelper {
|
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
}
|
|
86
|
+
log_service_1.default.push('Then', `Failed two get the email with the given criteria and waiting 12 seconds`, AuxTA_1.StepStatus.PASSED);
|
|
82
87
|
yield new Promise(r => setTimeout(r, timeoutCount));
|
|
83
88
|
timeoutCount += 12000;
|
|
84
89
|
}
|