@auxcode/auxta 1.3.51-beta.13 → 1.3.51-beta.14

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.
@@ -14,10 +14,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.AuxGoogleAuth = void 0;
16
16
  const config_1 = require("../../auxta/configs/config");
17
- const fs = require('fs');
18
- const readline = require('readline');
19
17
  const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
20
18
  const code_helper_1 = __importDefault(require("../helpers/code.helper"));
19
+ const status_of_step_1 = __importDefault(require("../../auxta/enums/status-of.step"));
20
+ const fs = require('fs');
21
+ const readline = require('readline');
21
22
  const { google } = require("googleapis");
22
23
  const SCOPES = [
23
24
  'https://www.googleapis.com/auth/gmail.addons.current.action.compose',
@@ -133,11 +134,13 @@ class AuxGoogleAuth {
133
134
  scope: SCOPES,
134
135
  });
135
136
  const code = yield this.LogIn(authUrl);
137
+ code_helper_1.default.log('tes', code, status_of_step_1.default.PASSED);
136
138
  oAuth2Client.getToken(code, (err, token) => {
137
139
  if (err)
138
140
  return console.error('Error retrieving access token', err);
139
141
  oAuth2Client.setCredentials(token);
140
- TOKEN = token;
142
+ code_helper_1.default.log('tes', token, status_of_step_1.default.PASSED);
143
+ TOKEN = token.toString();
141
144
  this._oAuth2Client = oAuth2Client;
142
145
  });
143
146
  });
@@ -148,7 +151,6 @@ class AuxGoogleAuth {
148
151
  const context = yield puppeteer_1.default.defaultPage.browser().createIncognitoBrowserContext();
149
152
  const page = yield context.newPage();
150
153
  yield page.goto(authUrl);
151
- yield page.waitForNetworkIdle();
152
154
  yield code_helper_1.default.waitForSelector('visible', '#identifierId', config_1.config.timeout, page);
153
155
  yield ((_a = (yield page.$('#identifierId'))) === null || _a === void 0 ? void 0 : _a.type(EMAIL));
154
156
  yield (yield page.$$('button'))[3].click();
@@ -160,14 +162,14 @@ class AuxGoogleAuth {
160
162
  yield code_helper_1.default.waitForSelector('visible', '#headingText', config_1.config.timeout, page);
161
163
  yield (yield page.$$('button'))[2].click();
162
164
  yield code_helper_1.default.timeout(3000);
163
- const checkbox = yield page.$('input[type="checkbox"]');
164
- if (checkbox) {
165
+ const checkbox = yield page.$$('input[type="checkbox"]');
166
+ if (checkbox.length > 0) {
165
167
  yield code_helper_1.default.waitForSelector('visible', 'input[type="checkbox"]', config_1.config.timeout, page);
166
- yield checkbox.click();
168
+ yield checkbox[0].click();
167
169
  yield (yield page.$$('button'))[2].click();
168
170
  }
169
171
  else {
170
- yield (yield page.$$('button'))[3].click();
172
+ yield (yield page.$$('button'))[2].click();
171
173
  }
172
174
  yield code_helper_1.default.timeout(3000);
173
175
  const currentUrl = page.url();
@@ -8,10 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { config } from "../../auxta/configs/config";
11
- const fs = require('fs');
12
- const readline = require('readline');
13
11
  import puppeteer from "../../puppeteer/puppeteer";
14
12
  import FunctionHelper from "../helpers/code.helper";
13
+ import StatusOfStep from "../../auxta/enums/status-of.step";
14
+ const fs = require('fs');
15
+ const readline = require('readline');
15
16
  const { google } = require("googleapis");
16
17
  const SCOPES = [
17
18
  'https://www.googleapis.com/auth/gmail.addons.current.action.compose',
@@ -127,11 +128,13 @@ export class AuxGoogleAuth {
127
128
  scope: SCOPES,
128
129
  });
129
130
  const code = yield this.LogIn(authUrl);
131
+ FunctionHelper.log('tes', code, StatusOfStep.PASSED);
130
132
  oAuth2Client.getToken(code, (err, token) => {
131
133
  if (err)
132
134
  return console.error('Error retrieving access token', err);
133
135
  oAuth2Client.setCredentials(token);
134
- TOKEN = token;
136
+ FunctionHelper.log('tes', token, StatusOfStep.PASSED);
137
+ TOKEN = token.toString();
135
138
  this._oAuth2Client = oAuth2Client;
136
139
  });
137
140
  });
@@ -142,7 +145,6 @@ export class AuxGoogleAuth {
142
145
  const context = yield puppeteer.defaultPage.browser().createIncognitoBrowserContext();
143
146
  const page = yield context.newPage();
144
147
  yield page.goto(authUrl);
145
- yield page.waitForNetworkIdle();
146
148
  yield FunctionHelper.waitForSelector('visible', '#identifierId', config.timeout, page);
147
149
  yield ((_a = (yield page.$('#identifierId'))) === null || _a === void 0 ? void 0 : _a.type(EMAIL));
148
150
  yield (yield page.$$('button'))[3].click();
@@ -154,14 +156,14 @@ export class AuxGoogleAuth {
154
156
  yield FunctionHelper.waitForSelector('visible', '#headingText', config.timeout, page);
155
157
  yield (yield page.$$('button'))[2].click();
156
158
  yield FunctionHelper.timeout(3000);
157
- const checkbox = yield page.$('input[type="checkbox"]');
158
- if (checkbox) {
159
+ const checkbox = yield page.$$('input[type="checkbox"]');
160
+ if (checkbox.length > 0) {
159
161
  yield FunctionHelper.waitForSelector('visible', 'input[type="checkbox"]', config.timeout, page);
160
- yield checkbox.click();
162
+ yield checkbox[0].click();
161
163
  yield (yield page.$$('button'))[2].click();
162
164
  }
163
165
  else {
164
- yield (yield page.$$('button'))[3].click();
166
+ yield (yield page.$$('button'))[2].click();
165
167
  }
166
168
  yield FunctionHelper.timeout(3000);
167
169
  const currentUrl = page.url();