@getjones/test-infra 4.4.6 → 4.4.7
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
CHANGED
|
@@ -8,8 +8,7 @@ const Endpoints = {
|
|
|
8
8
|
editUserProfile: `${backendUrl}/saas/user/update`,
|
|
9
9
|
getByProjectId: projectId =>
|
|
10
10
|
`${backendUrl}/saas/project/${projectId}/team-members`,
|
|
11
|
-
getByEmail: email => `${backendUrl}/saas/
|
|
12
|
-
getTeamMemberByEmail: (email, accountId) => `${backendUrl}/saas/team-member/account/${accountId}/email/${email}`,
|
|
11
|
+
getByEmail: email => `${backendUrl}/saas/team-member/by-email/${email}`,
|
|
13
12
|
getEnabledAndDisabledByEmail: email => `${backendUrl}/saas/user/automation/email/${email}`,
|
|
14
13
|
delete: userId => `${backendUrl}/saas/users/${userId}`,
|
|
15
14
|
getUserListByRecordId: recordId => `${backendUrl}/saas/users/record/${recordId}`,
|
|
@@ -49,10 +48,6 @@ const getUserByEmail = (email, context) => {
|
|
|
49
48
|
return requests.getRequestHandler(Endpoints.getByEmail(email), null, context);
|
|
50
49
|
};
|
|
51
50
|
|
|
52
|
-
const getTeamMemberByEmail = (email, accountId, context) => {
|
|
53
|
-
return requests.getRequestHandler(Endpoints.getTeamMemberByEmail(email, accountId), null, context);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
51
|
const getEnabledAndDisabledByEmail = (email, context) => {
|
|
57
52
|
return requests.getRequestHandler(Endpoints.getEnabledAndDisabledByEmail(email), null, context);
|
|
58
53
|
};
|
|
@@ -110,7 +105,6 @@ module.exports = {
|
|
|
110
105
|
getUsersByProjectId,
|
|
111
106
|
getEnabledAndDisabledByEmail,
|
|
112
107
|
getUserByEmail,
|
|
113
|
-
getTeamMemberByEmail,
|
|
114
108
|
getUserEncryptedData,
|
|
115
109
|
getUserListByRecordId,
|
|
116
110
|
deleteUser,
|
|
@@ -36,16 +36,6 @@ const getUserByEmail = async (email, context) => {
|
|
|
36
36
|
return userAPI.getUserByEmail(email, context);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const getTeamMemberByEmail = async (email, accountId, context) => {
|
|
40
|
-
const response = await userAPI.getTeamMemberByEmail(email, accountId, context);
|
|
41
|
-
|
|
42
|
-
if (response.status !== httpResponseStatusCodes.OK) {
|
|
43
|
-
throw new Error(`Failed to get user by email ${email}`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return response.data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
39
|
const getEnabledAndDisabledByEmail = async (email, context) => {
|
|
50
40
|
const response = await userAPI.getEnabledAndDisabledByEmail(email, context);
|
|
51
41
|
|
|
@@ -59,7 +49,7 @@ const getEnabledAndDisabledByEmail = async (email, context) => {
|
|
|
59
49
|
const getOrCreateUser = async (email, role, projectsIds, context, { fullName = role, password = credentials.strongPassword } = {}) => {
|
|
60
50
|
let userResponse = await getUserByEmail(email, context);
|
|
61
51
|
|
|
62
|
-
if (userResponse.data !== '') {
|
|
52
|
+
if (userResponse.data !== '' && userResponse.status === httpResponseStatusCodes.OK) {
|
|
63
53
|
const { projectPermissions } = userResponse.data;
|
|
64
54
|
const projectPermissionsIds = projectPermissions.map(projectPermission => projectPermission.projectId);
|
|
65
55
|
|
|
@@ -203,7 +193,6 @@ const getUserListByRecordId = async (recordId, context, { searchTerm } = {}) =>
|
|
|
203
193
|
module.exports = {
|
|
204
194
|
inviteUser,
|
|
205
195
|
signupUser,
|
|
206
|
-
getTeamMemberByEmail,
|
|
207
196
|
getUsersByProjectId,
|
|
208
197
|
getUserByEmail,
|
|
209
198
|
getEnabledAndDisabledByEmail,
|