@getjones/test-infra 1.7.0 → 1.7.2

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/README.md CHANGED
@@ -67,6 +67,26 @@ const getAuthCookie = async (email, password) => {};
67
67
  * @return ICS cookie (String)
68
68
  */
69
69
  const getIcsCookie = async () => {};
70
+
71
+ /**
72
+ *
73
+ * Required Configuration: {
74
+ * credentials.auditorUser,
75
+ * credentials.auditorPassword
76
+ * }
77
+ * @return Auditor cookie (String)
78
+ */
79
+ const getAuditorCookie = async () => {};
80
+
81
+ /**
82
+ *
83
+ * Required Configuration: {
84
+ * credentials.operatorUser,
85
+ * credentials.operatorPassword
86
+ * }
87
+ * @return Operator cookie (String)
88
+ */
89
+ const getOperatorCookie = async () => {};
70
90
  ```
71
91
 
72
92
  ### accounts
@@ -296,3 +316,14 @@ const updateProjectSettingsInput = {
296
316
  tenantSolution: false,
297
317
  };
298
318
  ```
319
+ ### serviceArea
320
+
321
+ ```node
322
+ /**
323
+ * @param city (string)
324
+ * @param state (string)
325
+ * @param context (string): Should contain cookie
326
+ */
327
+
328
+ const getCoordinatesByAddress = (city, state, context) => {}
329
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,6 @@
1
+ const convertStringToDate = date => {
2
+ const [day, month, year] = date.split('/').map(Number);
3
+ return new Date(year, month - 1, day + 1);
4
+ };
5
+
6
+ module.exports = { convertStringToDate };
@@ -5,7 +5,8 @@ const Endpoints = {
5
5
  generateReportAndSendViaEmail: (accountId, reportType) => `${backendUrl}/saas/ExportXLSXReport/account/${accountId}/${reportType}`,
6
6
  generateReportAndUploadToS3: reportType => `${backendUrl}/saas/integration-tests/ExportXLSXReport/${reportType}`,
7
7
  getScheduledReports: accountId => `${backendUrl}/saas/scheduled-report/account/${accountId}`,
8
- deleteScheduledReport: scheduledReportId => `${backendUrl}/saas/scheduled-report/${scheduledReportId}`
8
+ deleteScheduledReport: scheduledReportId => `${backendUrl}/saas/scheduled-report/${scheduledReportId}`,
9
+ updateScheduledReportLastSentDate: scheduledReportId => `${backendUrl}/saas/automation/scheduled-report/${scheduledReportId}`
9
10
  };
10
11
 
11
12
  const generateReportAndSendViaEmail = (reportFilters, accountId, reportType, context) => {
@@ -24,9 +25,15 @@ const deleteScheduledReport = (scheduledReportId, context) => {
24
25
  return requests.deleteRequestHandler(Endpoints.deleteScheduledReport(scheduledReportId), context);
25
26
  };
26
27
 
28
+ const updateScheduledReportLastSentDate = (scheduledReportId, customLastSentDate, context) => {
29
+ const url = `${Endpoints.updateScheduledReportLastSentDate(scheduledReportId)}?customLastSentDate=${customLastSentDate.toISOString()}`;
30
+ return requests.putRequestHandler(url, {}, context);
31
+ };
32
+
27
33
  module.exports = {
28
34
  generateReportAndSendViaEmail,
29
35
  generateReportAndUploadToS3,
30
36
  getScheduledReports,
31
- deleteScheduledReport
37
+ deleteScheduledReport,
38
+ updateScheduledReportLastSentDate
32
39
  };
@@ -20,9 +20,15 @@ const deleteScheduledReport = (scheduledReportId, context) => {
20
20
  return reportsApi.deleteScheduledReport(scheduledReportId, context);
21
21
  };
22
22
 
23
+ const updateScheduledReportLastSentDate = (scheduledReportId, customLastSentDate, context) => {
24
+ validateType(customLastSentDate, Date);
25
+ return reportsApi.updateScheduledReportLastSentDate(scheduledReportId, customLastSentDate, context);
26
+ };
27
+
23
28
  module.exports = {
24
29
  generateReportAndSendViaEmail,
25
30
  generateReportAndUploadToS3,
26
31
  getScheduledReports,
27
- deleteScheduledReport
32
+ deleteScheduledReport,
33
+ updateScheduledReportLastSentDate
28
34
  };
@@ -1,7 +1,7 @@
1
1
  const service = require('../api/coordinates.service');
2
2
 
3
- const getCoordinatesByAddress = async (state, city, context) => {
4
- const response = await service.getCoordinatesByAddress(state, city, context);
3
+ const getCoordinatesByAddress = async (city, state, context) => {
4
+ const response = await service.getCoordinatesByAddress(city, state, context);
5
5
  return response.data;
6
6
  };
7
7
 
@@ -22,7 +22,7 @@ const createTab = (tabModel, context) => {
22
22
  };
23
23
 
24
24
  const updateTab = (tabModel, context) => {
25
- return requests.postRequestHandler(Endpoints.update, tabModel, context);
25
+ return requests.putRequestHandler(Endpoints.update, tabModel, context);
26
26
  };
27
27
 
28
28
  const deleteTab = (tabId, context) => {
@@ -5,12 +5,8 @@ const Endpoints = {
5
5
  run: `${backendUrl}/threadSchedular/${threadSchedulerSecret}`
6
6
  };
7
7
 
8
- const runThreadScheduler = ({ contractorIds = null } = {}) => {
9
- if (contractorIds) {
10
- contractorIds = contractorIds.reduce((f, s) => `${f},${s}`);
11
- }
12
-
13
- const params = { contractorIdsList: contractorIds };
8
+ const runThreadScheduler = ({ contractorIds = [], scheduledReportsIds = [] } = {}) => {
9
+ const params = { contractorIdsList: contractorIds.toString(), scheduledReportsIds: scheduledReportsIds.toString() };
14
10
  return requests.getRequestHandler(Endpoints.run, params);
15
11
  };
16
12