@auxcode/auxta 1.3.30 → 1.3.32-beta.0

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,6 +14,7 @@ declare class AuxTA extends FunctionHelper {
14
14
  organization: string;
15
15
  netlifyPath: string;
16
16
  digitalProduct: string;
17
+ bucket: string;
17
18
  token: string;
18
19
  screenWidth: number;
19
20
  screenHeight: number;
@@ -82,7 +82,7 @@ class AuxTA extends code_helper_1.FunctionHelper {
82
82
  catch (e) {
83
83
  console.log("Missing field in auxta.json:", e);
84
84
  }
85
- this.uploadModel = new upload_model_1.UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment);
85
+ this.uploadModel = new upload_model_1.UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment, jsonConfig.bucket);
86
86
  }
87
87
  catch (e) {
88
88
  console.log("Missing or corrupted config: auxta.json. Searching in location:", file);
@@ -91,7 +91,7 @@ class AuxTA extends code_helper_1.FunctionHelper {
91
91
  }
92
92
  }
93
93
  else {
94
- this.uploadModel = new upload_model_1.UploadModel('', '', '', '');
94
+ this.uploadModel = new upload_model_1.UploadModel('', '', '', '', '');
95
95
  }
96
96
  }
97
97
  run(event, overrideConfig) {
@@ -118,6 +118,8 @@ class AuxTA extends code_helper_1.FunctionHelper {
118
118
  this.uploadModel.environment = overrideConfig.environment;
119
119
  if (overrideConfig.baseURL)
120
120
  this.uploadModel.baseUrl = overrideConfig.baseURL;
121
+ if (overrideConfig.bucket)
122
+ this.uploadModel.bucket = overrideConfig.bucket;
121
123
  this.config = (0, config_1.setupOverrideConfig)(overrideConfig);
122
124
  }
123
125
  }
@@ -5,6 +5,7 @@ export declare function setupConfig(jsonConfig: any): {
5
5
  organization: string;
6
6
  netlifyPath: string;
7
7
  digitalProduct: string;
8
+ bucket: string;
8
9
  token: string;
9
10
  screenWidth: number;
10
11
  screenHeight: number;
@@ -23,6 +24,7 @@ export declare function setupOverrideConfig(overrideConfig: any): {
23
24
  organization: string;
24
25
  netlifyPath: string;
25
26
  digitalProduct: string;
27
+ bucket: string;
26
28
  token: string;
27
29
  screenWidth: number;
28
30
  screenHeight: number;
@@ -41,6 +43,7 @@ export declare let config: {
41
43
  organization: string;
42
44
  netlifyPath: string;
43
45
  digitalProduct: string;
46
+ bucket: string;
44
47
  token: string;
45
48
  screenWidth: number;
46
49
  screenHeight: number;
@@ -8,6 +8,9 @@ function setupConfig(jsonConfig) {
8
8
  if (!jsonConfig.digitalProduct)
9
9
  throw new Error("digitalProduct");
10
10
  exports.config.digitalProduct = jsonConfig.digitalProduct;
11
+ if (!jsonConfig.testsURL)
12
+ throw new Error("testsURL");
13
+ exports.config.bucket = jsonConfig.bucket;
11
14
  if (!jsonConfig.testsURL)
12
15
  throw new Error("testsURL");
13
16
  exports.config.netlifyPath = (process.env.ENVIRONMENT == 'LOCAL') ? 'http://localhost:9999/' : jsonConfig.testsURL;
@@ -46,12 +49,13 @@ function setupOverrideConfig(overrideConfig) {
46
49
  }
47
50
  exports.setupOverrideConfig = setupOverrideConfig;
48
51
  exports.config = {
49
- auxtaURL: "https://auxta.live/.netlify/functions/",
52
+ auxtaURL: "https://acceptance--auxta.netlify.app/.netlify/functions/",
50
53
  baseURL: "",
51
54
  siteURL: "",
52
55
  organization: "",
53
56
  netlifyPath: "",
54
57
  digitalProduct: "",
58
+ bucket: "",
55
59
  token: "",
56
60
  screenWidth: 1920,
57
61
  screenHeight: 1080,
@@ -4,15 +4,18 @@ export declare class UploadModel {
4
4
  private _digitalProduct;
5
5
  private _baseUrl;
6
6
  private readonly _organization;
7
+ private _bucket;
7
8
  private _environment;
8
9
  private _currentSuite;
9
10
  private _retries;
10
11
  private _featureName;
11
12
  private _scenarioName;
12
- constructor(org: string, baseUrl: string, digitalProduct: string, environment: string);
13
+ constructor(org: string, baseUrl: string, digitalProduct: string, environment: string, bucket: string);
13
14
  set currentSuite(value: string);
14
15
  set retries(value: number);
15
16
  get currentSuite(): string;
17
+ get bucket(): string;
18
+ set bucket(value: string);
16
19
  get retries(): number;
17
20
  get reportId(): string;
18
21
  set reportId(value: string);
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UploadModel = void 0;
4
4
  class UploadModel {
5
- constructor(org, baseUrl, digitalProduct, environment) {
5
+ constructor(org, baseUrl, digitalProduct, environment, bucket) {
6
6
  this._reportId = '';
7
7
  this._nextSuites = [];
8
8
  this._currentSuite = '';
9
9
  this._retries = 0;
10
10
  this._organization = org;
11
+ this._bucket = bucket;
11
12
  this._digitalProduct = digitalProduct;
12
13
  this._environment = environment;
13
14
  this._baseUrl = baseUrl;
@@ -23,6 +24,12 @@ class UploadModel {
23
24
  get currentSuite() {
24
25
  return this._currentSuite;
25
26
  }
27
+ get bucket() {
28
+ return this._bucket;
29
+ }
30
+ set bucket(value) {
31
+ this._bucket = value;
32
+ }
26
33
  get retries() {
27
34
  return this._retries;
28
35
  }
@@ -43,7 +43,8 @@ function createEmptyReport(body) {
43
43
  const token = yield auth();
44
44
  return (yield axios_1.default.post(config_1.config.auxtaURL + "create-empty-report", {
45
45
  environment: body.environment,
46
- digitalProductName: body.digitalProduct,
46
+ digitalProductToken: body.digitalProduct,
47
+ bucket: body.bucket,
47
48
  start: new Date(),
48
49
  url: body.baseUrl
49
50
  }, headers(token))).data.reportId;
@@ -141,7 +142,7 @@ function postNotifications(body) {
141
142
  let token = yield auth();
142
143
  yield axios_1.default.post(`${config_1.config.auxtaURL}post-notification-after-run-background`, {
143
144
  environmentName: body.environment,
144
- digitalProductName: body.digitalProduct,
145
+ digitalProductToken: body.digitalProduct,
145
146
  organizationName: body.organization,
146
147
  reportId: body.reportId,
147
148
  }, headers(token));
@@ -153,7 +154,7 @@ function postNotificationsOnFail(body) {
153
154
  let token = yield auth();
154
155
  yield axios_1.default.post(`${config_1.config.auxtaURL}post-notifications-after-case-fail-background`, {
155
156
  environmentName: body.environment,
156
- digitalProductName: body.digitalProduct,
157
+ digitalProductToken: body.digitalProduct,
157
158
  organizationName: body.organization,
158
159
  reportId: body.reportId,
159
160
  featureName: body.featureName,
@@ -22,16 +22,16 @@ 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.setup();
25
+ const res = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.list({
26
+ userId: "me",
27
+ maxResults: 3
28
+ });
29
+ const messagesIds = res.data.messages;
30
+ if (!messagesIds || messagesIds.length === 0) {
31
+ throw new Error('No messagesIds found.');
32
+ }
25
33
  let timeoutCount = 12000;
26
34
  while (timeoutCount <= 60000) {
27
- const res = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.list({
28
- userId: "me",
29
- maxResults: 1
30
- });
31
- const messagesIds = res.data.messages;
32
- if (!messagesIds || messagesIds.length === 0) {
33
- throw new Error('No messagesIds found.');
34
- }
35
35
  for (const messageId of messagesIds) {
36
36
  if (messageId.id) {
37
37
  const gmailResponse = yield AuxGoogleAuth_1.AuxGoogleAuth.gmailClient.users.messages.get({
@@ -14,6 +14,7 @@ declare class AuxTA extends FunctionHelper {
14
14
  organization: string;
15
15
  netlifyPath: string;
16
16
  digitalProduct: string;
17
+ bucket: string;
17
18
  token: string;
18
19
  screenWidth: number;
19
20
  screenHeight: number;
@@ -53,7 +53,7 @@ class AuxTA extends FunctionHelper {
53
53
  catch (e) {
54
54
  console.log("Missing field in auxta.json:", e);
55
55
  }
56
- this.uploadModel = new UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment);
56
+ this.uploadModel = new UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment, jsonConfig.bucket);
57
57
  }
58
58
  catch (e) {
59
59
  console.log("Missing or corrupted config: auxta.json. Searching in location:", file);
@@ -62,7 +62,7 @@ class AuxTA extends FunctionHelper {
62
62
  }
63
63
  }
64
64
  else {
65
- this.uploadModel = new UploadModel('', '', '', '');
65
+ this.uploadModel = new UploadModel('', '', '', '', '');
66
66
  }
67
67
  }
68
68
  run(event, overrideConfig) {
@@ -89,6 +89,8 @@ class AuxTA extends FunctionHelper {
89
89
  this.uploadModel.environment = overrideConfig.environment;
90
90
  if (overrideConfig.baseURL)
91
91
  this.uploadModel.baseUrl = overrideConfig.baseURL;
92
+ if (overrideConfig.bucket)
93
+ this.uploadModel.bucket = overrideConfig.bucket;
92
94
  this.config = setupOverrideConfig(overrideConfig);
93
95
  }
94
96
  }
@@ -5,6 +5,7 @@ export declare function setupConfig(jsonConfig: any): {
5
5
  organization: string;
6
6
  netlifyPath: string;
7
7
  digitalProduct: string;
8
+ bucket: string;
8
9
  token: string;
9
10
  screenWidth: number;
10
11
  screenHeight: number;
@@ -23,6 +24,7 @@ export declare function setupOverrideConfig(overrideConfig: any): {
23
24
  organization: string;
24
25
  netlifyPath: string;
25
26
  digitalProduct: string;
27
+ bucket: string;
26
28
  token: string;
27
29
  screenWidth: number;
28
30
  screenHeight: number;
@@ -41,6 +43,7 @@ export declare let config: {
41
43
  organization: string;
42
44
  netlifyPath: string;
43
45
  digitalProduct: string;
46
+ bucket: string;
44
47
  token: string;
45
48
  screenWidth: number;
46
49
  screenHeight: number;
@@ -5,6 +5,9 @@ export function setupConfig(jsonConfig) {
5
5
  if (!jsonConfig.digitalProduct)
6
6
  throw new Error("digitalProduct");
7
7
  config.digitalProduct = jsonConfig.digitalProduct;
8
+ if (!jsonConfig.testsURL)
9
+ throw new Error("testsURL");
10
+ config.bucket = jsonConfig.bucket;
8
11
  if (!jsonConfig.testsURL)
9
12
  throw new Error("testsURL");
10
13
  config.netlifyPath = (process.env.ENVIRONMENT == 'LOCAL') ? 'http://localhost:9999/' : jsonConfig.testsURL;
@@ -41,12 +44,13 @@ export function setupOverrideConfig(overrideConfig) {
41
44
  return config;
42
45
  }
43
46
  export let config = {
44
- auxtaURL: "https://auxta.live/.netlify/functions/",
47
+ auxtaURL: "https://acceptance--auxta.netlify.app/.netlify/functions/",
45
48
  baseURL: "",
46
49
  siteURL: "",
47
50
  organization: "",
48
51
  netlifyPath: "",
49
52
  digitalProduct: "",
53
+ bucket: "",
50
54
  token: "",
51
55
  screenWidth: 1920,
52
56
  screenHeight: 1080,
@@ -4,15 +4,18 @@ export declare class UploadModel {
4
4
  private _digitalProduct;
5
5
  private _baseUrl;
6
6
  private readonly _organization;
7
+ private _bucket;
7
8
  private _environment;
8
9
  private _currentSuite;
9
10
  private _retries;
10
11
  private _featureName;
11
12
  private _scenarioName;
12
- constructor(org: string, baseUrl: string, digitalProduct: string, environment: string);
13
+ constructor(org: string, baseUrl: string, digitalProduct: string, environment: string, bucket: string);
13
14
  set currentSuite(value: string);
14
15
  set retries(value: number);
15
16
  get currentSuite(): string;
17
+ get bucket(): string;
18
+ set bucket(value: string);
16
19
  get retries(): number;
17
20
  get reportId(): string;
18
21
  set reportId(value: string);
@@ -1,10 +1,11 @@
1
1
  export class UploadModel {
2
- constructor(org, baseUrl, digitalProduct, environment) {
2
+ constructor(org, baseUrl, digitalProduct, environment, bucket) {
3
3
  this._reportId = '';
4
4
  this._nextSuites = [];
5
5
  this._currentSuite = '';
6
6
  this._retries = 0;
7
7
  this._organization = org;
8
+ this._bucket = bucket;
8
9
  this._digitalProduct = digitalProduct;
9
10
  this._environment = environment;
10
11
  this._baseUrl = baseUrl;
@@ -20,6 +21,12 @@ export class UploadModel {
20
21
  get currentSuite() {
21
22
  return this._currentSuite;
22
23
  }
24
+ get bucket() {
25
+ return this._bucket;
26
+ }
27
+ set bucket(value) {
28
+ this._bucket = value;
29
+ }
23
30
  get retries() {
24
31
  return this._retries;
25
32
  }
@@ -37,7 +37,8 @@ export function createEmptyReport(body) {
37
37
  const token = yield auth();
38
38
  return (yield axios.post(config.auxtaURL + "create-empty-report", {
39
39
  environment: body.environment,
40
- digitalProductName: body.digitalProduct,
40
+ digitalProductToken: body.digitalProduct,
41
+ bucket: body.bucket,
41
42
  start: new Date(),
42
43
  url: body.baseUrl
43
44
  }, headers(token))).data.reportId;
@@ -129,7 +130,7 @@ export function postNotifications(body) {
129
130
  let token = yield auth();
130
131
  yield axios.post(`${config.auxtaURL}post-notification-after-run-background`, {
131
132
  environmentName: body.environment,
132
- digitalProductName: body.digitalProduct,
133
+ digitalProductToken: body.digitalProduct,
133
134
  organizationName: body.organization,
134
135
  reportId: body.reportId,
135
136
  }, headers(token));
@@ -140,7 +141,7 @@ export function postNotificationsOnFail(body) {
140
141
  let token = yield auth();
141
142
  yield axios.post(`${config.auxtaURL}post-notifications-after-case-fail-background`, {
142
143
  environmentName: body.environment,
143
- digitalProductName: body.digitalProduct,
144
+ digitalProductToken: body.digitalProduct,
144
145
  organizationName: body.organization,
145
146
  reportId: body.reportId,
146
147
  featureName: body.featureName,
@@ -16,16 +16,16 @@ export class EmailHelper {
16
16
  verifyEmail(from_name, from_email, subject, body, link = false) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  yield AuxGoogleAuth.setup();
19
+ const res = yield AuxGoogleAuth.gmailClient.users.messages.list({
20
+ userId: "me",
21
+ maxResults: 3
22
+ });
23
+ const messagesIds = res.data.messages;
24
+ if (!messagesIds || messagesIds.length === 0) {
25
+ throw new Error('No messagesIds found.');
26
+ }
19
27
  let timeoutCount = 12000;
20
28
  while (timeoutCount <= 60000) {
21
- const res = yield AuxGoogleAuth.gmailClient.users.messages.list({
22
- userId: "me",
23
- maxResults: 1
24
- });
25
- const messagesIds = res.data.messages;
26
- if (!messagesIds || messagesIds.length === 0) {
27
- throw new Error('No messagesIds found.');
28
- }
29
29
  for (const messageId of messagesIds) {
30
30
  if (messageId.id) {
31
31
  const gmailResponse = yield AuxGoogleAuth.gmailClient.users.messages.get({