@auxcode/auxta 1.3.54 → 1.3.56

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.
@@ -202,7 +202,7 @@ class AuxGoogleAuth {
202
202
  yield (yield page.$$('button'))[2].click();
203
203
  }
204
204
  yield code_helper_1.default.timeout(3000);
205
- yield code_helper_1.default.waitForSelector('visible', '#app', config_1.config.timeout, page);
205
+ yield code_helper_1.default.waitForSelector('visible', 'body', config_1.config.timeout, page);
206
206
  const currentUrl = page.url();
207
207
  const code = currentUrl.substring(currentUrl.indexOf("code=") + 5, currentUrl.lastIndexOf("&"));
208
208
  code_helper_1.default.log('Then', 'I get the code form the url', status_of_step_1.default.PASSED);
@@ -26,19 +26,25 @@ class EmailHelper {
26
26
  while (timeoutCount <= 60000) {
27
27
  const res = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.list({
28
28
  userId: "me",
29
- maxResults: 10
29
+ maxResults: 20
30
30
  });
31
31
  const messagesIds = res.data.messages;
32
32
  if (!messagesIds || messagesIds.length === 0) {
33
33
  throw new Error('No messagesIds found.');
34
34
  }
35
+ const runs = [];
35
36
  for (const messageId of messagesIds) {
36
37
  if (messageId.id) {
37
- const gmailResponse = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.get({
38
+ runs.push(yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.get({
38
39
  userId: "me",
39
40
  id: messageId.id.toString(),
40
41
  format: 'FULL'
41
- });
42
+ }));
43
+ }
44
+ }
45
+ yield Promise.all(runs);
46
+ for (const gmailResponse of runs) {
47
+ if (gmailResponse) {
42
48
  if (gmailResponse.data.payload && gmailResponse.data.id && gmailResponse.data.threadId) {
43
49
  const message_sender = this.getHeader('from', gmailResponse);
44
50
  const message_subject = this.getHeader('subject', gmailResponse);
@@ -69,7 +75,6 @@ class EmailHelper {
69
75
  return { id: gmailResponse.data.id, threadId: gmailResponse.data.threadId, link: '' };
70
76
  }
71
77
  }
72
- break;
73
78
  }
74
79
  }
75
80
  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.54",
3
+ "version": "1.3.56",
4
4
  "description": "",
5
5
  "main": "./build/AuxTA.js",
6
6
  "types": "./build/AuxTA.d.ts",