@auxcode/auxta 1.3.55 → 1.3.57

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.
@@ -22,23 +22,30 @@ 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
  yield AuxGoogleAuth_1.AuxGoogleAuth.setupHeadless();
25
+ yield new Promise(r => setTimeout(r, 35000));
25
26
  let timeoutCount = 12000;
26
27
  while (timeoutCount <= 60000) {
27
28
  const res = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.list({
28
29
  userId: "me",
29
- maxResults: 10
30
+ maxResults: 20
30
31
  });
31
32
  const messagesIds = res.data.messages;
32
33
  if (!messagesIds || messagesIds.length === 0) {
33
34
  throw new Error('No messagesIds found.');
34
35
  }
36
+ const runs = [];
35
37
  for (const messageId of messagesIds) {
36
38
  if (messageId.id) {
37
- const gmailResponse = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.get({
39
+ runs.push(yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.get({
38
40
  userId: "me",
39
41
  id: messageId.id.toString(),
40
42
  format: 'FULL'
41
- });
43
+ }));
44
+ }
45
+ }
46
+ yield Promise.all(runs);
47
+ for (const gmailResponse of runs) {
48
+ if (gmailResponse) {
42
49
  if (gmailResponse.data.payload && gmailResponse.data.id && gmailResponse.data.threadId) {
43
50
  const message_sender = this.getHeader('from', gmailResponse);
44
51
  const message_subject = this.getHeader('subject', gmailResponse);
@@ -69,7 +76,6 @@ class EmailHelper {
69
76
  return { id: gmailResponse.data.id, threadId: gmailResponse.data.threadId, link: '' };
70
77
  }
71
78
  }
72
- break;
73
79
  }
74
80
  }
75
81
  yield new Promise(r => setTimeout(r, timeoutCount));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "1.3.55",
3
+ "version": "1.3.57",
4
4
  "description": "",
5
5
  "main": "./build/AuxTA.js",
6
6
  "types": "./build/AuxTA.d.ts",