@auxcode/auxta 1.3.23-beta.2 → 1.3.23-beta.3
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.
|
@@ -39,13 +39,21 @@ class EmailHelper {
|
|
|
39
39
|
id: messageId.id.toString(),
|
|
40
40
|
format: 'FULL'
|
|
41
41
|
});
|
|
42
|
-
if (gmailResponse.data.payload) {
|
|
42
|
+
if (gmailResponse.data.payload && gmailResponse.data.id && gmailResponse.data.threadId) {
|
|
43
43
|
const message_sender = this.getHeader('from', gmailResponse.data.payload.headers);
|
|
44
44
|
const message_subject = this.getHeader('subject', gmailResponse.data.payload.headers);
|
|
45
45
|
const message_body = this.getBody(from_name, from_email, subject, gmailResponse);
|
|
46
46
|
if (message_sender.includes(from_email) && message_sender.includes(from_name.toLocaleLowerCase()) &&
|
|
47
47
|
message_subject.includes(subject.toLocaleLowerCase()) && message_body.includes(body.toLocaleLowerCase())) {
|
|
48
48
|
log_service_1.default.push('Then', `Email from: ${from_name} ${from_email} with subject: ${subject} and body: ${body} is found`, AuxTA_1.StepStatus.PASSED);
|
|
49
|
+
yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.modify({
|
|
50
|
+
userId: "me",
|
|
51
|
+
id: gmailResponse.data.id,
|
|
52
|
+
requestBody: {
|
|
53
|
+
'addLabelIds': [],
|
|
54
|
+
'removeLabelIds': ['UNREAD']
|
|
55
|
+
}
|
|
56
|
+
});
|
|
49
57
|
return { id: gmailResponse.data.id.toString(), threadId: gmailResponse.data.threadId.toString() };
|
|
50
58
|
}
|
|
51
59
|
}
|
|
@@ -33,13 +33,21 @@ export class EmailHelper {
|
|
|
33
33
|
id: messageId.id.toString(),
|
|
34
34
|
format: 'FULL'
|
|
35
35
|
});
|
|
36
|
-
if (gmailResponse.data.payload) {
|
|
36
|
+
if (gmailResponse.data.payload && gmailResponse.data.id && gmailResponse.data.threadId) {
|
|
37
37
|
const message_sender = this.getHeader('from', gmailResponse.data.payload.headers);
|
|
38
38
|
const message_subject = this.getHeader('subject', gmailResponse.data.payload.headers);
|
|
39
39
|
const message_body = this.getBody(from_name, from_email, subject, gmailResponse);
|
|
40
40
|
if (message_sender.includes(from_email) && message_sender.includes(from_name.toLocaleLowerCase()) &&
|
|
41
41
|
message_subject.includes(subject.toLocaleLowerCase()) && message_body.includes(body.toLocaleLowerCase())) {
|
|
42
42
|
log.push('Then', `Email from: ${from_name} ${from_email} with subject: ${subject} and body: ${body} is found`, StepStatus.PASSED);
|
|
43
|
+
yield AuxGoogleAuth.gmailClient.users.messages.modify({
|
|
44
|
+
userId: "me",
|
|
45
|
+
id: gmailResponse.data.id,
|
|
46
|
+
requestBody: {
|
|
47
|
+
'addLabelIds': [],
|
|
48
|
+
'removeLabelIds': ['UNREAD']
|
|
49
|
+
}
|
|
50
|
+
});
|
|
43
51
|
return { id: gmailResponse.data.id.toString(), threadId: gmailResponse.data.threadId.toString() };
|
|
44
52
|
}
|
|
45
53
|
}
|