@auxcode/auxta 1.3.98 → 1.3.100

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/build/AuxTA.d.ts CHANGED
@@ -23,6 +23,7 @@ declare class AuxTA extends FunctionHelper {
23
23
  email: string;
24
24
  password: string;
25
25
  };
26
+ timezone: string;
26
27
  };
27
28
  email: import("./macros/helpers/emailHelper").EmailHelper;
28
29
  private readonly uploadModel;
@@ -16,6 +16,7 @@ export declare function setupConfig(jsonConfig: any): {
16
16
  email: string;
17
17
  password: string;
18
18
  };
19
+ timezone: string;
19
20
  };
20
21
  export declare function setupOverrideConfig(overrideConfig: any): {
21
22
  auxtaURL: string;
@@ -35,6 +36,7 @@ export declare function setupOverrideConfig(overrideConfig: any): {
35
36
  email: string;
36
37
  password: string;
37
38
  };
39
+ timezone: string;
38
40
  };
39
41
  export declare let config: {
40
42
  auxtaURL: string;
@@ -54,4 +56,5 @@ export declare let config: {
54
56
  email: string;
55
57
  password: string;
56
58
  };
59
+ timezone: string;
57
60
  };
@@ -5,6 +5,12 @@ function setupConfig(jsonConfig) {
5
5
  if (!jsonConfig.baseURL)
6
6
  throw new Error("baseURL");
7
7
  exports.config.baseURL = jsonConfig.baseURL;
8
+ if (!jsonConfig.auxtaURL)
9
+ throw new Error("auxtaURL missing");
10
+ exports.config.auxtaURL = jsonConfig.auxtaURL;
11
+ if (!jsonConfig.timezone)
12
+ throw new Error("auxtaURL missing");
13
+ exports.config.timezone = jsonConfig.timezone;
8
14
  if (!jsonConfig.digitalProduct)
9
15
  throw new Error("digitalProduct");
10
16
  exports.config.digitalProduct = jsonConfig.digitalProduct;
@@ -49,7 +55,7 @@ function setupOverrideConfig(overrideConfig) {
49
55
  }
50
56
  exports.setupOverrideConfig = setupOverrideConfig;
51
57
  exports.config = {
52
- auxtaURL: "https://auxta.live/.netlify/functions/",
58
+ auxtaURL: "",
53
59
  baseURL: "",
54
60
  siteURL: "",
55
61
  organization: "",
@@ -66,4 +72,5 @@ exports.config = {
66
72
  email: "",
67
73
  password: "",
68
74
  },
75
+ timezone: ""
69
76
  };
@@ -16,6 +16,7 @@ export interface Steps {
16
16
  suggestedSteps: number;
17
17
  performanceFailure: number;
18
18
  }
19
+ export declare function setTimeZone(): Promise<string>;
19
20
  export declare function createEmptyReport(body: any): Promise<string>;
20
21
  export declare function uploadStep(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
21
22
  stepRef: any;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getVerifyReceivedEmail = exports.postNotificationsOnFail = exports.postNotifications = exports.compareScreenshots = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadScenario = exports.uploadStep = exports.createEmptyReport = void 0;
15
+ exports.getVerifyReceivedEmail = exports.postNotificationsOnFail = exports.postNotifications = exports.compareScreenshots = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadScenario = exports.uploadStep = exports.createEmptyReport = exports.setTimeZone = void 0;
16
16
  const axios_1 = __importDefault(require("axios"));
17
17
  const config_1 = require("../configs/config");
18
18
  function headers(token) {
@@ -52,14 +52,24 @@ function auth() {
52
52
  return token;
53
53
  });
54
54
  }
55
+ function setTimeZone() {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const token = yield auth();
58
+ return (yield axios_1.default.post(config_1.config.auxtaURL + "set-timezone", {
59
+ organization: config_1.config.organization
60
+ }, headers(token))).data;
61
+ });
62
+ }
63
+ exports.setTimeZone = setTimeZone;
55
64
  function createEmptyReport(body) {
56
65
  return __awaiter(this, void 0, void 0, function* () {
57
66
  const token = yield auth();
67
+ const moment = require('moment-timezone');
58
68
  return (yield axios_1.default.post(config_1.config.auxtaURL + "create-empty-report", {
59
69
  environment: body.environment,
60
70
  digitalProductToken: body.digitalProduct,
61
71
  bucket: body.bucket,
62
- start: new Date(),
72
+ start: moment().tz(config_1.config.timezone),
63
73
  url: body.baseUrl
64
74
  }, headers(token))).data.reportId;
65
75
  });
@@ -123,9 +133,11 @@ exports.uploadScenario = uploadScenario;
123
133
  function updateReport(reportId, scenario, steps, isFinal) {
124
134
  return __awaiter(this, void 0, void 0, function* () {
125
135
  let token = yield auth();
136
+ const moment = require('moment-timezone');
126
137
  yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
127
138
  reportId: reportId,
128
139
  isFinal: isFinal,
140
+ end: moment().tz(config_1.config.timezone),
129
141
  data: Object.assign({ scenario: {
130
142
  scenarioRef: scenario.scenarioId,
131
143
  name: scenario.scenarioName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auxcode/auxta",
3
- "version": "1.3.98",
3
+ "version": "1.3.100",
4
4
  "description": "",
5
5
  "main": "./build/AuxTA.js",
6
6
  "types": "./build/AuxTA.d.ts",
@@ -22,6 +22,7 @@
22
22
  "fs": "^0.0.1-security",
23
23
  "googleapis": "^118.0.0",
24
24
  "js-base64": "^3.7.5",
25
+ "moment-timezone": "^0.5.45",
25
26
  "node-2fa": "^2.0.3",
26
27
  "nodemailer": "^6.9.9",
27
28
  "puppeteer": "^22.0.0",