@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,7 +1,6 @@
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
  });
@@ -10,34 +9,24 @@ exports.loadPublicSecurityPolicy = loadPublicSecurityPolicy;
10
9
  exports.loadPublicSecurityPolicyMock = loadPublicSecurityPolicyMock;
11
10
  exports.securityPolicySagas = securityPolicySagas;
12
11
  exports.securityPolicySagasMock = securityPolicySagasMock;
13
-
14
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
-
16
13
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
17
-
18
14
  var _effects = require("redux-saga/effects");
19
-
20
15
  var _restApi = require("@frontegg/rest-api");
21
-
22
16
  var _reducer = require("../reducer");
23
-
24
17
  var _utils = require("../utils");
25
-
26
18
  var _dummy = require("../dummy");
27
-
28
19
  const _excluded = ["callback"],
29
- _excluded2 = ["callback"],
30
- _excluded3 = ["callback"],
31
- _excluded4 = ["callback"],
32
- _excluded5 = ["callback"],
33
- _excluded6 = ["callback"];
34
-
20
+ _excluded2 = ["callback"],
21
+ _excluded3 = ["callback"],
22
+ _excluded4 = ["callback"],
23
+ _excluded5 = ["callback"],
24
+ _excluded6 = ["callback"];
35
25
  function* loadSecurityPolicy() {
36
26
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyGlobalState({
37
27
  loading: true,
38
28
  error: null
39
29
  }));
40
-
41
30
  try {
42
31
  const policy = yield (0, _effects.call)(_restApi.api.auth.getGlobalSecurityPolicy);
43
32
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyGlobalState({
@@ -50,7 +39,6 @@ function* loadSecurityPolicy() {
50
39
  loading: false
51
40
  }));
52
41
  }
53
-
54
42
  yield (0, _effects.put)(_reducer.actions.loadSecurityPolicyMfa());
55
43
  yield (0, _effects.put)(_reducer.actions.loadSecurityPolicyVendorMfa());
56
44
  yield (0, _effects.put)(_reducer.actions.loadSecurityPolicyLockout());
@@ -59,13 +47,11 @@ function* loadSecurityPolicy() {
59
47
  yield (0, _effects.put)(_reducer.actions.loadSecurityPolicyCaptcha());
60
48
  yield (0, _effects.put)(_reducer.actions.loadPublicAuthStrategiesPolicy());
61
49
  }
62
-
63
50
  function* loadPublicSecurityPolicy() {
64
51
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPublicState({
65
52
  loading: true,
66
53
  error: null
67
54
  }));
68
-
69
55
  try {
70
56
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorConfig);
71
57
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPublicState({
@@ -79,13 +65,11 @@ function* loadPublicSecurityPolicy() {
79
65
  }));
80
66
  }
81
67
  }
82
-
83
68
  function* loadPublicAuthStrategiesPolicy() {
84
69
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyAuthStrategyPublicState({
85
70
  loading: true,
86
71
  error: null
87
72
  }));
88
-
89
73
  try {
90
74
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorPublicAuthStrategiesConfig);
91
75
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyAuthStrategyPublicState({
@@ -99,13 +83,11 @@ function* loadPublicAuthStrategiesPolicy() {
99
83
  }));
100
84
  }
101
85
  }
102
-
103
86
  function* loadSecurityPolicyMfa() {
104
87
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
105
88
  loading: true,
106
89
  error: null
107
90
  }));
108
-
109
91
  try {
110
92
  const policy = yield (0, _effects.call)(_restApi.api.auth.getMfaPolicy);
111
93
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
@@ -119,13 +101,11 @@ function* loadSecurityPolicyMfa() {
119
101
  }));
120
102
  }
121
103
  }
122
-
123
104
  function* loadSecurityPolicyVendorMfa() {
124
105
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
125
106
  loading: true,
126
107
  error: null
127
108
  }));
128
-
129
109
  try {
130
110
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorMfaPolicy);
131
111
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorMfaState({
@@ -139,19 +119,17 @@ function* loadSecurityPolicyVendorMfa() {
139
119
  }));
140
120
  }
141
121
  }
142
-
143
122
  function* saveSecurityPolicyMfa(_ref) {
144
123
  let {
145
- payload: {
146
- callback
147
- }
148
- } = _ref,
149
- newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
124
+ payload: {
125
+ callback
126
+ }
127
+ } = _ref,
128
+ newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref.payload, _excluded);
150
129
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
151
130
  saving: true,
152
131
  error: null
153
132
  }));
154
-
155
133
  try {
156
134
  const policy = yield (0, _effects.call)(_restApi.api.auth.saveMfaPolicy, newSecurityPolicy);
157
135
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
@@ -167,13 +145,11 @@ function* saveSecurityPolicyMfa(_ref) {
167
145
  callback == null ? void 0 : callback(null, e);
168
146
  }
169
147
  }
170
-
171
148
  function* loadSecurityPolicyLockout() {
172
149
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
173
150
  loading: true,
174
151
  error: null
175
152
  }));
176
-
177
153
  try {
178
154
  const policy = yield (0, _effects.call)(_restApi.api.auth.getLockoutPolicy);
179
155
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
@@ -187,19 +163,17 @@ function* loadSecurityPolicyLockout() {
187
163
  }));
188
164
  }
189
165
  }
190
-
191
166
  function* saveSecurityPolicyLockout(_ref2) {
192
167
  let {
193
- payload: {
194
- callback
195
- }
196
- } = _ref2,
197
- newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
168
+ payload: {
169
+ callback
170
+ }
171
+ } = _ref2,
172
+ newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
198
173
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
199
174
  saving: true,
200
175
  error: null
201
176
  }));
202
-
203
177
  try {
204
178
  const policy = yield (0, _effects.call)(_restApi.api.auth.saveLockoutPolicy, newSecurityPolicy);
205
179
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
@@ -215,13 +189,11 @@ function* saveSecurityPolicyLockout(_ref2) {
215
189
  callback == null ? void 0 : callback(null, e);
216
190
  }
217
191
  }
218
-
219
192
  function* loadSecurityPolicyVendorLockout() {
220
193
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorLockoutState({
221
194
  loading: true,
222
195
  error: null
223
196
  }));
224
-
225
197
  try {
226
198
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorLockoutPolicy);
227
199
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorLockoutState({
@@ -235,13 +207,11 @@ function* loadSecurityPolicyVendorLockout() {
235
207
  }));
236
208
  }
237
209
  }
238
-
239
210
  function* loadSecurityPolicyCaptcha() {
240
211
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
241
212
  loading: true,
242
213
  error: null
243
214
  }));
244
-
245
215
  try {
246
216
  const policy = yield (0, _effects.call)(_restApi.api.auth.getCaptchaPolicy);
247
217
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyCaptchaState({
@@ -255,13 +225,11 @@ function* loadSecurityPolicyCaptcha() {
255
225
  }));
256
226
  }
257
227
  }
258
-
259
228
  function* loadSecurityPolicyPasswordHistory() {
260
229
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordHistoryState({
261
230
  loading: true,
262
231
  error: null
263
232
  }));
264
-
265
233
  try {
266
234
  const policy = yield (0, _effects.call)(_restApi.api.auth.getPasswordHistoryPolicy);
267
235
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordHistoryState({
@@ -275,13 +243,11 @@ function* loadSecurityPolicyPasswordHistory() {
275
243
  }));
276
244
  }
277
245
  }
278
-
279
246
  function* loadSecurityPolicyVendorPasswordHistory() {
280
247
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorPasswordHistoryState({
281
248
  loading: true,
282
249
  error: null
283
250
  }));
284
-
285
251
  try {
286
252
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorPasswordHistoryPolicy);
287
253
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorPasswordHistoryState({
@@ -295,19 +261,17 @@ function* loadSecurityPolicyVendorPasswordHistory() {
295
261
  }));
296
262
  }
297
263
  }
298
-
299
264
  function* saveSecurityPolicyPasswordHistory(_ref3) {
300
265
  let {
301
- payload: {
302
- callback
303
- }
304
- } = _ref3,
305
- newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref3.payload, _excluded3);
266
+ payload: {
267
+ callback
268
+ }
269
+ } = _ref3,
270
+ newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref3.payload, _excluded3);
306
271
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordHistoryState({
307
272
  saving: true,
308
273
  error: null
309
274
  }));
310
-
311
275
  try {
312
276
  const policy = yield (0, _effects.call)(_restApi.api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
313
277
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordHistoryState({
@@ -323,13 +287,11 @@ function* saveSecurityPolicyPasswordHistory(_ref3) {
323
287
  callback == null ? void 0 : callback(null, e);
324
288
  }
325
289
  }
326
-
327
290
  function* loadVendorPasswordConfig() {
328
291
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordState({
329
292
  loading: true,
330
293
  error: null
331
294
  }));
332
-
333
295
  try {
334
296
  const policy = yield (0, _effects.call)(_restApi.api.auth.getPasswordConfigPolicy);
335
297
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordState({
@@ -343,7 +305,6 @@ function* loadVendorPasswordConfig() {
343
305
  }));
344
306
  }
345
307
  }
346
-
347
308
  function* securityPolicySagas() {
348
309
  yield (0, _effects.takeLeading)(_reducer.actions.loadSecurityPolicy, loadSecurityPolicy);
349
310
  yield (0, _effects.takeEvery)(_reducer.actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
@@ -360,17 +321,16 @@ function* securityPolicySagas() {
360
321
  yield (0, _effects.takeEvery)(_reducer.actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
361
322
  yield (0, _effects.takeEvery)(_reducer.actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
362
323
  }
324
+
363
325
  /*********************************
364
326
  * Preview Sagas
365
327
  *********************************/
366
328
 
367
-
368
329
  function* loadPublicSecurityPolicyMock() {
369
330
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPublicState({
370
331
  loading: true,
371
332
  error: null
372
333
  }));
373
-
374
334
  try {
375
335
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPublicState({
376
336
  policy: _dummy.publicSecurityPolicy,
@@ -383,7 +343,6 @@ function* loadPublicSecurityPolicyMock() {
383
343
  }));
384
344
  }
385
345
  }
386
-
387
346
  function* loadSecurityPolicyMock() {
388
347
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyGlobalState({
389
348
  loading: true,
@@ -402,7 +361,6 @@ function* loadSecurityPolicyMock() {
402
361
  yield (0, _effects.put)(_reducer.actions.loadSecurityPolicyVendorPasswordHistory());
403
362
  yield (0, _effects.put)(_reducer.actions.loadSecurityPolicyCaptcha());
404
363
  }
405
-
406
364
  function* loadSecurityPolicyMfaMock() {
407
365
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
408
366
  loading: true,
@@ -414,7 +372,6 @@ function* loadSecurityPolicyMfaMock() {
414
372
  loading: false
415
373
  }));
416
374
  }
417
-
418
375
  function* loadSecurityPolicyVendorMfaMock() {
419
376
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorMfaState({
420
377
  loading: true,
@@ -426,16 +383,14 @@ function* loadSecurityPolicyVendorMfaMock() {
426
383
  loading: false
427
384
  }));
428
385
  }
429
-
430
386
  function* saveSecurityPolicyMfaMock(_ref4) {
431
387
  var _newSecurityPolicy$id;
432
-
433
388
  let {
434
- payload: {
435
- callback
436
- }
437
- } = _ref4,
438
- newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref4.payload, _excluded4);
389
+ payload: {
390
+ callback
391
+ }
392
+ } = _ref4,
393
+ newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref4.payload, _excluded4);
439
394
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyMfaState({
440
395
  saving: true,
441
396
  error: null
@@ -451,7 +406,6 @@ function* saveSecurityPolicyMfaMock(_ref4) {
451
406
  }));
452
407
  callback == null ? void 0 : callback(policy);
453
408
  }
454
-
455
409
  function* loadSecurityPolicyLockoutMock() {
456
410
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
457
411
  loading: true,
@@ -463,7 +417,6 @@ function* loadSecurityPolicyLockoutMock() {
463
417
  loading: false
464
418
  }));
465
419
  }
466
-
467
420
  function* loadSecurityPolicyVendorLockoutMock() {
468
421
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorLockoutState({
469
422
  loading: true,
@@ -475,14 +428,13 @@ function* loadSecurityPolicyVendorLockoutMock() {
475
428
  loading: false
476
429
  }));
477
430
  }
478
-
479
431
  function* saveSecurityPolicyLockoutMock(_ref5) {
480
432
  let {
481
- payload: {
482
- callback
483
- }
484
- } = _ref5,
485
- newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref5.payload, _excluded5);
433
+ payload: {
434
+ callback
435
+ }
436
+ } = _ref5,
437
+ newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref5.payload, _excluded5);
486
438
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
487
439
  saving: true,
488
440
  error: null
@@ -497,7 +449,6 @@ function* saveSecurityPolicyLockoutMock(_ref5) {
497
449
  saving: false
498
450
  }));
499
451
  }
500
-
501
452
  function* loadSecurityPolicyCaptchaMock() {
502
453
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyLockoutState({
503
454
  loading: true,
@@ -509,7 +460,6 @@ function* loadSecurityPolicyCaptchaMock() {
509
460
  loading: false
510
461
  }));
511
462
  }
512
-
513
463
  function* loadSecurityPolicyPasswordHistoryMock() {
514
464
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordHistoryState({
515
465
  loading: true,
@@ -521,7 +471,6 @@ function* loadSecurityPolicyPasswordHistoryMock() {
521
471
  loading: false
522
472
  }));
523
473
  }
524
-
525
474
  function* loadSecurityPolicyVendorPasswordHistoryMock() {
526
475
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyVendorPasswordHistoryState({
527
476
  loading: true,
@@ -533,14 +482,13 @@ function* loadSecurityPolicyVendorPasswordHistoryMock() {
533
482
  loading: false
534
483
  }));
535
484
  }
536
-
537
485
  function* saveSecurityPolicyPasswordHistoryMock(_ref6) {
538
486
  let {
539
- payload: {
540
- callback
541
- }
542
- } = _ref6,
543
- newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref6.payload, _excluded6);
487
+ payload: {
488
+ callback
489
+ }
490
+ } = _ref6,
491
+ newSecurityPolicy = (0, _objectWithoutPropertiesLoose2.default)(_ref6.payload, _excluded6);
544
492
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPasswordHistoryState({
545
493
  saving: true,
546
494
  error: null
@@ -555,7 +503,6 @@ function* saveSecurityPolicyPasswordHistoryMock(_ref6) {
555
503
  saving: false
556
504
  }));
557
505
  }
558
-
559
506
  function* securityPolicySagasMock() {
560
507
  yield (0, _effects.takeLeading)(_reducer.actions.loadSecurityPolicy, loadSecurityPolicyMock);
561
508
  yield (0, _effects.takeEvery)(_reducer.actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.sessionsPolicyState = exports.sessionsPolicyReducers = exports.sessionsPolicyActions = 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 sessionsPolicyState = {
15
11
  loading: false,
16
12
  configurations: {}
@@ -29,14 +25,13 @@ const actions = {
29
25
  payload
30
26
  }))
31
27
  };
28
+
32
29
  /**
33
30
  * To be used for actions types after dispatch, and should contains
34
31
  * the reducers and actions as standalone function
35
32
  */
36
-
37
33
  exports.sessionsPolicyActions = actions;
38
34
  // noinspection JSUnusedLocalSymbols
39
-
40
35
  /**
41
36
  * if you see error in matcher that's mean the DispatchAction does not
42
37
  * contains the same functions in reducers and actions
@@ -1,34 +1,24 @@
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.sessionsPolicySaga = sessionsPolicySaga;
9
8
  exports.sessionsPolicySagaMock = sessionsPolicySagaMock;
10
-
11
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
-
13
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
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
  const _excluded = ["callback"],
24
- _excluded2 = ["callback"];
25
-
16
+ _excluded2 = ["callback"];
26
17
  function* loadSessionPolicyState() {
27
18
  yield (0, _effects.put)(_reducer.actions.setSessionsPolicyState({
28
19
  loading: true,
29
20
  error: null
30
21
  }));
31
-
32
22
  try {
33
23
  const sessionsPolicy = yield (0, _effects.call)(_restApi.api.auth.getSessionConfigurations);
34
24
  yield (0, _effects.put)(_reducer.actions.setSessionsPolicyState({
@@ -42,7 +32,6 @@ function* loadSessionPolicyState() {
42
32
  }));
43
33
  }
44
34
  }
45
-
46
35
  function* createOrUpdateSessionsPolicy({
47
36
  payload
48
37
  }) {
@@ -50,12 +39,11 @@ function* createOrUpdateSessionsPolicy({
50
39
  loading: true,
51
40
  error: null
52
41
  }));
53
-
54
42
  try {
55
43
  const {
56
- callback
57
- } = payload,
58
- rest = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded);
44
+ callback
45
+ } = payload,
46
+ rest = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded);
59
47
  yield (0, _effects.call)(_restApi.api.auth.createOrUpdateSessionConfigrations, rest);
60
48
  yield (0, _effects.put)(_reducer.actions.loadSessionsPolicy());
61
49
  callback == null ? void 0 : callback(true);
@@ -66,12 +54,10 @@ function* createOrUpdateSessionsPolicy({
66
54
  }));
67
55
  }
68
56
  }
69
-
70
57
  function* sessionsPolicySaga() {
71
58
  yield (0, _effects.takeLeading)(_reducer.actions.loadSessionsPolicy, loadSessionPolicyState);
72
59
  yield (0, _effects.takeLatest)(_reducer.actions.createOrUpdateSessionsPolicy, createOrUpdateSessionsPolicy);
73
60
  }
74
-
75
61
  function* loadSessionPolicyStateMock() {
76
62
  yield (0, _effects.put)(_reducer.actions.setSessionsPolicyState({
77
63
  loading: true,
@@ -79,14 +65,12 @@ function* loadSessionPolicyStateMock() {
79
65
  }));
80
66
  const sessionPolicyState = yield (0, _effects.select)(state => {
81
67
  var _state$auth$sessionsP, _state$auth;
82
-
83
68
  return (_state$auth$sessionsP = state == null ? void 0 : (_state$auth = state.auth) == null ? void 0 : _state$auth.sessionsPolicyState) != null ? _state$auth$sessionsP : _dummy.sessionsConfigDummies;
84
69
  });
85
70
  yield (0, _effects.put)(_reducer.actions.setSessionsPolicyState((0, _extends2.default)({}, sessionPolicyState, {
86
71
  loading: false
87
72
  })));
88
73
  }
89
-
90
74
  function* createOrUpdateSessionsPolicyMock({
91
75
  payload
92
76
  }) {
@@ -95,16 +79,15 @@ function* createOrUpdateSessionsPolicyMock({
95
79
  error: null
96
80
  }));
97
81
  const {
98
- callback
99
- } = payload,
100
- rest = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded2);
82
+ callback
83
+ } = payload,
84
+ rest = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded2);
101
85
  callback == null ? void 0 : callback(true);
102
86
  yield (0, _effects.put)(_reducer.actions.setSessionsPolicyState({
103
87
  configurations: rest,
104
88
  loading: false
105
89
  }));
106
90
  }
107
-
108
91
  function* sessionsPolicySagaMock() {
109
92
  yield (0, _effects.takeLeading)(_reducer.actions.loadSessionsPolicy, loadSessionPolicyStateMock);
110
93
  yield (0, _effects.takeLatest)(_reducer.actions.createOrUpdateSessionsPolicy, createOrUpdateSessionsPolicyMock);
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.sessionsState = exports.sessionsReducers = exports.sessionsActions = 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 sessionsState = {
15
11
  loading: false,
16
12
  sessions: []
@@ -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.sessionsActions = 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