@frontegg/redux-store 6.69.0 → 6.70.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/audits/AuditLogsState/index.js +1 -1
- package/audits/AuditLogsState/saga.js +1 -18
- package/audits/AuditsMetadataState/index.js +1 -1
- package/audits/AuditsMetadataState/saga.js +1 -5
- package/audits/backward-compatibility/saga.js +0 -18
- package/audits/dummy.js +0 -16
- package/audits/index.js +4 -2
- package/audits/reducer.js +0 -2
- package/auth/AcceptInvitationState/index.d.ts +2 -0
- package/auth/AcceptInvitationState/index.js +1 -1
- package/auth/AcceptInvitationState/interfaces.js +0 -1
- package/auth/AcceptInvitationState/saga.js +0 -3
- package/auth/AccountSettingsState/index.d.ts +2 -0
- package/auth/AccountSettingsState/index.js +1 -1
- package/auth/AccountSettingsState/interfaces.d.ts +2 -0
- package/auth/AccountSettingsState/saga.js +1 -11
- package/auth/ActivateState/index.d.ts +3 -0
- package/auth/ActivateState/index.js +1 -1
- package/auth/ActivateState/interfaces.js +0 -1
- package/auth/ActivateState/saga.js +14 -34
- package/auth/ApiTokensState/index.d.ts +2 -0
- package/auth/ApiTokensState/index.js +1 -1
- package/auth/ApiTokensState/interfaces.d.ts +1 -0
- package/auth/ApiTokensState/interfaces.js +0 -1
- package/auth/ApiTokensState/saga.js +1 -44
- package/auth/ForgotPasswordState/index.d.ts +2 -0
- package/auth/ForgotPasswordState/index.js +1 -1
- package/auth/ForgotPasswordState/interfaces.js +0 -1
- package/auth/ForgotPasswordState/saga.js +5 -12
- package/auth/ImpersonationState/index.d.ts +2 -0
- package/auth/ImpersonationState/index.js +1 -1
- package/auth/ImpersonationState/interfaces.js +0 -1
- package/auth/ImpersonationState/saga.js +5 -9
- package/auth/LoginState/index.d.ts +2 -0
- package/auth/LoginState/index.js +1 -1
- package/auth/LoginState/interfaces.js +0 -6
- package/auth/LoginState/saga.d.ts +2 -38
- package/auth/LoginState/saga.js +132 -292
- package/auth/MfaState/index.d.ts +4 -2
- package/auth/MfaState/index.js +1 -1
- package/auth/MfaState/interfaces.d.ts +2 -2
- package/auth/MfaState/interfaces.js +0 -1
- package/auth/MfaState/saga.js +64 -143
- package/auth/ProfileState/index.d.ts +2 -0
- package/auth/ProfileState/index.js +1 -1
- package/auth/ProfileState/saga.js +22 -50
- package/auth/Provisioning/index.d.ts +2 -0
- package/auth/Provisioning/index.js +1 -1
- package/auth/Provisioning/saga.js +11 -23
- package/auth/ResetPhoneNumberState/index.d.ts +2 -0
- package/auth/ResetPhoneNumberState/index.js +1 -1
- package/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/auth/ResetPhoneNumberState/saga.js +17 -26
- package/auth/RestrictionsState/index.d.ts +3 -0
- package/auth/RestrictionsState/index.js +1 -1
- package/auth/RestrictionsState/saga.js +52 -105
- package/auth/RolesState/index.d.ts +2 -0
- package/auth/RolesState/index.js +1 -1
- package/auth/RolesState/saga.js +30 -51
- package/auth/SSOState/index.d.ts +2 -0
- package/auth/SSOState/index.js +1 -1
- package/auth/SSOState/interfaces.js +0 -3
- package/auth/SSOState/saga.js +10 -58
- package/auth/SSOState/saga.v2.js +13 -49
- package/auth/SecurityPolicyState/index.d.ts +13 -0
- package/auth/SecurityPolicyState/index.js +1 -1
- package/auth/SecurityPolicyState/saga.js +36 -90
- package/auth/SessionsPolicyState/index.d.ts +2 -0
- package/auth/SessionsPolicyState/index.js +1 -1
- package/auth/SessionsPolicyState/saga.js +7 -19
- package/auth/SessionsState/index.d.ts +2 -0
- package/auth/SessionsState/index.js +1 -1
- package/auth/SessionsState/saga.js +1 -15
- package/auth/SignUp/index.d.ts +2 -0
- package/auth/SignUp/index.js +1 -1
- package/auth/SignUp/interfaces.js +0 -1
- package/auth/SignUp/saga.js +6 -15
- package/auth/SocialLogins/index.d.ts +2 -0
- package/auth/SocialLogins/index.js +1 -1
- package/auth/SocialLogins/saga.js +10 -20
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/TeamState/index.js +1 -1
- package/auth/TeamState/interfaces.js +0 -1
- package/auth/TeamState/saga.js +85 -205
- package/auth/TenantsState/index.d.ts +2 -0
- package/auth/TenantsState/index.js +1 -1
- package/auth/TenantsState/saga.js +1 -17
- package/auth/index.d.ts +2 -2
- package/auth/index.js +4 -3
- package/auth/interfaces.d.ts +2 -1
- package/auth/interfaces.js +0 -6
- package/auth/reducer.d.ts +2 -2
- package/auth/reducer.js +0 -2
- package/auth/saga.js +2 -1
- package/auth/utils.d.ts +4 -0
- package/auth/utils.js +7 -21
- package/connectivity/ConnectivityState/index.d.ts +9 -0
- package/connectivity/ConnectivityState/index.js +1 -1
- package/connectivity/consts.js +0 -5
- package/connectivity/index.js +4 -2
- package/connectivity/interfaces.d.ts +1 -0
- package/connectivity/reducer.js +0 -2
- package/connectivity/saga.js +48 -85
- package/helpers.js +4 -7
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +1 -8
- package/node/audits/AuditLogsState/saga.js +1 -26
- package/node/audits/AuditsMetadataState/index.js +1 -8
- package/node/audits/AuditsMetadataState/saga.js +1 -10
- package/node/audits/backward-compatibility/index.js +0 -8
- package/node/audits/backward-compatibility/reducer.js +0 -5
- package/node/audits/backward-compatibility/saga.js +0 -23
- package/node/audits/dummy.js +0 -19
- package/node/audits/index.js +0 -14
- package/node/audits/initialState.js +0 -3
- package/node/audits/reducer.js +0 -8
- package/node/audits/saga.js +0 -5
- package/node/audits/utils.js +0 -4
- package/node/auth/AcceptInvitationState/index.js +1 -7
- package/node/auth/AcceptInvitationState/interfaces.js +0 -1
- package/node/auth/AcceptInvitationState/saga.js +0 -7
- package/node/auth/AccountSettingsState/index.js +1 -6
- package/node/auth/AccountSettingsState/saga.js +1 -16
- package/node/auth/ActivateState/index.js +1 -7
- package/node/auth/ActivateState/interfaces.js +0 -1
- package/node/auth/ActivateState/saga.js +14 -41
- package/node/auth/ApiTokensState/index.js +1 -6
- package/node/auth/ApiTokensState/interfaces.js +0 -1
- package/node/auth/ApiTokensState/saga.js +1 -51
- package/node/auth/ForgotPasswordState/index.js +1 -7
- package/node/auth/ForgotPasswordState/interfaces.js +0 -1
- package/node/auth/ForgotPasswordState/saga.js +5 -19
- package/node/auth/ImpersonationState/index.js +1 -7
- package/node/auth/ImpersonationState/interfaces.js +0 -1
- package/node/auth/ImpersonationState/saga.js +5 -15
- package/node/auth/LoginState/index.js +1 -7
- package/node/auth/LoginState/interfaces.js +0 -7
- package/node/auth/LoginState/saga.js +132 -322
- package/node/auth/MfaState/index.js +1 -7
- package/node/auth/MfaState/interfaces.js +0 -1
- package/node/auth/MfaState/saga.js +64 -137
- package/node/auth/ProfileState/index.js +1 -6
- package/node/auth/ProfileState/saga.js +22 -58
- package/node/auth/Provisioning/index.js +1 -6
- package/node/auth/Provisioning/saga.js +11 -28
- package/node/auth/ResetPhoneNumberState/index.js +1 -7
- package/node/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/node/auth/ResetPhoneNumberState/saga.js +17 -32
- package/node/auth/RestrictionsState/index.js +1 -7
- package/node/auth/RestrictionsState/saga.js +52 -109
- package/node/auth/RolesState/index.js +1 -6
- package/node/auth/RolesState/saga.js +30 -54
- package/node/auth/SSOState/index.js +1 -6
- package/node/auth/SSOState/interfaces.js +0 -3
- package/node/auth/SSOState/saga.js +10 -63
- package/node/auth/SSOState/saga.v2.js +13 -53
- package/node/auth/SecurityPolicyState/index.js +1 -6
- package/node/auth/SecurityPolicyState/saga.js +36 -89
- package/node/auth/SessionsPolicyState/index.js +1 -6
- package/node/auth/SessionsPolicyState/saga.js +7 -24
- package/node/auth/SessionsState/index.js +1 -6
- package/node/auth/SessionsState/saga.js +1 -22
- package/node/auth/SignUp/index.js +1 -7
- package/node/auth/SignUp/interfaces.js +0 -1
- package/node/auth/SignUp/saga.js +6 -30
- package/node/auth/SocialLogins/index.js +1 -6
- package/node/auth/SocialLogins/saga.js +10 -33
- package/node/auth/TeamState/index.js +1 -6
- package/node/auth/TeamState/interfaces.js +0 -1
- package/node/auth/TeamState/saga.js +86 -190
- package/node/auth/TenantsState/index.js +1 -6
- package/node/auth/TenantsState/saga.js +1 -24
- package/node/auth/dummy.js +0 -5
- package/node/auth/index.js +0 -90
- package/node/auth/initialState.js +0 -23
- package/node/auth/interfaces.js +0 -6
- package/node/auth/reducer.js +0 -28
- package/node/auth/saga.js +2 -26
- package/node/auth/utils.js +7 -42
- package/node/connectivity/ConnectivityState/index.js +1 -7
- package/node/connectivity/consts.js +1 -7
- package/node/connectivity/index.js +0 -5
- package/node/connectivity/reducer.js +0 -6
- package/node/connectivity/saga.js +47 -91
- package/node/helpers.js +2 -14
- package/node/index.js +1 -17
- package/node/subscriptions/Billing/Information/index.js +0 -7
- package/node/subscriptions/Billing/Information/saga.js +1 -25
- package/node/subscriptions/Billing/Invoices/index.js +0 -6
- package/node/subscriptions/Billing/Invoices/saga.js +1 -13
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -8
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
- package/node/subscriptions/Billing/PaymentMethod/saga.js +1 -17
- package/node/subscriptions/Billing/Subscription/index.js +0 -6
- package/node/subscriptions/Billing/Subscription/saga.js +3 -23
- package/node/subscriptions/Billing/index.js +0 -6
- package/node/subscriptions/Billing/interfaces.js +0 -8
- package/node/subscriptions/Billing/saga.js +0 -7
- package/node/subscriptions/Checkout/index.js +0 -6
- package/node/subscriptions/Checkout/saga.js +2 -22
- package/node/subscriptions/Config/index.js +0 -6
- package/node/subscriptions/Config/saga.js +1 -12
- package/node/subscriptions/Plans/index.js +0 -6
- package/node/subscriptions/Plans/saga.js +1 -13
- package/node/subscriptions/Stripe/index.js +0 -6
- package/node/subscriptions/Stripe/saga.js +0 -8
- package/node/subscriptions/VendorPublicConfig/index.js +0 -6
- package/node/subscriptions/VendorPublicConfig/saga.js +1 -9
- package/node/subscriptions/dummy.js +2 -4
- package/node/subscriptions/general.interfaces.js +0 -5
- package/node/subscriptions/index.js +0 -5
- package/node/subscriptions/interfaces.js +0 -14
- package/node/subscriptions/mapper.js +0 -11
- package/node/subscriptions/reducer.js +0 -9
- package/node/subscriptions/saga.js +0 -9
- package/node/subscriptions/utils.js +0 -6
- package/node/toolkit/index.js +0 -31
- package/node/toolkit/redux-saga.js +0 -3
- package/node/toolkit/redux.js +0 -1
- package/node/vendor/VendorState/index.js +1 -7
- package/node/vendor/index.js +0 -5
- package/node/vendor/reducer.js +0 -6
- package/node/vendor/saga.js +1 -9
- package/package.json +1 -1
- package/subscriptions/Billing/Information/index.js +0 -4
- package/subscriptions/Billing/Information/saga.js +1 -12
- package/subscriptions/Billing/Invoices/index.js +0 -4
- package/subscriptions/Billing/Invoices/saga.js +1 -5
- package/subscriptions/Billing/PaymentMethod/index.js +2 -6
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -1
- package/subscriptions/Billing/PaymentMethod/saga.js +1 -9
- package/subscriptions/Billing/Subscription/index.js +0 -4
- package/subscriptions/Billing/Subscription/saga.js +3 -17
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/index.js +0 -4
- package/subscriptions/Checkout/saga.js +2 -12
- package/subscriptions/Config/index.js +0 -4
- package/subscriptions/Config/saga.js +1 -7
- package/subscriptions/Plans/index.js +0 -2
- package/subscriptions/Plans/saga.js +1 -6
- package/subscriptions/Stripe/index.js +0 -4
- package/subscriptions/Stripe/saga.js +0 -4
- package/subscriptions/VendorPublicConfig/index.js +0 -2
- package/subscriptions/VendorPublicConfig/saga.js +1 -4
- package/subscriptions/dummy.js +3 -2
- package/subscriptions/general.interfaces.js +0 -5
- package/subscriptions/index.js +3 -1
- package/subscriptions/mapper.js +0 -5
- package/toolkit/index.d.ts +1 -1
- package/toolkit/index.js +0 -9
- package/vendor/VendorState/index.js +1 -0
- package/vendor/index.js +4 -2
- package/vendor/reducer.js +0 -2
- package/vendor/saga.js +1 -2
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.auditsMetadataState = exports.auditsMetadataReducers = exports.auditsMetadataActions = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _utils = require("../utils");
|
|
13
|
-
|
|
14
10
|
var _toolkit = require("@reduxjs/toolkit");
|
|
15
|
-
|
|
16
11
|
var _constants = require("../../constants");
|
|
17
|
-
|
|
18
12
|
const auditsMetadataState = {
|
|
19
13
|
loading: true
|
|
20
14
|
};
|
|
@@ -29,14 +23,13 @@ exports.auditsMetadataReducers = reducers;
|
|
|
29
23
|
const actions = {
|
|
30
24
|
loadAuditsMetadata: (0, _toolkit.createAction)(`${_constants.auditsStoreName}/loadAuditsMetadata`)
|
|
31
25
|
};
|
|
26
|
+
|
|
32
27
|
/**
|
|
33
28
|
* To be used for actions types after dispatch, and should contains
|
|
34
29
|
* the reducers and actions as standalone function
|
|
35
30
|
*/
|
|
36
|
-
|
|
37
31
|
exports.auditsMetadataActions = actions;
|
|
38
32
|
// noinspection JSUnusedLocalSymbols
|
|
39
|
-
|
|
40
33
|
/**
|
|
41
34
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
42
35
|
* contains the same functions in reducers and actions
|
|
@@ -5,21 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.auditsMetadataSagas = auditsMetadataSagas;
|
|
7
7
|
exports.auditsMetadataSagasMock = auditsMetadataSagasMock;
|
|
8
|
-
|
|
9
8
|
var _effects = require("redux-saga/effects");
|
|
10
|
-
|
|
11
9
|
var _restApi = require("@frontegg/rest-api");
|
|
12
|
-
|
|
13
10
|
var _reducer = require("../reducer");
|
|
14
|
-
|
|
15
11
|
var _dummy = require("../dummy");
|
|
16
|
-
|
|
17
12
|
function* loadAuditsMetadata() {
|
|
18
13
|
yield (0, _effects.put)(_reducer.actions.setAuditsMetadataState({
|
|
19
14
|
loading: true,
|
|
20
15
|
error: null
|
|
21
16
|
}));
|
|
22
|
-
|
|
23
17
|
try {
|
|
24
18
|
const {
|
|
25
19
|
properties
|
|
@@ -35,21 +29,19 @@ function* loadAuditsMetadata() {
|
|
|
35
29
|
}));
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
function* auditsMetadataSagas() {
|
|
40
33
|
yield (0, _effects.takeEvery)(_reducer.actions.loadAuditsMetadata, loadAuditsMetadata);
|
|
41
34
|
}
|
|
35
|
+
|
|
42
36
|
/*********************************
|
|
43
37
|
* Preview Sagas
|
|
44
38
|
*********************************/
|
|
45
39
|
|
|
46
|
-
|
|
47
40
|
function* loadAuditsMetadataMock() {
|
|
48
41
|
yield (0, _effects.put)(_reducer.actions.setAuditsMetadataState({
|
|
49
42
|
loading: true,
|
|
50
43
|
error: null
|
|
51
44
|
}));
|
|
52
|
-
|
|
53
45
|
try {
|
|
54
46
|
const {
|
|
55
47
|
properties
|
|
@@ -65,7 +57,6 @@ function* loadAuditsMetadataMock() {
|
|
|
65
57
|
}));
|
|
66
58
|
}
|
|
67
59
|
}
|
|
68
|
-
|
|
69
60
|
function* auditsMetadataSagasMock() {
|
|
70
61
|
yield (0, _effects.takeEvery)(_reducer.actions.loadAuditsMetadata, loadAuditsMetadataMock);
|
|
71
62
|
}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _interfaces = require("./interfaces");
|
|
8
|
-
|
|
9
7
|
Object.keys(_interfaces).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _interfaces[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_interfaces).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _reducer = require("./reducer");
|
|
21
|
-
|
|
22
18
|
Object.keys(_reducer).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _reducer[key]) return;
|
|
@@ -29,9 +25,7 @@ Object.keys(_reducer).forEach(function (key) {
|
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var _saga = require("./saga");
|
|
34
|
-
|
|
35
29
|
Object.keys(_saga).forEach(function (key) {
|
|
36
30
|
if (key === "default" || key === "__esModule") return;
|
|
37
31
|
if (key in exports && exports[key] === _saga[key]) return;
|
|
@@ -42,9 +36,7 @@ Object.keys(_saga).forEach(function (key) {
|
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
38
|
});
|
|
45
|
-
|
|
46
39
|
var _initialState = require("./initialState");
|
|
47
|
-
|
|
48
40
|
Object.keys(_initialState).forEach(function (key) {
|
|
49
41
|
if (key === "default" || key === "__esModule") return;
|
|
50
42
|
if (key in exports && exports[key] === _initialState[key]) return;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.storeName = exports.reducer = exports.defaultItemsPerPage = exports.actions = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _toolkit = require("@reduxjs/toolkit");
|
|
13
|
-
|
|
14
10
|
var _initialState = require("./initialState");
|
|
15
|
-
|
|
16
11
|
const defaultItemsPerPage = 20;
|
|
17
12
|
exports.defaultItemsPerPage = defaultItemsPerPage;
|
|
18
13
|
const {
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.sagas = sagas;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _restApi = require("@frontegg/rest-api");
|
|
13
|
-
|
|
14
10
|
var _reducer = require("./reducer");
|
|
15
|
-
|
|
16
11
|
var _effects = require("redux-saga/effects");
|
|
17
|
-
|
|
18
12
|
const select = () => (0, _effects.select)(_ => _[_reducer.storeName]);
|
|
19
|
-
|
|
20
13
|
function* loadStats() {
|
|
21
14
|
const {
|
|
22
15
|
sortBy,
|
|
23
16
|
sortDirection
|
|
24
17
|
} = yield select();
|
|
25
|
-
|
|
26
18
|
try {
|
|
27
19
|
const stats = yield (0, _effects.call)(_restApi.api.audits.getAuditsStats, {
|
|
28
20
|
sortBy,
|
|
@@ -39,7 +31,6 @@ function* loadStats() {
|
|
|
39
31
|
yield (0, _effects.put)(_reducer.actions.loadItemFailedAction(errorMessage));
|
|
40
32
|
}
|
|
41
33
|
}
|
|
42
|
-
|
|
43
34
|
function* loadMetadata() {
|
|
44
35
|
try {
|
|
45
36
|
const result = yield (0, _effects.call)(_restApi.api.metadata.getAuditsMetadata);
|
|
@@ -53,12 +44,10 @@ function* loadMetadata() {
|
|
|
53
44
|
yield (0, _effects.put)(_reducer.actions.loadItemFailedAction(errorMessage));
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
|
-
|
|
57
47
|
const filterToObject = arr => arr.reduce((res, curr) => {
|
|
58
48
|
res[curr.key] = curr.value;
|
|
59
49
|
return res;
|
|
60
50
|
}, {});
|
|
61
|
-
|
|
62
51
|
function* loadAuditsFunction({
|
|
63
52
|
payload
|
|
64
53
|
}) {
|
|
@@ -80,7 +69,6 @@ function* loadAuditsFunction({
|
|
|
80
69
|
} = appendMode ? yield select() : {
|
|
81
70
|
rowsData: []
|
|
82
71
|
};
|
|
83
|
-
|
|
84
72
|
try {
|
|
85
73
|
const f2o = filterToObject(filters);
|
|
86
74
|
const {
|
|
@@ -101,7 +89,6 @@ function* loadAuditsFunction({
|
|
|
101
89
|
rowsData: [...rowsData, ...data],
|
|
102
90
|
total
|
|
103
91
|
}));
|
|
104
|
-
|
|
105
92
|
if (onlyOneLoad) {
|
|
106
93
|
yield (0, _effects.put)(_reducer.actions.finishLoading());
|
|
107
94
|
}
|
|
@@ -114,7 +101,6 @@ function* loadAuditsFunction({
|
|
|
114
101
|
yield (0, _effects.put)(_reducer.actions.loadItemFailedAction(errorMessage));
|
|
115
102
|
}
|
|
116
103
|
}
|
|
117
|
-
|
|
118
104
|
function* initDataFunction() {
|
|
119
105
|
yield (0, _effects.put)(_reducer.actions.startLoading());
|
|
120
106
|
yield (0, _effects.all)([loadStats(), loadMetadata(), loadAuditsFunction({
|
|
@@ -125,7 +111,6 @@ function* initDataFunction() {
|
|
|
125
111
|
})]);
|
|
126
112
|
yield (0, _effects.put)(_reducer.actions.finishLoading());
|
|
127
113
|
}
|
|
128
|
-
|
|
129
114
|
function* removeFilterFunction({
|
|
130
115
|
payload
|
|
131
116
|
}) {
|
|
@@ -133,15 +118,12 @@ function* removeFilterFunction({
|
|
|
133
118
|
filters: allFilters
|
|
134
119
|
} = yield select();
|
|
135
120
|
const removedFilterIndex = allFilters.findIndex(item => item.key === payload.key);
|
|
136
|
-
|
|
137
121
|
if (removedFilterIndex < 0) {
|
|
138
122
|
return;
|
|
139
123
|
}
|
|
140
|
-
|
|
141
124
|
const newFilters = [...allFilters.slice(0, removedFilterIndex), ...allFilters.slice(removedFilterIndex + 1)];
|
|
142
125
|
yield (0, _effects.put)(_reducer.actions.setFilterData(newFilters));
|
|
143
126
|
}
|
|
144
|
-
|
|
145
127
|
function* filterDataFunction({
|
|
146
128
|
payload
|
|
147
129
|
}) {
|
|
@@ -149,15 +131,12 @@ function* filterDataFunction({
|
|
|
149
131
|
filters: allFilters
|
|
150
132
|
} = yield select();
|
|
151
133
|
let filterIndex = allFilters.findIndex(item => item.key === payload.key);
|
|
152
|
-
|
|
153
134
|
if (filterIndex < 0) {
|
|
154
135
|
filterIndex = allFilters.length;
|
|
155
136
|
}
|
|
156
|
-
|
|
157
137
|
const newFilters = [...allFilters.slice(0, filterIndex), payload, ...allFilters.slice(filterIndex + 1)];
|
|
158
138
|
yield (0, _effects.put)(_reducer.actions.setFilterData(newFilters));
|
|
159
139
|
}
|
|
160
|
-
|
|
161
140
|
function* exportCsvFunction() {
|
|
162
141
|
const {
|
|
163
142
|
filters,
|
|
@@ -169,7 +148,6 @@ function* exportCsvFunction() {
|
|
|
169
148
|
const f2o = filterToObject(filters);
|
|
170
149
|
yield (0, _effects.put)(_reducer.actions.startDownloadingCsv());
|
|
171
150
|
const outputFileName = `audits.csv`;
|
|
172
|
-
|
|
173
151
|
try {
|
|
174
152
|
yield _restApi.api.audits.exportAudits((0, _extends2.default)({
|
|
175
153
|
endpoint: 'csv/v2',
|
|
@@ -187,7 +165,6 @@ function* exportCsvFunction() {
|
|
|
187
165
|
yield (0, _effects.put)(_reducer.actions.stopDownloadingCsv());
|
|
188
166
|
}
|
|
189
167
|
}
|
|
190
|
-
|
|
191
168
|
function* sagas() {
|
|
192
169
|
yield (0, _effects.takeLatest)(_reducer.actions.initData, initDataFunction);
|
|
193
170
|
yield (0, _effects.takeLatest)(_reducer.actions.removeFilter, removeFilterFunction);
|
package/node/audits/dummy.js
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.auditsLogsFilterAndSort = exports.auditLogsMetadataDemo = exports.auditLogsDataDemo = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
const sortMethodBasedOnOrder = (sortBy, desc) => (a, b) => {
|
|
13
10
|
if (a[sortBy] > b[sortBy]) {
|
|
14
11
|
return desc ? -1 : 1;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
if (b[sortBy] > a[sortBy]) {
|
|
18
14
|
return desc ? 1 : -1;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
return 0;
|
|
22
17
|
};
|
|
23
|
-
|
|
24
18
|
const filterAuditsByQuery = filterOptions => log => filterOptions.filter(filterOutTimeFilterForDummyMode).every(filterItem => log[filterItem.id].includes(filterItem.value));
|
|
25
|
-
|
|
26
19
|
const filterOutTimeFilterForDummyMode = filterItem => filterItem.id !== 'createdAt';
|
|
27
|
-
|
|
28
20
|
const auditsLogsFilterAndSort = (filterOptions, sortOptions) => {
|
|
29
21
|
const {
|
|
30
22
|
data
|
|
31
23
|
} = auditLogsDataDemo;
|
|
32
24
|
let dataByQuery = data.filter(filterAuditsByQuery(filterOptions));
|
|
33
|
-
|
|
34
25
|
if (sortOptions.length) {
|
|
35
26
|
const {
|
|
36
27
|
id,
|
|
@@ -38,18 +29,14 @@ const auditsLogsFilterAndSort = (filterOptions, sortOptions) => {
|
|
|
38
29
|
} = sortOptions[0];
|
|
39
30
|
dataByQuery = dataByQuery.sort(sortMethodBasedOnOrder(id, desc));
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
return {
|
|
43
33
|
data: dataByQuery,
|
|
44
34
|
total: dataByQuery.length
|
|
45
35
|
};
|
|
46
36
|
};
|
|
47
|
-
|
|
48
37
|
exports.auditsLogsFilterAndSort = auditsLogsFilterAndSort;
|
|
49
|
-
|
|
50
38
|
const randomAction = () => {
|
|
51
39
|
const random = Math.floor(Math.random() * 6);
|
|
52
|
-
|
|
53
40
|
switch (random) {
|
|
54
41
|
case 0:
|
|
55
42
|
return {
|
|
@@ -57,35 +44,30 @@ const randomAction = () => {
|
|
|
57
44
|
description: 'User updated profile details',
|
|
58
45
|
severity: 'Info'
|
|
59
46
|
};
|
|
60
|
-
|
|
61
47
|
case 1:
|
|
62
48
|
return {
|
|
63
49
|
action: 'User logged in',
|
|
64
50
|
severity: 'Info',
|
|
65
51
|
description: 'User logged in to the product'
|
|
66
52
|
};
|
|
67
|
-
|
|
68
53
|
case 2:
|
|
69
54
|
return {
|
|
70
55
|
action: 'User failed to login',
|
|
71
56
|
severity: 'High',
|
|
72
57
|
description: 'User failed to login with password'
|
|
73
58
|
};
|
|
74
|
-
|
|
75
59
|
case 3:
|
|
76
60
|
return {
|
|
77
61
|
action: 'Added user',
|
|
78
62
|
severity: 'Info',
|
|
79
63
|
description: 'Added user david+535@frontegg.com to tenant'
|
|
80
64
|
};
|
|
81
|
-
|
|
82
65
|
case 4:
|
|
83
66
|
return {
|
|
84
67
|
action: 'Assigned roles',
|
|
85
68
|
severity: 'Info',
|
|
86
69
|
description: 'Assigned 0 roles for user'
|
|
87
70
|
};
|
|
88
|
-
|
|
89
71
|
case 5:
|
|
90
72
|
return {
|
|
91
73
|
action: 'Removed user david+108@frontegg.com from account',
|
|
@@ -94,7 +76,6 @@ const randomAction = () => {
|
|
|
94
76
|
};
|
|
95
77
|
}
|
|
96
78
|
};
|
|
97
|
-
|
|
98
79
|
const auditLogsDataDemo = {
|
|
99
80
|
total: 20,
|
|
100
81
|
data: Array.from(Array(5).keys()).map(i => (0, _extends2.default)({
|
package/node/audits/index.js
CHANGED
|
@@ -48,17 +48,11 @@ Object.defineProperty(exports, "auditsStoreName", {
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
exports.default = void 0;
|
|
51
|
-
|
|
52
51
|
var _reducer = require("./reducer");
|
|
53
|
-
|
|
54
52
|
var _saga = require("./saga");
|
|
55
|
-
|
|
56
53
|
var _constants = require("../constants");
|
|
57
|
-
|
|
58
54
|
var _initialState = require("./initialState");
|
|
59
|
-
|
|
60
55
|
var _interfaces = require("./interfaces");
|
|
61
|
-
|
|
62
56
|
Object.keys(_interfaces).forEach(function (key) {
|
|
63
57
|
if (key === "default" || key === "__esModule") return;
|
|
64
58
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -70,9 +64,7 @@ Object.keys(_interfaces).forEach(function (key) {
|
|
|
70
64
|
}
|
|
71
65
|
});
|
|
72
66
|
});
|
|
73
|
-
|
|
74
67
|
var _interfaces2 = require("./AuditLogsState/interfaces");
|
|
75
|
-
|
|
76
68
|
Object.keys(_interfaces2).forEach(function (key) {
|
|
77
69
|
if (key === "default" || key === "__esModule") return;
|
|
78
70
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -84,9 +76,7 @@ Object.keys(_interfaces2).forEach(function (key) {
|
|
|
84
76
|
}
|
|
85
77
|
});
|
|
86
78
|
});
|
|
87
|
-
|
|
88
79
|
var _AuditLogsState = require("./AuditLogsState");
|
|
89
|
-
|
|
90
80
|
Object.keys(_AuditLogsState).forEach(function (key) {
|
|
91
81
|
if (key === "default" || key === "__esModule") return;
|
|
92
82
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -98,9 +88,7 @@ Object.keys(_AuditLogsState).forEach(function (key) {
|
|
|
98
88
|
}
|
|
99
89
|
});
|
|
100
90
|
});
|
|
101
|
-
|
|
102
91
|
var _interfaces3 = require("./AuditsMetadataState/interfaces");
|
|
103
|
-
|
|
104
92
|
Object.keys(_interfaces3).forEach(function (key) {
|
|
105
93
|
if (key === "default" || key === "__esModule") return;
|
|
106
94
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -112,9 +100,7 @@ Object.keys(_interfaces3).forEach(function (key) {
|
|
|
112
100
|
}
|
|
113
101
|
});
|
|
114
102
|
});
|
|
115
|
-
|
|
116
103
|
var _AuditsMetadataState = require("./AuditsMetadataState");
|
|
117
|
-
|
|
118
104
|
Object.keys(_AuditsMetadataState).forEach(function (key) {
|
|
119
105
|
if (key === "default" || key === "__esModule") return;
|
|
120
106
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.initialState = void 0;
|
|
7
|
-
|
|
8
7
|
var _AuditLogsState = require("./AuditLogsState");
|
|
9
|
-
|
|
10
8
|
var _AuditsMetadataState = require("./AuditsMetadataState");
|
|
11
|
-
|
|
12
9
|
const initialState = {
|
|
13
10
|
auditLogsState: _AuditLogsState.auditLogsState,
|
|
14
11
|
auditsMetadataState: _AuditsMetadataState.auditsMetadataState
|
package/node/audits/reducer.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.reducer = exports.actions = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _constants = require("../constants");
|
|
13
|
-
|
|
14
10
|
var _initialState = require("./initialState");
|
|
15
|
-
|
|
16
11
|
var _toolkit = require("@reduxjs/toolkit");
|
|
17
|
-
|
|
18
12
|
var _AuditLogsState = require("./AuditLogsState");
|
|
19
|
-
|
|
20
13
|
var _AuditsMetadataState = require("./AuditsMetadataState");
|
|
21
|
-
|
|
22
14
|
const {
|
|
23
15
|
reducer,
|
|
24
16
|
actions: sliceActions
|
package/node/audits/saga.js
CHANGED
|
@@ -5,17 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.mockSagas = mockSagas;
|
|
7
7
|
exports.sagas = sagas;
|
|
8
|
-
|
|
9
8
|
var _effects = require("redux-saga/effects");
|
|
10
|
-
|
|
11
9
|
var _saga = require("./AuditLogsState/saga");
|
|
12
|
-
|
|
13
10
|
var _saga2 = require("./AuditsMetadataState/saga");
|
|
14
|
-
|
|
15
11
|
function* sagas() {
|
|
16
12
|
yield (0, _effects.all)([(0, _effects.call)(_saga.auditLogsSagas), (0, _effects.call)(_saga2.auditsMetadataSagas)]);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
function* mockSagas() {
|
|
20
15
|
yield (0, _effects.all)([(0, _effects.call)(_saga.auditLogsSagasMock), (0, _effects.call)(_saga2.auditsMetadataSagasMock)]);
|
|
21
16
|
}
|
package/node/audits/utils.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.typeReducerForKey = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
const typeReducerForKey = key => ({
|
|
13
10
|
prepare: payload => ({
|
|
14
11
|
payload
|
|
@@ -21,5 +18,4 @@ const typeReducerForKey = key => ({
|
|
|
21
18
|
});
|
|
22
19
|
}
|
|
23
20
|
});
|
|
24
|
-
|
|
25
21
|
exports.typeReducerForKey = typeReducerForKey;
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.acceptInvitationState = exports.acceptInvitationReducers = exports.acceptInvitationActions = void 0;
|
|
7
|
-
|
|
8
7
|
var _toolkit = require("@reduxjs/toolkit");
|
|
9
|
-
|
|
10
8
|
var _utils = require("../utils");
|
|
11
|
-
|
|
12
9
|
var _interfaces = require("./interfaces");
|
|
13
|
-
|
|
14
10
|
var _constants = require("../../constants");
|
|
15
|
-
|
|
16
11
|
const acceptInvitationState = {
|
|
17
12
|
step: _interfaces.AcceptInvitationStep.validate
|
|
18
13
|
};
|
|
@@ -29,14 +24,13 @@ const actions = {
|
|
|
29
24
|
payload
|
|
30
25
|
}))
|
|
31
26
|
};
|
|
27
|
+
|
|
32
28
|
/**
|
|
33
29
|
* To be used for actions types after dispatch, and should contains
|
|
34
30
|
* the reducers and actions as standalone function
|
|
35
31
|
*/
|
|
36
|
-
|
|
37
32
|
exports.acceptInvitationActions = actions;
|
|
38
33
|
// noinspection JSUnusedLocalSymbols
|
|
39
|
-
|
|
40
34
|
/**
|
|
41
35
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
42
36
|
* contains the same functions in reducers and actions
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.AcceptInvitationStep = void 0;
|
|
7
7
|
let AcceptInvitationStep;
|
|
8
8
|
exports.AcceptInvitationStep = AcceptInvitationStep;
|
|
9
|
-
|
|
10
9
|
(function (AcceptInvitationStep) {
|
|
11
10
|
AcceptInvitationStep["validate"] = "validate";
|
|
12
11
|
AcceptInvitationStep["invalid"] = "invalid";
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.acceptInvitationSagas = acceptInvitationSagas;
|
|
7
|
-
|
|
8
7
|
var _effects = require("redux-saga/effects");
|
|
9
|
-
|
|
10
8
|
var _reducer = require("../reducer");
|
|
11
|
-
|
|
12
9
|
var _restApi = require("@frontegg/rest-api");
|
|
13
|
-
|
|
14
10
|
var _interfaces = require("./interfaces");
|
|
15
|
-
|
|
16
11
|
function* acceptInvitation({
|
|
17
12
|
payload
|
|
18
13
|
}) {
|
|
@@ -23,7 +18,6 @@ function* acceptInvitation({
|
|
|
23
18
|
}));
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
try {
|
|
28
22
|
yield (0, _effects.put)(_reducer.actions.setAcceptInvitationState({
|
|
29
23
|
error: undefined,
|
|
@@ -45,7 +39,6 @@ function* acceptInvitation({
|
|
|
45
39
|
}));
|
|
46
40
|
}
|
|
47
41
|
}
|
|
48
|
-
|
|
49
42
|
function* acceptInvitationSagas() {
|
|
50
43
|
yield (0, _effects.takeLeading)(_reducer.actions.acceptInvitation, acceptInvitation);
|
|
51
44
|
}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.accountSettingsState = exports.accountSettingsReducers = exports.accountSettingsActions = void 0;
|
|
7
|
-
|
|
8
7
|
var _toolkit = require("@reduxjs/toolkit");
|
|
9
|
-
|
|
10
8
|
var _utils = require("../utils");
|
|
11
|
-
|
|
12
9
|
var _constants = require("../../constants");
|
|
13
|
-
|
|
14
10
|
const accountSettingsState = {
|
|
15
11
|
loading: false
|
|
16
12
|
};
|
|
@@ -30,14 +26,13 @@ const actions = {
|
|
|
30
26
|
payload
|
|
31
27
|
}))
|
|
32
28
|
};
|
|
29
|
+
|
|
33
30
|
/**
|
|
34
31
|
* To be used for actions types after dispatch, and should contains
|
|
35
32
|
* the reducers and actions as standalone function
|
|
36
33
|
*/
|
|
37
|
-
|
|
38
34
|
exports.accountSettingsActions = actions;
|
|
39
35
|
// noinspection JSUnusedLocalSymbols
|
|
40
|
-
|
|
41
36
|
/**
|
|
42
37
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
43
38
|
* contains the same functions in reducers and actions
|