@frontegg/redux-store 7.122.0 → 7.123.0-alpha.1
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/actions/index.d.ts +1 -0
- package/auth/TeamState/actions/users.actions.d.ts +2 -1
- package/auth/TeamState/actions/users.actions.js +23 -0
- package/auth/TeamState/interfaces.d.ts +3 -0
- package/index.js +1 -1
- package/mocks/auth-mocks/teamActions.mocks.d.ts +1 -0
- package/node/auth/TeamState/actions/users.actions.js +23 -0
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -23,6 +23,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
|
|
|
23
23
|
loadUsersByGetUsersPhoneNumberV2: (payload: WithCallback<import("../../../interfaces").WithRetryConfig<import("../../../interfaces").WithSilentLoad<import("../interfaces").ILoadUsersByGetPhoneNumberV2Payload>>, import("@frontegg/rest-api").ITeamUser[]>) => Promise<void>;
|
|
24
24
|
loadUsersByGetUsernamesV1: (payload: WithCallback<import("../../../interfaces").WithRetryConfig<import("../../../interfaces").WithSilentLoad<import("../interfaces").ILoadUsersByGetUsernamesV1Payload>>, import("@frontegg/rest-api").ITeamUser[]>) => Promise<void>;
|
|
25
25
|
loadUsersByGetEmailsV1: (payload: WithCallback<import("../../../interfaces").WithRetryConfig<import("../../../interfaces").WithSilentLoad<import("../interfaces").ILoadUsersByGetEmailsV1Payload>>, import("@frontegg/rest-api").ITeamUser[]>) => Promise<void>;
|
|
26
|
+
loadUsersByRolesV1: (payload: WithCallback<import("../../../interfaces").WithRetryConfig<import("../../../interfaces").WithSilentLoad<import("../interfaces").ILoadUsersByRolesV1Payload>>, import("@frontegg/rest-api").ITeamUser[]>) => Promise<void>;
|
|
26
27
|
addUser: (payload: WithCallback<import("../interfaces").AddUserPayload, import("@frontegg/rest-api").ITeamUser>) => Promise<void>;
|
|
27
28
|
addUsersBulk: (payload: WithCallback<import("../interfaces").IAddUsers, import("../interfaces").BulkInvintationData>) => Promise<void>;
|
|
28
29
|
updateUser: (payload: WithCallback<import("@frontegg/rest-api").IUpdateUser, import("@frontegg/rest-api").ITeamUser>) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDeleteUser, ILoadUsers, ITeamUser, IUpdateUser, IUpdateUserExpiration } from '@frontegg/rest-api';
|
|
2
2
|
import { FronteggState, RestApi, SharedActions, WithCallback, WithRetryConfig, WithSilentLoad } from '../../../interfaces';
|
|
3
|
-
import { AddUserPayload, BulkInvintationData, IAddUsers, IGetUsersV2Payload, IGetUsersV3Payload, ILoadUsersByGetPhoneNumberV2Payload, ILoadUsersByGetUsernamesV1Payload, ILoadUsersByGetEmailsV1Payload, LoadRolesAndPermissionsPayload } from '../interfaces';
|
|
3
|
+
import { AddUserPayload, BulkInvintationData, IAddUsers, IGetUsersV2Payload, IGetUsersV3Payload, ILoadUsersByGetPhoneNumberV2Payload, ILoadUsersByGetUsernamesV1Payload, ILoadUsersByGetEmailsV1Payload, ILoadUsersByRolesV1Payload, LoadRolesAndPermissionsPayload } from '../interfaces';
|
|
4
4
|
declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
|
|
5
5
|
loadRoles: (payload?: WithRetryConfig<LoadRolesAndPermissionsPayload>) => Promise<void>;
|
|
6
6
|
loadUsers: (payload: WithCallback<WithSilentLoad<ILoadUsers>, ITeamUser[]>) => Promise<void>;
|
|
@@ -9,6 +9,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
|
|
|
9
9
|
loadUsersByGetUsersPhoneNumberV2: (payload: WithCallback<WithRetryConfig<WithSilentLoad<ILoadUsersByGetPhoneNumberV2Payload>>, ITeamUser[]>) => Promise<void>;
|
|
10
10
|
loadUsersByGetUsernamesV1: (payload: WithCallback<WithRetryConfig<WithSilentLoad<ILoadUsersByGetUsernamesV1Payload>>, ITeamUser[]>) => Promise<void>;
|
|
11
11
|
loadUsersByGetEmailsV1: (payload: WithCallback<WithRetryConfig<WithSilentLoad<ILoadUsersByGetEmailsV1Payload>>, ITeamUser[]>) => Promise<void>;
|
|
12
|
+
loadUsersByRolesV1: (payload: WithCallback<WithRetryConfig<WithSilentLoad<ILoadUsersByRolesV1Payload>>, ITeamUser[]>) => Promise<void>;
|
|
12
13
|
addUser: (payload: WithCallback<AddUserPayload, ITeamUser>) => Promise<void>;
|
|
13
14
|
addUsersBulk: (payload: WithCallback<IAddUsers, BulkInvintationData>) => Promise<void>;
|
|
14
15
|
updateUser: (payload: WithCallback<IUpdateUser, ITeamUser>) => Promise<void>;
|
|
@@ -900,6 +900,28 @@ export default ((store, api, sharedActions) => {
|
|
|
900
900
|
_limit: pageSize
|
|
901
901
|
}), shouldLoadRoles, shouldLoadApps);
|
|
902
902
|
};
|
|
903
|
+
const loadUsersByRolesV1 = async payload => {
|
|
904
|
+
const {
|
|
905
|
+
_roleIds,
|
|
906
|
+
shouldLoadRoles = true,
|
|
907
|
+
shouldLoadApps
|
|
908
|
+
} = payload;
|
|
909
|
+
if (!(_roleIds != null && _roleIds.length)) {
|
|
910
|
+
var _payload$callback3;
|
|
911
|
+
sharedActions.setTeamState({
|
|
912
|
+
users: [],
|
|
913
|
+
totalPages: 0,
|
|
914
|
+
totalItems: 0
|
|
915
|
+
});
|
|
916
|
+
(_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, []);
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
return __loadUsersBySearchCriteria(payload, (pageOffset, pageSize) => api.usersRoles.getUsersByRolesV1({
|
|
920
|
+
_roleIds,
|
|
921
|
+
_offset: pageOffset,
|
|
922
|
+
_limit: pageSize
|
|
923
|
+
}), shouldLoadRoles, shouldLoadApps);
|
|
924
|
+
};
|
|
903
925
|
return {
|
|
904
926
|
loadRoles,
|
|
905
927
|
loadUsers,
|
|
@@ -908,6 +930,7 @@ export default ((store, api, sharedActions) => {
|
|
|
908
930
|
loadUsersByGetUsersPhoneNumberV2,
|
|
909
931
|
loadUsersByGetUsernamesV1,
|
|
910
932
|
loadUsersByGetEmailsV1,
|
|
933
|
+
loadUsersByRolesV1,
|
|
911
934
|
addUser,
|
|
912
935
|
addUsersBulk,
|
|
913
936
|
updateUser,
|
|
@@ -148,6 +148,9 @@ export interface ILoadUsersByGetUsernamesV1Payload extends IBaseUserSearchPayloa
|
|
|
148
148
|
export interface ILoadUsersByGetEmailsV1Payload extends IBaseUserSearchPayload {
|
|
149
149
|
_email: string;
|
|
150
150
|
}
|
|
151
|
+
export interface ILoadUsersByRolesV1Payload extends IBaseUserSearchPayload {
|
|
152
|
+
_roleIds: string[];
|
|
153
|
+
}
|
|
151
154
|
export interface ISearchUsersByAnyFieldPayload extends Partial<IGetUsersV3Payload> {
|
|
152
155
|
callback?: (users: ITeamUser[] | null, error?: any) => void;
|
|
153
156
|
}
|
package/index.js
CHANGED
|
@@ -23,6 +23,7 @@ declare const _default: (store: FronteggState, api: RestApi, actions: SharedActi
|
|
|
23
23
|
loadUsersByGetUsersPhoneNumberV2: (payload: WithCallback<import("../../interfaces").WithRetryConfig<WithSilentLoad<import("../../auth").ILoadUsersByGetPhoneNumberV2Payload>>, ITeamUser[]>) => Promise<void>;
|
|
24
24
|
loadUsersByGetUsernamesV1: (payload: WithCallback<import("../../interfaces").WithRetryConfig<WithSilentLoad<import("../../auth").ILoadUsersByGetUsernamesV1Payload>>, ITeamUser[]>) => Promise<void>;
|
|
25
25
|
loadUsersByGetEmailsV1: (payload: WithCallback<import("../../interfaces").WithRetryConfig<WithSilentLoad<import("../../auth").ILoadUsersByGetEmailsV1Payload>>, ITeamUser[]>) => Promise<void>;
|
|
26
|
+
loadUsersByRolesV1: (payload: WithCallback<import("../../interfaces").WithRetryConfig<WithSilentLoad<import("../../auth").ILoadUsersByRolesV1Payload>>, ITeamUser[]>) => Promise<void>;
|
|
26
27
|
addUser: (payload: WithCallback<import("../../auth").AddUserPayload, ITeamUser>) => Promise<void>;
|
|
27
28
|
addUsersBulk: (payload: WithCallback<import("../../auth").IAddUsers, import("../../auth").BulkInvintationData>) => Promise<void>;
|
|
28
29
|
updateUser: (payload: WithCallback<IUpdateUser, ITeamUser>) => Promise<void>;
|
|
@@ -907,6 +907,28 @@ var _default = (store, api, sharedActions) => {
|
|
|
907
907
|
_limit: pageSize
|
|
908
908
|
}), shouldLoadRoles, shouldLoadApps);
|
|
909
909
|
};
|
|
910
|
+
const loadUsersByRolesV1 = async payload => {
|
|
911
|
+
const {
|
|
912
|
+
_roleIds,
|
|
913
|
+
shouldLoadRoles = true,
|
|
914
|
+
shouldLoadApps
|
|
915
|
+
} = payload;
|
|
916
|
+
if (!(_roleIds != null && _roleIds.length)) {
|
|
917
|
+
var _payload$callback3;
|
|
918
|
+
sharedActions.setTeamState({
|
|
919
|
+
users: [],
|
|
920
|
+
totalPages: 0,
|
|
921
|
+
totalItems: 0
|
|
922
|
+
});
|
|
923
|
+
(_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, []);
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
return __loadUsersBySearchCriteria(payload, (pageOffset, pageSize) => api.usersRoles.getUsersByRolesV1({
|
|
927
|
+
_roleIds,
|
|
928
|
+
_offset: pageOffset,
|
|
929
|
+
_limit: pageSize
|
|
930
|
+
}), shouldLoadRoles, shouldLoadApps);
|
|
931
|
+
};
|
|
910
932
|
return {
|
|
911
933
|
loadRoles,
|
|
912
934
|
loadUsers,
|
|
@@ -915,6 +937,7 @@ var _default = (store, api, sharedActions) => {
|
|
|
915
937
|
loadUsersByGetUsersPhoneNumberV2,
|
|
916
938
|
loadUsersByGetUsernamesV1,
|
|
917
939
|
loadUsersByGetEmailsV1,
|
|
940
|
+
loadUsersByRolesV1,
|
|
918
941
|
addUser,
|
|
919
942
|
addUsersBulk,
|
|
920
943
|
updateUser,
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.123.0-alpha.1",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.
|
|
10
|
+
"@frontegg/rest-api": "7.123.0-alpha.1",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|