@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,29 +1,21 @@
|
|
|
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.accountSettingsSaga = accountSettingsSaga;
|
|
9
8
|
exports.accountSettingsSagaMock = accountSettingsSagaMock;
|
|
10
|
-
|
|
11
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
-
|
|
13
10
|
var _effects = require("redux-saga/effects");
|
|
14
|
-
|
|
15
11
|
var _reducer = require("../reducer");
|
|
16
|
-
|
|
17
12
|
var _restApi = require("@frontegg/rest-api");
|
|
18
|
-
|
|
19
13
|
var _utils = require("../utils");
|
|
20
|
-
|
|
21
14
|
function* saveAccountSettings({
|
|
22
15
|
payload
|
|
23
16
|
}) {
|
|
24
17
|
try {
|
|
25
18
|
var _payload$callback;
|
|
26
|
-
|
|
27
19
|
yield (0, _effects.put)(_reducer.actions.setAccountSettingsState({
|
|
28
20
|
loading: true
|
|
29
21
|
}));
|
|
@@ -52,7 +44,6 @@ function* saveAccountSettings({
|
|
|
52
44
|
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, body);
|
|
53
45
|
} catch (e) {
|
|
54
46
|
var _payload$callback2;
|
|
55
|
-
|
|
56
47
|
yield (0, _effects.put)(_reducer.actions.setAccountSettingsState({
|
|
57
48
|
loading: false,
|
|
58
49
|
error: e.message
|
|
@@ -60,7 +51,6 @@ function* saveAccountSettings({
|
|
|
60
51
|
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
61
52
|
}
|
|
62
53
|
}
|
|
63
|
-
|
|
64
54
|
function* loadAccountSettings({
|
|
65
55
|
payload
|
|
66
56
|
}) {
|
|
@@ -68,7 +58,6 @@ function* loadAccountSettings({
|
|
|
68
58
|
loading: !(payload != null && payload.silentLoading),
|
|
69
59
|
error: null
|
|
70
60
|
}));
|
|
71
|
-
|
|
72
61
|
try {
|
|
73
62
|
const body = yield (0, _effects.call)(_restApi.api.accountSettings.getSettings);
|
|
74
63
|
yield (0, _effects.put)(_reducer.actions.setAccountSettingsState((0, _extends2.default)({}, body, {
|
|
@@ -81,21 +70,19 @@ function* loadAccountSettings({
|
|
|
81
70
|
}));
|
|
82
71
|
}
|
|
83
72
|
}
|
|
84
|
-
|
|
85
73
|
function* accountSettingsSaga() {
|
|
86
74
|
yield (0, _effects.takeLeading)(_reducer.actions.saveAccountSettings, saveAccountSettings);
|
|
87
75
|
yield (0, _effects.takeLeading)(_reducer.actions.loadAccountSettings, loadAccountSettings);
|
|
88
76
|
}
|
|
77
|
+
|
|
89
78
|
/*********************************
|
|
90
79
|
* Preview Sagas
|
|
91
80
|
*********************************/
|
|
92
81
|
|
|
93
|
-
|
|
94
82
|
function* saveAccountSettingsMock({
|
|
95
83
|
payload
|
|
96
84
|
}) {
|
|
97
85
|
var _payload$callback3;
|
|
98
|
-
|
|
99
86
|
yield (0, _effects.put)(_reducer.actions.setAccountSettingsState({
|
|
100
87
|
loading: true
|
|
101
88
|
}));
|
|
@@ -124,7 +111,6 @@ function* saveAccountSettingsMock({
|
|
|
124
111
|
})));
|
|
125
112
|
(_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, body);
|
|
126
113
|
}
|
|
127
|
-
|
|
128
114
|
function* loadAccountSettingsMock({
|
|
129
115
|
payload
|
|
130
116
|
}) {
|
|
@@ -142,7 +128,6 @@ function* loadAccountSettingsMock({
|
|
|
142
128
|
loading: false
|
|
143
129
|
}));
|
|
144
130
|
}
|
|
145
|
-
|
|
146
131
|
function* accountSettingsSagaMock() {
|
|
147
132
|
yield (0, _effects.takeLeading)(_reducer.actions.saveAccountSettings, saveAccountSettingsMock);
|
|
148
133
|
yield (0, _effects.takeLeading)(_reducer.actions.loadAccountSettings, loadAccountSettingsMock);
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.activateState = exports.activateAccountReducers = exports.activateAccountActions = 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 activateState = {
|
|
17
12
|
step: _interfaces.ActivateAccountStep.activating,
|
|
18
13
|
loading: false,
|
|
@@ -44,14 +39,13 @@ const actions = {
|
|
|
44
39
|
payload
|
|
45
40
|
}))
|
|
46
41
|
};
|
|
42
|
+
|
|
47
43
|
/**
|
|
48
44
|
* To be used for actions types after dispatch, and should contains
|
|
49
45
|
* the reducers and actions as standalone function
|
|
50
46
|
*/
|
|
51
|
-
|
|
52
47
|
exports.activateAccountActions = actions;
|
|
53
48
|
// noinspection JSUnusedLocalSymbols
|
|
54
|
-
|
|
55
49
|
/**
|
|
56
50
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
57
51
|
* contains the same functions in reducers and actions
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ActivateAccountStep = void 0;
|
|
7
7
|
let ActivateAccountStep;
|
|
8
8
|
exports.ActivateAccountStep = ActivateAccountStep;
|
|
9
|
-
|
|
10
9
|
(function (ActivateAccountStep) {
|
|
11
10
|
ActivateAccountStep["activating"] = "activating";
|
|
12
11
|
ActivateAccountStep["success"] = "success";
|
|
@@ -1,32 +1,21 @@
|
|
|
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.activateSagas = activateSagas;
|
|
9
|
-
|
|
10
8
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
-
|
|
12
9
|
var _effects = require("redux-saga/effects");
|
|
13
|
-
|
|
14
10
|
var _restApi = require("@frontegg/rest-api");
|
|
15
|
-
|
|
16
11
|
var _reducer = require("../reducer");
|
|
17
|
-
|
|
18
12
|
var _saga = require("../LoginState/saga");
|
|
19
|
-
|
|
20
13
|
var _interfaces = require("../interfaces");
|
|
21
|
-
|
|
22
14
|
var _interfaces2 = require("./interfaces");
|
|
23
|
-
|
|
24
15
|
var _interfaces3 = require("../TeamState/interfaces");
|
|
25
|
-
|
|
26
16
|
const _excluded = ["callback", "events"],
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
_excluded2 = ["callback"],
|
|
18
|
+
_excluded3 = ["callback"];
|
|
30
19
|
function* preActivateAccount({
|
|
31
20
|
payload: {
|
|
32
21
|
userId,
|
|
@@ -37,16 +26,13 @@ function* preActivateAccount({
|
|
|
37
26
|
loading: true,
|
|
38
27
|
step: _interfaces2.ActivateAccountStep.activating
|
|
39
28
|
}));
|
|
40
|
-
|
|
41
29
|
try {
|
|
42
30
|
const {
|
|
43
31
|
isAuthenticated
|
|
44
32
|
} = yield (0, _effects.select)(state => state.auth);
|
|
45
|
-
|
|
46
33
|
if (isAuthenticated) {
|
|
47
34
|
yield (0, _effects.put)(_reducer.actions.silentLogout());
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
const strategy = yield (0, _effects.call)(_restApi.api.auth.getActivateAccountStrategy, {
|
|
51
37
|
userId,
|
|
52
38
|
token
|
|
@@ -56,7 +42,6 @@ function* preActivateAccount({
|
|
|
56
42
|
loading: false,
|
|
57
43
|
error: undefined
|
|
58
44
|
}));
|
|
59
|
-
|
|
60
45
|
if (strategy.shouldSetPassword) {
|
|
61
46
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
62
47
|
loading: false,
|
|
@@ -70,31 +55,27 @@ function* preActivateAccount({
|
|
|
70
55
|
}));
|
|
71
56
|
}
|
|
72
57
|
}
|
|
73
|
-
|
|
74
58
|
function* activateAccount(_ref) {
|
|
75
59
|
let {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
60
|
+
payload: {
|
|
61
|
+
callback,
|
|
62
|
+
events
|
|
63
|
+
}
|
|
64
|
+
} = _ref,
|
|
65
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
|
|
82
66
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
83
67
|
loading: true
|
|
84
68
|
}));
|
|
85
|
-
|
|
86
69
|
try {
|
|
87
70
|
const onRedirectTo = _restApi.ContextHolder.onRedirectTo;
|
|
88
71
|
const {
|
|
89
72
|
routes
|
|
90
73
|
} = yield (0, _effects.select)(state => state.auth);
|
|
91
74
|
const data = yield (0, _effects.call)(_restApi.api.auth.activateAccount, payload);
|
|
92
|
-
|
|
93
75
|
if (data.redirectLocation) {
|
|
94
76
|
window.location.href = data.redirectLocation;
|
|
95
77
|
return;
|
|
96
78
|
}
|
|
97
|
-
|
|
98
79
|
if ((0, _saga.isMfaRequired)(data)) {
|
|
99
80
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
100
81
|
step: _interfaces2.ActivateAccountStep.success
|
|
@@ -107,7 +88,6 @@ function* activateAccount(_ref) {
|
|
|
107
88
|
});
|
|
108
89
|
} else {
|
|
109
90
|
var _events$userVerified;
|
|
110
|
-
|
|
111
91
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
112
92
|
step: _interfaces2.ActivateAccountStep.success
|
|
113
93
|
}));
|
|
@@ -135,7 +115,6 @@ function* activateAccount(_ref) {
|
|
|
135
115
|
yield (0, _saga.afterAuthNavigation)();
|
|
136
116
|
yield (0, _effects.put)(_reducer.actions.resetActivateState());
|
|
137
117
|
}
|
|
138
|
-
|
|
139
118
|
callback == null ? void 0 : callback(true);
|
|
140
119
|
} catch (e) {
|
|
141
120
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
@@ -144,18 +123,16 @@ function* activateAccount(_ref) {
|
|
|
144
123
|
}));
|
|
145
124
|
}
|
|
146
125
|
}
|
|
147
|
-
|
|
148
126
|
function* getActivateAccountStrategy({
|
|
149
127
|
payload
|
|
150
128
|
}) {
|
|
151
129
|
const {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
130
|
+
callback
|
|
131
|
+
} = payload,
|
|
132
|
+
params = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded2);
|
|
155
133
|
yield (0, _effects.put)(_reducer.actions.setActivateStrategyState({
|
|
156
134
|
loading: true
|
|
157
135
|
}));
|
|
158
|
-
|
|
159
136
|
try {
|
|
160
137
|
const strategy = yield (0, _effects.call)(_restApi.api.auth.getActivateAccountStrategy, params);
|
|
161
138
|
yield (0, _effects.put)(_reducer.actions.setActivateStrategyState({
|
|
@@ -171,14 +148,13 @@ function* getActivateAccountStrategy({
|
|
|
171
148
|
}));
|
|
172
149
|
}
|
|
173
150
|
}
|
|
174
|
-
|
|
175
151
|
function* resendActivationEmailFunction({
|
|
176
152
|
payload
|
|
177
153
|
}) {
|
|
178
154
|
const {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
155
|
+
callback
|
|
156
|
+
} = payload,
|
|
157
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded3);
|
|
182
158
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
183
159
|
key: _interfaces3.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
184
160
|
value: body.email
|
|
@@ -186,7 +162,6 @@ function* resendActivationEmailFunction({
|
|
|
186
162
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
187
163
|
loading: true
|
|
188
164
|
}));
|
|
189
|
-
|
|
190
165
|
try {
|
|
191
166
|
yield (0, _effects.call)(_restApi.api.auth.resendActivationEmail, body);
|
|
192
167
|
yield (0, _effects.put)(_reducer.actions.setActivateState({
|
|
@@ -206,13 +181,11 @@ function* resendActivationEmailFunction({
|
|
|
206
181
|
}));
|
|
207
182
|
callback == null ? void 0 : callback(null, e.message);
|
|
208
183
|
}
|
|
209
|
-
|
|
210
184
|
yield (0, _effects.put)(_reducer.actions.setTeamLoader({
|
|
211
185
|
key: _interfaces3.TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
212
186
|
value: false
|
|
213
187
|
}));
|
|
214
188
|
}
|
|
215
|
-
|
|
216
189
|
function* activateSagas() {
|
|
217
190
|
yield (0, _effects.takeLeading)(_reducer.actions.activateAccount, activateAccount);
|
|
218
191
|
yield (0, _effects.takeLeading)(_reducer.actions.preActivateAccount, preActivateAccount);
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.apiTokensState = exports.apiTokensReducers = exports.apiTokensActions = 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 apiTokensState = {
|
|
15
11
|
apiTokenType: null,
|
|
16
12
|
searchValue: '',
|
|
@@ -68,14 +64,13 @@ const actions = {
|
|
|
68
64
|
payload
|
|
69
65
|
}))
|
|
70
66
|
};
|
|
67
|
+
|
|
71
68
|
/**
|
|
72
69
|
* To be used for actions types after dispatch, and should contains
|
|
73
70
|
* the reducers and actions as standalone function
|
|
74
71
|
*/
|
|
75
|
-
|
|
76
72
|
exports.apiTokensActions = actions;
|
|
77
73
|
// noinspection JSUnusedLocalSymbols
|
|
78
|
-
|
|
79
74
|
/**
|
|
80
75
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
81
76
|
* contains the same functions in reducers and actions
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ApiStateKeys = void 0;
|
|
7
7
|
let ApiStateKeys;
|
|
8
8
|
exports.ApiStateKeys = ApiStateKeys;
|
|
9
|
-
|
|
10
9
|
(function (ApiStateKeys) {
|
|
11
10
|
ApiStateKeys["LOAD_API_TOKENS"] = "LOAD_API_TOKENS";
|
|
12
11
|
ApiStateKeys["ADD_API_TOKEN"] = "ADD_API_TOKEN";
|
|
@@ -1,27 +1,18 @@
|
|
|
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.apiTokensSaga = apiTokensSaga;
|
|
9
8
|
exports.apiTokensSagaMock = apiTokensSagaMock;
|
|
10
|
-
|
|
11
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
-
|
|
13
10
|
var _effects = require("redux-saga/effects");
|
|
14
|
-
|
|
15
11
|
var _restApi = require("@frontegg/rest-api");
|
|
16
|
-
|
|
17
12
|
var _reducer = require("../reducer");
|
|
18
|
-
|
|
19
13
|
var _interfaces = require("./interfaces");
|
|
20
|
-
|
|
21
14
|
var _dummy = require("../dummy");
|
|
22
|
-
|
|
23
15
|
var _uuid = require("uuid");
|
|
24
|
-
|
|
25
16
|
function* addUserApiToken({
|
|
26
17
|
payload
|
|
27
18
|
}) {
|
|
@@ -33,7 +24,6 @@ function* addUserApiToken({
|
|
|
33
24
|
const {
|
|
34
25
|
apiTokensDataUser
|
|
35
26
|
} = yield (0, _effects.select)(state => state.auth.apiTokensState);
|
|
36
|
-
|
|
37
27
|
try {
|
|
38
28
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
39
29
|
key: _interfaces.ApiStateKeys.ADD_API_TOKEN,
|
|
@@ -41,14 +31,12 @@ function* addUserApiToken({
|
|
|
41
31
|
}));
|
|
42
32
|
let data;
|
|
43
33
|
let expiresInMinutes;
|
|
44
|
-
|
|
45
34
|
if (expires !== undefined) {
|
|
46
35
|
if (expires === null) {
|
|
47
36
|
expiresInMinutes = null;
|
|
48
37
|
} else {
|
|
49
38
|
expiresInMinutes = expires * 1440;
|
|
50
39
|
}
|
|
51
|
-
|
|
52
40
|
data = yield (0, _effects.call)(_restApi.api.auth.createUserAccessToken, {
|
|
53
41
|
description,
|
|
54
42
|
expiresInMinutes
|
|
@@ -58,7 +46,6 @@ function* addUserApiToken({
|
|
|
58
46
|
description
|
|
59
47
|
});
|
|
60
48
|
}
|
|
61
|
-
|
|
62
49
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
63
50
|
showAddTokenDialog: false
|
|
64
51
|
}));
|
|
@@ -88,7 +75,6 @@ function* addUserApiToken({
|
|
|
88
75
|
callback == null ? void 0 : callback(null, e.message);
|
|
89
76
|
}
|
|
90
77
|
}
|
|
91
|
-
|
|
92
78
|
function* addTenantApiToken({
|
|
93
79
|
payload
|
|
94
80
|
}) {
|
|
@@ -101,7 +87,6 @@ function* addTenantApiToken({
|
|
|
101
87
|
const {
|
|
102
88
|
apiTokensDataTenant
|
|
103
89
|
} = yield (0, _effects.select)(state => state.auth.apiTokensState);
|
|
104
|
-
|
|
105
90
|
try {
|
|
106
91
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
107
92
|
key: _interfaces.ApiStateKeys.ADD_API_TOKEN,
|
|
@@ -109,14 +94,12 @@ function* addTenantApiToken({
|
|
|
109
94
|
}));
|
|
110
95
|
let data;
|
|
111
96
|
let expiresInMinutes;
|
|
112
|
-
|
|
113
97
|
if (expires !== undefined) {
|
|
114
98
|
if (expires === null) {
|
|
115
99
|
expiresInMinutes = null;
|
|
116
100
|
} else {
|
|
117
101
|
expiresInMinutes = expires * 1440;
|
|
118
102
|
}
|
|
119
|
-
|
|
120
103
|
data = yield (0, _effects.call)(_restApi.api.auth.createTenantAccessToken, {
|
|
121
104
|
description,
|
|
122
105
|
expiresInMinutes,
|
|
@@ -128,7 +111,6 @@ function* addTenantApiToken({
|
|
|
128
111
|
roleIds
|
|
129
112
|
});
|
|
130
113
|
}
|
|
131
|
-
|
|
132
114
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
133
115
|
showAddTokenDialog: false
|
|
134
116
|
}));
|
|
@@ -158,7 +140,6 @@ function* addTenantApiToken({
|
|
|
158
140
|
callback == null ? void 0 : callback(null, e.message);
|
|
159
141
|
}
|
|
160
142
|
}
|
|
161
|
-
|
|
162
143
|
function* deleteUserApiToken({
|
|
163
144
|
payload
|
|
164
145
|
}) {
|
|
@@ -166,13 +147,11 @@ function* deleteUserApiToken({
|
|
|
166
147
|
apiTokensDataUser
|
|
167
148
|
} = yield (0, _effects.select)(state => state.auth.apiTokensState);
|
|
168
149
|
const isAccessToken = apiTokensDataUser.some(token => token.id === payload);
|
|
169
|
-
|
|
170
150
|
try {
|
|
171
151
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
172
152
|
key: _interfaces.ApiStateKeys.DELETE_API_TOKEN,
|
|
173
153
|
value: true
|
|
174
154
|
}));
|
|
175
|
-
|
|
176
155
|
if (isAccessToken) {
|
|
177
156
|
yield (0, _effects.call)(_restApi.api.auth.deleteUserAccessToken, {
|
|
178
157
|
id: payload
|
|
@@ -196,7 +175,6 @@ function* deleteUserApiToken({
|
|
|
196
175
|
}
|
|
197
176
|
}));
|
|
198
177
|
}
|
|
199
|
-
|
|
200
178
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
201
179
|
key: _interfaces.ApiStateKeys.DELETE_API_TOKEN,
|
|
202
180
|
value: false
|
|
@@ -212,7 +190,6 @@ function* deleteUserApiToken({
|
|
|
212
190
|
}));
|
|
213
191
|
}
|
|
214
192
|
}
|
|
215
|
-
|
|
216
193
|
function* deleteTenantApiToken({
|
|
217
194
|
payload
|
|
218
195
|
}) {
|
|
@@ -221,13 +198,11 @@ function* deleteTenantApiToken({
|
|
|
221
198
|
} = yield (0, _effects.select)(state => state.auth.apiTokensState);
|
|
222
199
|
const isAccessToken = apiTokensDataTenant.some(token => token.id === payload);
|
|
223
200
|
let filteredApiTokensDataTenant = apiTokensDataTenant;
|
|
224
|
-
|
|
225
201
|
try {
|
|
226
202
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
227
203
|
key: _interfaces.ApiStateKeys.DELETE_API_TOKEN,
|
|
228
204
|
value: true
|
|
229
205
|
}));
|
|
230
|
-
|
|
231
206
|
if (isAccessToken) {
|
|
232
207
|
yield (0, _effects.call)(_restApi.api.auth.deleteTenantAccessToken, {
|
|
233
208
|
id: payload
|
|
@@ -239,7 +214,6 @@ function* deleteTenantApiToken({
|
|
|
239
214
|
});
|
|
240
215
|
filteredApiTokensDataTenant = apiTokensDataTenant.filter(token => token.clientId !== payload);
|
|
241
216
|
}
|
|
242
|
-
|
|
243
217
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
244
218
|
apiTokensDataTenant: filteredApiTokensDataTenant,
|
|
245
219
|
deleteTokenDialog: {
|
|
@@ -262,7 +236,6 @@ function* deleteTenantApiToken({
|
|
|
262
236
|
}));
|
|
263
237
|
}
|
|
264
238
|
}
|
|
265
|
-
|
|
266
239
|
function* loadApiTokens({
|
|
267
240
|
payload
|
|
268
241
|
}) {
|
|
@@ -272,10 +245,8 @@ function* loadApiTokens({
|
|
|
272
245
|
value: true
|
|
273
246
|
}));
|
|
274
247
|
}
|
|
275
|
-
|
|
276
248
|
try {
|
|
277
249
|
var _payload$callback;
|
|
278
|
-
|
|
279
250
|
const [apiTokensDataUser = [], apiTokensDataTenant = []] = yield (0, _effects.all)([(0, _effects.call)(_restApi.api.auth.getUserApiTokensData), (0, _effects.call)(_restApi.api.auth.getTenantApiTokensData)]);
|
|
280
251
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
281
252
|
apiTokensDataUser,
|
|
@@ -288,7 +259,6 @@ function* loadApiTokens({
|
|
|
288
259
|
payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
289
260
|
} catch (e) {
|
|
290
261
|
var _payload$callback2;
|
|
291
|
-
|
|
292
262
|
yield (0, _effects.put)(_reducer.actions.setApiTokensError({
|
|
293
263
|
key: _interfaces.ApiStateKeys.LOAD_API_TOKENS,
|
|
294
264
|
value: e.message
|
|
@@ -300,7 +270,6 @@ function* loadApiTokens({
|
|
|
300
270
|
payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
301
271
|
}
|
|
302
272
|
}
|
|
303
|
-
|
|
304
273
|
function* loadUserApiTokens({
|
|
305
274
|
payload
|
|
306
275
|
}) {
|
|
@@ -310,10 +279,8 @@ function* loadUserApiTokens({
|
|
|
310
279
|
value: true
|
|
311
280
|
}));
|
|
312
281
|
}
|
|
313
|
-
|
|
314
282
|
try {
|
|
315
283
|
var _call, _call2, _accessTokensData$acc, _payload$callback3;
|
|
316
|
-
|
|
317
284
|
const apiTokensData = yield (_call = (0, _effects.call)(_restApi.api.auth.getUserApiTokensData)) != null ? _call : [];
|
|
318
285
|
const accessTokensData = yield (_call2 = (0, _effects.call)(_restApi.api.auth.getUserAccessTokensData)) != null ? _call2 : [];
|
|
319
286
|
const accessTokens = (_accessTokensData$acc = accessTokensData.accessTokens) != null ? _accessTokensData$acc : [];
|
|
@@ -329,7 +296,6 @@ function* loadUserApiTokens({
|
|
|
329
296
|
payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
330
297
|
} catch (e) {
|
|
331
298
|
var _payload$callback4;
|
|
332
|
-
|
|
333
299
|
yield (0, _effects.put)(_reducer.actions.setApiTokensError({
|
|
334
300
|
key: _interfaces.ApiStateKeys.LOAD_API_TOKENS,
|
|
335
301
|
value: e.message
|
|
@@ -341,7 +307,6 @@ function* loadUserApiTokens({
|
|
|
341
307
|
payload == null ? void 0 : (_payload$callback4 = payload.callback) == null ? void 0 : _payload$callback4.call(payload, null, e);
|
|
342
308
|
}
|
|
343
309
|
}
|
|
344
|
-
|
|
345
310
|
function* loadTenantApiTokens({
|
|
346
311
|
payload
|
|
347
312
|
}) {
|
|
@@ -351,10 +316,8 @@ function* loadTenantApiTokens({
|
|
|
351
316
|
value: true
|
|
352
317
|
}));
|
|
353
318
|
}
|
|
354
|
-
|
|
355
319
|
try {
|
|
356
320
|
var _call3, _call4, _accessTokensData$acc2, _payload$callback5;
|
|
357
|
-
|
|
358
321
|
const apiTokensData = yield (_call3 = (0, _effects.call)(_restApi.api.auth.getTenantApiTokensData)) != null ? _call3 : [];
|
|
359
322
|
const accessTokensData = yield (_call4 = (0, _effects.call)(_restApi.api.auth.getTenantAccessTokensData)) != null ? _call4 : [];
|
|
360
323
|
const accessTokens = (_accessTokensData$acc2 = accessTokensData == null ? void 0 : accessTokensData.accessTokens) != null ? _accessTokensData$acc2 : [];
|
|
@@ -370,7 +333,6 @@ function* loadTenantApiTokens({
|
|
|
370
333
|
payload == null ? void 0 : (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, true);
|
|
371
334
|
} catch (e) {
|
|
372
335
|
var _payload$callback6;
|
|
373
|
-
|
|
374
336
|
yield (0, _effects.put)(_reducer.actions.setApiTokensError({
|
|
375
337
|
key: _interfaces.ApiStateKeys.LOAD_API_TOKENS,
|
|
376
338
|
value: e.message
|
|
@@ -382,7 +344,6 @@ function* loadTenantApiTokens({
|
|
|
382
344
|
payload == null ? void 0 : (_payload$callback6 = payload.callback) == null ? void 0 : _payload$callback6.call(payload, null, e);
|
|
383
345
|
}
|
|
384
346
|
}
|
|
385
|
-
|
|
386
347
|
function* apiTokensSaga() {
|
|
387
348
|
yield (0, _effects.takeLeading)(_reducer.actions.loadApiTokens, loadApiTokens);
|
|
388
349
|
yield (0, _effects.takeLeading)(_reducer.actions.loadUserApiTokens, loadUserApiTokens);
|
|
@@ -392,11 +353,11 @@ function* apiTokensSaga() {
|
|
|
392
353
|
yield (0, _effects.takeLatest)(_reducer.actions.deleteTenantApiToken, deleteTenantApiToken);
|
|
393
354
|
yield (0, _effects.takeLatest)(_reducer.actions.deleteUserApiToken, deleteUserApiToken);
|
|
394
355
|
}
|
|
356
|
+
|
|
395
357
|
/*********************************
|
|
396
358
|
* Preview Sagas
|
|
397
359
|
*********************************/
|
|
398
360
|
|
|
399
|
-
|
|
400
361
|
function* addTenantApiTokenMock({
|
|
401
362
|
payload
|
|
402
363
|
}) {
|
|
@@ -436,7 +397,6 @@ function* addTenantApiTokenMock({
|
|
|
436
397
|
}));
|
|
437
398
|
callback == null ? void 0 : callback(null);
|
|
438
399
|
}
|
|
439
|
-
|
|
440
400
|
function* deleteTenantApiTokenMock({
|
|
441
401
|
payload
|
|
442
402
|
}) {
|
|
@@ -458,19 +418,16 @@ function* deleteTenantApiTokenMock({
|
|
|
458
418
|
value: false
|
|
459
419
|
}));
|
|
460
420
|
}
|
|
461
|
-
|
|
462
421
|
function* loadApiTokensMock({
|
|
463
422
|
payload
|
|
464
423
|
}) {
|
|
465
424
|
var _payload$callback7;
|
|
466
|
-
|
|
467
425
|
if (!(payload != null && payload.silentLoading)) {
|
|
468
426
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
469
427
|
key: _interfaces.ApiStateKeys.LOAD_API_TOKENS,
|
|
470
428
|
value: true
|
|
471
429
|
}));
|
|
472
430
|
}
|
|
473
|
-
|
|
474
431
|
const apiTokensDataUser = [_dummy.apiTokensDataDemo];
|
|
475
432
|
const apiTokensDataTenant = [_dummy.apiTokensDataTenantDemo];
|
|
476
433
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
@@ -484,19 +441,16 @@ function* loadApiTokensMock({
|
|
|
484
441
|
}));
|
|
485
442
|
payload == null ? void 0 : (_payload$callback7 = payload.callback) == null ? void 0 : _payload$callback7.call(payload, true);
|
|
486
443
|
}
|
|
487
|
-
|
|
488
444
|
function* loadUserApiTokensMock({
|
|
489
445
|
payload
|
|
490
446
|
}) {
|
|
491
447
|
var _payload$callback8;
|
|
492
|
-
|
|
493
448
|
if (!(payload != null && payload.silentLoading)) {
|
|
494
449
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
495
450
|
key: _interfaces.ApiStateKeys.LOAD_API_TOKENS,
|
|
496
451
|
value: true
|
|
497
452
|
}));
|
|
498
453
|
}
|
|
499
|
-
|
|
500
454
|
const apiTokensDataUser = [_dummy.apiTokensDataDemo];
|
|
501
455
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
502
456
|
apiTokensDataUser
|
|
@@ -508,19 +462,16 @@ function* loadUserApiTokensMock({
|
|
|
508
462
|
}));
|
|
509
463
|
payload == null ? void 0 : (_payload$callback8 = payload.callback) == null ? void 0 : _payload$callback8.call(payload, true);
|
|
510
464
|
}
|
|
511
|
-
|
|
512
465
|
function* loadTenantApiTokensMock({
|
|
513
466
|
payload
|
|
514
467
|
}) {
|
|
515
468
|
var _payload$callback9;
|
|
516
|
-
|
|
517
469
|
if (!(payload != null && payload.silentLoading)) {
|
|
518
470
|
yield (0, _effects.put)(_reducer.actions.setApiTokensLoader({
|
|
519
471
|
key: _interfaces.ApiStateKeys.LOAD_API_TOKENS,
|
|
520
472
|
value: true
|
|
521
473
|
}));
|
|
522
474
|
}
|
|
523
|
-
|
|
524
475
|
const apiTokensDataTenant = [_dummy.apiTokensDataTenantDemo];
|
|
525
476
|
yield (0, _effects.put)(_reducer.actions.setApiTokensState({
|
|
526
477
|
apiTokensDataTenant
|
|
@@ -532,7 +483,6 @@ function* loadTenantApiTokensMock({
|
|
|
532
483
|
}));
|
|
533
484
|
payload == null ? void 0 : (_payload$callback9 = payload.callback) == null ? void 0 : _payload$callback9.call(payload, true);
|
|
534
485
|
}
|
|
535
|
-
|
|
536
486
|
function* apiTokensSagaMock() {
|
|
537
487
|
yield (0, _effects.takeLeading)(_reducer.actions.loadApiTokens, loadApiTokensMock);
|
|
538
488
|
yield (0, _effects.takeLeading)(_reducer.actions.loadUserApiTokens, loadUserApiTokensMock);
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.forgotPasswordState = exports.forgotPasswordReducers = exports.forgotPasswordActions = 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 forgotPasswordState = {
|
|
17
12
|
step: _interfaces.ForgotPasswordStep.forgotPassword,
|
|
18
13
|
loading: false,
|
|
@@ -38,14 +33,13 @@ const actions = {
|
|
|
38
33
|
payload
|
|
39
34
|
}))
|
|
40
35
|
};
|
|
36
|
+
|
|
41
37
|
/**
|
|
42
38
|
* To be used for actions types after dispatch, and should contains
|
|
43
39
|
* the reducers and actions as standalone function
|
|
44
40
|
*/
|
|
45
|
-
|
|
46
41
|
exports.forgotPasswordActions = actions;
|
|
47
42
|
// noinspection JSUnusedLocalSymbols
|
|
48
|
-
|
|
49
43
|
/**
|
|
50
44
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
51
45
|
* contains the same functions in reducers and actions
|