ag-awsauth 0.0.46 → 0.0.47

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.
package/dist/config.d.ts CHANGED
@@ -10,3 +10,4 @@ export declare const validateConfig: () => boolean;
10
10
  export declare const setConfig: () => void;
11
11
  export declare const runConfig: () => void;
12
12
  export declare const timeoutMs = 30000;
13
+ export declare const timeoutShortMs = 3000;
package/dist/config.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.timeoutMs = exports.runConfig = exports.setConfig = exports.validateConfig = exports.targetRegion = exports.ssoStartUrl = exports.identityCenterRegion = exports.setBasePath = exports.basePath = exports.nativeStsDurationSeconds = exports.stsDurationSeconds = exports.logPath = void 0;
6
+ exports.timeoutShortMs = exports.timeoutMs = exports.runConfig = exports.setConfig = exports.validateConfig = exports.targetRegion = exports.ssoStartUrl = exports.identityCenterRegion = exports.setBasePath = exports.basePath = exports.nativeStsDurationSeconds = exports.stsDurationSeconds = exports.logPath = void 0;
7
7
  const envfile_1 = require("envfile");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
@@ -53,3 +53,4 @@ const runConfig = () => {
53
53
  };
54
54
  exports.runConfig = runConfig;
55
55
  exports.timeoutMs = 30000;
56
+ exports.timeoutShortMs = 3000;
@@ -96,7 +96,7 @@ function getMFA(p) {
96
96
  //
97
97
  try {
98
98
  const messageDiv = yield page.waitForSelector('.awsui-alert-message', {
99
- timeout: 2000, //can be short
99
+ timeout: config_1.timeoutShortMs,
100
100
  });
101
101
  const value = yield page.evaluate((el) => { var _a; return (_a = el === null || el === void 0 ? void 0 : el.textContent) !== null && _a !== void 0 ? _a : ''; }, messageDiv);
102
102
  if (value) {
@@ -126,7 +126,7 @@ function getMFA(p) {
126
126
  yield page.waitForNetworkIdle({ idleTime: 250 });
127
127
  (0, log_1.info)('waiting for potential error');
128
128
  const messageDiv = yield page.waitForSelector('.awsui-alert-message', {
129
- timeout: 2000, // can be short
129
+ timeout: config_1.timeoutShortMs,
130
130
  });
131
131
  const value = yield page.evaluate((el) => { var _a; return (_a = el === null || el === void 0 ? void 0 : el.textContent) !== null && _a !== void 0 ? _a : ''; }, messageDiv);
132
132
  if (value) {
@@ -146,17 +146,22 @@ function getMFA(p) {
146
146
  }
147
147
  } while (retry);
148
148
  //
149
- yield (0, sleep_1.sleep)(3000);
149
+ yield (0, sleep_1.sleep)(config_1.timeoutShortMs);
150
150
  yield page.waitForNetworkIdle({ idleTime: 250 });
151
151
  (0, log_1.info)('waiting for sign in button');
152
152
  yield page.waitForSelector('.awsui-signin-button', {
153
- timeout: 2000,
153
+ timeout: config_1.timeoutShortMs,
154
154
  });
155
155
  (0, log_1.info)('pressing sign in');
156
156
  yield page.$eval('.awsui-signin-button', (el) => el.click());
157
157
  (0, log_1.info)('waiting for completion');
158
158
  yield (0, sleep_1.sleep)(250);
159
- yield page.waitForNetworkIdle({ idleTime: 250 });
159
+ try {
160
+ yield page.waitForNetworkIdle({ idleTime: 250, timeout: config_1.timeoutShortMs });
161
+ }
162
+ catch (e) {
163
+ //
164
+ }
160
165
  (0, log_1.info)('waiting for success');
161
166
  yield page.waitForSelector('.awsui-icon-variant-success', {
162
167
  timeout: config_1.timeoutMs,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "andrei gec (andreigec@hotmail.com)",
6
6
  "license": "ISC",
7
7
  "private": false,
8
- "version": "0.0.46",
8
+ "version": "0.0.47",
9
9
  "preferGlobal": true,
10
10
  "scripts": {
11
11
  "format": "eslint --ext .ts,.tsx ./src --fix",