@frontegg/redux-store 6.104.0-alpha.0 → 6.104.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/MSP/AllAccountsState/index.d.ts +0 -2
- package/auth/MSP/AllAccountsState/index.js +1 -9
- package/auth/MSP/AllAccountsState/saga.js +0 -34
- package/auth/MSP/AllAccountsState/types/stateTypes.d.ts +4 -6
- package/auth/MSP/AllAccountsState/types/stateTypes.js +0 -1
- package/auth/index.d.ts +0 -1
- package/auth/reducer.d.ts +0 -1
- package/index.js +1 -1
- package/node/auth/MSP/AllAccountsState/index.js +1 -9
- package/node/auth/MSP/AllAccountsState/saga.js +0 -34
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -149,7 +149,6 @@ declare const actions: {
|
|
|
149
149
|
} & import("./types").TUserJwtPayload, boolean>], import("../../../interfaces").WithCallback<import("@frontegg/rest-api").UpdateUserRolesForSubTenantsRequestDto & {
|
|
150
150
|
userId: string;
|
|
151
151
|
} & import("./types").TUserJwtPayload, boolean>, string, never, never>;
|
|
152
|
-
getUserJwtForTopAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[void], void, string, never, never>;
|
|
153
152
|
getUserJwtForSubAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../../../interfaces").WithCallback<import("@frontegg/rest-api").GetUserJwtRequestDto, boolean>], import("../../../interfaces").WithCallback<import("@frontegg/rest-api").GetUserJwtRequestDto, boolean>, string, never, never>;
|
|
154
153
|
getParentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./types").TUserJwtPayload], import("./types").TUserJwtPayload, string, never, never>;
|
|
155
154
|
};
|
|
@@ -170,7 +169,6 @@ declare type DispatchedActions = {
|
|
|
170
169
|
getAccountUsers: (payload: IAllAccountsStateActionsPayloads['getAccountUsers']) => void;
|
|
171
170
|
deleteUsersFromAccount: (payload: IAllAccountsStateActionsPayloads['deleteUsersFromAccount']) => void;
|
|
172
171
|
setUserRolesForSubAccount: (payload: IAllAccountsStateActionsPayloads['setUserRolesForSubAccount']) => void;
|
|
173
|
-
getUserJwtForTopAccount: (payload: IAllAccountsStateActionsPayloads['getUserJwtForTopAccount']) => void;
|
|
174
172
|
getUserJwtForSubAccount: (payload: IAllAccountsStateActionsPayloads['getUserJwtForSubAccount']) => void;
|
|
175
173
|
getParentAccounts: (payload: IAllAccountsStateActionsPayloads['getParentAccounts']) => void;
|
|
176
174
|
};
|
|
@@ -17,12 +17,7 @@ const allAccountsState = {
|
|
|
17
17
|
},
|
|
18
18
|
searchAccountsData: [],
|
|
19
19
|
topAccount: {
|
|
20
|
-
tenantId: ''
|
|
21
|
-
userJwt: {
|
|
22
|
-
accessToken: '',
|
|
23
|
-
expiresIn: 0,
|
|
24
|
-
expires: ''
|
|
25
|
-
}
|
|
20
|
+
tenantId: ''
|
|
26
21
|
},
|
|
27
22
|
selectedAccount: {
|
|
28
23
|
tenantId: '',
|
|
@@ -86,9 +81,6 @@ const actions = {
|
|
|
86
81
|
setUserRolesForSubAccount: createAction(`${authStoreName}/setUserRolesForSubAccount`, payload => ({
|
|
87
82
|
payload
|
|
88
83
|
})),
|
|
89
|
-
getUserJwtForTopAccount: createAction(`${authStoreName}/getUserJwtForTopAccount`, payload => ({
|
|
90
|
-
payload
|
|
91
|
-
})),
|
|
92
84
|
getUserJwtForSubAccount: createAction(`${authStoreName}/getUserJwtForSubAccount`, payload => ({
|
|
93
85
|
payload
|
|
94
86
|
})),
|
|
@@ -175,39 +175,6 @@ function* getUserJwtForSubAccount({
|
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
function* getUserJwtForTopAccount() {
|
|
179
|
-
const key = AllAccountsStateKeys.GET_USER_JWT;
|
|
180
|
-
yield put(actions.setAllAccountsLoader({
|
|
181
|
-
key,
|
|
182
|
-
value: true
|
|
183
|
-
}));
|
|
184
|
-
const {
|
|
185
|
-
tenantId
|
|
186
|
-
} = yield selectUserState();
|
|
187
|
-
const {
|
|
188
|
-
topAccount
|
|
189
|
-
} = yield selectAllAccountsState();
|
|
190
|
-
try {
|
|
191
|
-
const userJwt = yield call(api.users.GetUserJwt, {
|
|
192
|
-
tenantId
|
|
193
|
-
});
|
|
194
|
-
yield put(actions.setAllAccountsState({
|
|
195
|
-
topAccount: _extends({}, topAccount, {
|
|
196
|
-
userJwt
|
|
197
|
-
})
|
|
198
|
-
}));
|
|
199
|
-
} catch (e) {
|
|
200
|
-
yield put(actions.setAllAccountsError({
|
|
201
|
-
key,
|
|
202
|
-
value: errorHandler(e)
|
|
203
|
-
}));
|
|
204
|
-
} finally {
|
|
205
|
-
yield put(actions.setAllAccountsLoader({
|
|
206
|
-
key,
|
|
207
|
-
value: false
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
178
|
function* createSubAccount({
|
|
212
179
|
payload
|
|
213
180
|
}) {
|
|
@@ -596,7 +563,6 @@ export function* allAccountsSagas() {
|
|
|
596
563
|
yield takeLatest(actions.loadAccounts, loadAccounts);
|
|
597
564
|
yield takeLatest(actions.searchAccounts, searchAccounts);
|
|
598
565
|
yield takeLatest(actions.updateSubAccountAccessForUser, updateSubAccountAccessForUser);
|
|
599
|
-
yield takeLatest(actions.getUserJwtForTopAccount, getUserJwtForTopAccount);
|
|
600
566
|
yield takeLatest(actions.getUserJwtForSubAccount, getUserJwtForSubAccount);
|
|
601
567
|
yield takeLatest(actions.getParentAccounts, getParentAccounts);
|
|
602
568
|
yield takeLatest(actions.getAccountSettings, getAccountSettings);
|
|
@@ -19,7 +19,7 @@ export declare enum AllAccountsStateKeys {
|
|
|
19
19
|
GET_TEAM_USERS = "GET_TEAM_USERS"
|
|
20
20
|
}
|
|
21
21
|
export declare type TUserJwtPayload = {
|
|
22
|
-
jwt
|
|
22
|
+
jwt?: TUserJwt['accessToken'];
|
|
23
23
|
};
|
|
24
24
|
export declare type TAccountsTree = {
|
|
25
25
|
tenantId: string;
|
|
@@ -27,6 +27,7 @@ export declare type TAccountsTree = {
|
|
|
27
27
|
createdAt?: Date;
|
|
28
28
|
loadMoreLink?: string;
|
|
29
29
|
children?: TAccountsTree[];
|
|
30
|
+
numberOfUsers?: number;
|
|
30
31
|
};
|
|
31
32
|
interface ISelectedAccount extends TAccountsTree {
|
|
32
33
|
users?: IUsersV3Data[];
|
|
@@ -43,9 +44,7 @@ export declare type TAccountsQueryParams = SearchSubTenantsParams & {
|
|
|
43
44
|
export declare type TSetUserRolesForSubAccountRequest = UpdateUserRolesForSubTenantsRequestDto & {
|
|
44
45
|
userId: string;
|
|
45
46
|
};
|
|
46
|
-
export
|
|
47
|
-
userJwt: TUserJwt;
|
|
48
|
-
}
|
|
47
|
+
export declare type TTopLevelAccount = Omit<TAccountsTree, 'children'>;
|
|
49
48
|
export declare type AllAccountsStateIndicator = {
|
|
50
49
|
key: AllAccountsStateKeys;
|
|
51
50
|
value: boolean | string;
|
|
@@ -59,7 +58,7 @@ export interface IAllAccountsState {
|
|
|
59
58
|
accounts: TAccountsTree;
|
|
60
59
|
accountsQueryParams: TAccountsQueryParams;
|
|
61
60
|
searchAccountsData: Omit<TAccountsTree, 'children'>[];
|
|
62
|
-
topAccount:
|
|
61
|
+
topAccount: TTopLevelAccount;
|
|
63
62
|
selectedAccount: TSelectedAccount;
|
|
64
63
|
accountSettings: TAccountSettings;
|
|
65
64
|
teamUsers?: ITeamUser[];
|
|
@@ -75,7 +74,6 @@ export interface IAllAccountsStateActionsPayloads {
|
|
|
75
74
|
updateSubAccount: WithCallback<CreateSubTenantRequest & TUserJwtPayload>;
|
|
76
75
|
deleteSubAccount: WithCallback<RemoveUserFromSubTenantsRequestTenantDto & TUserJwtPayload>;
|
|
77
76
|
updateSubAccountSettings: WithCallback<UpdateSubTenantRequestParams & UpdateSubTenantRequest & TUserJwtPayload>;
|
|
78
|
-
getUserJwtForTopAccount: void;
|
|
79
77
|
getUserJwtForSubAccount: WithCallback<GetUserJwtRequestDto>;
|
|
80
78
|
addUsersToAccount: WithCallback<AddUsersToSubTenantRequest & TUserJwtPayload>;
|
|
81
79
|
deleteUsersFromAccount: WithCallback<RemoveUserFromSubTenantsRequest & TUserJwtPayload>;
|
package/auth/index.d.ts
CHANGED
|
@@ -95,7 +95,6 @@ declare const _default: {
|
|
|
95
95
|
} & import("./MSP/AllAccountsState").TUserJwtPayload, boolean>], import("..").WithCallback<import("@frontegg/rest-api").UpdateUserRolesForSubTenantsRequestDto & {
|
|
96
96
|
userId: string;
|
|
97
97
|
} & import("./MSP/AllAccountsState").TUserJwtPayload, boolean>, string, never, never>;
|
|
98
|
-
getUserJwtForTopAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[void], void, string, never, never>;
|
|
99
98
|
getUserJwtForSubAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").GetUserJwtRequestDto, boolean>], import("..").WithCallback<import("@frontegg/rest-api").GetUserJwtRequestDto, boolean>, string, never, never>;
|
|
100
99
|
getParentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./MSP/AllAccountsState").TUserJwtPayload], import("./MSP/AllAccountsState").TUserJwtPayload, string, never, never>;
|
|
101
100
|
loadWebAuthnDevices: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -56,7 +56,6 @@ declare const actions: {
|
|
|
56
56
|
} & import("./MSP/AllAccountsState").TUserJwtPayload, boolean>], import("..").WithCallback<import("@frontegg/rest-api").UpdateUserRolesForSubTenantsRequestDto & {
|
|
57
57
|
userId: string;
|
|
58
58
|
} & import("./MSP/AllAccountsState").TUserJwtPayload, boolean>, string, never, never>;
|
|
59
|
-
getUserJwtForTopAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[void], void, string, never, never>;
|
|
60
59
|
getUserJwtForSubAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").GetUserJwtRequestDto, boolean>], import("..").WithCallback<import("@frontegg/rest-api").GetUserJwtRequestDto, boolean>, string, never, never>;
|
|
61
60
|
getParentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./MSP/AllAccountsState").TUserJwtPayload], import("./MSP/AllAccountsState").TUserJwtPayload, string, never, never>;
|
|
62
61
|
loadWebAuthnDevices: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/index.js
CHANGED
|
@@ -39,12 +39,7 @@ const allAccountsState = {
|
|
|
39
39
|
},
|
|
40
40
|
searchAccountsData: [],
|
|
41
41
|
topAccount: {
|
|
42
|
-
tenantId: ''
|
|
43
|
-
userJwt: {
|
|
44
|
-
accessToken: '',
|
|
45
|
-
expiresIn: 0,
|
|
46
|
-
expires: ''
|
|
47
|
-
}
|
|
42
|
+
tenantId: ''
|
|
48
43
|
},
|
|
49
44
|
selectedAccount: {
|
|
50
45
|
tenantId: '',
|
|
@@ -110,9 +105,6 @@ const actions = {
|
|
|
110
105
|
setUserRolesForSubAccount: (0, _toolkit.createAction)(`${_constants.authStoreName}/setUserRolesForSubAccount`, payload => ({
|
|
111
106
|
payload
|
|
112
107
|
})),
|
|
113
|
-
getUserJwtForTopAccount: (0, _toolkit.createAction)(`${_constants.authStoreName}/getUserJwtForTopAccount`, payload => ({
|
|
114
|
-
payload
|
|
115
|
-
})),
|
|
116
108
|
getUserJwtForSubAccount: (0, _toolkit.createAction)(`${_constants.authStoreName}/getUserJwtForSubAccount`, payload => ({
|
|
117
109
|
payload
|
|
118
110
|
})),
|
|
@@ -186,39 +186,6 @@ function* getUserJwtForSubAccount({
|
|
|
186
186
|
}));
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function* getUserJwtForTopAccount() {
|
|
190
|
-
const key = _stateTypes.AllAccountsStateKeys.GET_USER_JWT;
|
|
191
|
-
yield (0, _effects.put)(_reducer.actions.setAllAccountsLoader({
|
|
192
|
-
key,
|
|
193
|
-
value: true
|
|
194
|
-
}));
|
|
195
|
-
const {
|
|
196
|
-
tenantId
|
|
197
|
-
} = yield selectUserState();
|
|
198
|
-
const {
|
|
199
|
-
topAccount
|
|
200
|
-
} = yield selectAllAccountsState();
|
|
201
|
-
try {
|
|
202
|
-
const userJwt = yield (0, _effects.call)(_restApi.api.users.GetUserJwt, {
|
|
203
|
-
tenantId
|
|
204
|
-
});
|
|
205
|
-
yield (0, _effects.put)(_reducer.actions.setAllAccountsState({
|
|
206
|
-
topAccount: (0, _extends2.default)({}, topAccount, {
|
|
207
|
-
userJwt
|
|
208
|
-
})
|
|
209
|
-
}));
|
|
210
|
-
} catch (e) {
|
|
211
|
-
yield (0, _effects.put)(_reducer.actions.setAllAccountsError({
|
|
212
|
-
key,
|
|
213
|
-
value: (0, _utils.errorHandler)(e)
|
|
214
|
-
}));
|
|
215
|
-
} finally {
|
|
216
|
-
yield (0, _effects.put)(_reducer.actions.setAllAccountsLoader({
|
|
217
|
-
key,
|
|
218
|
-
value: false
|
|
219
|
-
}));
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
189
|
function* createSubAccount({
|
|
223
190
|
payload
|
|
224
191
|
}) {
|
|
@@ -607,7 +574,6 @@ function* allAccountsSagas() {
|
|
|
607
574
|
yield (0, _effects.takeLatest)(_reducer.actions.loadAccounts, loadAccounts);
|
|
608
575
|
yield (0, _effects.takeLatest)(_reducer.actions.searchAccounts, searchAccounts);
|
|
609
576
|
yield (0, _effects.takeLatest)(_reducer.actions.updateSubAccountAccessForUser, updateSubAccountAccessForUser);
|
|
610
|
-
yield (0, _effects.takeLatest)(_reducer.actions.getUserJwtForTopAccount, getUserJwtForTopAccount);
|
|
611
577
|
yield (0, _effects.takeLatest)(_reducer.actions.getUserJwtForSubAccount, getUserJwtForSubAccount);
|
|
612
578
|
yield (0, _effects.takeLatest)(_reducer.actions.getParentAccounts, getParentAccounts);
|
|
613
579
|
yield (0, _effects.takeLatest)(_reducer.actions.getAccountSettings, getAccountSettings);
|
package/node/index.js
CHANGED