@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,18 +1,16 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["callback", "profilePictureUrl"],
|
|
4
|
-
|
|
4
|
+
_excluded2 = ["callback", "profilePictureUrl"];
|
|
5
5
|
import { call, put, retry, select, takeEvery, takeLeading } from 'redux-saga/effects';
|
|
6
6
|
import { api } from '@frontegg/rest-api';
|
|
7
7
|
import { actions } from '../reducer';
|
|
8
8
|
import { profileStateDemo, userDemo, userProfileDemo } from '../dummy';
|
|
9
9
|
import { delay } from '../utils';
|
|
10
|
-
|
|
11
10
|
function* loadProfile() {
|
|
12
11
|
yield put(actions.setProfileState({
|
|
13
12
|
loading: true
|
|
14
13
|
}));
|
|
15
|
-
|
|
16
14
|
try {
|
|
17
15
|
const profile = yield retry(3, 2000, api.teams.getProfile);
|
|
18
16
|
const currentUser = yield select(state => state.auth.user);
|
|
@@ -28,73 +26,62 @@ function* loadProfile() {
|
|
|
28
26
|
}));
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
function b64toBlob(base64, contentType) {
|
|
33
30
|
const sliceSize = 512;
|
|
34
31
|
const byteCharacters = atob(base64);
|
|
35
32
|
const byteArrays = [];
|
|
36
|
-
|
|
37
33
|
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
|
38
34
|
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
|
39
35
|
const byteNumbers = new Array(slice.length);
|
|
40
|
-
|
|
41
36
|
for (let i = 0; i < slice.length; i++) {
|
|
42
37
|
byteNumbers[i] = slice.charCodeAt(i);
|
|
43
38
|
}
|
|
44
|
-
|
|
45
39
|
byteArrays.push(new Uint8Array(byteNumbers));
|
|
46
40
|
}
|
|
47
|
-
|
|
48
41
|
return new Blob(byteArrays, {
|
|
49
42
|
type: contentType
|
|
50
43
|
});
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
function base64ToFormData(base64, key = 'file') {
|
|
54
46
|
const matchResult = base64.match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);
|
|
55
|
-
|
|
56
47
|
if (matchResult == null) {
|
|
57
48
|
return null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const contentType = `image/${matchResult[1]}`; // get the real base64 content of the file
|
|
49
|
+
}
|
|
62
50
|
|
|
63
|
-
|
|
51
|
+
// Get the content type of the image
|
|
52
|
+
const contentType = `image/${matchResult[1]}`;
|
|
53
|
+
// get the real base64 content of the file
|
|
54
|
+
const data = matchResult[2];
|
|
64
55
|
|
|
65
|
-
|
|
56
|
+
// Convert it to a blob to upload
|
|
57
|
+
const blob = b64toBlob(data, contentType);
|
|
66
58
|
|
|
59
|
+
// Create a FormData and append the file with "image" as parameter name
|
|
67
60
|
const formDataToUpload = new FormData();
|
|
68
61
|
formDataToUpload.append(key, new File([blob], key, {
|
|
69
62
|
type: contentType
|
|
70
63
|
}));
|
|
71
64
|
return formDataToUpload;
|
|
72
65
|
}
|
|
73
|
-
|
|
74
66
|
function* saveProfile(_ref) {
|
|
75
67
|
let {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
payload: {
|
|
69
|
+
callback,
|
|
70
|
+
profilePictureUrl
|
|
71
|
+
}
|
|
72
|
+
} = _ref,
|
|
73
|
+
payload = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
83
74
|
yield put(actions.setProfileState({
|
|
84
75
|
saving: true,
|
|
85
76
|
error: null
|
|
86
77
|
}));
|
|
87
|
-
|
|
88
78
|
try {
|
|
89
79
|
const oldProfileData = yield select(state => state.auth.profileState.profile);
|
|
90
80
|
let newProfilePictureUrl = oldProfileData.profilePictureUrl;
|
|
91
|
-
|
|
92
81
|
if (profilePictureUrl !== oldProfileData.profilePictureUrl && profilePictureUrl) {
|
|
93
82
|
const matchResult = (profilePictureUrl || '').match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);
|
|
94
|
-
|
|
95
83
|
if (matchResult) {
|
|
96
84
|
const profileImage = base64ToFormData(profilePictureUrl, 'image');
|
|
97
|
-
|
|
98
85
|
if (profileImage) {
|
|
99
86
|
newProfilePictureUrl = yield call(api.teams.updateProfileImage, profileImage);
|
|
100
87
|
const imageTimeStamp = Date.now().toString();
|
|
@@ -104,11 +91,9 @@ function* saveProfile(_ref) {
|
|
|
104
91
|
}
|
|
105
92
|
}
|
|
106
93
|
}
|
|
107
|
-
|
|
108
94
|
const newProfileData = _extends({}, oldProfileData, payload, {
|
|
109
95
|
profilePictureUrl: newProfilePictureUrl
|
|
110
96
|
});
|
|
111
|
-
|
|
112
97
|
const profile = yield call(api.teams.updateProfile, newProfileData);
|
|
113
98
|
const currentUser = yield select(state => state.auth.user);
|
|
114
99
|
yield put(actions.setUser(_extends({}, currentUser, profile)));
|
|
@@ -125,17 +110,14 @@ function* saveProfile(_ref) {
|
|
|
125
110
|
callback == null ? void 0 : callback(null, e);
|
|
126
111
|
}
|
|
127
112
|
}
|
|
128
|
-
|
|
129
113
|
function* changePassword({
|
|
130
114
|
payload
|
|
131
115
|
}) {
|
|
132
116
|
yield put(actions.setProfileState({
|
|
133
117
|
loading: true
|
|
134
118
|
}));
|
|
135
|
-
|
|
136
119
|
try {
|
|
137
120
|
var _payload$callback;
|
|
138
|
-
|
|
139
121
|
yield call(api.teams.changePassword, payload);
|
|
140
122
|
yield put(actions.setProfileState({
|
|
141
123
|
loading: false,
|
|
@@ -144,7 +126,6 @@ function* changePassword({
|
|
|
144
126
|
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
145
127
|
} catch (e) {
|
|
146
128
|
var _payload$callback2;
|
|
147
|
-
|
|
148
129
|
yield put(actions.setProfileState({
|
|
149
130
|
loading: false,
|
|
150
131
|
error: e.message
|
|
@@ -152,12 +133,12 @@ function* changePassword({
|
|
|
152
133
|
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
153
134
|
}
|
|
154
135
|
}
|
|
155
|
-
|
|
156
136
|
export function* profileSagas() {
|
|
157
137
|
yield takeLeading(actions.loadProfile, loadProfile);
|
|
158
138
|
yield takeEvery(actions.saveProfile, saveProfile);
|
|
159
139
|
yield takeEvery(actions.changePassword, changePassword);
|
|
160
140
|
}
|
|
141
|
+
|
|
161
142
|
/*********************************
|
|
162
143
|
* Preview Sagas
|
|
163
144
|
*********************************/
|
|
@@ -173,35 +154,29 @@ function* loadProfileMock() {
|
|
|
173
154
|
profile: userProfileDemo
|
|
174
155
|
}));
|
|
175
156
|
}
|
|
176
|
-
|
|
177
157
|
function* saveProfileMock(_ref2) {
|
|
178
158
|
let {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
159
|
+
payload: {
|
|
160
|
+
callback,
|
|
161
|
+
profilePictureUrl
|
|
162
|
+
}
|
|
163
|
+
} = _ref2,
|
|
164
|
+
payload = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
|
|
186
165
|
yield put(actions.setProfileState({
|
|
187
166
|
saving: true,
|
|
188
167
|
error: null
|
|
189
168
|
}));
|
|
190
169
|
const oldProfileData = profileStateDemo;
|
|
191
170
|
let newProfilePictureUrl = oldProfileData.profile.profilePictureUrl;
|
|
192
|
-
|
|
193
171
|
if (profilePictureUrl !== oldProfileData.profile.profilePictureUrl && profilePictureUrl) {
|
|
194
172
|
const matchResult = (profilePictureUrl || '').match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);
|
|
195
|
-
|
|
196
173
|
if (matchResult) {
|
|
197
174
|
newProfilePictureUrl = profilePictureUrl;
|
|
198
175
|
}
|
|
199
176
|
}
|
|
200
|
-
|
|
201
177
|
const newProfileData = _extends({}, oldProfileData.profile, payload, {
|
|
202
178
|
profilePictureUrl: newProfilePictureUrl
|
|
203
179
|
});
|
|
204
|
-
|
|
205
180
|
const currentUser = userDemo;
|
|
206
181
|
yield delay();
|
|
207
182
|
yield put(actions.setUser(_extends({}, currentUser, newProfileData)));
|
|
@@ -213,12 +188,10 @@ function* saveProfileMock(_ref2) {
|
|
|
213
188
|
}));
|
|
214
189
|
callback == null ? void 0 : callback(newProfileData);
|
|
215
190
|
}
|
|
216
|
-
|
|
217
191
|
function* changePasswordMock({
|
|
218
192
|
payload
|
|
219
193
|
}) {
|
|
220
194
|
var _payload$callback3;
|
|
221
|
-
|
|
222
195
|
yield put(actions.setProfileState({
|
|
223
196
|
loading: true
|
|
224
197
|
}));
|
|
@@ -229,7 +202,6 @@ function* changePasswordMock({
|
|
|
229
202
|
}));
|
|
230
203
|
(_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
231
204
|
}
|
|
232
|
-
|
|
233
205
|
export function* profileSagasMock() {
|
|
234
206
|
yield takeLeading(actions.loadProfile, loadProfileMock);
|
|
235
207
|
yield takeEvery(actions.saveProfile, saveProfileMock);
|
|
@@ -20,6 +20,7 @@ declare const reducers: {
|
|
|
20
20
|
user?: import("..").User | null | undefined;
|
|
21
21
|
isSSOAuth: boolean;
|
|
22
22
|
ssoACS?: string | undefined;
|
|
23
|
+
includeQueryParam?: boolean | undefined;
|
|
23
24
|
loginState: import("..").LoginState;
|
|
24
25
|
activateState: import("..").ActivateAccountState;
|
|
25
26
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -58,6 +59,7 @@ declare const reducers: {
|
|
|
58
59
|
user?: import("..").User | null | undefined;
|
|
59
60
|
isSSOAuth: boolean;
|
|
60
61
|
ssoACS?: string | undefined;
|
|
62
|
+
includeQueryParam?: boolean | undefined;
|
|
61
63
|
loginState: import("..").LoginState;
|
|
62
64
|
activateState: import("..").ActivateAccountState;
|
|
63
65
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -22,13 +22,13 @@ const actions = {
|
|
|
22
22
|
payload
|
|
23
23
|
}))
|
|
24
24
|
};
|
|
25
|
+
|
|
25
26
|
/**
|
|
26
27
|
* To be used for actions types after dispatch, and should contains
|
|
27
28
|
* the reducers and actions as standalone function
|
|
28
29
|
*/
|
|
29
30
|
|
|
30
31
|
// noinspection JSUnusedLocalSymbols
|
|
31
|
-
|
|
32
32
|
/**
|
|
33
33
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
34
34
|
* contains the same functions in reducers and actions
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["callback"],
|
|
4
|
-
|
|
4
|
+
_excluded2 = ["id"];
|
|
5
5
|
import { all, call, put, takeEvery, takeLeading } from 'redux-saga/effects';
|
|
6
6
|
import { api } from '@frontegg/rest-api';
|
|
7
7
|
import { actions } from '../reducer';
|
|
8
|
-
|
|
9
8
|
function* loadCountForConnection(connection) {
|
|
10
9
|
const {
|
|
11
10
|
count
|
|
@@ -14,13 +13,11 @@ function* loadCountForConnection(connection) {
|
|
|
14
13
|
count
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
function* loadScim2Connections() {
|
|
19
17
|
yield put(actions.setProvisioningState({
|
|
20
18
|
loading: true,
|
|
21
19
|
error: null
|
|
22
20
|
}));
|
|
23
|
-
|
|
24
21
|
try {
|
|
25
22
|
const connections = yield call(api.directory.getConfigs);
|
|
26
23
|
const connectionsWithCount = yield all(connections.map(connection => loadCountForConnection(connection)));
|
|
@@ -35,20 +32,17 @@ function* loadScim2Connections() {
|
|
|
35
32
|
}));
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
|
|
39
35
|
function* createScim2Connection(_ref) {
|
|
40
36
|
let {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
payload: {
|
|
38
|
+
callback
|
|
39
|
+
}
|
|
40
|
+
} = _ref,
|
|
41
|
+
newConnectionBody = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
47
42
|
yield put(actions.setProvisioningState({
|
|
48
43
|
loading: true,
|
|
49
44
|
error: null
|
|
50
45
|
}));
|
|
51
|
-
|
|
52
46
|
try {
|
|
53
47
|
const newConnectionResponse = yield call(api.directory.createConfiguration, newConnectionBody);
|
|
54
48
|
const connections = yield call(api.directory.getConfigs);
|
|
@@ -65,20 +59,17 @@ function* createScim2Connection(_ref) {
|
|
|
65
59
|
}));
|
|
66
60
|
}
|
|
67
61
|
}
|
|
68
|
-
|
|
69
62
|
function* updateScim2Connection(_ref2) {
|
|
70
63
|
let {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
64
|
+
payload: {
|
|
65
|
+
id
|
|
66
|
+
}
|
|
67
|
+
} = _ref2,
|
|
68
|
+
updateRequest = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
|
|
77
69
|
yield put(actions.setProvisioningState({
|
|
78
70
|
loading: true,
|
|
79
71
|
error: null
|
|
80
72
|
}));
|
|
81
|
-
|
|
82
73
|
try {
|
|
83
74
|
yield call(api.directory.updateConfiguration, id, updateRequest);
|
|
84
75
|
const connections = yield call(api.directory.getConfigs);
|
|
@@ -94,7 +85,6 @@ function* updateScim2Connection(_ref2) {
|
|
|
94
85
|
}));
|
|
95
86
|
}
|
|
96
87
|
}
|
|
97
|
-
|
|
98
88
|
function* deleteScim2Connection({
|
|
99
89
|
payload: {
|
|
100
90
|
id,
|
|
@@ -105,7 +95,6 @@ function* deleteScim2Connection({
|
|
|
105
95
|
loading: true,
|
|
106
96
|
error: null
|
|
107
97
|
}));
|
|
108
|
-
|
|
109
98
|
try {
|
|
110
99
|
yield call(api.directory.deleteConfiguration, id);
|
|
111
100
|
const connections = yield call(api.directory.getConfigs);
|
|
@@ -123,7 +112,6 @@ function* deleteScim2Connection({
|
|
|
123
112
|
callback == null ? void 0 : callback(false, e);
|
|
124
113
|
}
|
|
125
114
|
}
|
|
126
|
-
|
|
127
115
|
export function* provisionSagas() {
|
|
128
116
|
yield takeLeading(actions.loadProvisionConnections, loadScim2Connections);
|
|
129
117
|
yield takeEvery(actions.createProvisionConnection, createScim2Connection);
|
|
@@ -20,6 +20,7 @@ declare const reducers: {
|
|
|
20
20
|
user?: import("..").User | null | undefined;
|
|
21
21
|
isSSOAuth: boolean;
|
|
22
22
|
ssoACS?: string | undefined;
|
|
23
|
+
includeQueryParam?: boolean | undefined;
|
|
23
24
|
loginState: import("..").LoginState;
|
|
24
25
|
activateState: import("..").ActivateAccountState;
|
|
25
26
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -58,6 +59,7 @@ declare const reducers: {
|
|
|
58
59
|
user?: import("..").User | null | undefined;
|
|
59
60
|
isSSOAuth: boolean;
|
|
60
61
|
ssoACS?: string | undefined;
|
|
62
|
+
includeQueryParam?: boolean | undefined;
|
|
61
63
|
loginState: import("..").LoginState;
|
|
62
64
|
activateState: import("..").ActivateAccountState;
|
|
63
65
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -23,13 +23,13 @@ const actions = {
|
|
|
23
23
|
payload
|
|
24
24
|
}))
|
|
25
25
|
};
|
|
26
|
+
|
|
26
27
|
/**
|
|
27
28
|
* To be used for actions types after dispatch, and should contains
|
|
28
29
|
* the reducers and actions as standalone function
|
|
29
30
|
*/
|
|
30
31
|
|
|
31
32
|
// noinspection JSUnusedLocalSymbols
|
|
32
|
-
|
|
33
33
|
/**
|
|
34
34
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
35
35
|
* contains the same functions in reducers and actions
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
const _excluded = ["callback"],
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
_excluded2 = ["callback"],
|
|
4
|
+
_excluded3 = ["callback"];
|
|
5
5
|
import { call, put, select, takeLeading } from 'redux-saga/effects';
|
|
6
6
|
import { api, AuthStrategyEnum } from '@frontegg/rest-api';
|
|
7
7
|
import { actions } from '../reducer';
|
|
8
8
|
import { ResetPhoneNumberStep } from './interfaces';
|
|
9
9
|
import { LoginStep } from '../LoginState/interfaces';
|
|
10
|
-
|
|
11
10
|
function* resetPhoneNumber(_ref) {
|
|
12
11
|
let {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
payload: {
|
|
13
|
+
callback
|
|
14
|
+
}
|
|
15
|
+
} = _ref,
|
|
16
|
+
body = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
19
17
|
yield put(actions.setResetPhoneNumberState({
|
|
20
18
|
loading: true
|
|
21
19
|
}));
|
|
22
|
-
|
|
23
20
|
try {
|
|
24
21
|
const res = yield call(api.auth.resetPhoneNumber, body);
|
|
25
22
|
yield put(actions.setResetPhoneNumberState({
|
|
@@ -39,19 +36,16 @@ function* resetPhoneNumber(_ref) {
|
|
|
39
36
|
callback == null ? void 0 : callback(null, e);
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
|
|
43
39
|
function* verifyResetPhoneNumber(_ref2) {
|
|
44
40
|
let {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
payload: {
|
|
42
|
+
callback
|
|
43
|
+
}
|
|
44
|
+
} = _ref2,
|
|
45
|
+
body = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
|
|
51
46
|
yield put(actions.setResetPhoneNumberState({
|
|
52
47
|
loading: true
|
|
53
48
|
}));
|
|
54
|
-
|
|
55
49
|
try {
|
|
56
50
|
const res = yield call(api.auth.verifyResetPhoneNumber, body);
|
|
57
51
|
yield put(actions.setResetPhoneNumberState({
|
|
@@ -69,19 +63,16 @@ function* verifyResetPhoneNumber(_ref2) {
|
|
|
69
63
|
callback == null ? void 0 : callback(null, e);
|
|
70
64
|
}
|
|
71
65
|
}
|
|
72
|
-
|
|
73
66
|
export function* changePhoneNumber(_ref3) {
|
|
74
67
|
let {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
payload: {
|
|
69
|
+
callback
|
|
70
|
+
}
|
|
71
|
+
} = _ref3,
|
|
72
|
+
body = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
|
|
81
73
|
yield put(actions.setResetPhoneNumberState({
|
|
82
74
|
loading: true
|
|
83
75
|
}));
|
|
84
|
-
|
|
85
76
|
try {
|
|
86
77
|
const {
|
|
87
78
|
onRedirectTo,
|
|
@@ -20,6 +20,7 @@ declare const reducers: {
|
|
|
20
20
|
user?: import("..").User | null | undefined;
|
|
21
21
|
isSSOAuth: boolean;
|
|
22
22
|
ssoACS?: string | undefined;
|
|
23
|
+
includeQueryParam?: boolean | undefined;
|
|
23
24
|
loginState: import("..").LoginState;
|
|
24
25
|
activateState: import("..").ActivateAccountState;
|
|
25
26
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -65,6 +66,7 @@ declare const reducers: {
|
|
|
65
66
|
user?: import("..").User | null | undefined;
|
|
66
67
|
isSSOAuth: boolean;
|
|
67
68
|
ssoACS?: string | undefined;
|
|
69
|
+
includeQueryParam?: boolean | undefined;
|
|
68
70
|
loginState: import("..").LoginState;
|
|
69
71
|
activateState: import("..").ActivateAccountState;
|
|
70
72
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -110,6 +112,7 @@ declare const reducers: {
|
|
|
110
112
|
user?: import("..").User | null | undefined;
|
|
111
113
|
isSSOAuth: boolean;
|
|
112
114
|
ssoACS?: string | undefined;
|
|
115
|
+
includeQueryParam?: boolean | undefined;
|
|
113
116
|
loginState: import("..").LoginState;
|
|
114
117
|
activateState: import("..").ActivateAccountState;
|
|
115
118
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -48,13 +48,13 @@ const actions = {
|
|
|
48
48
|
payload
|
|
49
49
|
}))
|
|
50
50
|
};
|
|
51
|
+
|
|
51
52
|
/**
|
|
52
53
|
* To be used for actions types after dispatch, and should contains
|
|
53
54
|
* the reducers and actions as standalone function
|
|
54
55
|
*/
|
|
55
56
|
|
|
56
57
|
// noinspection JSUnusedLocalSymbols
|
|
57
|
-
|
|
58
58
|
/**
|
|
59
59
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
60
60
|
* contains the same functions in reducers and actions
|