@frontegg/redux-store 6.0.3-alpha.4 → 6.2.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/audits/AuditLogsState/index.js +11 -0
- package/audits/AuditLogsState/saga.js +3 -0
- package/audits/AuditsMetadataState/index.js +11 -0
- package/audits/AuditsMetadataState/saga.js +3 -0
- package/audits/backward-compatibility/saga.js +1 -0
- package/audits/index.js +4 -2
- package/auth/AcceptInvitationState/index.js +11 -0
- package/auth/AccountSettingsState/index.js +11 -0
- package/auth/AccountSettingsState/saga.js +3 -0
- package/auth/ActivateState/index.d.ts +12 -3
- package/auth/ActivateState/index.js +11 -0
- package/auth/ApiTokensState/index.js +11 -0
- package/auth/ApiTokensState/saga.js +3 -0
- package/auth/ForgotPasswordState/index.js +11 -0
- package/auth/LoginState/index.js +11 -0
- package/auth/LoginState/saga.js +18 -7
- package/auth/MfaState/index.d.ts +8 -2
- package/auth/MfaState/index.js +11 -0
- package/auth/MfaState/saga.js +3 -0
- package/auth/ProfileState/index.js +11 -0
- package/auth/ProfileState/saga.js +11 -4
- package/auth/ResetPhoneNumberState/index.js +11 -0
- package/auth/RolesState/index.js +11 -0
- package/auth/SSOState/index.js +12 -0
- package/auth/SSOState/saga.js +3 -0
- package/auth/SecurityPolicyState/index.js +11 -0
- package/auth/SecurityPolicyState/saga.js +4 -0
- package/auth/SessionsPolicyState/index.js +11 -0
- package/auth/SessionsState/index.d.ts +8 -0
- package/auth/SessionsState/index.js +11 -0
- package/auth/SessionsState/saga.js +3 -0
- package/auth/SignUp/index.js +11 -0
- package/auth/SocialLogins/index.d.ts +2 -8
- package/auth/SocialLogins/index.js +11 -0
- package/auth/TeamState/index.js +11 -0
- package/auth/TeamState/saga.js +3 -0
- package/auth/TenantsState/index.js +11 -0
- package/auth/TenantsState/saga.js +3 -0
- package/auth/dummy.js +2 -1
- package/auth/index.js +4 -2
- package/auth/interfaces.d.ts +1 -0
- package/auth/saga.js +7 -1
- package/connectivity/ConnectivityState/index.js +7 -0
- package/connectivity/index.js +4 -2
- package/connectivity/saga.js +40 -10
- package/helpers.js +2 -1
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +11 -0
- package/node/audits/AuditLogsState/saga.js +4 -0
- package/node/audits/AuditsMetadataState/index.js +11 -0
- package/node/audits/AuditsMetadataState/saga.js +4 -0
- package/node/audits/backward-compatibility/saga.js +1 -0
- package/node/audits/index.js +2 -0
- package/node/auth/AcceptInvitationState/index.js +11 -0
- package/node/auth/AccountSettingsState/index.js +11 -0
- package/node/auth/AccountSettingsState/saga.js +4 -0
- package/node/auth/ActivateState/index.js +11 -0
- package/node/auth/ApiTokensState/index.js +11 -0
- package/node/auth/ApiTokensState/saga.js +4 -0
- package/node/auth/ForgotPasswordState/index.js +11 -0
- package/node/auth/LoginState/index.js +11 -0
- package/node/auth/LoginState/saga.js +19 -7
- package/node/auth/MfaState/index.js +11 -0
- package/node/auth/MfaState/saga.js +4 -0
- package/node/auth/ProfileState/index.js +11 -0
- package/node/auth/ProfileState/saga.js +12 -4
- package/node/auth/ResetPhoneNumberState/index.js +11 -0
- package/node/auth/RolesState/index.js +11 -0
- package/node/auth/SSOState/index.js +12 -0
- package/node/auth/SSOState/saga.js +4 -0
- package/node/auth/SecurityPolicyState/index.js +11 -0
- package/node/auth/SecurityPolicyState/saga.js +4 -0
- package/node/auth/SessionsPolicyState/index.js +11 -0
- package/node/auth/SessionsState/index.js +11 -0
- package/node/auth/SessionsState/saga.js +4 -0
- package/node/auth/SignUp/index.js +11 -0
- package/node/auth/SocialLogins/index.js +11 -0
- package/node/auth/TeamState/index.js +11 -0
- package/node/auth/TeamState/saga.js +4 -0
- package/node/auth/TenantsState/index.js +11 -0
- package/node/auth/TenantsState/saga.js +4 -0
- package/node/auth/dummy.js +2 -1
- package/node/auth/index.js +2 -0
- package/node/auth/saga.js +7 -1
- package/node/connectivity/ConnectivityState/index.js +7 -0
- package/node/connectivity/index.js +2 -0
- package/node/connectivity/saga.js +40 -10
- package/node/helpers.js +2 -1
- package/node/index.js +1 -1
- package/node/subscriptions/Billing/Information/saga.js +4 -0
- package/node/subscriptions/Billing/Invoices/saga.js +4 -0
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -1
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +1 -0
- package/node/subscriptions/Billing/PaymentMethod/saga.js +4 -0
- package/node/subscriptions/Billing/Subscription/saga.js +6 -1
- package/node/subscriptions/Checkout/saga.js +8 -0
- package/node/subscriptions/Config/saga.js +4 -0
- package/node/subscriptions/Plans/saga.js +4 -0
- package/node/subscriptions/VendorPublicConfig/saga.js +4 -0
- package/node/subscriptions/dummy.js +15 -1
- package/node/subscriptions/index.js +2 -0
- package/node/toolkit/redux-types.js +5 -0
- package/node/vendor/VendorState/index.js +11 -0
- package/node/vendor/index.js +2 -0
- package/node/vendor/saga.js +4 -0
- package/package.json +1 -1
- package/subscriptions/Billing/Information/saga.js +3 -0
- package/subscriptions/Billing/Invoices/saga.js +4 -0
- package/subscriptions/Billing/PaymentMethod/index.js +2 -1
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -0
- package/subscriptions/Billing/PaymentMethod/saga.js +4 -0
- package/subscriptions/Billing/Subscription/saga.js +6 -1
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/saga.js +8 -0
- package/subscriptions/Config/saga.js +4 -0
- package/subscriptions/Plans/saga.js +4 -0
- package/subscriptions/VendorPublicConfig/saga.js +4 -0
- package/subscriptions/dummy.js +15 -1
- package/subscriptions/index.js +3 -1
- package/toolkit/index.d.ts +1 -1
- package/toolkit/redux-types.d.ts +3 -0
- package/toolkit/redux-types.js +1 -0
- package/toolkit/redux.d.ts +2 -1
- package/vendor/VendorState/index.js +11 -0
- package/vendor/index.js +4 -2
- package/vendor/saga.js +3 -0
|
@@ -24,5 +24,16 @@ const actions = {
|
|
|
24
24
|
payload
|
|
25
25
|
}))
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* To be used for actions types after dispatch, and should contains
|
|
29
|
+
* the reducers and actions as standalone function
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
// noinspection JSUnusedLocalSymbols
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
36
|
+
* contains the same functions in reducers and actions
|
|
37
|
+
*/
|
|
27
38
|
const Matcher = {};
|
|
28
39
|
export { auditLogsState, reducers as auditLogsReducers, actions as auditLogsActions };
|
|
@@ -109,6 +109,9 @@ export function* auditLogsSagas() {
|
|
|
109
109
|
yield takeEvery(actions.exportAuditsCsv, exportAuditsCsv);
|
|
110
110
|
yield takeEvery(actions.loadAuditLogs, loadAuditLogs);
|
|
111
111
|
}
|
|
112
|
+
/*********************************
|
|
113
|
+
* Preview Sagas
|
|
114
|
+
*********************************/
|
|
112
115
|
|
|
113
116
|
function* loadAuditLogsMock({
|
|
114
117
|
payload
|
|
@@ -14,5 +14,16 @@ const reducers = {
|
|
|
14
14
|
const actions = {
|
|
15
15
|
loadAuditsMetadata: createAction(`${auditsStoreName}/loadAuditsMetadata`)
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* To be used for actions types after dispatch, and should contains
|
|
19
|
+
* the reducers and actions as standalone function
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// noinspection JSUnusedLocalSymbols
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
26
|
+
* contains the same functions in reducers and actions
|
|
27
|
+
*/
|
|
17
28
|
const Matcher = {};
|
|
18
29
|
export { auditsMetadataState, reducers as auditsMetadataReducers, actions as auditsMetadataActions };
|
|
@@ -28,6 +28,9 @@ function* loadAuditsMetadata() {
|
|
|
28
28
|
export function* auditsMetadataSagas() {
|
|
29
29
|
yield takeEvery(actions.loadAuditsMetadata, loadAuditsMetadata);
|
|
30
30
|
}
|
|
31
|
+
/*********************************
|
|
32
|
+
* Preview Sagas
|
|
33
|
+
*********************************/
|
|
31
34
|
|
|
32
35
|
function* loadAuditsMetadataMock() {
|
|
33
36
|
yield put(actions.setAuditsMetadataState({
|
|
@@ -81,6 +81,7 @@ function* loadAuditsFunction({
|
|
|
81
81
|
sortBy,
|
|
82
82
|
filter
|
|
83
83
|
}, f2o, {
|
|
84
|
+
// TODO: refactor once api become V2 with query field for virtual scroll
|
|
84
85
|
offset: virtualScroll ? rowsData.length + incomeOffset || rowsData.length + offset : incomeOffset || offset,
|
|
85
86
|
count: defaultItemsPerPage
|
|
86
87
|
}));
|
package/audits/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { reducer, actions } from './reducer';
|
|
2
2
|
import { sagas, mockSagas } from './saga';
|
|
3
3
|
import { auditsStoreName as storeName } from '../constants';
|
|
4
|
-
import { initialState } from './initialState';
|
|
4
|
+
import { initialState } from './initialState'; // export types
|
|
5
|
+
|
|
5
6
|
export * from './interfaces';
|
|
6
7
|
export * from './AuditLogsState/interfaces';
|
|
7
8
|
export * from './AuditLogsState';
|
|
8
9
|
export * from './AuditsMetadataState/interfaces';
|
|
9
10
|
export * from './AuditsMetadataState';
|
|
10
|
-
export { sagas as auditsSagas, mockSagas as auditsMockSagas, reducer as auditsReducers, actions as auditsActions, initialState as auditsInitialState, storeName as auditsStoreName };
|
|
11
|
+
export { sagas as auditsSagas, mockSagas as auditsMockSagas, reducer as auditsReducers, actions as auditsActions, initialState as auditsInitialState, storeName as auditsStoreName }; // export store
|
|
12
|
+
|
|
11
13
|
export default {
|
|
12
14
|
sagas,
|
|
13
15
|
mockSagas,
|
|
@@ -16,5 +16,16 @@ const actions = {
|
|
|
16
16
|
payload
|
|
17
17
|
}))
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* To be used for actions types after dispatch, and should contains
|
|
21
|
+
* the reducers and actions as standalone function
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
// noinspection JSUnusedLocalSymbols
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
28
|
+
* contains the same functions in reducers and actions
|
|
29
|
+
*/
|
|
19
30
|
const Matcher = {};
|
|
20
31
|
export { acceptInvitationState, reducers as acceptInvitationReducers, actions as acceptInvitationActions };
|
|
@@ -18,5 +18,16 @@ const actions = {
|
|
|
18
18
|
payload
|
|
19
19
|
}))
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* To be used for actions types after dispatch, and should contains
|
|
23
|
+
* the reducers and actions as standalone function
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
// noinspection JSUnusedLocalSymbols
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
30
|
+
* contains the same functions in reducers and actions
|
|
31
|
+
*/
|
|
21
32
|
const Matcher = {};
|
|
22
33
|
export { accountSettingsState, reducers as accountSettingsReducers, actions as accountSettingsActions };
|
|
@@ -72,6 +72,9 @@ export function* accountSettingsSaga() {
|
|
|
72
72
|
yield takeLeading(actions.saveAccountSettings, saveAccountSettings);
|
|
73
73
|
yield takeLeading(actions.loadAccountSettings, loadAccountSettings);
|
|
74
74
|
}
|
|
75
|
+
/*********************************
|
|
76
|
+
* Preview Sagas
|
|
77
|
+
*********************************/
|
|
75
78
|
|
|
76
79
|
function* saveAccountSettingsMock({
|
|
77
80
|
payload
|
|
@@ -15,7 +15,10 @@ declare const reducers: {
|
|
|
15
15
|
error?: any;
|
|
16
16
|
isAuthenticated: boolean;
|
|
17
17
|
isLoading: boolean;
|
|
18
|
-
keepSessionAlive?: boolean | undefined;
|
|
18
|
+
keepSessionAlive?: boolean | undefined; /**
|
|
19
|
+
* To be used for actions types after dispatch, and should contains
|
|
20
|
+
* the reducers and actions as standalone function
|
|
21
|
+
*/
|
|
19
22
|
user?: import("..").User | null | undefined;
|
|
20
23
|
isSSOAuth: boolean;
|
|
21
24
|
ssoACS?: string | undefined;
|
|
@@ -48,7 +51,10 @@ declare const reducers: {
|
|
|
48
51
|
error?: any;
|
|
49
52
|
isAuthenticated: boolean;
|
|
50
53
|
isLoading: boolean;
|
|
51
|
-
keepSessionAlive?: boolean | undefined;
|
|
54
|
+
keepSessionAlive?: boolean | undefined; /**
|
|
55
|
+
* To be used for actions types after dispatch, and should contains
|
|
56
|
+
* the reducers and actions as standalone function
|
|
57
|
+
*/
|
|
52
58
|
user?: import("..").User | null | undefined;
|
|
53
59
|
isSSOAuth: boolean;
|
|
54
60
|
ssoACS?: string | undefined;
|
|
@@ -87,7 +93,10 @@ declare const reducers: {
|
|
|
87
93
|
error?: any;
|
|
88
94
|
isAuthenticated: boolean;
|
|
89
95
|
isLoading: boolean;
|
|
90
|
-
keepSessionAlive?: boolean | undefined;
|
|
96
|
+
keepSessionAlive?: boolean | undefined; /**
|
|
97
|
+
* To be used for actions types after dispatch, and should contains
|
|
98
|
+
* the reducers and actions as standalone function
|
|
99
|
+
*/
|
|
91
100
|
user?: import("..").User | null | undefined;
|
|
92
101
|
isSSOAuth: boolean;
|
|
93
102
|
ssoACS?: string | undefined;
|
|
@@ -31,5 +31,16 @@ const actions = {
|
|
|
31
31
|
payload
|
|
32
32
|
}))
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* To be used for actions types after dispatch, and should contains
|
|
36
|
+
* the reducers and actions as standalone function
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
// noinspection JSUnusedLocalSymbols
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
43
|
+
* contains the same functions in reducers and actions
|
|
44
|
+
*/
|
|
34
45
|
const Matcher = {};
|
|
35
46
|
export { activateState, reducers as activateAccountReducers, actions as activateAccountActions };
|
|
@@ -50,5 +50,16 @@ const actions = {
|
|
|
50
50
|
payload
|
|
51
51
|
}))
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* To be used for actions types after dispatch, and should contains
|
|
55
|
+
* the reducers and actions as standalone function
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
// noinspection JSUnusedLocalSymbols
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
62
|
+
* contains the same functions in reducers and actions
|
|
63
|
+
*/
|
|
53
64
|
const Matcher = {};
|
|
54
65
|
export { apiTokensState, reducers as apiTokensReducers, actions as apiTokensActions };
|
|
@@ -277,6 +277,9 @@ export function* apiTokensSaga() {
|
|
|
277
277
|
yield takeLatest(actions.deleteTenantApiToken, deleteTenantApiToken);
|
|
278
278
|
yield takeLatest(actions.deleteUserApiToken, deleteUserApiToken);
|
|
279
279
|
}
|
|
280
|
+
/*********************************
|
|
281
|
+
* Preview Sagas
|
|
282
|
+
*********************************/
|
|
280
283
|
|
|
281
284
|
function* loadApiTokensDataMock({
|
|
282
285
|
payload: apiTokenType
|
|
@@ -25,5 +25,16 @@ const actions = {
|
|
|
25
25
|
payload
|
|
26
26
|
}))
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* To be used for actions types after dispatch, and should contains
|
|
30
|
+
* the reducers and actions as standalone function
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
// noinspection JSUnusedLocalSymbols
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
37
|
+
* contains the same functions in reducers and actions
|
|
38
|
+
*/
|
|
28
39
|
const Matcher = {};
|
|
29
40
|
export { forgotPasswordState, reducers as forgotPasswordReducers, actions as forgotPasswordActions };
|
package/auth/LoginState/index.js
CHANGED
|
@@ -84,5 +84,16 @@ const actions = {
|
|
|
84
84
|
payload
|
|
85
85
|
}))
|
|
86
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* To be used for actions types after dispatch, and should contains
|
|
89
|
+
* the reducers and actions as standalone function
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
// noinspection JSUnusedLocalSymbols
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
96
|
+
* contains the same functions in reducers and actions
|
|
97
|
+
*/
|
|
87
98
|
const Matcher = {};
|
|
88
99
|
export { loginState, reducers as loginReducers, actions as loginActions };
|
package/auth/LoginState/saga.js
CHANGED
|
@@ -380,13 +380,16 @@ function* requestHostedLoginAuthorize({
|
|
|
380
380
|
routes: state.auth.routes,
|
|
381
381
|
onRedirectTo: state.auth.onRedirectTo,
|
|
382
382
|
context: state.root.context
|
|
383
|
-
}));
|
|
383
|
+
})); // Generate the relevant params for the redirect
|
|
384
|
+
|
|
384
385
|
const nonce = createRandomString();
|
|
385
386
|
const code_verifier = createRandomString();
|
|
386
|
-
const code_challenge = yield call(generateCodeChallenge, code_verifier);
|
|
387
|
+
const code_challenge = yield call(generateCodeChallenge, code_verifier); // We are saving the verifier in session storage to be able to validate the response
|
|
388
|
+
|
|
387
389
|
localStorage.setItem(HOSTED_LOGIN_VERIFIER_KEY, code_verifier);
|
|
388
390
|
const redirectUrl = `${window.location.origin}${routes.hostedLoginRedirectUrl}`;
|
|
389
|
-
const baseUrl = fetch.getBaseUrl(context, '/oauth/authorize');
|
|
391
|
+
const baseUrl = fetch.getBaseUrl(context, '/oauth/authorize'); // Hard coded for now
|
|
392
|
+
|
|
390
393
|
const oauthUrl = `${baseUrl}/oauth/authorize`;
|
|
391
394
|
|
|
392
395
|
const params = _extends({
|
|
@@ -409,6 +412,7 @@ function* requestHostedLoginAuthorize({
|
|
|
409
412
|
function* handleHostedLoginCallback({
|
|
410
413
|
payload
|
|
411
414
|
}) {
|
|
415
|
+
// Hard coded for now
|
|
412
416
|
const code_verifier = localStorage.getItem(HOSTED_LOGIN_VERIFIER_KEY) || 'INVALID-CODE-VERIFIER';
|
|
413
417
|
const routes = yield select(state => state.auth.routes);
|
|
414
418
|
const redirectUrl = `${window.location.origin}${routes.hostedLoginRedirectUrl}`;
|
|
@@ -418,7 +422,8 @@ function* handleHostedLoginCallback({
|
|
|
418
422
|
code_verifier,
|
|
419
423
|
grant_type: 'authorization_code'
|
|
420
424
|
};
|
|
421
|
-
const user = yield call(api.auth.exchangeOAuthTokens, body);
|
|
425
|
+
const user = yield call(api.auth.exchangeOAuthTokens, body); // TODO: Validate nonce and aud
|
|
426
|
+
|
|
422
427
|
yield put(actions.setState({
|
|
423
428
|
user,
|
|
424
429
|
isAuthenticated: true
|
|
@@ -930,9 +935,11 @@ function* webAuthnPostLogin(_ref10) {
|
|
|
930
935
|
yield put(actions.setLoginState({
|
|
931
936
|
error: undefined
|
|
932
937
|
}));
|
|
933
|
-
yield afterAuthNavigation();
|
|
938
|
+
yield afterAuthNavigation(); // TODO: Itamar why moving callback to inside the else block
|
|
939
|
+
|
|
934
940
|
callback == null ? void 0 : callback(true);
|
|
935
|
-
}
|
|
941
|
+
} // callback?.(true);
|
|
942
|
+
|
|
936
943
|
} catch (e) {
|
|
937
944
|
yield put(actions.setLoginState({
|
|
938
945
|
error: e.message
|
|
@@ -1075,7 +1082,8 @@ function* login({
|
|
|
1075
1082
|
|
|
1076
1083
|
if (isAuthenticated && loginState.flow === LoginFlow.Login) {
|
|
1077
1084
|
yield afterAuthNavigation();
|
|
1078
|
-
}
|
|
1085
|
+
} // TODO: extract item name to constants
|
|
1086
|
+
|
|
1079
1087
|
|
|
1080
1088
|
localStorage.removeItem('register-quick-login');
|
|
1081
1089
|
callback == null ? void 0 : callback(true);
|
|
@@ -1232,6 +1240,9 @@ export function* loginSagas() {
|
|
|
1232
1240
|
yield takeLeading(actions.webAuthnVerifyNewDeviceSession, webAuthnVerifyNewDeviceSession);
|
|
1233
1241
|
yield takeLeading(actions.afterAuthNavigation, afterAuthNavigation);
|
|
1234
1242
|
}
|
|
1243
|
+
/*********************************
|
|
1244
|
+
* Preview Sagas
|
|
1245
|
+
*********************************/
|
|
1235
1246
|
|
|
1236
1247
|
function* requestAuthorizeMock({
|
|
1237
1248
|
payload: firstTime
|
package/auth/MfaState/index.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ declare const reducers: {
|
|
|
12
12
|
type: string;
|
|
13
13
|
}) => {
|
|
14
14
|
onRedirectTo: (path: string, opts?: import("@frontegg/rest-api").RedirectOptions | undefined) => void;
|
|
15
|
-
error?: any;
|
|
15
|
+
error?: any; /**
|
|
16
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
17
|
+
* contains the same functions in reducers and actions
|
|
18
|
+
*/
|
|
16
19
|
isAuthenticated: boolean;
|
|
17
20
|
isLoading: boolean;
|
|
18
21
|
keepSessionAlive?: boolean | undefined;
|
|
@@ -45,7 +48,10 @@ declare const reducers: {
|
|
|
45
48
|
};
|
|
46
49
|
resetMfaState: (state: import("..").AuthState) => {
|
|
47
50
|
onRedirectTo: (path: string, opts?: import("@frontegg/rest-api").RedirectOptions | undefined) => void;
|
|
48
|
-
error?: any;
|
|
51
|
+
error?: any; /**
|
|
52
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
53
|
+
* contains the same functions in reducers and actions
|
|
54
|
+
*/
|
|
49
55
|
isAuthenticated: boolean;
|
|
50
56
|
isLoading: boolean;
|
|
51
57
|
keepSessionAlive?: boolean | undefined;
|
package/auth/MfaState/index.js
CHANGED
|
@@ -24,5 +24,16 @@ const actions = {
|
|
|
24
24
|
payload
|
|
25
25
|
}))
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* To be used for actions types after dispatch, and should contains
|
|
29
|
+
* the reducers and actions as standalone function
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
// noinspection JSUnusedLocalSymbols
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
36
|
+
* contains the same functions in reducers and actions
|
|
37
|
+
*/
|
|
27
38
|
const Matcher = {};
|
|
28
39
|
export { mfaState, reducers as mfaReducers, actions as mfaActions };
|
package/auth/MfaState/saga.js
CHANGED
|
@@ -147,6 +147,9 @@ export function* mfaSagas() {
|
|
|
147
147
|
yield takeEvery(actions.disableMfa, disableMfa);
|
|
148
148
|
yield takeEvery(actions.verifyMfaAfterForce, verifyMfaAfterForce);
|
|
149
149
|
}
|
|
150
|
+
/*********************************
|
|
151
|
+
* Preview Sagas
|
|
152
|
+
*********************************/
|
|
150
153
|
|
|
151
154
|
function* enrollMfaMock() {
|
|
152
155
|
yield put(actions.setMfaState({
|
|
@@ -20,5 +20,16 @@ const actions = {
|
|
|
20
20
|
payload
|
|
21
21
|
}))
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* To be used for actions types after dispatch, and should contains
|
|
25
|
+
* the reducers and actions as standalone function
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
// noinspection JSUnusedLocalSymbols
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
32
|
+
* contains the same functions in reducers and actions
|
|
33
|
+
*/
|
|
23
34
|
const Matcher = {};
|
|
24
35
|
export { profileState, reducers as profileReducers, actions as profileActions };
|
|
@@ -55,11 +55,15 @@ function base64ToFormData(base64, key = 'file') {
|
|
|
55
55
|
|
|
56
56
|
if (matchResult == null) {
|
|
57
57
|
return null;
|
|
58
|
-
}
|
|
58
|
+
} // Get the content type of the image
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
const contentType = `image/${matchResult[1]}`; // get the real base64 content of the file
|
|
62
|
+
|
|
63
|
+
const data = matchResult[2]; // Convert it to a blob to upload
|
|
64
|
+
|
|
65
|
+
const blob = b64toBlob(data, contentType); // Create a FormData and append the file with "image" as parameter name
|
|
59
66
|
|
|
60
|
-
const contentType = `image/${matchResult[1]}`;
|
|
61
|
-
const data = matchResult[2];
|
|
62
|
-
const blob = b64toBlob(data, contentType);
|
|
63
67
|
const formDataToUpload = new FormData();
|
|
64
68
|
formDataToUpload.append(key, new File([blob], key, {
|
|
65
69
|
type: contentType
|
|
@@ -154,6 +158,9 @@ export function* profileSagas() {
|
|
|
154
158
|
yield takeEvery(actions.saveProfile, saveProfile);
|
|
155
159
|
yield takeEvery(actions.changePassword, changePassword);
|
|
156
160
|
}
|
|
161
|
+
/*********************************
|
|
162
|
+
* Preview Sagas
|
|
163
|
+
*********************************/
|
|
157
164
|
|
|
158
165
|
function* loadProfileMock() {
|
|
159
166
|
yield put(actions.setProfileState({
|
|
@@ -23,5 +23,16 @@ const actions = {
|
|
|
23
23
|
payload
|
|
24
24
|
}))
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* To be used for actions types after dispatch, and should contains
|
|
28
|
+
* the reducers and actions as standalone function
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
// noinspection JSUnusedLocalSymbols
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
35
|
+
* contains the same functions in reducers and actions
|
|
36
|
+
*/
|
|
26
37
|
const Matcher = {};
|
|
27
38
|
export { resetPhoneNumberState, reducers as resetPhoneNumberReducers, actions as resetPhoneNumberActions };
|
package/auth/RolesState/index.js
CHANGED
|
@@ -33,5 +33,16 @@ const actions = {
|
|
|
33
33
|
payload
|
|
34
34
|
}))
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* To be used for actions types after dispatch, and should contains
|
|
38
|
+
* the reducers and actions as standalone function
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
// noinspection JSUnusedLocalSymbols
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
45
|
+
* contains the same functions in reducers and actions
|
|
46
|
+
*/
|
|
36
47
|
const Matcher = {};
|
|
37
48
|
export { rolesState, reducers as rolesReducers, actions as rolesActions };
|
package/auth/SSOState/index.js
CHANGED
|
@@ -57,6 +57,7 @@ const actions = {
|
|
|
57
57
|
saveSSOConfigurations: createAction(`${authStoreName}/saveSSOConfigurations`, payload => ({
|
|
58
58
|
payload
|
|
59
59
|
})),
|
|
60
|
+
// NOTE: use withCallback in case of promise response
|
|
60
61
|
saveSSOConfigurationsFile: createAction(`${authStoreName}/saveSSOConfigurationsFile`, payload => ({
|
|
61
62
|
payload
|
|
62
63
|
})),
|
|
@@ -79,5 +80,16 @@ const actions = {
|
|
|
79
80
|
payload
|
|
80
81
|
}))
|
|
81
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* To be used for actions types after dispatch, and should contains
|
|
85
|
+
* the reducers and actions as standalone function
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
// noinspection JSUnusedLocalSymbols
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
92
|
+
* contains the same functions in reducers and actions
|
|
93
|
+
*/
|
|
82
94
|
const Matcher = {};
|
|
83
95
|
export { ssoState, reducers as ssoReducers, actions as ssoActions };
|
package/auth/SSOState/saga.js
CHANGED
|
@@ -372,6 +372,9 @@ export function* ssoSagas() {
|
|
|
372
372
|
yield takeEvery(actions.createSamlGroup, createSamlGroupFunction);
|
|
373
373
|
yield takeEvery(actions.oidcPostlogin, oidcPostloginFunction);
|
|
374
374
|
}
|
|
375
|
+
/*********************************
|
|
376
|
+
* Preview Sagas
|
|
377
|
+
*********************************/
|
|
375
378
|
|
|
376
379
|
function* loadSSOConfigurationsMock() {
|
|
377
380
|
yield put(actions.setSSOState({
|
|
@@ -65,5 +65,16 @@ const actions = {
|
|
|
65
65
|
loadVendorPasswordConfig: createAction(`${authStoreName}/loadVendorPasswordConfig`),
|
|
66
66
|
loadPublicAuthStrategiesPolicy: createAction(`${authStoreName}/loadPublicAuthStrategiesPolicy`)
|
|
67
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* To be used for actions types after dispatch, and should contains
|
|
70
|
+
* the reducers and actions as standalone function
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
// noinspection JSUnusedLocalSymbols
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
77
|
+
* contains the same functions in reducers and actions
|
|
78
|
+
*/
|
|
68
79
|
const Matcher = {};
|
|
69
80
|
export { securityPolicyState, reducers as securityPolicyReducers, actions as securityPolicyActions };
|
|
@@ -298,6 +298,10 @@ export function* securityPolicySagas() {
|
|
|
298
298
|
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
299
299
|
yield takeEvery(actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
|
|
300
300
|
}
|
|
301
|
+
/*********************************
|
|
302
|
+
* Preview Sagas
|
|
303
|
+
*********************************/
|
|
304
|
+
|
|
301
305
|
export function* loadPublicSecurityPolicyMock() {
|
|
302
306
|
yield put(actions.setSecurityPolicyPublicState({
|
|
303
307
|
loading: true,
|
|
@@ -17,5 +17,16 @@ const actions = {
|
|
|
17
17
|
payload
|
|
18
18
|
}))
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* To be used for actions types after dispatch, and should contains
|
|
22
|
+
* the reducers and actions as standalone function
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// noinspection JSUnusedLocalSymbols
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
29
|
+
* contains the same functions in reducers and actions
|
|
30
|
+
*/
|
|
20
31
|
const Matcher = {};
|
|
21
32
|
export { sessionsPolicyState, reducers as sessionsPolicyReducers, actions as sessionsPolicyActions };
|
|
@@ -10,6 +10,10 @@ declare const reducers: {
|
|
|
10
10
|
payload: Partial<SessionsState>;
|
|
11
11
|
type: string;
|
|
12
12
|
}) => {
|
|
13
|
+
/**
|
|
14
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
15
|
+
* contains the same functions in reducers and actions
|
|
16
|
+
*/
|
|
13
17
|
onRedirectTo: (path: string, opts?: import("@frontegg/rest-api").RedirectOptions | undefined) => void;
|
|
14
18
|
error?: any;
|
|
15
19
|
isAuthenticated: boolean;
|
|
@@ -43,6 +47,10 @@ declare const reducers: {
|
|
|
43
47
|
};
|
|
44
48
|
};
|
|
45
49
|
resetSessionsState: (state: import("..").AuthState) => {
|
|
50
|
+
/**
|
|
51
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
52
|
+
* contains the same functions in reducers and actions
|
|
53
|
+
*/
|
|
46
54
|
onRedirectTo: (path: string, opts?: import("@frontegg/rest-api").RedirectOptions | undefined) => void;
|
|
47
55
|
error?: any;
|
|
48
56
|
isAuthenticated: boolean;
|
|
@@ -22,5 +22,16 @@ const actions = {
|
|
|
22
22
|
payload
|
|
23
23
|
}))
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* To be used for actions types after dispatch, and should contains
|
|
27
|
+
* the reducers and actions as standalone function
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// noinspection JSUnusedLocalSymbols
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
34
|
+
* contains the same functions in reducers and actions
|
|
35
|
+
*/
|
|
25
36
|
const Matcher = {};
|
|
26
37
|
export { sessionsState, reducers as sessionsReducers, actions as sessionsActions };
|
|
@@ -111,6 +111,9 @@ export function* sessionsSaga() {
|
|
|
111
111
|
yield takeLatest(actions.loadCurrentUserSession, loadCurrentUserSession);
|
|
112
112
|
yield takeEvery(actions.revokeUserSessions, revokeUserSessions);
|
|
113
113
|
}
|
|
114
|
+
/*********************************
|
|
115
|
+
* Preview Sagas
|
|
116
|
+
*********************************/
|
|
114
117
|
|
|
115
118
|
function* loadCurrentUserSessionsMock() {
|
|
116
119
|
yield put(actions.setSessionsState({
|
package/auth/SignUp/index.js
CHANGED
|
@@ -21,5 +21,16 @@ const actions = {
|
|
|
21
21
|
})),
|
|
22
22
|
resetSignUpStateSoft: createAction(`${authStoreName}/resetSignUpStateSoft`)
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* To be used for actions types after dispatch, and should contains
|
|
26
|
+
* the reducers and actions as standalone function
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
// noinspection JSUnusedLocalSymbols
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
33
|
+
* contains the same functions in reducers and actions
|
|
34
|
+
*/
|
|
24
35
|
const Matcher = {};
|
|
25
36
|
export { signUpState, reducers as signUpReducers, actions as signUpActions };
|
|
@@ -14,10 +14,7 @@ declare const reducers: {
|
|
|
14
14
|
error?: any;
|
|
15
15
|
isAuthenticated: boolean;
|
|
16
16
|
isLoading: boolean;
|
|
17
|
-
keepSessionAlive?: boolean | undefined;
|
|
18
|
-
* if you see error in matcher that's mean the DispatchAction does not
|
|
19
|
-
* contains the same functions in reducers and actions
|
|
20
|
-
*/
|
|
17
|
+
keepSessionAlive?: boolean | undefined;
|
|
21
18
|
user?: import("..").User | null | undefined;
|
|
22
19
|
isSSOAuth: boolean;
|
|
23
20
|
ssoACS?: string | undefined;
|
|
@@ -50,10 +47,7 @@ declare const reducers: {
|
|
|
50
47
|
error?: any;
|
|
51
48
|
isAuthenticated: boolean;
|
|
52
49
|
isLoading: boolean;
|
|
53
|
-
keepSessionAlive?: boolean | undefined;
|
|
54
|
-
* if you see error in matcher that's mean the DispatchAction does not
|
|
55
|
-
* contains the same functions in reducers and actions
|
|
56
|
-
*/
|
|
50
|
+
keepSessionAlive?: boolean | undefined;
|
|
57
51
|
user?: import("..").User | null | undefined;
|
|
58
52
|
isSSOAuth: boolean;
|
|
59
53
|
ssoACS?: string | undefined;
|
|
@@ -22,5 +22,16 @@ const actions = {
|
|
|
22
22
|
payload
|
|
23
23
|
}))
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* To be used for actions types after dispatch, and should contains
|
|
27
|
+
* the reducers and actions as standalone function
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// noinspection JSUnusedLocalSymbols
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* if you see error in matcher that's mean the DispatchAction does not
|
|
34
|
+
* contains the same functions in reducers and actions
|
|
35
|
+
*/
|
|
25
36
|
const Matcher = {};
|
|
26
37
|
export { socialLoginState, reducers as socialLoginsReducer, actions as socialLoginsActions };
|