@getjones/test-infra 1.2.4 → 1.2.6
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/package.json +1 -1
- package/src/common/requests/apiKeyAuth/requests.js +38 -0
- package/src/common/requests/cookieAuth/requests.js +40 -0
- package/src/common/requests/requestHandlers.js +60 -0
- package/src/common/validations/errorValidation.js +10 -10
- package/src/common/validations/typeValidations.js +4 -4
- package/src/index.js +26 -19
- package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +10 -10
- package/src/saas/internal-api/accounts/api/core/accounts.core.setup.js +35 -36
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +20 -20
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.setup.js +35 -35
- package/src/saas/internal-api/accounts/api/settings/settings.api.js +8 -8
- package/src/saas/internal-api/accounts/api/settings/settings.setup.js +9 -9
- package/src/saas/internal-api/accounts/index.js +4 -4
- package/src/saas/internal-api/accounts/models/core/create.account.model.js +8 -9
- package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +11 -11
- package/src/saas/internal-api/auth/api/auth.api.js +4 -4
- package/src/saas/internal-api/auth/api/auth.setup.js +31 -22
- package/src/saas/internal-api/auth/index.js +1 -1
- package/src/saas/internal-api/coi/api/coi.api.js +14 -14
- package/src/saas/internal-api/coi/api/coi.setup.js +5 -5
- package/src/saas/internal-api/coi/index.js +1 -1
- package/src/saas/internal-api/coi/models/submit.coi.model.js +6 -6
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +11 -11
- package/src/saas/internal-api/compliance/api/audit/audit.setup.js +5 -5
- package/src/saas/internal-api/compliance/api/convert/convert.api.js +6 -6
- package/src/saas/internal-api/compliance/api/convert/convert.setup.js +3 -3
- package/src/saas/internal-api/compliance/api/coverage/coverage.api.js +16 -16
- package/src/saas/internal-api/compliance/api/coverage/coverage.setup.js +13 -13
- package/src/saas/internal-api/compliance/api/waive/waive.api.js +9 -11
- package/src/saas/internal-api/compliance/api/waive/waive.setup.js +5 -5
- package/src/saas/internal-api/compliance/index.js +15 -6
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +66 -66
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +28 -28
- package/src/saas/internal-api/contractors/api/contractors.api.js +42 -42
- package/src/saas/internal-api/contractors/api/contractors.setup.js +27 -27
- package/src/saas/internal-api/contractors/index.js +2 -2
- package/src/saas/internal-api/contractors/models/create.contractor.model.js +13 -13
- package/src/saas/internal-api/contractors/models/edit.contractor.model.js +66 -68
- package/src/saas/internal-api/globalRecord/api/global.record.api.js +46 -0
- package/src/saas/internal-api/globalRecord/api/global.record.setup.js +57 -0
- package/src/saas/internal-api/globalRecord/index.js +4 -0
- package/src/saas/internal-api/globalRecord/models/global.record.model.js +37 -0
- package/src/saas/internal-api/homepageCharts/api/charts.api.js +4 -4
- package/src/saas/internal-api/homepageCharts/api/charts.setup.js +2 -2
- package/src/saas/internal-api/homepageCharts/index.js +1 -1
- package/src/saas/internal-api/projects/api/core/projects.api.js +13 -13
- package/src/saas/internal-api/projects/api/core/projects.setup.js +26 -26
- package/src/saas/internal-api/projects/api/settings/project.settings.api.js +6 -6
- package/src/saas/internal-api/projects/api/settings/project.settings.setup.js +5 -5
- package/src/saas/internal-api/projects/index.js +5 -5
- package/src/saas/internal-api/projects/models/core/create.project.model.js +19 -19
- package/src/saas/internal-api/projects/models/core/update.project.model.js +21 -21
- package/src/saas/internal-api/projects/models/settings/update.project.settings.model.js +27 -28
- package/src/saas/internal-api/recordNotes/api/record.notes.api.js +18 -18
- package/src/saas/internal-api/recordNotes/api/record.notes.setup.js +11 -11
- package/src/saas/internal-api/reports/api/reports.api.js +4 -4
- package/src/saas/internal-api/reports/api/reports.setup.js +2 -3
- package/src/saas/internal-api/reports/index.js +3 -3
- package/src/saas/internal-api/reports/models/report.model.js +23 -23
- package/src/saas/internal-api/requirements/api/requirements.api.js +11 -11
- package/src/saas/internal-api/requirements/api/requirements.setup.js +7 -7
- package/src/saas/internal-api/requirements/index.js +1 -1
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +27 -28
- package/src/saas/internal-api/tabs/api/tabs.api.js +1 -1
- package/src/saas/internal-api/tabs/index.js +1 -1
- package/src/saas/internal-api/thread-scheduler/runner.js +17 -0
- package/src/saas/internal-api/users/api/users.api.js +9 -9
- package/src/saas/internal-api/users/models/edit.user.model.js +6 -6
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +1 -1
- package/src/saas/openapi/accounts/accounts.api.js +5 -5
- package/src/saas/openapi/accounts/accounts.setup.js +4 -4
- package/src/saas/openapi/contractors/contractors.api.js +3 -3
- package/src/saas/openapi/contractors/contractors.setup.js +5 -5
- package/src/saas/openapi/projects/projects.api.js +25 -24
- package/src/saas/openapi/projects/projects.setup.js +15 -15
- package/src/saas/openapi/requirements/index.js +1 -1
- package/src/saas/openapi/requirements/models/copy.requirement.model.js +7 -7
- package/src/saas/openapi/requirements/requirements.api.js +3 -4
- package/src/saas/openapi/requirements/requirements.setup.js +11 -11
- package/src/saas/openapi/tabs/tabs.api.js +4 -4
- package/src/saas/openapi/tabs/tabs.setup.js +2 -2
- package/src/saas/internal-api/common/requests.js +0 -71
- package/src/saas/openapi/common/requests.js +0 -74
- package/src/saas/thread-scheduler/runner.js +0 -17
|
@@ -4,17 +4,17 @@ const { validateType } = require('../../../common/validations/typeValidations');
|
|
|
4
4
|
const CopyRequirementModel = require('./models/copy.requirement.model');
|
|
5
5
|
|
|
6
6
|
const copyRequirement = async (apiKey, copyRequirementModel) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
validateType(copyRequirementModel, CopyRequirementModel);
|
|
8
|
+
const {
|
|
9
|
+
sourceRequirementId,
|
|
10
|
+
destinationTabId,
|
|
11
|
+
newRequirementName,
|
|
12
|
+
certificateHolder,
|
|
13
|
+
additionalInsured
|
|
14
|
+
} = copyRequirementModel;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const newRequirementOverrides = { destinationTabId, newRequirementName, certificateHolder, additionalInsured };
|
|
17
|
+
return requirementsApi.copyRequirement(apiKey, sourceRequirementId, newRequirementOverrides);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
module.exports = { copyRequirement };
|
|
20
|
+
module.exports = { copyRequirement };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const requests = require('
|
|
1
|
+
const requests = require('../../../common/requests/apiKeyAuth/requests');
|
|
2
2
|
const { openapiUrl, backendUrl } = require('../../../env').getEnv();
|
|
3
3
|
|
|
4
4
|
const Endpoints = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
delete: tabId => `${openapiUrl}/tabs/${tabId}`,
|
|
6
|
+
get: tabId => `${backendUrl}/tabs/${tabId}`
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const deleteTabById = async (tabId, apiKey) => {
|
|
10
|
-
|
|
10
|
+
return requests.deleteRequestHandler(Endpoints.delete(tabId), apiKey);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
module.exports = { deleteTabById };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const tabsApi = require('./tabs.api');
|
|
2
2
|
|
|
3
3
|
const deleteTabById = async (tabId, apiKey) => {
|
|
4
|
-
|
|
4
|
+
return tabsApi.deleteTabById(tabId, apiKey);
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
module.exports = { deleteTabById };
|
|
7
|
+
module.exports = { deleteTabById };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
const axios = require('axios');
|
|
2
|
-
const errorValidation = require('../../../common/validations/errorValidation');
|
|
3
|
-
|
|
4
|
-
const getRequestHandler = async (url, params = {}, context = null, headers = {}) => {
|
|
5
|
-
enrichCookie(headers, context);
|
|
6
|
-
try {
|
|
7
|
-
const response = await axios.get(url, { params, headers });
|
|
8
|
-
return response;
|
|
9
|
-
} catch (error) {
|
|
10
|
-
errorValidation.validateError(error);
|
|
11
|
-
return error.response;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const postRequestHandler = async (url, body, context = null, headers = {}, params = {}) => {
|
|
16
|
-
enrichCookie(headers, context);
|
|
17
|
-
try {
|
|
18
|
-
const response = await axios.post(url, body, { headers, params });
|
|
19
|
-
return response;
|
|
20
|
-
} catch (error) {
|
|
21
|
-
errorValidation.validateError(error);
|
|
22
|
-
return error.response;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const putRequestHandler = async (url, body, context = null, headers = {}, params = {}) => {
|
|
27
|
-
enrichCookie(headers, context);
|
|
28
|
-
try {
|
|
29
|
-
const response = await axios.put(url, body, { headers, params });
|
|
30
|
-
return response;
|
|
31
|
-
} catch (error) {
|
|
32
|
-
errorValidation.validateError(error);
|
|
33
|
-
return error.response;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const patchRequestHandler = async (url, context, body, headers = {}) => {
|
|
38
|
-
enrichCookie(headers, context);
|
|
39
|
-
try {
|
|
40
|
-
const response = await axios.patch(url, body, { headers });
|
|
41
|
-
return response;
|
|
42
|
-
} catch (error) {
|
|
43
|
-
errorValidation.validateError(error);
|
|
44
|
-
return error.response;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const deleteRequestHandler = async (url, context = null, headers = {}, params = {}, data = {}) => {
|
|
49
|
-
enrichCookie(headers, context);
|
|
50
|
-
try {
|
|
51
|
-
const response = await axios.delete(url, { params, headers, data });
|
|
52
|
-
return response;
|
|
53
|
-
} catch (error) {
|
|
54
|
-
errorValidation.validateError(error);
|
|
55
|
-
return error.response;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const enrichCookie = (headers, context) => {
|
|
60
|
-
if (context) {
|
|
61
|
-
headers.Cookie = context;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
module.exports = {
|
|
66
|
-
getRequestHandler,
|
|
67
|
-
postRequestHandler,
|
|
68
|
-
putRequestHandler,
|
|
69
|
-
patchRequestHandler,
|
|
70
|
-
deleteRequestHandler
|
|
71
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const axios = require('axios');
|
|
2
|
-
const errorValidation = require('../../../common/validations/errorValidation');
|
|
3
|
-
|
|
4
|
-
const getRequestHandler = async (url, apiKey, params = {}, headers = {}) => {
|
|
5
|
-
enrichApiKey(headers, apiKey);
|
|
6
|
-
try {
|
|
7
|
-
const response = await axios.get(url, { params, headers });
|
|
8
|
-
return response;
|
|
9
|
-
} catch (error) {
|
|
10
|
-
errorValidation.validateError(error);
|
|
11
|
-
return error.response;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const postRequestHandler = async (url, apiKey, body, headers = {}) => {
|
|
17
|
-
enrichApiKey(headers, apiKey);
|
|
18
|
-
try {
|
|
19
|
-
const response = await axios.post(url, body, { headers });
|
|
20
|
-
return response;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
errorValidation.validateError(error);
|
|
23
|
-
return error.response;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const putRequestHandler = async (url, apiKey, body, headers = {}) => {
|
|
29
|
-
enrichApiKey(headers, apiKey);
|
|
30
|
-
try {
|
|
31
|
-
const response = await axios.put(url, body, { headers });
|
|
32
|
-
return response;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
errorValidation.validateError(error);
|
|
35
|
-
return error.response;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const patchRequestHandler = async (url, apiKey, body, headers = {}) => {
|
|
41
|
-
enrichApiKey(headers, apiKey);
|
|
42
|
-
try {
|
|
43
|
-
const response = await axios.patch(url, body, { headers });
|
|
44
|
-
return response;
|
|
45
|
-
} catch (error) {
|
|
46
|
-
errorValidation.validateError(error);
|
|
47
|
-
return error.response;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const deleteRequestHandler = async (url, apiKey, headers = {}, params = {}, data = {}) => {
|
|
53
|
-
enrichApiKey(headers, apiKey);
|
|
54
|
-
try {
|
|
55
|
-
const response = await axios.delete(url, { params, headers, data });
|
|
56
|
-
return response;
|
|
57
|
-
} catch (error) {
|
|
58
|
-
errorValidation.validateError(error);
|
|
59
|
-
return error.response;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const enrichApiKey = (headers, apiKey) => {
|
|
65
|
-
headers['x-api-key'] = apiKey;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
module.exports = {
|
|
69
|
-
getRequestHandler,
|
|
70
|
-
postRequestHandler,
|
|
71
|
-
putRequestHandler,
|
|
72
|
-
patchRequestHandler,
|
|
73
|
-
deleteRequestHandler
|
|
74
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const requests = require('../internal-api/common/requests');
|
|
2
|
-
const { backendUrl, threadSchedulerSecret } = require('../../env').getEnv();
|
|
3
|
-
|
|
4
|
-
const Endpoints = {
|
|
5
|
-
run: `${backendUrl}/threadSchedular/${threadSchedulerSecret}`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const runThreadScheduler = ({ contractorIds = null } = {}) => {
|
|
9
|
-
if (contractorIds) {
|
|
10
|
-
contractorIds = contractorIds.reduce((f, s) => `${f},${s}`);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const params = { contractorIdsList: contractorIds };
|
|
14
|
-
return requests.getRequestHandler(Endpoints.run, params);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
module.exports = { runThreadScheduler };
|