@frontegg/redux-store 6.52.0-alpha.1 → 6.52.0
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/auth/TeamState/index.d.ts +3 -3
- package/auth/TeamState/interfaces.d.ts +4 -0
- package/auth/TeamState/saga.js +63 -64
- package/auth/index.d.ts +1 -1
- package/auth/reducer.d.ts +1 -1
- package/index.js +1 -1
- package/node/auth/TeamState/saga.js +64 -62
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAddUser, IDeleteUser, ILoadUsers, IResendActivationLink, IResendInvitationLink, IResendInvitationEmail, ITeamUser, IUpdateUser, ICreateOrUpdateInviteUserLink, ILoadAllUsers, ISubTenantUser, AddUserToSubTenantsRequest, RemoveUserFromSubTenantsRequest, UpdateUserRolesForSubTenantsRequestDto } from '@frontegg/rest-api';
|
|
2
|
-
import { ISetAddUserDialog, ISetDeleteUserDialog, TeamState, TeamStateIndicator, LoadRolesAndPermissionsPayload, IAddUsers } from './interfaces';
|
|
2
|
+
import { ISetAddUserDialog, ISetDeleteUserDialog, TeamState, TeamStateIndicator, LoadRolesAndPermissionsPayload, IAddUsers, BulkInvintationData } from './interfaces';
|
|
3
3
|
import { WithCallback, WithSilentLoad } from '../../interfaces';
|
|
4
4
|
declare const teamState: TeamState;
|
|
5
5
|
declare const reducers: {
|
|
@@ -117,7 +117,7 @@ declare const actions: {
|
|
|
117
117
|
} | null, error?: string | undefined) => void) | undefined;
|
|
118
118
|
} | undefined, string, never, never>;
|
|
119
119
|
addUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IAddUser, ITeamUser>], WithCallback<IAddUser, ITeamUser>, string, never, never>;
|
|
120
|
-
addUsersBulk: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IAddUsers,
|
|
120
|
+
addUsersBulk: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IAddUsers, BulkInvintationData>], WithCallback<IAddUsers, BulkInvintationData>, string, never, never>;
|
|
121
121
|
addUserToSubTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<AddUserToSubTenantsRequest, boolean>], WithCallback<AddUserToSubTenantsRequest, boolean>, string, never, never>;
|
|
122
122
|
updateUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Partial<ITeamUser>, ITeamUser>], WithCallback<Partial<ITeamUser>, ITeamUser>, string, never, never>;
|
|
123
123
|
deleteUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IDeleteUser, boolean>], WithCallback<IDeleteUser, boolean>, string, never, never>;
|
|
@@ -159,7 +159,7 @@ declare type DispatchedActions = {
|
|
|
159
159
|
loadUsers: (payload: WithCallback<WithSilentLoad<ILoadUsers>, ITeamUser[]>) => void;
|
|
160
160
|
loadAllSubTenantsUsers: (payload: WithCallback<WithSilentLoad<Partial<ILoadAllUsers>>, ISubTenantUser[]>) => void;
|
|
161
161
|
loadRoles: (payload?: LoadRolesAndPermissionsPayload) => void;
|
|
162
|
-
addUsersBulk: (payload: WithCallback<IAddUsers>) => void;
|
|
162
|
+
addUsersBulk: (payload: WithCallback<IAddUsers, BulkInvintationData>) => void;
|
|
163
163
|
addUser: (payload: WithCallback<IAddUser, ITeamUser>) => void;
|
|
164
164
|
addUserToSubTenants: (payload: WithCallback<AddUserToSubTenantsRequest>) => void;
|
|
165
165
|
setUserRolesForSubTenants: (payload: WithCallback<UpdateUserRolesForSubTenantsRequestDto & {
|
package/auth/TeamState/saga.js
CHANGED
|
@@ -2,25 +2,24 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["callback"],
|
|
4
4
|
_excluded2 = ["roles"],
|
|
5
|
-
_excluded3 = ["
|
|
6
|
-
_excluded4 = ["callback"],
|
|
7
|
-
_excluded5 = ["callback"
|
|
8
|
-
_excluded6 = ["callback"],
|
|
9
|
-
_excluded7 = ["callback"
|
|
5
|
+
_excluded3 = ["callback"],
|
|
6
|
+
_excluded4 = ["callback", "profileImage"],
|
|
7
|
+
_excluded5 = ["callback"],
|
|
8
|
+
_excluded6 = ["callback", "userId"],
|
|
9
|
+
_excluded7 = ["callback"],
|
|
10
10
|
_excluded8 = ["callback"],
|
|
11
11
|
_excluded9 = ["callback"],
|
|
12
12
|
_excluded10 = ["callback"],
|
|
13
13
|
_excluded11 = ["callback"],
|
|
14
14
|
_excluded12 = ["callback"],
|
|
15
15
|
_excluded13 = ["callback"],
|
|
16
|
-
_excluded14 = ["callback"],
|
|
17
|
-
_excluded15 = ["callback"
|
|
16
|
+
_excluded14 = ["callback", "profileImage"],
|
|
17
|
+
_excluded15 = ["callback"],
|
|
18
18
|
_excluded16 = ["callback"],
|
|
19
19
|
_excluded17 = ["callback"],
|
|
20
20
|
_excluded18 = ["callback"],
|
|
21
21
|
_excluded19 = ["callback"],
|
|
22
|
-
_excluded20 = ["callback"]
|
|
23
|
-
_excluded21 = ["callback"];
|
|
22
|
+
_excluded20 = ["callback"];
|
|
24
23
|
import { takeLatest, put, call, all, takeEvery, select as sagaSelect } from 'redux-saga/effects';
|
|
25
24
|
import { api } from '@frontegg/rest-api';
|
|
26
25
|
import { actions } from '../reducer';
|
|
@@ -274,46 +273,46 @@ function* addUsersBulk({
|
|
|
274
273
|
loading: true
|
|
275
274
|
})
|
|
276
275
|
}));
|
|
276
|
+
const allowedEmails = [];
|
|
277
|
+
const unallowedEmails = [];
|
|
278
|
+
const bodies = payload.emails.map(email => ({
|
|
279
|
+
email,
|
|
280
|
+
roleIds: payload.roleIds
|
|
281
|
+
}));
|
|
282
|
+
yield put(actions.setTeamState({
|
|
283
|
+
addUserDialogState: {
|
|
284
|
+
open: true,
|
|
285
|
+
loading: true
|
|
286
|
+
}
|
|
287
|
+
}));
|
|
277
288
|
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
email,
|
|
281
|
-
roleIds: payload.roleIds
|
|
282
|
-
}));
|
|
283
|
-
const response = yield all(bodies.map(body => call(api.teams.addUser, body)));
|
|
284
|
-
let newUsers = [];
|
|
285
|
-
response.forEach(res => {
|
|
286
|
-
const {
|
|
287
|
-
roles
|
|
288
|
-
} = res,
|
|
289
|
-
userWithoutRoleIds = _objectWithoutPropertiesLoose(res, _excluded3);
|
|
290
|
-
|
|
291
|
-
const roleIds = roles.map(role => role.id);
|
|
292
|
-
|
|
293
|
-
const newUser = _extends({}, userWithoutRoleIds, {
|
|
294
|
-
roleIds
|
|
295
|
-
});
|
|
289
|
+
for (let i = 0; i < bodies.length; i++) {
|
|
290
|
+
const body = bodies.at(i);
|
|
296
291
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
open: false,
|
|
304
|
-
loading: false
|
|
305
|
-
}
|
|
306
|
-
}));
|
|
307
|
-
callback == null ? void 0 : callback(true);
|
|
308
|
-
} catch (e) {
|
|
309
|
-
yield put(actions.setTeamState({
|
|
310
|
-
addUserDialogState: _extends({}, teamState.addUserDialogState, {
|
|
311
|
-
loading: false,
|
|
312
|
-
error: e.message
|
|
313
|
-
})
|
|
314
|
-
}));
|
|
315
|
-
callback == null ? void 0 : callback(null, e.message);
|
|
292
|
+
try {
|
|
293
|
+
yield call(api.teams.addUser, body);
|
|
294
|
+
allowedEmails.push(body.email);
|
|
295
|
+
} catch (e) {
|
|
296
|
+
unallowedEmails.push(body.email);
|
|
297
|
+
}
|
|
316
298
|
}
|
|
299
|
+
|
|
300
|
+
const queryObject = {
|
|
301
|
+
pageOffset: 0,
|
|
302
|
+
pageSize: 10,
|
|
303
|
+
filter: [],
|
|
304
|
+
silentLoading: payload.emails.length > 0
|
|
305
|
+
};
|
|
306
|
+
yield put(actions.loadUsers(queryObject));
|
|
307
|
+
yield put(actions.setTeamState({
|
|
308
|
+
addUserDialogState: {
|
|
309
|
+
loading: false
|
|
310
|
+
}
|
|
311
|
+
}));
|
|
312
|
+
callback == null ? void 0 : callback({
|
|
313
|
+
unallowedEmails,
|
|
314
|
+
allowedEmails
|
|
315
|
+
});
|
|
317
316
|
}
|
|
318
317
|
|
|
319
318
|
function* addUserToSubTenants({
|
|
@@ -322,7 +321,7 @@ function* addUserToSubTenants({
|
|
|
322
321
|
const {
|
|
323
322
|
callback
|
|
324
323
|
} = payload,
|
|
325
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
324
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded3);
|
|
326
325
|
|
|
327
326
|
const teamState = yield selectTeamState();
|
|
328
327
|
yield put(actions.setTeamState({
|
|
@@ -373,7 +372,7 @@ function* updateUser({
|
|
|
373
372
|
const {
|
|
374
373
|
callback
|
|
375
374
|
} = payload,
|
|
376
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
375
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded4);
|
|
377
376
|
|
|
378
377
|
const {
|
|
379
378
|
id: userId
|
|
@@ -446,7 +445,7 @@ function* deleteUser({
|
|
|
446
445
|
const {
|
|
447
446
|
callback
|
|
448
447
|
} = payload,
|
|
449
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
448
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded5);
|
|
450
449
|
|
|
451
450
|
const teamState = yield selectTeamState();
|
|
452
451
|
yield put(actions.setTeamState({
|
|
@@ -483,7 +482,7 @@ function* setUserRolesForSubTenants({
|
|
|
483
482
|
callback,
|
|
484
483
|
userId
|
|
485
484
|
} = payload,
|
|
486
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
485
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded6);
|
|
487
486
|
|
|
488
487
|
const teamState = yield selectTeamState();
|
|
489
488
|
yield put(actions.setTeamState({
|
|
@@ -539,7 +538,7 @@ function* deleteUserFromSubTenants({
|
|
|
539
538
|
const {
|
|
540
539
|
callback
|
|
541
540
|
} = payload,
|
|
542
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
541
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded7);
|
|
543
542
|
|
|
544
543
|
const teamState = yield selectTeamState();
|
|
545
544
|
yield put(actions.setTeamState({
|
|
@@ -575,7 +574,7 @@ function* resendActivationLink({
|
|
|
575
574
|
const {
|
|
576
575
|
callback
|
|
577
576
|
} = payload,
|
|
578
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
577
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded8);
|
|
579
578
|
|
|
580
579
|
yield put(actions.setTeamLoader({
|
|
581
580
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
@@ -605,7 +604,7 @@ function* resendInvitationLink({
|
|
|
605
604
|
const {
|
|
606
605
|
callback
|
|
607
606
|
} = payload,
|
|
608
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
607
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded9);
|
|
609
608
|
|
|
610
609
|
yield put(actions.setTeamLoader({
|
|
611
610
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
@@ -635,7 +634,7 @@ function* resendInvitationEmail({
|
|
|
635
634
|
const {
|
|
636
635
|
callback
|
|
637
636
|
} = payload,
|
|
638
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
637
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded10);
|
|
639
638
|
|
|
640
639
|
yield put(actions.setTeamLoader({
|
|
641
640
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
@@ -665,7 +664,7 @@ function* resendInvitationLinkToAllSubTenants({
|
|
|
665
664
|
const {
|
|
666
665
|
callback
|
|
667
666
|
} = payload,
|
|
668
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
667
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded11);
|
|
669
668
|
|
|
670
669
|
yield put(actions.setTeamLoader({
|
|
671
670
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
@@ -1032,7 +1031,7 @@ function* addUserMock({
|
|
|
1032
1031
|
const {
|
|
1033
1032
|
callback
|
|
1034
1033
|
} = payload,
|
|
1035
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1034
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded12);
|
|
1036
1035
|
|
|
1037
1036
|
const teamState = yield selectTeamState();
|
|
1038
1037
|
yield put(actions.setTeamState({
|
|
@@ -1062,7 +1061,7 @@ function* addUserToSubTenantsMock({
|
|
|
1062
1061
|
const {
|
|
1063
1062
|
callback
|
|
1064
1063
|
} = payload,
|
|
1065
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1064
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded13);
|
|
1066
1065
|
|
|
1067
1066
|
const teamState = yield selectTeamState();
|
|
1068
1067
|
yield put(actions.setTeamState({
|
|
@@ -1094,7 +1093,7 @@ function* updateUserMock({
|
|
|
1094
1093
|
const {
|
|
1095
1094
|
callback
|
|
1096
1095
|
} = payload,
|
|
1097
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1096
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded14);
|
|
1098
1097
|
|
|
1099
1098
|
const {
|
|
1100
1099
|
id: userId
|
|
@@ -1151,7 +1150,7 @@ function* deleteUserMock({
|
|
|
1151
1150
|
const {
|
|
1152
1151
|
callback
|
|
1153
1152
|
} = payload,
|
|
1154
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1153
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded15);
|
|
1155
1154
|
|
|
1156
1155
|
const teamState = yield selectTeamState();
|
|
1157
1156
|
yield put(actions.setTeamState({
|
|
@@ -1176,7 +1175,7 @@ function* deleteUserFromSubTenantsMock({
|
|
|
1176
1175
|
const {
|
|
1177
1176
|
callback
|
|
1178
1177
|
} = payload,
|
|
1179
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1178
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded16);
|
|
1180
1179
|
|
|
1181
1180
|
const teamState = yield selectTeamState();
|
|
1182
1181
|
yield put(actions.setTeamState({
|
|
@@ -1201,7 +1200,7 @@ function* resendActivationLinkMock({
|
|
|
1201
1200
|
const {
|
|
1202
1201
|
callback
|
|
1203
1202
|
} = payload,
|
|
1204
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1203
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded17);
|
|
1205
1204
|
|
|
1206
1205
|
yield put(actions.setTeamLoader({
|
|
1207
1206
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
@@ -1221,7 +1220,7 @@ function* resendInvitationLinkMock({
|
|
|
1221
1220
|
const {
|
|
1222
1221
|
callback
|
|
1223
1222
|
} = payload,
|
|
1224
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1223
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded18);
|
|
1225
1224
|
|
|
1226
1225
|
yield put(actions.setTeamLoader({
|
|
1227
1226
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
@@ -1241,7 +1240,7 @@ function* resendInvitationEmailMock({
|
|
|
1241
1240
|
const {
|
|
1242
1241
|
callback
|
|
1243
1242
|
} = payload,
|
|
1244
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1243
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded19);
|
|
1245
1244
|
|
|
1246
1245
|
yield put(actions.setTeamLoader({
|
|
1247
1246
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
|
@@ -1261,7 +1260,7 @@ function* resendInvitationLinkToAllSubTenantsMock({
|
|
|
1261
1260
|
const {
|
|
1262
1261
|
callback
|
|
1263
1262
|
} = payload,
|
|
1264
|
-
body = _objectWithoutPropertiesLoose(payload,
|
|
1263
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded20);
|
|
1265
1264
|
|
|
1266
1265
|
yield put(actions.setTeamLoader({
|
|
1267
1266
|
key: TeamStateKeys.RESEND_INVITATION_LINK,
|
package/auth/index.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ declare const _default: {
|
|
|
175
175
|
} | null, error?: string | undefined) => void) | undefined;
|
|
176
176
|
} | undefined, string, never, never>;
|
|
177
177
|
addUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IAddUser, import("@frontegg/rest-api").ITeamUser>], import("..").WithCallback<import("@frontegg/rest-api").IAddUser, import("@frontegg/rest-api").ITeamUser>, string, never, never>;
|
|
178
|
-
addUsersBulk: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("./TeamState/interfaces").IAddUsers,
|
|
178
|
+
addUsersBulk: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("./TeamState/interfaces").IAddUsers, import("./TeamState/interfaces").BulkInvintationData>], import("..").WithCallback<import("./TeamState/interfaces").IAddUsers, import("./TeamState/interfaces").BulkInvintationData>, string, never, never>;
|
|
179
179
|
addUserToSubTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").AddUserToSubTenantsRequest, boolean>], import("..").WithCallback<import("@frontegg/rest-api").AddUserToSubTenantsRequest, boolean>, string, never, never>;
|
|
180
180
|
updateUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Partial<import("@frontegg/rest-api").ITeamUser>, import("@frontegg/rest-api").ITeamUser>], import("..").WithCallback<Partial<import("@frontegg/rest-api").ITeamUser>, import("@frontegg/rest-api").ITeamUser>, string, never, never>;
|
|
181
181
|
deleteUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>, string, never, never>;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ declare const actions: {
|
|
|
143
143
|
} | null, error?: string | undefined) => void) | undefined;
|
|
144
144
|
} | undefined, string, never, never>;
|
|
145
145
|
addUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IAddUser, import("@frontegg/rest-api").ITeamUser>], import("..").WithCallback<import("@frontegg/rest-api").IAddUser, import("@frontegg/rest-api").ITeamUser>, string, never, never>;
|
|
146
|
-
addUsersBulk: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import(".").IAddUsers,
|
|
146
|
+
addUsersBulk: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import(".").IAddUsers, import(".").BulkInvintationData>], import("..").WithCallback<import(".").IAddUsers, import(".").BulkInvintationData>, string, never, never>;
|
|
147
147
|
addUserToSubTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").AddUserToSubTenantsRequest, boolean>], import("..").WithCallback<import("@frontegg/rest-api").AddUserToSubTenantsRequest, boolean>, string, never, never>;
|
|
148
148
|
updateUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Partial<import("@frontegg/rest-api").ITeamUser>, import("@frontegg/rest-api").ITeamUser>], import("..").WithCallback<Partial<import("@frontegg/rest-api").ITeamUser>, import("@frontegg/rest-api").ITeamUser>, string, never, never>;
|
|
149
149
|
deleteUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IDeleteUser, boolean>, string, never, never>;
|
package/index.js
CHANGED
|
@@ -30,25 +30,24 @@ var _uuid = require("uuid");
|
|
|
30
30
|
|
|
31
31
|
const _excluded = ["callback"],
|
|
32
32
|
_excluded2 = ["roles"],
|
|
33
|
-
_excluded3 = ["
|
|
34
|
-
_excluded4 = ["callback"],
|
|
35
|
-
_excluded5 = ["callback"
|
|
36
|
-
_excluded6 = ["callback"],
|
|
37
|
-
_excluded7 = ["callback"
|
|
33
|
+
_excluded3 = ["callback"],
|
|
34
|
+
_excluded4 = ["callback", "profileImage"],
|
|
35
|
+
_excluded5 = ["callback"],
|
|
36
|
+
_excluded6 = ["callback", "userId"],
|
|
37
|
+
_excluded7 = ["callback"],
|
|
38
38
|
_excluded8 = ["callback"],
|
|
39
39
|
_excluded9 = ["callback"],
|
|
40
40
|
_excluded10 = ["callback"],
|
|
41
41
|
_excluded11 = ["callback"],
|
|
42
42
|
_excluded12 = ["callback"],
|
|
43
43
|
_excluded13 = ["callback"],
|
|
44
|
-
_excluded14 = ["callback"],
|
|
45
|
-
_excluded15 = ["callback"
|
|
44
|
+
_excluded14 = ["callback", "profileImage"],
|
|
45
|
+
_excluded15 = ["callback"],
|
|
46
46
|
_excluded16 = ["callback"],
|
|
47
47
|
_excluded17 = ["callback"],
|
|
48
48
|
_excluded18 = ["callback"],
|
|
49
49
|
_excluded19 = ["callback"],
|
|
50
|
-
_excluded20 = ["callback"]
|
|
51
|
-
_excluded21 = ["callback"];
|
|
50
|
+
_excluded20 = ["callback"];
|
|
52
51
|
|
|
53
52
|
const selectTeamState = () => (0, _effects.select)(_ => _[_constants.authStoreName].teamState); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
53
|
|
|
@@ -289,43 +288,46 @@ function* addUsersBulk({
|
|
|
289
288
|
loading: true
|
|
290
289
|
})
|
|
291
290
|
}));
|
|
291
|
+
const allowedEmails = [];
|
|
292
|
+
const unallowedEmails = [];
|
|
293
|
+
const bodies = payload.emails.map(email => ({
|
|
294
|
+
email,
|
|
295
|
+
roleIds: payload.roleIds
|
|
296
|
+
}));
|
|
297
|
+
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
298
|
+
addUserDialogState: {
|
|
299
|
+
open: true,
|
|
300
|
+
loading: true
|
|
301
|
+
}
|
|
302
|
+
}));
|
|
292
303
|
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
roles
|
|
303
|
-
} = res,
|
|
304
|
-
userWithoutRoleIds = (0, _objectWithoutPropertiesLoose2.default)(res, _excluded3);
|
|
305
|
-
const roleIds = roles.map(role => role.id);
|
|
306
|
-
const newUser = (0, _extends2.default)({}, userWithoutRoleIds, {
|
|
307
|
-
roleIds
|
|
308
|
-
});
|
|
309
|
-
newUsers.push(newUser);
|
|
310
|
-
});
|
|
311
|
-
let newUsersToAdd = newUsers.concat(...teamState.users);
|
|
312
|
-
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
313
|
-
users: newUsersToAdd,
|
|
314
|
-
addUserDialogState: {
|
|
315
|
-
open: false,
|
|
316
|
-
loading: false
|
|
317
|
-
}
|
|
318
|
-
}));
|
|
319
|
-
callback == null ? void 0 : callback(true);
|
|
320
|
-
} catch (e) {
|
|
321
|
-
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
322
|
-
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
323
|
-
loading: false,
|
|
324
|
-
error: e.message
|
|
325
|
-
})
|
|
326
|
-
}));
|
|
327
|
-
callback == null ? void 0 : callback(null, e.message);
|
|
304
|
+
for (let i = 0; i < bodies.length; i++) {
|
|
305
|
+
const body = bodies.at(i);
|
|
306
|
+
|
|
307
|
+
try {
|
|
308
|
+
yield (0, _effects.call)(_restApi.api.teams.addUser, body);
|
|
309
|
+
allowedEmails.push(body.email);
|
|
310
|
+
} catch (e) {
|
|
311
|
+
unallowedEmails.push(body.email);
|
|
312
|
+
}
|
|
328
313
|
}
|
|
314
|
+
|
|
315
|
+
const queryObject = {
|
|
316
|
+
pageOffset: 0,
|
|
317
|
+
pageSize: 10,
|
|
318
|
+
filter: [],
|
|
319
|
+
silentLoading: payload.emails.length > 0
|
|
320
|
+
};
|
|
321
|
+
yield (0, _effects.put)(_reducer.actions.loadUsers(queryObject));
|
|
322
|
+
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
323
|
+
addUserDialogState: {
|
|
324
|
+
loading: false
|
|
325
|
+
}
|
|
326
|
+
}));
|
|
327
|
+
callback == null ? void 0 : callback({
|
|
328
|
+
unallowedEmails,
|
|
329
|
+
allowedEmails
|
|
330
|
+
});
|
|
329
331
|
}
|
|
330
332
|
|
|
331
333
|
function* addUserToSubTenants({
|
|
@@ -334,7 +336,7 @@ function* addUserToSubTenants({
|
|
|
334
336
|
const {
|
|
335
337
|
callback
|
|
336
338
|
} = payload,
|
|
337
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
339
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded3);
|
|
338
340
|
const teamState = yield selectTeamState();
|
|
339
341
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
340
342
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
@@ -384,7 +386,7 @@ function* updateUser({
|
|
|
384
386
|
const {
|
|
385
387
|
callback
|
|
386
388
|
} = payload,
|
|
387
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
389
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded4);
|
|
388
390
|
const {
|
|
389
391
|
id: userId
|
|
390
392
|
} = body;
|
|
@@ -456,7 +458,7 @@ function* deleteUser({
|
|
|
456
458
|
const {
|
|
457
459
|
callback
|
|
458
460
|
} = payload,
|
|
459
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
461
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded5);
|
|
460
462
|
const teamState = yield selectTeamState();
|
|
461
463
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
462
464
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
@@ -492,7 +494,7 @@ function* setUserRolesForSubTenants({
|
|
|
492
494
|
callback,
|
|
493
495
|
userId
|
|
494
496
|
} = payload,
|
|
495
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
497
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded6);
|
|
496
498
|
const teamState = yield selectTeamState();
|
|
497
499
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
498
500
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
@@ -547,7 +549,7 @@ function* deleteUserFromSubTenants({
|
|
|
547
549
|
const {
|
|
548
550
|
callback
|
|
549
551
|
} = payload,
|
|
550
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
552
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded7);
|
|
551
553
|
const teamState = yield selectTeamState();
|
|
552
554
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
553
555
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
@@ -582,7 +584,7 @@ function* resendActivationLink({
|
|
|
582
584
|
const {
|
|
583
585
|
callback
|
|
584
586
|
} = payload,
|
|
585
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
587
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded8);
|
|
586
588
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
587
589
|
key: _interfaces.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
588
590
|
value: body.userId
|
|
@@ -611,7 +613,7 @@ function* resendInvitationLink({
|
|
|
611
613
|
const {
|
|
612
614
|
callback
|
|
613
615
|
} = payload,
|
|
614
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
616
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded9);
|
|
615
617
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
616
618
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
617
619
|
value: body.email
|
|
@@ -640,7 +642,7 @@ function* resendInvitationEmail({
|
|
|
640
642
|
const {
|
|
641
643
|
callback
|
|
642
644
|
} = payload,
|
|
643
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
645
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded10);
|
|
644
646
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
645
647
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
646
648
|
value: body.email
|
|
@@ -669,7 +671,7 @@ function* resendInvitationLinkToAllSubTenants({
|
|
|
669
671
|
const {
|
|
670
672
|
callback
|
|
671
673
|
} = payload,
|
|
672
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
674
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded11);
|
|
673
675
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
674
676
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
675
677
|
value: body.email
|
|
@@ -1036,7 +1038,7 @@ function* addUserMock({
|
|
|
1036
1038
|
const {
|
|
1037
1039
|
callback
|
|
1038
1040
|
} = payload,
|
|
1039
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1041
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded12);
|
|
1040
1042
|
const teamState = yield selectTeamState();
|
|
1041
1043
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1042
1044
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
@@ -1063,7 +1065,7 @@ function* addUserToSubTenantsMock({
|
|
|
1063
1065
|
const {
|
|
1064
1066
|
callback
|
|
1065
1067
|
} = payload,
|
|
1066
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1068
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded13);
|
|
1067
1069
|
const teamState = yield selectTeamState();
|
|
1068
1070
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1069
1071
|
addUserDialogState: (0, _extends2.default)({}, teamState.addUserDialogState, {
|
|
@@ -1092,7 +1094,7 @@ function* updateUserMock({
|
|
|
1092
1094
|
const {
|
|
1093
1095
|
callback
|
|
1094
1096
|
} = payload,
|
|
1095
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1097
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded14);
|
|
1096
1098
|
const {
|
|
1097
1099
|
id: userId
|
|
1098
1100
|
} = body;
|
|
@@ -1146,7 +1148,7 @@ function* deleteUserMock({
|
|
|
1146
1148
|
const {
|
|
1147
1149
|
callback
|
|
1148
1150
|
} = payload,
|
|
1149
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1151
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded15);
|
|
1150
1152
|
const teamState = yield selectTeamState();
|
|
1151
1153
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1152
1154
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
@@ -1170,7 +1172,7 @@ function* deleteUserFromSubTenantsMock({
|
|
|
1170
1172
|
const {
|
|
1171
1173
|
callback
|
|
1172
1174
|
} = payload,
|
|
1173
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1175
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded16);
|
|
1174
1176
|
const teamState = yield selectTeamState();
|
|
1175
1177
|
yield (0, _effects.put)(_reducer.actions.setTeamState({
|
|
1176
1178
|
deleteUserDialogState: (0, _extends2.default)({}, teamState.deleteUserDialogState, {
|
|
@@ -1194,7 +1196,7 @@ function* resendActivationLinkMock({
|
|
|
1194
1196
|
const {
|
|
1195
1197
|
callback
|
|
1196
1198
|
} = payload,
|
|
1197
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1199
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded17);
|
|
1198
1200
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1199
1201
|
key: _interfaces.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
1200
1202
|
value: body.userId
|
|
@@ -1213,7 +1215,7 @@ function* resendInvitationLinkMock({
|
|
|
1213
1215
|
const {
|
|
1214
1216
|
callback
|
|
1215
1217
|
} = payload,
|
|
1216
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1218
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded18);
|
|
1217
1219
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1218
1220
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1219
1221
|
value: body.email
|
|
@@ -1232,7 +1234,7 @@ function* resendInvitationEmailMock({
|
|
|
1232
1234
|
const {
|
|
1233
1235
|
callback
|
|
1234
1236
|
} = payload,
|
|
1235
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1237
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded19);
|
|
1236
1238
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1237
1239
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1238
1240
|
value: body.email
|
|
@@ -1251,7 +1253,7 @@ function* resendInvitationLinkToAllSubTenantsMock({
|
|
|
1251
1253
|
const {
|
|
1252
1254
|
callback
|
|
1253
1255
|
} = payload,
|
|
1254
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(payload,
|
|
1256
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded20);
|
|
1255
1257
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
1256
1258
|
key: _interfaces.TeamStateKeys.RESEND_INVITATION_LINK,
|
|
1257
1259
|
value: body.email
|
package/node/index.js
CHANGED