@getjones/test-infra 2.12.0 → 2.12.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/package.json +1 -1
- package/src/saas/internal-api/contractors/api/contractors.api.js +0 -7
- package/src/saas/internal-api/contractors/api/contractors.service.js +0 -7
- package/src/saas/internal-api/contractors/index.js +1 -2
- package/src/saas/internal-api/tabs/api/tabs.service.js +2 -2
- package/src/saas/internal-api/tabs/models/tabs.model.js +3 -2
- package/src/saas/internal-api/users/api/users.api.js +6 -0
- package/src/saas/internal-api/users/api/users.service.js +6 -1
- package/src/saas/internal-api/contractors/models/create.contractor.model.js +0 -22
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
2
|
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
-
const { convertDateStringFormatToISOString } = require('../../../../common/utils/timeUtils');
|
|
4
3
|
|
|
5
4
|
const Endpoints = {
|
|
6
|
-
create: `${backendUrl}/saas/contractors/invite`,
|
|
7
5
|
get: `${backendUrl}/saas/contractors`,
|
|
8
6
|
getContractorById: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
9
7
|
getRecordHistory: contractorId => `${backendUrl}/saas/record/${contractorId}/history`,
|
|
@@ -29,10 +27,6 @@ const Endpoints = {
|
|
|
29
27
|
verifyInviteLink: encryptedData => `${backendUrl}/vendor-app/verify-link?data=${encryptedData}`
|
|
30
28
|
};
|
|
31
29
|
|
|
32
|
-
const createContractor = (createContractorModel, context) => {
|
|
33
|
-
return requests.postRequestHandler(Endpoints.create, createContractorModel, context);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
30
|
const getContractorsByAccountId = (params, context) => {
|
|
37
31
|
return requests.getRequestHandler(Endpoints.get, params, context);
|
|
38
32
|
};
|
|
@@ -139,7 +133,6 @@ const getInviteLinkStatus = (encryptedData, context) => {
|
|
|
139
133
|
};
|
|
140
134
|
|
|
141
135
|
module.exports = {
|
|
142
|
-
createContractor,
|
|
143
136
|
changeRequirement,
|
|
144
137
|
assignRequirement,
|
|
145
138
|
getContractorsByAccountId,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const contractorsAPI = require('./contractors.api');
|
|
2
|
-
const { CreateContractorModel } = require('../models/create.contractor.model');
|
|
3
2
|
const { RequestModel } = require('../../requests/models/edit.request.model');
|
|
4
3
|
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
5
4
|
const { RecordModifyDateVerificationModel } = require('../models/verification.contractor.model');
|
|
@@ -9,11 +8,6 @@ const httpResponseStatusCodes = require('../../../../common/httpResponseStatusCo
|
|
|
9
8
|
const { waitFor } = require('../../../../common/utils/timeUtils');
|
|
10
9
|
const utils = require('../utils');
|
|
11
10
|
|
|
12
|
-
const createContractor = async (createContractorModel, context) => {
|
|
13
|
-
validateType(createContractorModel, CreateContractorModel);
|
|
14
|
-
return contractorsAPI.createContractor(createContractorModel, context);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
11
|
const getContractorsByAccountId = async (accountId, context, activationStatus = null) => {
|
|
18
12
|
if (activationStatus) {
|
|
19
13
|
activationStatus = activationStatus.reduce((f, s) => `${f},${s}`);
|
|
@@ -186,7 +180,6 @@ const getContractorDetailsModel = recordConfig => {
|
|
|
186
180
|
};
|
|
187
181
|
|
|
188
182
|
module.exports = {
|
|
189
|
-
createContractor,
|
|
190
183
|
changeRequirement,
|
|
191
184
|
getContractorsByAccountId,
|
|
192
185
|
getContractorById,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
const createModel = require('./models/create.contractor.model');
|
|
2
1
|
const editModel = require('./models/edit.contractor.model');
|
|
3
2
|
const verificationModel = require('./models/verification.contractor.model');
|
|
4
3
|
const assignRequirementModel = require('./models/assign.requirement.model');
|
|
5
4
|
const services = require('./api/contractors.service');
|
|
6
5
|
|
|
7
|
-
const models = {
|
|
6
|
+
const models = { edit: editModel, verification: verificationModel, assignRequirementModel };
|
|
8
7
|
|
|
9
8
|
module.exports = { services, models };
|
|
@@ -34,8 +34,8 @@ const getOrCreateTab = async (projectId, tabName, tabType, context) => {
|
|
|
34
34
|
return createResponse.data;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const updateTab = async (projectId,
|
|
38
|
-
const tabModel = new UpdateTabModel(projectId,
|
|
37
|
+
const updateTab = async ({ id, projectId, name, type, context, dateModified }) => {
|
|
38
|
+
const tabModel = new UpdateTabModel({ id, projectId, name, type, dateModified });
|
|
39
39
|
return tabsAPI.updateTab(tabModel, context);
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -7,11 +7,12 @@ class CreateTabModel {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
class UpdateTabModel {
|
|
10
|
-
constructor(projectId, tabName, tabType, tabId) {
|
|
10
|
+
constructor({ projectId, name: tabName, type: tabType, id: tabId, dateModified } = {}) {
|
|
11
|
+
this.tabId = tabId;
|
|
11
12
|
this.projectId = projectId;
|
|
12
13
|
this.tabName = tabName;
|
|
13
14
|
this.type = tabType;
|
|
14
|
-
this.
|
|
15
|
+
this.dateModified = dateModified;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -10,6 +10,7 @@ const Endpoints = {
|
|
|
10
10
|
`${backendUrl}/saas/project/${projectId}/team-members`,
|
|
11
11
|
getByEmail: email => `${backendUrl}/saas/team-member/by-email/${email}`,
|
|
12
12
|
delete: userId => `${backendUrl}/saas/users/${userId}`,
|
|
13
|
+
getUserListByRecordId: recordId => `${backendUrl}/saas/users/record/${recordId}`,
|
|
13
14
|
deleteSingleProject: (userId, projectId) => `${backendUrl}/saas/project/${projectId}/sub-account/${userId}`,
|
|
14
15
|
reinvite: `${backendUrl}/saas/project/team-member/reinvite`,
|
|
15
16
|
getUserEncryptedData: (email, userRole) => `${backendUrl}/saas/team-member/email/${email}/role/${userRole}/signup-data`,
|
|
@@ -89,12 +90,17 @@ const editUserProfile = (editUserProfileModel, context) => {
|
|
|
89
90
|
return requests.postRequestHandler(Endpoints.editUserProfile, editUserProfileModel, context);
|
|
90
91
|
};
|
|
91
92
|
|
|
93
|
+
const getUserListByRecordId = (recordId, context, { searchTerm } = {}) => {
|
|
94
|
+
return requests.getRequestHandler(Endpoints.getUserListByRecordId(recordId), { searchTerm }, context);
|
|
95
|
+
};
|
|
96
|
+
|
|
92
97
|
module.exports = {
|
|
93
98
|
invite,
|
|
94
99
|
signupUser,
|
|
95
100
|
getUsersByProjectId,
|
|
96
101
|
getUserByEmail,
|
|
97
102
|
getUserEncryptedData,
|
|
103
|
+
getUserListByRecordId,
|
|
98
104
|
deleteUser,
|
|
99
105
|
deleteUserFromSingleProject,
|
|
100
106
|
removeAllUserTraceFromDb,
|
|
@@ -176,6 +176,10 @@ const editUserSettings = async (email, config, userContext) => {
|
|
|
176
176
|
return getUserByEmail(email, systemUserContext);
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
+
const getUserListByRecordId = async (recordId, context, { searchTerm } = {}) => {
|
|
180
|
+
return userAPI.getUserListByRecordId(recordId, context, { searchTerm });
|
|
181
|
+
};
|
|
182
|
+
|
|
179
183
|
module.exports = {
|
|
180
184
|
inviteUser,
|
|
181
185
|
signupUser,
|
|
@@ -194,5 +198,6 @@ module.exports = {
|
|
|
194
198
|
getOrCreateInnerSystemUser,
|
|
195
199
|
editUserProfile,
|
|
196
200
|
editUserSettings,
|
|
197
|
-
getInnerSystemUserByEmail
|
|
201
|
+
getInnerSystemUserByEmail,
|
|
202
|
+
getUserListByRecordId
|
|
198
203
|
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
-
|
|
3
|
-
function CreateContractorModel(requirementId, inviterEmail, vendorInfo, { tabId = null, sendMail = false, publicLink } = {}) {
|
|
4
|
-
this.reqId = requirementId;
|
|
5
|
-
this.inviterEmail = inviterEmail;
|
|
6
|
-
this.vendorInfo = vendorInfo;
|
|
7
|
-
this.disableMail = !sendMail;
|
|
8
|
-
this.tabId = tabId;
|
|
9
|
-
this.publicLink = publicLink;
|
|
10
|
-
|
|
11
|
-
vendorInfo && validateType(vendorInfo, ContractorInfo);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function ContractorInfo(recordType, email, companyName, additionalEmails) {
|
|
15
|
-
this.recordType = recordType;
|
|
16
|
-
this.email = email;
|
|
17
|
-
this.companyName = companyName;
|
|
18
|
-
this.title = email;
|
|
19
|
-
this.additionalEmails = additionalEmails;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = { CreateContractorModel, ContractorInfo };
|