@frontegg/redux-store 6.50.0 → 6.51.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/AcceptInvitationState/index.d.ts +2 -0
- package/auth/AccountSettingsState/index.d.ts +2 -8
- package/auth/ActivateState/index.d.ts +15 -0
- package/auth/ApiTokensState/index.d.ts +2 -0
- package/auth/ForgotPasswordState/index.d.ts +2 -0
- package/auth/LoginState/index.d.ts +2 -0
- package/auth/MfaState/index.d.ts +2 -0
- package/auth/ProfileState/index.d.ts +2 -0
- package/auth/Provisioning/index.d.ts +110 -0
- package/auth/Provisioning/index.js +37 -0
- package/auth/Provisioning/interfaces.d.ts +6 -0
- package/auth/Provisioning/interfaces.js +1 -0
- package/auth/Provisioning/saga.d.ts +1 -0
- package/auth/Provisioning/saga.js +132 -0
- package/auth/ResetPhoneNumberState/index.d.ts +2 -0
- package/auth/RestrictionsState/index.d.ts +3 -0
- package/auth/RestrictionsState/saga.js +18 -11
- package/auth/RolesState/index.d.ts +2 -0
- package/auth/SSOState/index.d.ts +2 -0
- package/auth/SecurityPolicyState/index.d.ts +11 -0
- package/auth/SessionsPolicyState/index.d.ts +2 -0
- package/auth/SessionsState/index.d.ts +2 -0
- package/auth/SignUp/index.d.ts +2 -0
- package/auth/SocialLogins/index.d.ts +2 -0
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/TenantsState/index.d.ts +2 -0
- package/auth/index.d.ts +12 -0
- package/auth/index.js +2 -0
- package/auth/initialState.js +3 -1
- package/auth/interfaces.d.ts +2 -0
- package/auth/reducer.d.ts +12 -1
- package/auth/reducer.js +3 -2
- package/auth/saga.js +2 -1
- package/auth/utils.d.ts +4 -0
- package/index.js +1 -1
- package/interfaces.d.ts +3 -0
- package/node/auth/Provisioning/index.js +49 -0
- package/node/auth/Provisioning/interfaces.js +5 -0
- package/node/auth/Provisioning/saga.js +144 -0
- package/node/auth/RestrictionsState/saga.js +19 -11
- package/node/auth/index.js +28 -0
- package/node/auth/initialState.js +4 -1
- package/node/auth/reducer.js +4 -2
- package/node/auth/saga.js +3 -1
- package/node/index.js +1 -1
- package/package.json +2 -2
- package/toolkit/index.d.ts +1 -1
|
@@ -18,6 +18,8 @@ var _restApi = require("@frontegg/rest-api");
|
|
|
18
18
|
|
|
19
19
|
var _reducer = require("../reducer");
|
|
20
20
|
|
|
21
|
+
var _uuid = require("uuid");
|
|
22
|
+
|
|
21
23
|
var _constants = require("../../constants");
|
|
22
24
|
|
|
23
25
|
var _dummy = require("../dummy");
|
|
@@ -494,7 +496,7 @@ function* checkIfUserIpValidMock() {
|
|
|
494
496
|
}
|
|
495
497
|
|
|
496
498
|
function* saveIpRestrictionMock(_ref5) {
|
|
497
|
-
var _ipRestrictionsState$4, _ipRestrictionsState$5;
|
|
499
|
+
var _ipRestrictionsState$4, _ipRestrictionsState$5, _newRestriction$isAct;
|
|
498
500
|
|
|
499
501
|
let {
|
|
500
502
|
payload: {
|
|
@@ -507,17 +509,18 @@ function* saveIpRestrictionMock(_ref5) {
|
|
|
507
509
|
error: null
|
|
508
510
|
}));
|
|
509
511
|
const ipRestrictionsState = yield selectIpRestrictionsState();
|
|
512
|
+
const filteredRestrictions = ipRestrictionsState.data.restrictions.filter(r => r.ip !== newRestriction.ip);
|
|
510
513
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
511
514
|
data: {
|
|
512
515
|
config: (_ipRestrictionsState$4 = (_ipRestrictionsState$5 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$5.config) != null ? _ipRestrictionsState$4 : {
|
|
513
516
|
isActive: false,
|
|
514
517
|
strategy: _restApi.RestrictionType.ALLOW
|
|
515
518
|
},
|
|
516
|
-
restrictions: [...
|
|
519
|
+
restrictions: [...filteredRestrictions, (0, _extends2.default)({}, newRestriction, {
|
|
517
520
|
createdAt: new Date(),
|
|
518
521
|
updatedAt: new Date(),
|
|
519
|
-
id:
|
|
520
|
-
isActive: true,
|
|
522
|
+
id: (0, _uuid.v4)(),
|
|
523
|
+
isActive: (_newRestriction$isAct = newRestriction.isActive) != null ? _newRestriction$isAct : true,
|
|
521
524
|
strategy: ipRestrictionsState.data.config.strategy
|
|
522
525
|
})]
|
|
523
526
|
},
|
|
@@ -533,20 +536,23 @@ function* saveIpRestrictionMock(_ref5) {
|
|
|
533
536
|
}
|
|
534
537
|
|
|
535
538
|
function* saveIpRestrictionsConfigMock(_ref6) {
|
|
539
|
+
var _ipRestrictionsState$6, _ipRestrictionsState$7, _ipRestrictionsState$8;
|
|
540
|
+
|
|
536
541
|
let {
|
|
537
542
|
payload: {
|
|
538
543
|
callback
|
|
539
544
|
}
|
|
540
545
|
} = _ref6,
|
|
541
546
|
config = (0, _objectWithoutPropertiesLoose2.default)(_ref6.payload, _excluded6);
|
|
547
|
+
const ipRestrictionsState = yield selectIpRestrictionsState();
|
|
542
548
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
543
549
|
saving: true,
|
|
544
550
|
error: null
|
|
545
551
|
}));
|
|
546
552
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
547
553
|
data: {
|
|
548
|
-
config,
|
|
549
|
-
restrictions:
|
|
554
|
+
config: (0, _extends2.default)({}, (_ipRestrictionsState$6 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$6.config, config),
|
|
555
|
+
restrictions: (_ipRestrictionsState$7 = (_ipRestrictionsState$8 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$8.restrictions) != null ? _ipRestrictionsState$7 : []
|
|
550
556
|
},
|
|
551
557
|
pagination: {
|
|
552
558
|
_filter: _restApi.RestrictionType.ALLOW,
|
|
@@ -565,10 +571,11 @@ function* saveIpRestrictionsConfigMock(_ref6) {
|
|
|
565
571
|
|
|
566
572
|
function* deleteIpRestrictionMock({
|
|
567
573
|
payload: {
|
|
568
|
-
id
|
|
574
|
+
id,
|
|
575
|
+
callback
|
|
569
576
|
}
|
|
570
577
|
}) {
|
|
571
|
-
var _ipRestrictionsState$
|
|
578
|
+
var _ipRestrictionsState$9;
|
|
572
579
|
|
|
573
580
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
574
581
|
saving: true,
|
|
@@ -577,7 +584,7 @@ function* deleteIpRestrictionMock({
|
|
|
577
584
|
const ipRestrictionsState = yield selectIpRestrictionsState();
|
|
578
585
|
yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
|
|
579
586
|
data: {
|
|
580
|
-
config: ((_ipRestrictionsState$
|
|
587
|
+
config: ((_ipRestrictionsState$9 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$9.config) || {
|
|
581
588
|
isActive: false,
|
|
582
589
|
strategy: _restApi.RestrictionType.ALLOW
|
|
583
590
|
},
|
|
@@ -589,8 +596,10 @@ function* deleteIpRestrictionMock({
|
|
|
589
596
|
_offset: 0
|
|
590
597
|
},
|
|
591
598
|
totalPages: 1,
|
|
592
|
-
saving: false
|
|
599
|
+
saving: false,
|
|
600
|
+
error: null
|
|
593
601
|
}));
|
|
602
|
+
callback == null ? void 0 : callback(true);
|
|
594
603
|
}
|
|
595
604
|
|
|
596
605
|
function* addCurrentUserIpAndActivateMock({
|
|
@@ -628,7 +637,6 @@ function* loadEmailDomainRestrictionsMock() {
|
|
|
628
637
|
loading: true,
|
|
629
638
|
error: null
|
|
630
639
|
}));
|
|
631
|
-
yield (0, _utils.delay)();
|
|
632
640
|
yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
|
|
633
641
|
loading: false,
|
|
634
642
|
data: {
|
package/node/auth/index.js
CHANGED
|
@@ -602,6 +602,34 @@ Object.keys(_interfaces20).forEach(function (key) {
|
|
|
602
602
|
}
|
|
603
603
|
});
|
|
604
604
|
});
|
|
605
|
+
|
|
606
|
+
var _Provisioning = require("./Provisioning");
|
|
607
|
+
|
|
608
|
+
Object.keys(_Provisioning).forEach(function (key) {
|
|
609
|
+
if (key === "default" || key === "__esModule") return;
|
|
610
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
611
|
+
if (key in exports && exports[key] === _Provisioning[key]) return;
|
|
612
|
+
Object.defineProperty(exports, key, {
|
|
613
|
+
enumerable: true,
|
|
614
|
+
get: function () {
|
|
615
|
+
return _Provisioning[key];
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
var _interfaces21 = require("./Provisioning/interfaces");
|
|
621
|
+
|
|
622
|
+
Object.keys(_interfaces21).forEach(function (key) {
|
|
623
|
+
if (key === "default" || key === "__esModule") return;
|
|
624
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
625
|
+
if (key in exports && exports[key] === _interfaces21[key]) return;
|
|
626
|
+
Object.defineProperty(exports, key, {
|
|
627
|
+
enumerable: true,
|
|
628
|
+
get: function () {
|
|
629
|
+
return _interfaces21[key];
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
});
|
|
605
633
|
// export types
|
|
606
634
|
// export store
|
|
607
635
|
var _default = {
|
|
@@ -47,6 +47,8 @@ var _SessionsPolicyState = require("./SessionsPolicyState");
|
|
|
47
47
|
|
|
48
48
|
var _RestrictionsState = require("./RestrictionsState");
|
|
49
49
|
|
|
50
|
+
var _Provisioning = require("./Provisioning");
|
|
51
|
+
|
|
50
52
|
const reinitializeState = {
|
|
51
53
|
isAuthenticated: false,
|
|
52
54
|
isLoading: true,
|
|
@@ -70,7 +72,8 @@ const reinitializeState = {
|
|
|
70
72
|
resetPhoneNumberState: _ResetPhoneNumberState.resetPhoneNumberState,
|
|
71
73
|
sessionsState: _SessionsState.sessionsState,
|
|
72
74
|
sessionsPolicyState: _SessionsPolicyState.sessionsPolicyState,
|
|
73
|
-
restrictionsState: _RestrictionsState.restrictionsState
|
|
75
|
+
restrictionsState: _RestrictionsState.restrictionsState,
|
|
76
|
+
provisioningState: _Provisioning.provisioningState
|
|
74
77
|
};
|
|
75
78
|
exports.reinitializeState = reinitializeState;
|
|
76
79
|
const initialState = (0, _extends2.default)({
|
package/node/auth/reducer.js
CHANGED
|
@@ -55,6 +55,8 @@ var _SessionsPolicyState = require("./SessionsPolicyState");
|
|
|
55
55
|
|
|
56
56
|
var _RestrictionsState = require("./RestrictionsState");
|
|
57
57
|
|
|
58
|
+
var _Provisioning = require("./Provisioning");
|
|
59
|
+
|
|
58
60
|
const {
|
|
59
61
|
reducer,
|
|
60
62
|
actions: sliceActions
|
|
@@ -67,8 +69,8 @@ const {
|
|
|
67
69
|
payload
|
|
68
70
|
}) => (0, _extends2.default)({}, state, payload),
|
|
69
71
|
setUser: (0, _utils.typeReducer)('user')
|
|
70
|
-
}, _LoginState.loginReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers)
|
|
72
|
+
}, _LoginState.loginReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers, _Provisioning.provisioningReducers)
|
|
71
73
|
});
|
|
72
74
|
exports.reducer = reducer;
|
|
73
|
-
const actions = (0, _extends2.default)({}, sliceActions, _LoginState.loginActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions);
|
|
75
|
+
const actions = (0, _extends2.default)({}, sliceActions, _LoginState.loginActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions, _Provisioning.provisioningActions);
|
|
74
76
|
exports.actions = actions;
|
package/node/auth/saga.js
CHANGED
|
@@ -48,8 +48,10 @@ var _saga19 = require("./SessionsPolicyState/saga");
|
|
|
48
48
|
|
|
49
49
|
var _saga20 = require("./RestrictionsState/saga");
|
|
50
50
|
|
|
51
|
+
var _saga21 = require("./Provisioning/saga");
|
|
52
|
+
|
|
51
53
|
function* sagas() {
|
|
52
|
-
yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagas), (0, _effects.call)(_saga6.activateSagas), (0, _effects.call)(_saga7.acceptInvitationSagas), (0, _effects.call)(_saga5.forgotPasswordSagas), (0, _effects.call)(_saga17.resetPhoneNumberSagas), (0, _effects.call)(_saga.ssoSagas), (0, _effects.call)(_saga2.ssoSagas), (0, _effects.call)(_saga3.profileSagas), (0, _effects.call)(_saga4.mfaSagas), (0, _effects.call)(_saga9.teamSagas), (0, _effects.call)(_saga10.socialLoginsSaga), (0, _effects.call)(_saga11.signUpSaga), (0, _effects.call)(_saga12.apiTokensSaga), (0, _effects.call)(_saga13.securityPolicySagas), (0, _effects.call)(_saga14.accountSettingsSaga), (0, _effects.call)(_saga15.tenantsSagas), (0, _effects.call)(_saga16.rolesSagas), (0, _effects.call)(_saga18.sessionsSaga), (0, _effects.call)(_saga19.sessionsPolicySaga), (0, _effects.call)(_saga20.restrictionsSagas)]);
|
|
54
|
+
yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagas), (0, _effects.call)(_saga6.activateSagas), (0, _effects.call)(_saga7.acceptInvitationSagas), (0, _effects.call)(_saga5.forgotPasswordSagas), (0, _effects.call)(_saga17.resetPhoneNumberSagas), (0, _effects.call)(_saga.ssoSagas), (0, _effects.call)(_saga2.ssoSagas), (0, _effects.call)(_saga3.profileSagas), (0, _effects.call)(_saga4.mfaSagas), (0, _effects.call)(_saga9.teamSagas), (0, _effects.call)(_saga10.socialLoginsSaga), (0, _effects.call)(_saga11.signUpSaga), (0, _effects.call)(_saga12.apiTokensSaga), (0, _effects.call)(_saga13.securityPolicySagas), (0, _effects.call)(_saga14.accountSettingsSaga), (0, _effects.call)(_saga15.tenantsSagas), (0, _effects.call)(_saga16.rolesSagas), (0, _effects.call)(_saga18.sessionsSaga), (0, _effects.call)(_saga19.sessionsPolicySaga), (0, _effects.call)(_saga20.restrictionsSagas), (0, _effects.call)(_saga21.provisionSagas)]);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
function* mockSagas() {
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.51.0",
|
|
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
|
-
"@frontegg/rest-api": "^3.0.
|
|
9
|
+
"@frontegg/rest-api": "^3.0.51",
|
|
10
10
|
"@reduxjs/toolkit": "^1.8.5",
|
|
11
11
|
"redux-saga": "^1.2.1",
|
|
12
12
|
"uuid": "^8.3.2"
|
package/toolkit/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface RootState {
|
|
|
15
15
|
urlStrategy: 'hash' | 'path';
|
|
16
16
|
previewMode?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "header" | "loaderComponent">> & {
|
|
18
|
+
export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "header" | "loaderComponent">> & {
|
|
19
19
|
routes?: Partial<AuthPageRoutes> | undefined;
|
|
20
20
|
}) | undefined, overrideInitialState?: Partial<{
|
|
21
21
|
auth: Partial<Omit<AuthState, 'routes'>> & {
|