@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.
Files changed (254) hide show
  1. package/audits/AuditLogsState/index.js +1 -1
  2. package/audits/AuditLogsState/saga.js +1 -18
  3. package/audits/AuditsMetadataState/index.js +1 -1
  4. package/audits/AuditsMetadataState/saga.js +1 -5
  5. package/audits/backward-compatibility/saga.js +0 -18
  6. package/audits/dummy.js +0 -16
  7. package/audits/index.js +4 -2
  8. package/audits/reducer.js +0 -2
  9. package/auth/AcceptInvitationState/index.d.ts +2 -0
  10. package/auth/AcceptInvitationState/index.js +1 -1
  11. package/auth/AcceptInvitationState/interfaces.js +0 -1
  12. package/auth/AcceptInvitationState/saga.js +0 -3
  13. package/auth/AccountSettingsState/index.d.ts +2 -0
  14. package/auth/AccountSettingsState/index.js +1 -1
  15. package/auth/AccountSettingsState/interfaces.d.ts +2 -0
  16. package/auth/AccountSettingsState/saga.js +1 -11
  17. package/auth/ActivateState/index.d.ts +3 -0
  18. package/auth/ActivateState/index.js +1 -1
  19. package/auth/ActivateState/interfaces.js +0 -1
  20. package/auth/ActivateState/saga.js +14 -34
  21. package/auth/ApiTokensState/index.d.ts +2 -0
  22. package/auth/ApiTokensState/index.js +1 -1
  23. package/auth/ApiTokensState/interfaces.d.ts +1 -0
  24. package/auth/ApiTokensState/interfaces.js +0 -1
  25. package/auth/ApiTokensState/saga.js +1 -44
  26. package/auth/ForgotPasswordState/index.d.ts +2 -0
  27. package/auth/ForgotPasswordState/index.js +1 -1
  28. package/auth/ForgotPasswordState/interfaces.js +0 -1
  29. package/auth/ForgotPasswordState/saga.js +5 -12
  30. package/auth/ImpersonationState/index.d.ts +2 -0
  31. package/auth/ImpersonationState/index.js +1 -1
  32. package/auth/ImpersonationState/interfaces.js +0 -1
  33. package/auth/ImpersonationState/saga.js +5 -9
  34. package/auth/LoginState/index.d.ts +2 -0
  35. package/auth/LoginState/index.js +1 -1
  36. package/auth/LoginState/interfaces.js +0 -6
  37. package/auth/LoginState/saga.d.ts +2 -38
  38. package/auth/LoginState/saga.js +132 -292
  39. package/auth/MfaState/index.d.ts +4 -2
  40. package/auth/MfaState/index.js +1 -1
  41. package/auth/MfaState/interfaces.d.ts +2 -2
  42. package/auth/MfaState/interfaces.js +0 -1
  43. package/auth/MfaState/saga.js +64 -143
  44. package/auth/ProfileState/index.d.ts +2 -0
  45. package/auth/ProfileState/index.js +1 -1
  46. package/auth/ProfileState/saga.js +22 -50
  47. package/auth/Provisioning/index.d.ts +2 -0
  48. package/auth/Provisioning/index.js +1 -1
  49. package/auth/Provisioning/saga.js +11 -23
  50. package/auth/ResetPhoneNumberState/index.d.ts +2 -0
  51. package/auth/ResetPhoneNumberState/index.js +1 -1
  52. package/auth/ResetPhoneNumberState/interfaces.js +0 -1
  53. package/auth/ResetPhoneNumberState/saga.js +17 -26
  54. package/auth/RestrictionsState/index.d.ts +3 -0
  55. package/auth/RestrictionsState/index.js +1 -1
  56. package/auth/RestrictionsState/saga.js +52 -105
  57. package/auth/RolesState/index.d.ts +2 -0
  58. package/auth/RolesState/index.js +1 -1
  59. package/auth/RolesState/saga.js +30 -51
  60. package/auth/SSOState/index.d.ts +2 -0
  61. package/auth/SSOState/index.js +1 -1
  62. package/auth/SSOState/interfaces.js +0 -3
  63. package/auth/SSOState/saga.js +10 -58
  64. package/auth/SSOState/saga.v2.js +13 -49
  65. package/auth/SecurityPolicyState/index.d.ts +13 -0
  66. package/auth/SecurityPolicyState/index.js +1 -1
  67. package/auth/SecurityPolicyState/saga.js +36 -90
  68. package/auth/SessionsPolicyState/index.d.ts +2 -0
  69. package/auth/SessionsPolicyState/index.js +1 -1
  70. package/auth/SessionsPolicyState/saga.js +7 -19
  71. package/auth/SessionsState/index.d.ts +2 -0
  72. package/auth/SessionsState/index.js +1 -1
  73. package/auth/SessionsState/saga.js +1 -15
  74. package/auth/SignUp/index.d.ts +2 -0
  75. package/auth/SignUp/index.js +1 -1
  76. package/auth/SignUp/interfaces.js +0 -1
  77. package/auth/SignUp/saga.js +6 -15
  78. package/auth/SocialLogins/index.d.ts +2 -0
  79. package/auth/SocialLogins/index.js +1 -1
  80. package/auth/SocialLogins/saga.js +10 -20
  81. package/auth/TeamState/index.d.ts +2 -0
  82. package/auth/TeamState/index.js +1 -1
  83. package/auth/TeamState/interfaces.js +0 -1
  84. package/auth/TeamState/saga.js +85 -205
  85. package/auth/TenantsState/index.d.ts +2 -0
  86. package/auth/TenantsState/index.js +1 -1
  87. package/auth/TenantsState/saga.js +1 -17
  88. package/auth/index.d.ts +2 -2
  89. package/auth/index.js +4 -3
  90. package/auth/interfaces.d.ts +2 -1
  91. package/auth/interfaces.js +0 -6
  92. package/auth/reducer.d.ts +2 -2
  93. package/auth/reducer.js +0 -2
  94. package/auth/saga.js +2 -1
  95. package/auth/utils.d.ts +4 -0
  96. package/auth/utils.js +7 -21
  97. package/connectivity/ConnectivityState/index.d.ts +9 -0
  98. package/connectivity/ConnectivityState/index.js +1 -1
  99. package/connectivity/consts.js +0 -5
  100. package/connectivity/index.js +4 -2
  101. package/connectivity/interfaces.d.ts +1 -0
  102. package/connectivity/reducer.js +0 -2
  103. package/connectivity/saga.js +48 -85
  104. package/helpers.js +4 -7
  105. package/index.js +1 -1
  106. package/node/audits/AuditLogsState/index.js +1 -8
  107. package/node/audits/AuditLogsState/saga.js +1 -26
  108. package/node/audits/AuditsMetadataState/index.js +1 -8
  109. package/node/audits/AuditsMetadataState/saga.js +1 -10
  110. package/node/audits/backward-compatibility/index.js +0 -8
  111. package/node/audits/backward-compatibility/reducer.js +0 -5
  112. package/node/audits/backward-compatibility/saga.js +0 -23
  113. package/node/audits/dummy.js +0 -19
  114. package/node/audits/index.js +0 -14
  115. package/node/audits/initialState.js +0 -3
  116. package/node/audits/reducer.js +0 -8
  117. package/node/audits/saga.js +0 -5
  118. package/node/audits/utils.js +0 -4
  119. package/node/auth/AcceptInvitationState/index.js +1 -7
  120. package/node/auth/AcceptInvitationState/interfaces.js +0 -1
  121. package/node/auth/AcceptInvitationState/saga.js +0 -7
  122. package/node/auth/AccountSettingsState/index.js +1 -6
  123. package/node/auth/AccountSettingsState/saga.js +1 -16
  124. package/node/auth/ActivateState/index.js +1 -7
  125. package/node/auth/ActivateState/interfaces.js +0 -1
  126. package/node/auth/ActivateState/saga.js +14 -41
  127. package/node/auth/ApiTokensState/index.js +1 -6
  128. package/node/auth/ApiTokensState/interfaces.js +0 -1
  129. package/node/auth/ApiTokensState/saga.js +1 -51
  130. package/node/auth/ForgotPasswordState/index.js +1 -7
  131. package/node/auth/ForgotPasswordState/interfaces.js +0 -1
  132. package/node/auth/ForgotPasswordState/saga.js +5 -19
  133. package/node/auth/ImpersonationState/index.js +1 -7
  134. package/node/auth/ImpersonationState/interfaces.js +0 -1
  135. package/node/auth/ImpersonationState/saga.js +5 -15
  136. package/node/auth/LoginState/index.js +1 -7
  137. package/node/auth/LoginState/interfaces.js +0 -7
  138. package/node/auth/LoginState/saga.js +132 -322
  139. package/node/auth/MfaState/index.js +1 -7
  140. package/node/auth/MfaState/interfaces.js +0 -1
  141. package/node/auth/MfaState/saga.js +64 -137
  142. package/node/auth/ProfileState/index.js +1 -6
  143. package/node/auth/ProfileState/saga.js +22 -58
  144. package/node/auth/Provisioning/index.js +1 -6
  145. package/node/auth/Provisioning/saga.js +11 -28
  146. package/node/auth/ResetPhoneNumberState/index.js +1 -7
  147. package/node/auth/ResetPhoneNumberState/interfaces.js +0 -1
  148. package/node/auth/ResetPhoneNumberState/saga.js +17 -32
  149. package/node/auth/RestrictionsState/index.js +1 -7
  150. package/node/auth/RestrictionsState/saga.js +52 -109
  151. package/node/auth/RolesState/index.js +1 -6
  152. package/node/auth/RolesState/saga.js +30 -54
  153. package/node/auth/SSOState/index.js +1 -6
  154. package/node/auth/SSOState/interfaces.js +0 -3
  155. package/node/auth/SSOState/saga.js +10 -63
  156. package/node/auth/SSOState/saga.v2.js +13 -53
  157. package/node/auth/SecurityPolicyState/index.js +1 -6
  158. package/node/auth/SecurityPolicyState/saga.js +36 -89
  159. package/node/auth/SessionsPolicyState/index.js +1 -6
  160. package/node/auth/SessionsPolicyState/saga.js +7 -24
  161. package/node/auth/SessionsState/index.js +1 -6
  162. package/node/auth/SessionsState/saga.js +1 -22
  163. package/node/auth/SignUp/index.js +1 -7
  164. package/node/auth/SignUp/interfaces.js +0 -1
  165. package/node/auth/SignUp/saga.js +6 -30
  166. package/node/auth/SocialLogins/index.js +1 -6
  167. package/node/auth/SocialLogins/saga.js +10 -33
  168. package/node/auth/TeamState/index.js +1 -6
  169. package/node/auth/TeamState/interfaces.js +0 -1
  170. package/node/auth/TeamState/saga.js +86 -190
  171. package/node/auth/TenantsState/index.js +1 -6
  172. package/node/auth/TenantsState/saga.js +1 -24
  173. package/node/auth/dummy.js +0 -5
  174. package/node/auth/index.js +0 -90
  175. package/node/auth/initialState.js +0 -23
  176. package/node/auth/interfaces.js +0 -6
  177. package/node/auth/reducer.js +0 -28
  178. package/node/auth/saga.js +2 -26
  179. package/node/auth/utils.js +7 -42
  180. package/node/connectivity/ConnectivityState/index.js +1 -7
  181. package/node/connectivity/consts.js +1 -7
  182. package/node/connectivity/index.js +0 -5
  183. package/node/connectivity/reducer.js +0 -6
  184. package/node/connectivity/saga.js +47 -91
  185. package/node/helpers.js +2 -14
  186. package/node/index.js +1 -17
  187. package/node/subscriptions/Billing/Information/index.js +0 -7
  188. package/node/subscriptions/Billing/Information/saga.js +1 -25
  189. package/node/subscriptions/Billing/Invoices/index.js +0 -6
  190. package/node/subscriptions/Billing/Invoices/saga.js +1 -13
  191. package/node/subscriptions/Billing/PaymentMethod/index.js +2 -8
  192. package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
  193. package/node/subscriptions/Billing/PaymentMethod/saga.js +1 -17
  194. package/node/subscriptions/Billing/Subscription/index.js +0 -6
  195. package/node/subscriptions/Billing/Subscription/saga.js +3 -23
  196. package/node/subscriptions/Billing/index.js +0 -6
  197. package/node/subscriptions/Billing/interfaces.js +0 -8
  198. package/node/subscriptions/Billing/saga.js +0 -7
  199. package/node/subscriptions/Checkout/index.js +0 -6
  200. package/node/subscriptions/Checkout/saga.js +2 -22
  201. package/node/subscriptions/Config/index.js +0 -6
  202. package/node/subscriptions/Config/saga.js +1 -12
  203. package/node/subscriptions/Plans/index.js +0 -6
  204. package/node/subscriptions/Plans/saga.js +1 -13
  205. package/node/subscriptions/Stripe/index.js +0 -6
  206. package/node/subscriptions/Stripe/saga.js +0 -8
  207. package/node/subscriptions/VendorPublicConfig/index.js +0 -6
  208. package/node/subscriptions/VendorPublicConfig/saga.js +1 -9
  209. package/node/subscriptions/dummy.js +2 -4
  210. package/node/subscriptions/general.interfaces.js +0 -5
  211. package/node/subscriptions/index.js +0 -5
  212. package/node/subscriptions/interfaces.js +0 -14
  213. package/node/subscriptions/mapper.js +0 -11
  214. package/node/subscriptions/reducer.js +0 -9
  215. package/node/subscriptions/saga.js +0 -9
  216. package/node/subscriptions/utils.js +0 -6
  217. package/node/toolkit/index.js +0 -31
  218. package/node/toolkit/redux-saga.js +0 -3
  219. package/node/toolkit/redux.js +0 -1
  220. package/node/vendor/VendorState/index.js +1 -7
  221. package/node/vendor/index.js +0 -5
  222. package/node/vendor/reducer.js +0 -6
  223. package/node/vendor/saga.js +1 -9
  224. package/package.json +1 -1
  225. package/subscriptions/Billing/Information/index.js +0 -4
  226. package/subscriptions/Billing/Information/saga.js +1 -12
  227. package/subscriptions/Billing/Invoices/index.js +0 -4
  228. package/subscriptions/Billing/Invoices/saga.js +1 -5
  229. package/subscriptions/Billing/PaymentMethod/index.js +2 -6
  230. package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -1
  231. package/subscriptions/Billing/PaymentMethod/saga.js +1 -9
  232. package/subscriptions/Billing/Subscription/index.js +0 -4
  233. package/subscriptions/Billing/Subscription/saga.js +3 -17
  234. package/subscriptions/Billing/interfaces.js +1 -0
  235. package/subscriptions/Checkout/index.js +0 -4
  236. package/subscriptions/Checkout/saga.js +2 -12
  237. package/subscriptions/Config/index.js +0 -4
  238. package/subscriptions/Config/saga.js +1 -7
  239. package/subscriptions/Plans/index.js +0 -2
  240. package/subscriptions/Plans/saga.js +1 -6
  241. package/subscriptions/Stripe/index.js +0 -4
  242. package/subscriptions/Stripe/saga.js +0 -4
  243. package/subscriptions/VendorPublicConfig/index.js +0 -2
  244. package/subscriptions/VendorPublicConfig/saga.js +1 -4
  245. package/subscriptions/dummy.js +3 -2
  246. package/subscriptions/general.interfaces.js +0 -5
  247. package/subscriptions/index.js +3 -1
  248. package/subscriptions/mapper.js +0 -5
  249. package/toolkit/index.d.ts +1 -1
  250. package/toolkit/index.js +0 -9
  251. package/vendor/VendorState/index.js +1 -0
  252. package/vendor/index.js +4 -2
  253. package/vendor/reducer.js +0 -2
  254. package/vendor/saga.js +1 -2
@@ -1,41 +1,28 @@
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.profileSagas = profileSagas;
9
8
  exports.profileSagasMock = profileSagasMock;
10
-
11
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
-
13
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
-
15
11
  var _effects = require("redux-saga/effects");
16
-
17
12
  var _restApi = require("@frontegg/rest-api");
18
-
19
13
  var _reducer = require("../reducer");
20
-
21
14
  var _dummy = require("../dummy");
22
-
23
15
  var _utils = require("../utils");
24
-
25
16
  const _excluded = ["callback", "profilePictureUrl"],
26
- _excluded2 = ["callback", "profilePictureUrl"];
27
-
17
+ _excluded2 = ["callback", "profilePictureUrl"];
28
18
  function* loadProfile() {
29
19
  yield (0, _effects.put)(_reducer.actions.setProfileState({
30
20
  loading: true
31
21
  }));
32
-
33
22
  try {
34
23
  const profile = yield (0, _effects.retry)(3, 2000, _restApi.api.teams.getProfile);
35
24
  const currentUser = yield (0, _effects.select)(state => state.auth.user);
36
-
37
25
  _reducer.actions.setUser((0, _extends2.default)({}, currentUser, profile));
38
-
39
26
  yield (0, _effects.put)(_reducer.actions.setProfileState({
40
27
  profile,
41
28
  loading: false
@@ -47,72 +34,62 @@ function* loadProfile() {
47
34
  }));
48
35
  }
49
36
  }
50
-
51
37
  function b64toBlob(base64, contentType) {
52
38
  const sliceSize = 512;
53
39
  const byteCharacters = atob(base64);
54
40
  const byteArrays = [];
55
-
56
41
  for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
57
42
  const slice = byteCharacters.slice(offset, offset + sliceSize);
58
43
  const byteNumbers = new Array(slice.length);
59
-
60
44
  for (let i = 0; i < slice.length; i++) {
61
45
  byteNumbers[i] = slice.charCodeAt(i);
62
46
  }
63
-
64
47
  byteArrays.push(new Uint8Array(byteNumbers));
65
48
  }
66
-
67
49
  return new Blob(byteArrays, {
68
50
  type: contentType
69
51
  });
70
52
  }
71
-
72
53
  function base64ToFormData(base64, key = 'file') {
73
54
  const matchResult = base64.match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);
74
-
75
55
  if (matchResult == null) {
76
56
  return null;
77
- } // Get the content type of the image
78
-
79
-
80
- const contentType = `image/${matchResult[1]}`; // get the real base64 content of the file
57
+ }
81
58
 
82
- const data = matchResult[2]; // Convert it to a blob to upload
59
+ // Get the content type of the image
60
+ const contentType = `image/${matchResult[1]}`;
61
+ // get the real base64 content of the file
62
+ const data = matchResult[2];
83
63
 
84
- const blob = b64toBlob(data, contentType); // Create a FormData and append the file with "image" as parameter name
64
+ // Convert it to a blob to upload
65
+ const blob = b64toBlob(data, contentType);
85
66
 
67
+ // Create a FormData and append the file with "image" as parameter name
86
68
  const formDataToUpload = new FormData();
87
69
  formDataToUpload.append(key, new File([blob], key, {
88
70
  type: contentType
89
71
  }));
90
72
  return formDataToUpload;
91
73
  }
92
-
93
74
  function* saveProfile(_ref) {
94
75
  let {
95
- payload: {
96
- callback,
97
- profilePictureUrl
98
- }
99
- } = _ref,
100
- payload = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
76
+ payload: {
77
+ callback,
78
+ profilePictureUrl
79
+ }
80
+ } = _ref,
81
+ payload = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
101
82
  yield (0, _effects.put)(_reducer.actions.setProfileState({
102
83
  saving: true,
103
84
  error: null
104
85
  }));
105
-
106
86
  try {
107
87
  const oldProfileData = yield (0, _effects.select)(state => state.auth.profileState.profile);
108
88
  let newProfilePictureUrl = oldProfileData.profilePictureUrl;
109
-
110
89
  if (profilePictureUrl !== oldProfileData.profilePictureUrl && profilePictureUrl) {
111
90
  const matchResult = (profilePictureUrl || '').match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);
112
-
113
91
  if (matchResult) {
114
92
  const profileImage = base64ToFormData(profilePictureUrl, 'image');
115
-
116
93
  if (profileImage) {
117
94
  newProfilePictureUrl = yield (0, _effects.call)(_restApi.api.teams.updateProfileImage, profileImage);
118
95
  const imageTimeStamp = Date.now().toString();
@@ -122,7 +99,6 @@ function* saveProfile(_ref) {
122
99
  }
123
100
  }
124
101
  }
125
-
126
102
  const newProfileData = (0, _extends2.default)({}, oldProfileData, payload, {
127
103
  profilePictureUrl: newProfilePictureUrl
128
104
  });
@@ -142,17 +118,14 @@ function* saveProfile(_ref) {
142
118
  callback == null ? void 0 : callback(null, e);
143
119
  }
144
120
  }
145
-
146
121
  function* changePassword({
147
122
  payload
148
123
  }) {
149
124
  yield (0, _effects.put)(_reducer.actions.setProfileState({
150
125
  loading: true
151
126
  }));
152
-
153
127
  try {
154
128
  var _payload$callback;
155
-
156
129
  yield (0, _effects.call)(_restApi.api.teams.changePassword, payload);
157
130
  yield (0, _effects.put)(_reducer.actions.setProfileState({
158
131
  loading: false,
@@ -161,7 +134,6 @@ function* changePassword({
161
134
  (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
162
135
  } catch (e) {
163
136
  var _payload$callback2;
164
-
165
137
  yield (0, _effects.put)(_reducer.actions.setProfileState({
166
138
  loading: false,
167
139
  error: e.message
@@ -169,17 +141,16 @@ function* changePassword({
169
141
  (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
170
142
  }
171
143
  }
172
-
173
144
  function* profileSagas() {
174
145
  yield (0, _effects.takeLeading)(_reducer.actions.loadProfile, loadProfile);
175
146
  yield (0, _effects.takeEvery)(_reducer.actions.saveProfile, saveProfile);
176
147
  yield (0, _effects.takeEvery)(_reducer.actions.changePassword, changePassword);
177
148
  }
149
+
178
150
  /*********************************
179
151
  * Preview Sagas
180
152
  *********************************/
181
153
 
182
-
183
154
  function* loadProfileMock() {
184
155
  yield (0, _effects.put)(_reducer.actions.setProfileState({
185
156
  loading: true
@@ -191,30 +162,26 @@ function* loadProfileMock() {
191
162
  profile: _dummy.userProfileDemo
192
163
  }));
193
164
  }
194
-
195
165
  function* saveProfileMock(_ref2) {
196
166
  let {
197
- payload: {
198
- callback,
199
- profilePictureUrl
200
- }
201
- } = _ref2,
202
- payload = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
167
+ payload: {
168
+ callback,
169
+ profilePictureUrl
170
+ }
171
+ } = _ref2,
172
+ payload = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
203
173
  yield (0, _effects.put)(_reducer.actions.setProfileState({
204
174
  saving: true,
205
175
  error: null
206
176
  }));
207
177
  const oldProfileData = _dummy.profileStateDemo;
208
178
  let newProfilePictureUrl = oldProfileData.profile.profilePictureUrl;
209
-
210
179
  if (profilePictureUrl !== oldProfileData.profile.profilePictureUrl && profilePictureUrl) {
211
180
  const matchResult = (profilePictureUrl || '').match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);
212
-
213
181
  if (matchResult) {
214
182
  newProfilePictureUrl = profilePictureUrl;
215
183
  }
216
184
  }
217
-
218
185
  const newProfileData = (0, _extends2.default)({}, oldProfileData.profile, payload, {
219
186
  profilePictureUrl: newProfilePictureUrl
220
187
  });
@@ -229,12 +196,10 @@ function* saveProfileMock(_ref2) {
229
196
  }));
230
197
  callback == null ? void 0 : callback(newProfileData);
231
198
  }
232
-
233
199
  function* changePasswordMock({
234
200
  payload
235
201
  }) {
236
202
  var _payload$callback3;
237
-
238
203
  yield (0, _effects.put)(_reducer.actions.setProfileState({
239
204
  loading: true
240
205
  }));
@@ -245,7 +210,6 @@ function* changePasswordMock({
245
210
  }));
246
211
  (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
247
212
  }
248
-
249
213
  function* profileSagasMock() {
250
214
  yield (0, _effects.takeLeading)(_reducer.actions.loadProfile, loadProfileMock);
251
215
  yield (0, _effects.takeEvery)(_reducer.actions.saveProfile, saveProfileMock);
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.provisioningState = exports.provisioningReducers = exports.provisioningActions = 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 provisioningState = {
15
11
  loading: false
16
12
  };
@@ -34,14 +30,13 @@ const actions = {
34
30
  payload
35
31
  }))
36
32
  };
33
+
37
34
  /**
38
35
  * To be used for actions types after dispatch, and should contains
39
36
  * the reducers and actions as standalone function
40
37
  */
41
-
42
38
  exports.provisioningActions = actions;
43
39
  // noinspection JSUnusedLocalSymbols
44
-
45
40
  /**
46
41
  * if you see error in matcher that's mean the DispatchAction does not
47
42
  * contains the same functions in reducers and actions
@@ -1,25 +1,17 @@
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.provisionSagas = provisionSagas;
9
-
10
8
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
-
12
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _effects = require("redux-saga/effects");
15
-
16
11
  var _restApi = require("@frontegg/rest-api");
17
-
18
12
  var _reducer = require("../reducer");
19
-
20
13
  const _excluded = ["callback"],
21
- _excluded2 = ["id"];
22
-
14
+ _excluded2 = ["id"];
23
15
  function* loadCountForConnection(connection) {
24
16
  const {
25
17
  count
@@ -28,13 +20,11 @@ function* loadCountForConnection(connection) {
28
20
  count
29
21
  });
30
22
  }
31
-
32
23
  function* loadScim2Connections() {
33
24
  yield (0, _effects.put)(_reducer.actions.setProvisioningState({
34
25
  loading: true,
35
26
  error: null
36
27
  }));
37
-
38
28
  try {
39
29
  const connections = yield (0, _effects.call)(_restApi.api.directory.getConfigs);
40
30
  const connectionsWithCount = yield (0, _effects.all)(connections.map(connection => loadCountForConnection(connection)));
@@ -49,19 +39,17 @@ function* loadScim2Connections() {
49
39
  }));
50
40
  }
51
41
  }
52
-
53
42
  function* createScim2Connection(_ref) {
54
43
  let {
55
- payload: {
56
- callback
57
- }
58
- } = _ref,
59
- newConnectionBody = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
44
+ payload: {
45
+ callback
46
+ }
47
+ } = _ref,
48
+ newConnectionBody = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
60
49
  yield (0, _effects.put)(_reducer.actions.setProvisioningState({
61
50
  loading: true,
62
51
  error: null
63
52
  }));
64
-
65
53
  try {
66
54
  const newConnectionResponse = yield (0, _effects.call)(_restApi.api.directory.createConfiguration, newConnectionBody);
67
55
  const connections = yield (0, _effects.call)(_restApi.api.directory.getConfigs);
@@ -78,19 +66,17 @@ function* createScim2Connection(_ref) {
78
66
  }));
79
67
  }
80
68
  }
81
-
82
69
  function* updateScim2Connection(_ref2) {
83
70
  let {
84
- payload: {
85
- id
86
- }
87
- } = _ref2,
88
- updateRequest = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
71
+ payload: {
72
+ id
73
+ }
74
+ } = _ref2,
75
+ updateRequest = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
89
76
  yield (0, _effects.put)(_reducer.actions.setProvisioningState({
90
77
  loading: true,
91
78
  error: null
92
79
  }));
93
-
94
80
  try {
95
81
  yield (0, _effects.call)(_restApi.api.directory.updateConfiguration, id, updateRequest);
96
82
  const connections = yield (0, _effects.call)(_restApi.api.directory.getConfigs);
@@ -106,7 +92,6 @@ function* updateScim2Connection(_ref2) {
106
92
  }));
107
93
  }
108
94
  }
109
-
110
95
  function* deleteScim2Connection({
111
96
  payload: {
112
97
  id,
@@ -117,7 +102,6 @@ function* deleteScim2Connection({
117
102
  loading: true,
118
103
  error: null
119
104
  }));
120
-
121
105
  try {
122
106
  yield (0, _effects.call)(_restApi.api.directory.deleteConfiguration, id);
123
107
  const connections = yield (0, _effects.call)(_restApi.api.directory.getConfigs);
@@ -135,7 +119,6 @@ function* deleteScim2Connection({
135
119
  callback == null ? void 0 : callback(false, e);
136
120
  }
137
121
  }
138
-
139
122
  function* provisionSagas() {
140
123
  yield (0, _effects.takeLeading)(_reducer.actions.loadProvisionConnections, loadScim2Connections);
141
124
  yield (0, _effects.takeEvery)(_reducer.actions.createProvisionConnection, createScim2Connection);
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.resetPhoneNumberState = exports.resetPhoneNumberReducers = exports.resetPhoneNumberActions = 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 resetPhoneNumberState = {
17
12
  step: _interfaces.ResetPhoneNumberStep.ResetPhoneNumber,
18
13
  loading: false
@@ -36,14 +31,13 @@ const actions = {
36
31
  payload
37
32
  }))
38
33
  };
34
+
39
35
  /**
40
36
  * To be used for actions types after dispatch, and should contains
41
37
  * the reducers and actions as standalone function
42
38
  */
43
-
44
39
  exports.resetPhoneNumberActions = actions;
45
40
  // noinspection JSUnusedLocalSymbols
46
-
47
41
  /**
48
42
  * if you see error in matcher that's mean the DispatchAction does not
49
43
  * contains the same functions in reducers and actions
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ResetPhoneNumberStep = void 0;
7
7
  let ResetPhoneNumberStep;
8
8
  exports.ResetPhoneNumberStep = ResetPhoneNumberStep;
9
-
10
9
  (function (ResetPhoneNumberStep) {
11
10
  ResetPhoneNumberStep["ResetPhoneNumber"] = "ResetPhoneNumber";
12
11
  ResetPhoneNumberStep["VerifyResetPhoneNumber"] = "VerifyResetPhoneNumber";
@@ -1,40 +1,30 @@
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.changePhoneNumber = changePhoneNumber;
9
8
  exports.resetPhoneNumberSagas = resetPhoneNumberSagas;
10
-
11
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
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 _interfaces2 = require("../LoginState/interfaces");
22
-
23
15
  const _excluded = ["callback"],
24
- _excluded2 = ["callback"],
25
- _excluded3 = ["callback"];
26
-
16
+ _excluded2 = ["callback"],
17
+ _excluded3 = ["callback"];
27
18
  function* resetPhoneNumber(_ref) {
28
19
  let {
29
- payload: {
30
- callback
31
- }
32
- } = _ref,
33
- body = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
20
+ payload: {
21
+ callback
22
+ }
23
+ } = _ref,
24
+ body = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
34
25
  yield (0, _effects.put)(_reducer.actions.setResetPhoneNumberState({
35
26
  loading: true
36
27
  }));
37
-
38
28
  try {
39
29
  const res = yield (0, _effects.call)(_restApi.api.auth.resetPhoneNumber, body);
40
30
  yield (0, _effects.put)(_reducer.actions.setResetPhoneNumberState({
@@ -54,18 +44,16 @@ function* resetPhoneNumber(_ref) {
54
44
  callback == null ? void 0 : callback(null, e);
55
45
  }
56
46
  }
57
-
58
47
  function* verifyResetPhoneNumber(_ref2) {
59
48
  let {
60
- payload: {
61
- callback
62
- }
63
- } = _ref2,
64
- body = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
49
+ payload: {
50
+ callback
51
+ }
52
+ } = _ref2,
53
+ body = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
65
54
  yield (0, _effects.put)(_reducer.actions.setResetPhoneNumberState({
66
55
  loading: true
67
56
  }));
68
-
69
57
  try {
70
58
  const res = yield (0, _effects.call)(_restApi.api.auth.verifyResetPhoneNumber, body);
71
59
  yield (0, _effects.put)(_reducer.actions.setResetPhoneNumberState({
@@ -83,18 +71,16 @@ function* verifyResetPhoneNumber(_ref2) {
83
71
  callback == null ? void 0 : callback(null, e);
84
72
  }
85
73
  }
86
-
87
74
  function* changePhoneNumber(_ref3) {
88
75
  let {
89
- payload: {
90
- callback
91
- }
92
- } = _ref3,
93
- body = (0, _objectWithoutPropertiesLoose2.default)(_ref3.payload, _excluded3);
76
+ payload: {
77
+ callback
78
+ }
79
+ } = _ref3,
80
+ body = (0, _objectWithoutPropertiesLoose2.default)(_ref3.payload, _excluded3);
94
81
  yield (0, _effects.put)(_reducer.actions.setResetPhoneNumberState({
95
82
  loading: true
96
83
  }));
97
-
98
84
  try {
99
85
  const {
100
86
  onRedirectTo,
@@ -133,7 +119,6 @@ function* changePhoneNumber(_ref3) {
133
119
  callback == null ? void 0 : callback(null, e);
134
120
  }
135
121
  }
136
-
137
122
  function* resetPhoneNumberSagas() {
138
123
  yield (0, _effects.takeLeading)(_reducer.actions.resetPhoneNumber, resetPhoneNumber);
139
124
  yield (0, _effects.takeLeading)(_reducer.actions.verifyResetPhoneNumber, verifyResetPhoneNumber);
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.restrictionsState = exports.restrictionsReducers = exports.restrictionsActions = 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
  var _restApi = require("@frontegg/rest-api");
15
-
16
11
  const restrictionsState = {
17
12
  ipRestrictions: {
18
13
  loading: false,
@@ -61,14 +56,13 @@ const actions = {
61
56
  payload
62
57
  }))
63
58
  };
59
+
64
60
  /**
65
61
  * To be used for actions types after dispatch, and should contains
66
62
  * the reducers and actions as standalone function
67
63
  */
68
-
69
64
  exports.restrictionsActions = actions;
70
65
  // noinspection JSUnusedLocalSymbols
71
-
72
66
  /**
73
67
  * if you see error in matcher that's mean the DispatchAction does not
74
68
  * contains the same functions in reducers and actions