@frontegg/redux-store 7.107.0-alpha.2 → 7.108.0-alpha.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/Security/RestrictionsState/actions.d.ts +3 -3
- package/auth/Security/RestrictionsState/actions.js +18 -9
- package/index.js +1 -1
- package/mocks/auth-mocks/security/restrictionsActions.mocks.d.ts +3 -3
- package/mocks/auth-mocks/security/restrictionsActions.mocks.js +3 -0
- package/node/auth/Security/RestrictionsState/actions.js +18 -9
- package/node/index.js +1 -1
- package/node/mocks/auth-mocks/security/restrictionsActions.mocks.js +3 -0
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
|
|
|
7
7
|
setEmailDomainRestrictionsState: (state: Partial<EmailDomainRestrictionsState>) => void;
|
|
8
8
|
setCountryRestrictionsState: (state: Partial<CountryRestrictionsState>) => void;
|
|
9
9
|
__securityCenterSagaWrapper: <T>(action: T) => T;
|
|
10
|
-
loadIpRestrictions: () => Promise<
|
|
10
|
+
loadIpRestrictions: () => Promise<false | undefined>;
|
|
11
11
|
saveIpRestriction: (payload: WithCallback<CreateIpRestriction>) => Promise<void>;
|
|
12
12
|
saveIpRestrictionsConfig: (payload: WithCallback<IPRestrictionsConfig>) => Promise<void>;
|
|
13
13
|
deleteIpRestriction: (payload: WithCallback<{
|
|
@@ -15,13 +15,13 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
|
|
|
15
15
|
}>) => Promise<void>;
|
|
16
16
|
checkIfUserIpValid: () => Promise<void>;
|
|
17
17
|
addCurrentUserIpAndActivate: (payload: WithCallback) => Promise<void>;
|
|
18
|
-
loadEmailDomainRestrictions: () => Promise<
|
|
18
|
+
loadEmailDomainRestrictions: () => Promise<false | undefined>;
|
|
19
19
|
saveEmailDomainRestriction: (payload: SaveEmailDomainRestrictionsPayload) => Promise<void>;
|
|
20
20
|
saveEmailDomainRestrictionsConfig: (payload: SaveEmailDomainRestrictionConfigPayload) => Promise<void>;
|
|
21
21
|
deleteEmailDomainRestriction: (payload: {
|
|
22
22
|
id: string;
|
|
23
23
|
}) => Promise<void>;
|
|
24
|
-
loadCountryRestrictions: () => Promise<
|
|
24
|
+
loadCountryRestrictions: () => Promise<false | undefined>;
|
|
25
25
|
saveCountryRestrictionsConfig: (payload: SaveCountryRestrictionConfigPayload) => Promise<void>;
|
|
26
26
|
saveCountryRestrictions: (payload: SaveCountryRestrictionsPayload) => Promise<void>;
|
|
27
27
|
addCurrentUserCountryAndActivate: (payload: AddCurrentUserCountryAndActivatePayload) => Promise<void>;
|
|
@@ -34,9 +34,13 @@ export default ((store, api, sharedActions) => {
|
|
|
34
34
|
*/
|
|
35
35
|
const __securityCenterSagaWrapper = action => {
|
|
36
36
|
return async (...args) => {
|
|
37
|
-
await action(...args);
|
|
37
|
+
const result = await action(...args);
|
|
38
|
+
if (result === false) {
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
38
41
|
await actions.loadRecommendations(withRetryConfig());
|
|
39
42
|
await actions.loadInsights(withRetryConfig());
|
|
43
|
+
return result;
|
|
40
44
|
};
|
|
41
45
|
};
|
|
42
46
|
const setRestrictionsState = state => {
|
|
@@ -52,6 +56,9 @@ export default ((store, api, sharedActions) => {
|
|
|
52
56
|
Object.assign(store.auth.restrictionsState.countryRestrictions, state);
|
|
53
57
|
};
|
|
54
58
|
const loadIpRestrictions = async () => {
|
|
59
|
+
if (store.auth.restrictionsState.ipRestrictions.loading) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
55
62
|
setIpRestrictionsState({
|
|
56
63
|
loading: true,
|
|
57
64
|
error: null
|
|
@@ -290,6 +297,9 @@ export default ((store, api, sharedActions) => {
|
|
|
290
297
|
}
|
|
291
298
|
};
|
|
292
299
|
const loadEmailDomainRestrictions = async () => {
|
|
300
|
+
if (store.auth.restrictionsState.emailDomainRestrictions.loading) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
293
303
|
setEmailDomainRestrictionsState({
|
|
294
304
|
loading: true,
|
|
295
305
|
error: null
|
|
@@ -415,6 +425,9 @@ export default ((store, api, sharedActions) => {
|
|
|
415
425
|
}
|
|
416
426
|
};
|
|
417
427
|
const loadCountryRestrictions = async () => {
|
|
428
|
+
if (store.auth.restrictionsState.countryRestrictions.loading) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
418
431
|
setCountryRestrictionsState({
|
|
419
432
|
loading: true,
|
|
420
433
|
error: null
|
|
@@ -561,17 +574,13 @@ export default ((store, api, sharedActions) => {
|
|
|
561
574
|
callback == null ? void 0 : callback(false, e);
|
|
562
575
|
}
|
|
563
576
|
};
|
|
564
|
-
const wrappedLoadIpRestrictions = __securityCenterSagaWrapper(loadIpRestrictions);
|
|
565
577
|
const wrappedSaveIpRestriction = __securityCenterSagaWrapper(saveIpRestriction);
|
|
566
578
|
const wrappedSaveIpRestrictionsConfig = __securityCenterSagaWrapper(saveIpRestrictionsConfig);
|
|
567
579
|
const wrappedDeleteIpRestriction = __securityCenterSagaWrapper(deleteIpRestriction);
|
|
568
|
-
const wrappedCheckIfUserIpValid = __securityCenterSagaWrapper(checkIfUserIpValid);
|
|
569
580
|
const wrappedAddCurrentUserIpAndActivate = __securityCenterSagaWrapper(addCurrentUserIpAndActivate);
|
|
570
|
-
const wrappedLoadEmailDomainRestrictions = __securityCenterSagaWrapper(loadEmailDomainRestrictions);
|
|
571
581
|
const wrappedSaveEmailDomainRestriction = __securityCenterSagaWrapper(saveEmailDomainRestriction);
|
|
572
582
|
const wrappedSaveEmailDomainRestrictionsConfig = __securityCenterSagaWrapper(saveEmailDomainRestrictionsConfig);
|
|
573
583
|
const wrappedDeleteEmailDomainRestriction = __securityCenterSagaWrapper(deleteEmailDomainRestriction);
|
|
574
|
-
const wrappedLoadCountryRestrictions = __securityCenterSagaWrapper(loadCountryRestrictions);
|
|
575
584
|
const wrappedSaveCountryRestrictionsConfig = __securityCenterSagaWrapper(saveCountryRestrictionsConfig);
|
|
576
585
|
const wrappedSaveCountryRestrictions = __securityCenterSagaWrapper(saveCountryRestrictions);
|
|
577
586
|
const wrappedAddCurrentUserCountryAndActivate = __securityCenterSagaWrapper(addCurrentUserCountryAndActivate);
|
|
@@ -583,17 +592,17 @@ export default ((store, api, sharedActions) => {
|
|
|
583
592
|
setCountryRestrictionsState,
|
|
584
593
|
__securityCenterSagaWrapper,
|
|
585
594
|
// actions
|
|
586
|
-
loadIpRestrictions
|
|
595
|
+
loadIpRestrictions,
|
|
587
596
|
saveIpRestriction: wrappedSaveIpRestriction,
|
|
588
597
|
saveIpRestrictionsConfig: wrappedSaveIpRestrictionsConfig,
|
|
589
598
|
deleteIpRestriction: wrappedDeleteIpRestriction,
|
|
590
|
-
checkIfUserIpValid
|
|
599
|
+
checkIfUserIpValid,
|
|
591
600
|
addCurrentUserIpAndActivate: wrappedAddCurrentUserIpAndActivate,
|
|
592
|
-
loadEmailDomainRestrictions
|
|
601
|
+
loadEmailDomainRestrictions,
|
|
593
602
|
saveEmailDomainRestriction: wrappedSaveEmailDomainRestriction,
|
|
594
603
|
saveEmailDomainRestrictionsConfig: wrappedSaveEmailDomainRestrictionsConfig,
|
|
595
604
|
deleteEmailDomainRestriction: wrappedDeleteEmailDomainRestriction,
|
|
596
|
-
loadCountryRestrictions
|
|
605
|
+
loadCountryRestrictions,
|
|
597
606
|
saveCountryRestrictionsConfig: wrappedSaveCountryRestrictionsConfig,
|
|
598
607
|
saveCountryRestrictions: wrappedSaveCountryRestrictions,
|
|
599
608
|
addCurrentUserCountryAndActivate: wrappedAddCurrentUserCountryAndActivate
|
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ declare const _default: (store: FronteggState, api: RestApi, actions: SharedActi
|
|
|
8
8
|
setEmailDomainRestrictionsState: (state: Partial<import("../../../auth").EmailDomainRestrictionsState>) => void;
|
|
9
9
|
setCountryRestrictionsState: (state: Partial<import("../../../auth").CountryRestrictionsState>) => void;
|
|
10
10
|
__securityCenterSagaWrapper: <T>(action: T) => T;
|
|
11
|
-
loadIpRestrictions: () => Promise<
|
|
11
|
+
loadIpRestrictions: () => Promise<false | undefined>;
|
|
12
12
|
saveIpRestriction: (payload: WithCallback<CreateIpRestriction>) => Promise<void>;
|
|
13
13
|
saveIpRestrictionsConfig: (payload: WithCallback<IPRestrictionsConfig>) => Promise<void>;
|
|
14
14
|
deleteIpRestriction: (payload: WithCallback<{
|
|
@@ -16,13 +16,13 @@ declare const _default: (store: FronteggState, api: RestApi, actions: SharedActi
|
|
|
16
16
|
}>) => Promise<void>;
|
|
17
17
|
checkIfUserIpValid: () => Promise<void>;
|
|
18
18
|
addCurrentUserIpAndActivate: (payload: WithCallback) => Promise<void>;
|
|
19
|
-
loadEmailDomainRestrictions: () => Promise<
|
|
19
|
+
loadEmailDomainRestrictions: () => Promise<false | undefined>;
|
|
20
20
|
saveEmailDomainRestriction: (payload: SaveEmailDomainRestrictionsPayload) => Promise<void>;
|
|
21
21
|
saveEmailDomainRestrictionsConfig: (payload: SaveEmailDomainRestrictionConfigPayload) => Promise<void>;
|
|
22
22
|
deleteEmailDomainRestriction: (payload: {
|
|
23
23
|
id: string;
|
|
24
24
|
}) => Promise<void>;
|
|
25
|
-
loadCountryRestrictions: () => Promise<
|
|
25
|
+
loadCountryRestrictions: () => Promise<false | undefined>;
|
|
26
26
|
saveCountryRestrictionsConfig: (payload: SaveCountryRestrictionConfigPayload) => Promise<void>;
|
|
27
27
|
saveCountryRestrictions: (payload: SaveCountryRestrictionsPayload) => Promise<void>;
|
|
28
28
|
addCurrentUserCountryAndActivate: (payload: AddCurrentUserCountryAndActivatePayload) => Promise<void>;
|
|
@@ -32,6 +32,7 @@ export default ((store, api, actions) => {
|
|
|
32
32
|
},
|
|
33
33
|
loading: false
|
|
34
34
|
});
|
|
35
|
+
return undefined;
|
|
35
36
|
};
|
|
36
37
|
mockedActions.loadEmailDomainRestrictions = async () => {
|
|
37
38
|
mockedActions.setEmailDomainRestrictionsState({
|
|
@@ -53,6 +54,7 @@ export default ((store, api, actions) => {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
});
|
|
57
|
+
return undefined;
|
|
56
58
|
};
|
|
57
59
|
mockedActions.loadCountryRestrictions = async () => {
|
|
58
60
|
mockedActions.setCountryRestrictionsState({
|
|
@@ -74,6 +76,7 @@ export default ((store, api, actions) => {
|
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
});
|
|
79
|
+
return undefined;
|
|
77
80
|
};
|
|
78
81
|
mockedActions.saveIpRestriction = async payload => {
|
|
79
82
|
var _ipRestrictionsState$, _ipRestrictionsState$2, _newRestriction$isAct;
|
|
@@ -41,9 +41,13 @@ var _default = (store, api, sharedActions) => {
|
|
|
41
41
|
*/
|
|
42
42
|
const __securityCenterSagaWrapper = action => {
|
|
43
43
|
return async (...args) => {
|
|
44
|
-
await action(...args);
|
|
44
|
+
const result = await action(...args);
|
|
45
|
+
if (result === false) {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
45
48
|
await actions.loadRecommendations((0, _helpers.withRetryConfig)());
|
|
46
49
|
await actions.loadInsights((0, _helpers.withRetryConfig)());
|
|
50
|
+
return result;
|
|
47
51
|
};
|
|
48
52
|
};
|
|
49
53
|
const setRestrictionsState = state => {
|
|
@@ -59,6 +63,9 @@ var _default = (store, api, sharedActions) => {
|
|
|
59
63
|
Object.assign(store.auth.restrictionsState.countryRestrictions, state);
|
|
60
64
|
};
|
|
61
65
|
const loadIpRestrictions = async () => {
|
|
66
|
+
if (store.auth.restrictionsState.ipRestrictions.loading) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
62
69
|
setIpRestrictionsState({
|
|
63
70
|
loading: true,
|
|
64
71
|
error: null
|
|
@@ -297,6 +304,9 @@ var _default = (store, api, sharedActions) => {
|
|
|
297
304
|
}
|
|
298
305
|
};
|
|
299
306
|
const loadEmailDomainRestrictions = async () => {
|
|
307
|
+
if (store.auth.restrictionsState.emailDomainRestrictions.loading) {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
300
310
|
setEmailDomainRestrictionsState({
|
|
301
311
|
loading: true,
|
|
302
312
|
error: null
|
|
@@ -422,6 +432,9 @@ var _default = (store, api, sharedActions) => {
|
|
|
422
432
|
}
|
|
423
433
|
};
|
|
424
434
|
const loadCountryRestrictions = async () => {
|
|
435
|
+
if (store.auth.restrictionsState.countryRestrictions.loading) {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
425
438
|
setCountryRestrictionsState({
|
|
426
439
|
loading: true,
|
|
427
440
|
error: null
|
|
@@ -568,17 +581,13 @@ var _default = (store, api, sharedActions) => {
|
|
|
568
581
|
callback == null ? void 0 : callback(false, e);
|
|
569
582
|
}
|
|
570
583
|
};
|
|
571
|
-
const wrappedLoadIpRestrictions = __securityCenterSagaWrapper(loadIpRestrictions);
|
|
572
584
|
const wrappedSaveIpRestriction = __securityCenterSagaWrapper(saveIpRestriction);
|
|
573
585
|
const wrappedSaveIpRestrictionsConfig = __securityCenterSagaWrapper(saveIpRestrictionsConfig);
|
|
574
586
|
const wrappedDeleteIpRestriction = __securityCenterSagaWrapper(deleteIpRestriction);
|
|
575
|
-
const wrappedCheckIfUserIpValid = __securityCenterSagaWrapper(checkIfUserIpValid);
|
|
576
587
|
const wrappedAddCurrentUserIpAndActivate = __securityCenterSagaWrapper(addCurrentUserIpAndActivate);
|
|
577
|
-
const wrappedLoadEmailDomainRestrictions = __securityCenterSagaWrapper(loadEmailDomainRestrictions);
|
|
578
588
|
const wrappedSaveEmailDomainRestriction = __securityCenterSagaWrapper(saveEmailDomainRestriction);
|
|
579
589
|
const wrappedSaveEmailDomainRestrictionsConfig = __securityCenterSagaWrapper(saveEmailDomainRestrictionsConfig);
|
|
580
590
|
const wrappedDeleteEmailDomainRestriction = __securityCenterSagaWrapper(deleteEmailDomainRestriction);
|
|
581
|
-
const wrappedLoadCountryRestrictions = __securityCenterSagaWrapper(loadCountryRestrictions);
|
|
582
591
|
const wrappedSaveCountryRestrictionsConfig = __securityCenterSagaWrapper(saveCountryRestrictionsConfig);
|
|
583
592
|
const wrappedSaveCountryRestrictions = __securityCenterSagaWrapper(saveCountryRestrictions);
|
|
584
593
|
const wrappedAddCurrentUserCountryAndActivate = __securityCenterSagaWrapper(addCurrentUserCountryAndActivate);
|
|
@@ -590,17 +599,17 @@ var _default = (store, api, sharedActions) => {
|
|
|
590
599
|
setCountryRestrictionsState,
|
|
591
600
|
__securityCenterSagaWrapper,
|
|
592
601
|
// actions
|
|
593
|
-
loadIpRestrictions
|
|
602
|
+
loadIpRestrictions,
|
|
594
603
|
saveIpRestriction: wrappedSaveIpRestriction,
|
|
595
604
|
saveIpRestrictionsConfig: wrappedSaveIpRestrictionsConfig,
|
|
596
605
|
deleteIpRestriction: wrappedDeleteIpRestriction,
|
|
597
|
-
checkIfUserIpValid
|
|
606
|
+
checkIfUserIpValid,
|
|
598
607
|
addCurrentUserIpAndActivate: wrappedAddCurrentUserIpAndActivate,
|
|
599
|
-
loadEmailDomainRestrictions
|
|
608
|
+
loadEmailDomainRestrictions,
|
|
600
609
|
saveEmailDomainRestriction: wrappedSaveEmailDomainRestriction,
|
|
601
610
|
saveEmailDomainRestrictionsConfig: wrappedSaveEmailDomainRestrictionsConfig,
|
|
602
611
|
deleteEmailDomainRestriction: wrappedDeleteEmailDomainRestriction,
|
|
603
|
-
loadCountryRestrictions
|
|
612
|
+
loadCountryRestrictions,
|
|
604
613
|
saveCountryRestrictionsConfig: wrappedSaveCountryRestrictionsConfig,
|
|
605
614
|
saveCountryRestrictions: wrappedSaveCountryRestrictions,
|
|
606
615
|
addCurrentUserCountryAndActivate: wrappedAddCurrentUserCountryAndActivate
|
package/node/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var _default = (store, api, actions) => {
|
|
|
39
39
|
},
|
|
40
40
|
loading: false
|
|
41
41
|
});
|
|
42
|
+
return undefined;
|
|
42
43
|
};
|
|
43
44
|
mockedActions.loadEmailDomainRestrictions = async () => {
|
|
44
45
|
mockedActions.setEmailDomainRestrictionsState({
|
|
@@ -60,6 +61,7 @@ var _default = (store, api, actions) => {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
});
|
|
64
|
+
return undefined;
|
|
63
65
|
};
|
|
64
66
|
mockedActions.loadCountryRestrictions = async () => {
|
|
65
67
|
mockedActions.setCountryRestrictionsState({
|
|
@@ -81,6 +83,7 @@ var _default = (store, api, actions) => {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
});
|
|
86
|
+
return undefined;
|
|
84
87
|
};
|
|
85
88
|
mockedActions.saveIpRestriction = async payload => {
|
|
86
89
|
var _ipRestrictionsState$, _ipRestrictionsState$2, _newRestriction$isAct;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.108.0-alpha.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
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.
|
|
10
|
+
"@frontegg/rest-api": "7.108.0-alpha.0",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|