@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,13 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["callback"],
4
- _excluded2 = ["callback"],
5
- _excluded3 = ["callback"],
6
- _excluded4 = ["callback"],
7
- _excluded5 = ["callback"],
8
- _excluded6 = ["callback"],
9
- _excluded7 = ["callback"],
10
- _excluded8 = ["callback"];
4
+ _excluded2 = ["callback"],
5
+ _excluded3 = ["callback"],
6
+ _excluded4 = ["callback"],
7
+ _excluded5 = ["callback"],
8
+ _excluded6 = ["callback"],
9
+ _excluded7 = ["callback"],
10
+ _excluded8 = ["callback"];
11
11
  import { all, call, put, select as sagaSelect, takeEvery, takeLeading } from 'redux-saga/effects';
12
12
  import { api, RestrictionType } from '@frontegg/rest-api';
13
13
  import { actions } from '../reducer';
@@ -15,19 +15,14 @@ import { v4 as uuid } from 'uuid';
15
15
  import { authStoreName } from '../../constants';
16
16
  import { dummyIpConfig, dummyIps } from '../dummy';
17
17
  import { delay } from '../utils';
18
-
19
18
  const selectIpRestrictionsState = () => sagaSelect(_ => _[authStoreName].restrictionsState.ipRestrictions);
20
-
21
19
  const selectUserIp = () => sagaSelect(_ => _[authStoreName].userIp);
22
-
23
20
  const selectEmailDomainRestrictionsState = () => sagaSelect(_ => _[authStoreName].restrictionsState.emailDomainRestrictions);
24
-
25
21
  function* loadEmailDomainRestrictions() {
26
22
  yield put(actions.setEmailDomainRestrictionsState({
27
23
  loading: true,
28
24
  error: null
29
25
  }));
30
-
31
26
  try {
32
27
  const restrictionsConfig = yield call(api.auth.getDomainRestrictionsConfig);
33
28
  const restrictions = yield call(api.auth.getDomainRestrictions);
@@ -46,29 +41,24 @@ function* loadEmailDomainRestrictions() {
46
41
  }));
47
42
  }
48
43
  }
49
-
50
44
  function* saveEmailDomainRestriction(_ref) {
51
45
  let {
52
- payload: {
53
- callback
54
- }
55
- } = _ref,
56
- newRestriction = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
57
-
46
+ payload: {
47
+ callback
48
+ }
49
+ } = _ref,
50
+ newRestriction = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
58
51
  yield put(actions.setEmailDomainRestrictionsState({
59
52
  saving: true,
60
53
  error: null
61
54
  }));
62
55
  const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
63
-
64
56
  try {
65
57
  var _emailDomainRestricti2;
66
-
67
58
  yield call(api.auth.createDomainRestriction, newRestriction);
68
59
  const restrictions = yield call(api.auth.getDomainRestrictions);
69
60
  const filteredRestrictions = restrictions.items.filter(restriction => {
70
61
  var _emailDomainRestricti;
71
-
72
62
  return restriction.type === ((_emailDomainRestricti = emailDomainRestrictionsState.data) == null ? void 0 : _emailDomainRestricti.config.listType);
73
63
  });
74
64
  yield put(actions.setEmailDomainRestrictionsState({
@@ -91,20 +81,17 @@ function* saveEmailDomainRestriction(_ref) {
91
81
  callback == null ? void 0 : callback(null, e);
92
82
  }
93
83
  }
94
-
95
84
  function* saveEmailDomainRestrictionConfig(_ref2) {
96
85
  let {
97
- payload: {
98
- callback
99
- }
100
- } = _ref2,
101
- config = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
102
-
86
+ payload: {
87
+ callback
88
+ }
89
+ } = _ref2,
90
+ config = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
103
91
  yield put(actions.setEmailDomainRestrictionsState({
104
92
  saving: true,
105
93
  error: null
106
94
  }));
107
-
108
95
  try {
109
96
  const updatedConfig = yield call(api.auth.updateDomainRestrictionConfig, config);
110
97
  const restrictions = yield call(api.auth.getDomainRestrictions);
@@ -125,7 +112,6 @@ function* saveEmailDomainRestrictionConfig(_ref2) {
125
112
  callback == null ? void 0 : callback(null, e);
126
113
  }
127
114
  }
128
-
129
115
  function* deleteEmailDomainRestriction({
130
116
  payload: {
131
117
  id
@@ -136,15 +122,12 @@ function* deleteEmailDomainRestriction({
136
122
  error: null
137
123
  }));
138
124
  const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
139
-
140
125
  try {
141
126
  var _emailDomainRestricti4;
142
-
143
127
  yield call(api.auth.deleteDomainRestriction, id);
144
128
  const restrictions = yield call(api.auth.getDomainRestrictions);
145
129
  const filteredRestrictions = restrictions.items.filter(restriction => {
146
130
  var _emailDomainRestricti3;
147
-
148
131
  return restriction.type === ((_emailDomainRestricti3 = emailDomainRestrictionsState.data) == null ? void 0 : _emailDomainRestricti3.config.listType);
149
132
  });
150
133
  yield put(actions.setEmailDomainRestrictionsState({
@@ -165,23 +148,19 @@ function* deleteEmailDomainRestriction({
165
148
  }));
166
149
  }
167
150
  }
168
-
169
151
  const getPagination = statePagination => {
170
152
  var _statePagination$_fil, _statePagination$_lim, _statePagination$_off;
171
-
172
153
  return {
173
154
  _filter: (_statePagination$_fil = statePagination == null ? void 0 : statePagination._filter) != null ? _statePagination$_fil : RestrictionType.ALLOW,
174
155
  _limit: (_statePagination$_lim = statePagination == null ? void 0 : statePagination._limit) != null ? _statePagination$_lim : 10,
175
156
  _offset: (_statePagination$_off = statePagination == null ? void 0 : statePagination._offset) != null ? _statePagination$_off : 0
176
157
  };
177
158
  };
178
-
179
159
  function* loadIpRestrictions() {
180
160
  yield put(actions.setIpRestrictionsState({
181
161
  loading: true,
182
162
  error: null
183
163
  }));
184
-
185
164
  try {
186
165
  const ipRestrictionState = yield selectIpRestrictionsState();
187
166
  const restrictionsConfig = yield call(api.auth.getIPRestrictionsConfig);
@@ -212,7 +191,6 @@ function* loadIpRestrictions() {
212
191
  }));
213
192
  }
214
193
  }
215
-
216
194
  function* checkIfUserIpValid() {
217
195
  try {
218
196
  const {
@@ -227,7 +205,6 @@ function* checkIfUserIpValid() {
227
205
  }));
228
206
  }
229
207
  }
230
-
231
208
  function* addCurrentUserIpAndActivate({
232
209
  payload: {
233
210
  callback
@@ -237,7 +214,6 @@ function* addCurrentUserIpAndActivate({
237
214
  saving: true,
238
215
  error: null
239
216
  }));
240
-
241
217
  try {
242
218
  const userIp = yield selectUserIp();
243
219
  yield all([call(api.auth.createIPRestriction, {
@@ -278,24 +254,20 @@ function* addCurrentUserIpAndActivate({
278
254
  callback == null ? void 0 : callback(false, e);
279
255
  }
280
256
  }
281
-
282
257
  function* saveIpRestriction(_ref3) {
283
258
  let {
284
- payload: {
285
- callback
286
- }
287
- } = _ref3,
288
- newRestriction = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
289
-
259
+ payload: {
260
+ callback
261
+ }
262
+ } = _ref3,
263
+ newRestriction = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
290
264
  yield put(actions.setIpRestrictionsState({
291
265
  saving: true,
292
266
  error: null
293
267
  }));
294
268
  const ipRestrictionsState = yield selectIpRestrictionsState();
295
-
296
269
  try {
297
270
  var _ipRestrictionsState$, _ipRestrictionsState$2;
298
-
299
271
  yield call(api.auth.createIPRestriction, newRestriction);
300
272
  const ipRestrictionState = yield selectIpRestrictionsState();
301
273
  const pagination = getPagination(ipRestrictionState.pagination);
@@ -327,20 +299,17 @@ function* saveIpRestriction(_ref3) {
327
299
  callback == null ? void 0 : callback(null, e);
328
300
  }
329
301
  }
330
-
331
302
  function* saveIpRestrictionsConfig(_ref4) {
332
303
  let {
333
- payload: {
334
- callback
335
- }
336
- } = _ref4,
337
- config = _objectWithoutPropertiesLoose(_ref4.payload, _excluded4);
338
-
304
+ payload: {
305
+ callback
306
+ }
307
+ } = _ref4,
308
+ config = _objectWithoutPropertiesLoose(_ref4.payload, _excluded4);
339
309
  yield put(actions.setIpRestrictionsState({
340
310
  saving: true,
341
311
  error: null
342
312
  }));
343
-
344
313
  try {
345
314
  yield call(api.auth.updateIPRestrictionConfig, config);
346
315
  const ipRestrictionState = yield selectIpRestrictionsState();
@@ -373,7 +342,6 @@ function* saveIpRestrictionsConfig(_ref4) {
373
342
  callback == null ? void 0 : callback(null, e);
374
343
  }
375
344
  }
376
-
377
345
  function* deleteIpRestriction({
378
346
  payload: {
379
347
  id,
@@ -385,10 +353,8 @@ function* deleteIpRestriction({
385
353
  error: null
386
354
  }));
387
355
  const ipRestrictionsState = yield selectIpRestrictionsState();
388
-
389
356
  try {
390
357
  var _ipRestrictionsState$3;
391
-
392
358
  yield call(api.auth.deleteIPRestriction, id);
393
359
  const ipRestrictionState = yield selectIpRestrictionsState();
394
360
  const pagination = getPagination(ipRestrictionState.pagination);
@@ -420,7 +386,6 @@ function* deleteIpRestriction({
420
386
  callback == null ? void 0 : callback(null, e);
421
387
  }
422
388
  }
423
-
424
389
  export function* restrictionsSagas() {
425
390
  yield takeLeading(actions.loadIpRestrictions, loadIpRestrictions);
426
391
  yield takeLeading(actions.loadEmailDomainRestrictions, loadEmailDomainRestrictions);
@@ -433,6 +398,7 @@ export function* restrictionsSagas() {
433
398
  yield takeEvery(actions.saveEmailDomainRestrictionsConfig, saveEmailDomainRestrictionConfig);
434
399
  yield takeEvery(actions.deleteEmailDomainRestriction, deleteEmailDomainRestriction);
435
400
  }
401
+
436
402
  /*********************************
437
403
  * Preview Sagas
438
404
  *********************************/
@@ -456,13 +422,11 @@ function* loadIpRestrictionsMock() {
456
422
  loading: false
457
423
  }));
458
424
  }
459
-
460
425
  function* checkIfUserIpValidMock() {
461
426
  yield put(actions.setIpRestrictionsState({
462
427
  loading: true,
463
428
  error: null
464
429
  }));
465
-
466
430
  try {
467
431
  const ipRestrictionState = yield selectIpRestrictionsState();
468
432
  const userIp = dummyIps[0].ip;
@@ -478,17 +442,14 @@ function* checkIfUserIpValidMock() {
478
442
  }));
479
443
  }
480
444
  }
481
-
482
445
  function* saveIpRestrictionMock(_ref5) {
483
446
  var _ipRestrictionsState$4, _ipRestrictionsState$5, _newRestriction$isAct;
484
-
485
447
  let {
486
- payload: {
487
- callback
488
- }
489
- } = _ref5,
490
- newRestriction = _objectWithoutPropertiesLoose(_ref5.payload, _excluded5);
491
-
448
+ payload: {
449
+ callback
450
+ }
451
+ } = _ref5,
452
+ newRestriction = _objectWithoutPropertiesLoose(_ref5.payload, _excluded5);
492
453
  yield put(actions.setIpRestrictionsState({
493
454
  saving: true,
494
455
  error: null
@@ -519,17 +480,14 @@ function* saveIpRestrictionMock(_ref5) {
519
480
  }));
520
481
  callback == null ? void 0 : callback(true);
521
482
  }
522
-
523
483
  function* saveIpRestrictionsConfigMock(_ref6) {
524
484
  var _ipRestrictionsState$6, _ipRestrictionsState$7, _ipRestrictionsState$8;
525
-
526
485
  let {
527
- payload: {
528
- callback
529
- }
530
- } = _ref6,
531
- config = _objectWithoutPropertiesLoose(_ref6.payload, _excluded6);
532
-
486
+ payload: {
487
+ callback
488
+ }
489
+ } = _ref6,
490
+ config = _objectWithoutPropertiesLoose(_ref6.payload, _excluded6);
533
491
  const ipRestrictionsState = yield selectIpRestrictionsState();
534
492
  yield put(actions.setIpRestrictionsState({
535
493
  saving: true,
@@ -554,7 +512,6 @@ function* saveIpRestrictionsConfigMock(_ref6) {
554
512
  }));
555
513
  callback == null ? void 0 : callback(true);
556
514
  }
557
-
558
515
  function* deleteIpRestrictionMock({
559
516
  payload: {
560
517
  id,
@@ -562,7 +519,6 @@ function* deleteIpRestrictionMock({
562
519
  }
563
520
  }) {
564
521
  var _ipRestrictionsState$9;
565
-
566
522
  yield put(actions.setIpRestrictionsState({
567
523
  saving: true,
568
524
  error: null
@@ -587,7 +543,6 @@ function* deleteIpRestrictionMock({
587
543
  }));
588
544
  callback == null ? void 0 : callback(true);
589
545
  }
590
-
591
546
  function* addCurrentUserIpAndActivateMock({
592
547
  payload: {
593
548
  callback
@@ -597,7 +552,6 @@ function* addCurrentUserIpAndActivateMock({
597
552
  saving: true,
598
553
  error: null
599
554
  }));
600
-
601
555
  try {
602
556
  const userIp = yield selectUserIp();
603
557
  yield put(actions.saveIpRestriction({
@@ -617,7 +571,6 @@ function* addCurrentUserIpAndActivateMock({
617
571
  callback == null ? void 0 : callback(false, e);
618
572
  }
619
573
  }
620
-
621
574
  function* loadEmailDomainRestrictionsMock() {
622
575
  yield put(actions.setEmailDomainRestrictionsState({
623
576
  loading: true,
@@ -639,17 +592,14 @@ function* loadEmailDomainRestrictionsMock() {
639
592
  }
640
593
  }));
641
594
  }
642
-
643
595
  function* saveEmailDomainRestrictionMock(_ref7) {
644
596
  var _emailDomainRestricti5, _emailDomainRestricti6;
645
-
646
597
  let {
647
- payload: {
648
- callback
649
- }
650
- } = _ref7,
651
- restriction = _objectWithoutPropertiesLoose(_ref7.payload, _excluded7);
652
-
598
+ payload: {
599
+ callback
600
+ }
601
+ } = _ref7,
602
+ restriction = _objectWithoutPropertiesLoose(_ref7.payload, _excluded7);
653
603
  const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
654
604
  yield put(actions.setEmailDomainRestrictionsState({
655
605
  saving: true,
@@ -671,17 +621,14 @@ function* saveEmailDomainRestrictionMock(_ref7) {
671
621
  saving: false
672
622
  }));
673
623
  }
674
-
675
624
  function* saveEmailDomainRestrictionConfigMock(_ref8) {
676
625
  var _emailDomainRestricti7;
677
-
678
626
  let {
679
- payload: {
680
- callback
681
- }
682
- } = _ref8,
683
- config = _objectWithoutPropertiesLoose(_ref8.payload, _excluded8);
684
-
627
+ payload: {
628
+ callback
629
+ }
630
+ } = _ref8,
631
+ config = _objectWithoutPropertiesLoose(_ref8.payload, _excluded8);
685
632
  const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
686
633
  yield put(actions.setEmailDomainRestrictionsState({
687
634
  saving: true,
@@ -701,14 +648,12 @@ function* saveEmailDomainRestrictionConfigMock(_ref8) {
701
648
  saving: false
702
649
  }));
703
650
  }
704
-
705
651
  function* deleteEmailDomainRestrictionMock({
706
652
  payload: {
707
653
  id
708
654
  }
709
655
  }) {
710
656
  var _emailDomainRestricti8, _emailDomainRestricti9;
711
-
712
657
  const emailDomainRestrictionsState = yield selectEmailDomainRestrictionsState();
713
658
  yield put(actions.setEmailDomainRestrictionsState({
714
659
  saving: true,
@@ -727,7 +672,6 @@ function* deleteEmailDomainRestrictionMock({
727
672
  saving: false
728
673
  }));
729
674
  }
730
-
731
675
  export function* restrictionsSagaMock() {
732
676
  yield takeLeading(actions.loadIpRestrictions, loadIpRestrictionsMock);
733
677
  yield takeLeading(actions.loadEmailDomainRestrictions, loadEmailDomainRestrictionsMock);
@@ -738,12 +682,15 @@ export function* restrictionsSagaMock() {
738
682
  yield takeEvery(actions.saveEmailDomainRestriction, saveEmailDomainRestrictionMock);
739
683
  yield takeEvery(actions.saveEmailDomainRestrictionsConfig, saveEmailDomainRestrictionConfigMock);
740
684
  yield takeEvery(actions.deleteEmailDomainRestriction, deleteEmailDomainRestrictionMock);
741
- } // export function* restrictionsSagas() {
685
+ }
686
+
687
+ // export function* restrictionsSagas() {
742
688
  // yield takeLeading(actions.loadEmailDomainRestrictions, loadEmailDomainRestrictions);
743
689
  // yield takeEvery(actions.saveEmailDomainRestriction, saveEmailDomainRestriction);
744
690
  // yield takeEvery(actions.saveEmailDomainRestrictionsConfig, saveEmailDomainRestrictionConfig);
745
691
  // yield takeEvery(actions.deleteEmailDomainRestriction, deleteEmailDomainRestriction);
746
692
  // }
693
+
747
694
  // /*********************************
748
695
  // * Preview Sagas
749
696
  // *********************************/
@@ -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;
@@ -33,13 +33,13 @@ const actions = {
33
33
  payload
34
34
  }))
35
35
  };
36
+
36
37
  /**
37
38
  * To be used for actions types after dispatch, and should contains
38
39
  * the reducers and actions as standalone function
39
40
  */
40
41
 
41
42
  // noinspection JSUnusedLocalSymbols
42
-
43
43
  /**
44
44
  * if you see error in matcher that's mean the DispatchAction does not
45
45
  * contains the same functions in reducers and actions
@@ -1,24 +1,21 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  const _excluded = ["callback"],
3
- _excluded2 = ["callback"],
4
- _excluded3 = ["callback"],
5
- _excluded4 = ["callback"],
6
- _excluded5 = ["callback"];
3
+ _excluded2 = ["callback"],
4
+ _excluded3 = ["callback"],
5
+ _excluded4 = ["callback"],
6
+ _excluded5 = ["callback"];
7
7
  import { all, call, put, takeEvery, takeLeading } from 'redux-saga/effects';
8
8
  import { api } from '@frontegg/rest-api';
9
9
  import { actions } from '../reducer';
10
10
  import { rolesAdminViewerDemo } from '../dummy';
11
-
12
11
  function* loadRolesAndPermissions({
13
12
  payload
14
13
  }) {
15
14
  var _payload$silentLoadin;
16
-
17
15
  yield put(actions.setRolesState({
18
16
  loading: !((_payload$silentLoadin = payload == null ? void 0 : payload.silentLoading) != null ? _payload$silentLoadin : false),
19
17
  error: null
20
18
  }));
21
-
22
19
  try {
23
20
  const result = yield all([call(api.roles.getRoles), call(api.roles.getPermissions), call(api.roles.getPermissionCategories)]);
24
21
  const [roles, permissions, permissionCategories] = result;
@@ -35,19 +32,16 @@ function* loadRolesAndPermissions({
35
32
  }));
36
33
  }
37
34
  }
38
-
39
35
  function* addRole(_ref) {
40
36
  let {
41
- payload: {
42
- callback
43
- }
44
- } = _ref,
45
- body = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
46
-
37
+ payload: {
38
+ callback
39
+ }
40
+ } = _ref,
41
+ body = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
47
42
  yield put(actions.setRolesState({
48
43
  saving: true
49
44
  }));
50
-
51
45
  try {
52
46
  const role = yield call(api.roles.addRole, body);
53
47
  const roles = yield call(api.roles.getRoles);
@@ -67,19 +61,16 @@ function* addRole(_ref) {
67
61
  callback == null ? void 0 : callback(null, e);
68
62
  }
69
63
  }
70
-
71
64
  function* deleteRole(_ref2) {
72
65
  let {
73
- payload: {
74
- callback
75
- }
76
- } = _ref2,
77
- body = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
78
-
66
+ payload: {
67
+ callback
68
+ }
69
+ } = _ref2,
70
+ body = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
79
71
  yield put(actions.setRolesState({
80
72
  saving: true
81
73
  }));
82
-
83
74
  try {
84
75
  yield call(api.roles.deleteRole, body);
85
76
  yield put(actions.loadRolesAndPermissions({
@@ -97,19 +88,16 @@ function* deleteRole(_ref2) {
97
88
  callback == null ? void 0 : callback(false, e);
98
89
  }
99
90
  }
100
-
101
91
  function* updateRole(_ref3) {
102
92
  let {
103
- payload: {
104
- callback
105
- }
106
- } = _ref3,
107
- body = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
108
-
93
+ payload: {
94
+ callback
95
+ }
96
+ } = _ref3,
97
+ body = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
109
98
  yield put(actions.setRolesState({
110
99
  saving: true
111
100
  }));
112
-
113
101
  try {
114
102
  const role = yield call(api.roles.updateRole, body);
115
103
  yield put(actions.loadRolesAndPermissions({
@@ -127,19 +115,16 @@ function* updateRole(_ref3) {
127
115
  callback == null ? void 0 : callback(null, e);
128
116
  }
129
117
  }
130
-
131
118
  function* attachPermissionsToRole(_ref4) {
132
119
  let {
133
- payload: {
134
- callback
135
- }
136
- } = _ref4,
137
- body = _objectWithoutPropertiesLoose(_ref4.payload, _excluded4);
138
-
120
+ payload: {
121
+ callback
122
+ }
123
+ } = _ref4,
124
+ body = _objectWithoutPropertiesLoose(_ref4.payload, _excluded4);
139
125
  yield put(actions.setRolesState({
140
126
  saving: true
141
127
  }));
142
-
143
128
  try {
144
129
  const role = yield call(api.roles.attachPermissionsToRole, body);
145
130
  yield put(actions.loadRolesAndPermissions({
@@ -157,19 +142,16 @@ function* attachPermissionsToRole(_ref4) {
157
142
  callback == null ? void 0 : callback(null, e);
158
143
  }
159
144
  }
160
-
161
145
  function* attachPermissionToRoles(_ref5) {
162
146
  let {
163
- payload: {
164
- callback
165
- }
166
- } = _ref5,
167
- body = _objectWithoutPropertiesLoose(_ref5.payload, _excluded5);
168
-
147
+ payload: {
148
+ callback
149
+ }
150
+ } = _ref5,
151
+ body = _objectWithoutPropertiesLoose(_ref5.payload, _excluded5);
169
152
  yield put(actions.setRolesState({
170
153
  saving: true
171
154
  }));
172
-
173
155
  try {
174
156
  const permission = yield call(api.roles.attachPermissionToRoles, body);
175
157
  yield put(actions.loadRolesAndPermissions({
@@ -187,7 +169,6 @@ function* attachPermissionToRoles(_ref5) {
187
169
  callback == null ? void 0 : callback(null, e);
188
170
  }
189
171
  }
190
-
191
172
  export function* rolesSagas() {
192
173
  yield takeLeading(actions.loadRolesAndPermissions, loadRolesAndPermissions);
193
174
  yield takeEvery(actions.addRole, addRole);
@@ -196,6 +177,7 @@ export function* rolesSagas() {
196
177
  yield takeEvery(actions.attachPermissionsToRole, attachPermissionsToRole);
197
178
  yield takeEvery(actions.attachPermissionToRoles, attachPermissionToRoles);
198
179
  }
180
+
199
181
  /*********************************
200
182
  * Preview Sagas
201
183
  *********************************/
@@ -204,12 +186,10 @@ function* loadRolesAndPermissionsMock({
204
186
  payload
205
187
  }) {
206
188
  var _payload$silentLoadin2;
207
-
208
189
  yield put(actions.setRolesState({
209
190
  loading: !((_payload$silentLoadin2 = payload == null ? void 0 : payload.silentLoading) != null ? _payload$silentLoadin2 : false),
210
191
  error: null
211
192
  }));
212
-
213
193
  try {
214
194
  yield put(actions.setRolesState({
215
195
  roles: rolesAdminViewerDemo,
@@ -222,7 +202,6 @@ function* loadRolesAndPermissionsMock({
222
202
  }));
223
203
  }
224
204
  }
225
-
226
205
  export function* rolesSagasMock() {
227
206
  yield takeLeading(actions.loadRolesAndPermissions, loadRolesAndPermissionsMock);
228
207
  }
@@ -38,6 +38,7 @@ declare const reducers: {
38
38
  user?: import("..").User | null | undefined;
39
39
  isSSOAuth: boolean;
40
40
  ssoACS?: string | undefined;
41
+ includeQueryParam?: boolean | undefined;
41
42
  loginState: import("..").LoginState;
42
43
  activateState: import("..").ActivateAccountState;
43
44
  acceptInvitationState: import("..").AcceptInvitationState;
@@ -76,6 +77,7 @@ declare const reducers: {
76
77
  user?: import("..").User | null | undefined;
77
78
  isSSOAuth: boolean;
78
79
  ssoACS?: string | undefined;
80
+ includeQueryParam?: boolean | undefined;
79
81
  loginState: import("..").LoginState;
80
82
  activateState: import("..").ActivateAccountState;
81
83
  acceptInvitationState: import("..").AcceptInvitationState;
@@ -80,13 +80,13 @@ const actions = {
80
80
  payload
81
81
  }))
82
82
  };
83
+
83
84
  /**
84
85
  * To be used for actions types after dispatch, and should contains
85
86
  * the reducers and actions as standalone function
86
87
  */
87
88
 
88
89
  // noinspection JSUnusedLocalSymbols
89
-
90
90
  /**
91
91
  * if you see error in matcher that's mean the DispatchAction does not
92
92
  * contains the same functions in reducers and actions