@frontegg/react-hooks 5.59.1 → 6.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FronteggProvider.d.ts +11 -10
- package/FronteggProvider.js +137 -0
- package/FronteggStoreContext.d.ts +8 -8
- package/FronteggStoreContext.js +13 -0
- package/audits/auditLogs.d.ts +5 -5
- package/audits/auditLogs.js +4 -0
- package/audits/auditsMetadata.d.ts +5 -5
- package/audits/auditsMetadata.js +4 -0
- package/audits/hooks.d.ts +12 -12
- package/audits/hooks.js +35 -0
- package/audits/index.d.ts +3 -3
- package/audits/index.js +3 -5
- package/auth/acceptInvitation.d.ts +5 -5
- package/auth/acceptInvitation.js +4 -0
- package/auth/activateAccount.d.ts +5 -5
- package/auth/activateAccount.js +4 -0
- package/auth/apiTokens.d.ts +5 -5
- package/auth/apiTokens.js +4 -0
- package/auth/forgotPassword.d.ts +5 -5
- package/auth/forgotPassword.js +4 -0
- package/auth/hooks.d.ts +62 -62
- package/auth/hooks.js +79 -0
- package/auth/index.d.ts +16 -16
- package/auth/index.js +16 -7
- package/auth/login.d.ts +5 -5
- package/auth/login.js +4 -0
- package/auth/mfa.d.ts +4 -4
- package/auth/mfa.js +4 -0
- package/auth/profile.d.ts +6 -6
- package/auth/profile.js +16 -0
- package/auth/resetPhoneNumber.d.ts +5 -5
- package/auth/resetPhoneNumber.js +4 -0
- package/auth/roles.d.ts +5 -5
- package/auth/roles.js +4 -0
- package/auth/securityPolicy.d.ts +11 -11
- package/auth/securityPolicy.js +25 -0
- package/auth/signup.d.ts +5 -5
- package/auth/signup.js +4 -0
- package/auth/socialLogin.d.ts +5 -5
- package/auth/socialLogin.js +4 -0
- package/auth/sso.d.ts +4 -4
- package/auth/sso.js +4 -0
- package/auth/team.d.ts +5 -5
- package/auth/team.js +4 -0
- package/auth/tenants.d.ts +5 -5
- package/auth/tenants.js +4 -0
- package/common/index.d.ts +17 -17
- package/common/index.js +30 -0
- package/common/package.json +6 -0
- package/connectivity/hooks.d.ts +5 -5
- package/connectivity/hooks.js +15 -0
- package/connectivity/index.d.ts +1 -1
- package/connectivity/index.js +1 -5
- package/index.d.ts +8 -8
- package/index.js +13 -93
- package/node/FronteggProvider.js +160 -0
- package/node/FronteggStoreContext.js +49 -0
- package/node/audits/auditLogs.js +18 -0
- package/node/audits/auditsMetadata.js +18 -0
- package/node/audits/hooks.js +62 -0
- package/node/audits/index.js +46 -13
- package/node/auth/acceptInvitation.js +18 -0
- package/node/auth/activateAccount.js +18 -0
- package/node/auth/apiTokens.js +18 -0
- package/node/auth/forgotPassword.js +18 -0
- package/node/auth/hooks.js +127 -0
- package/node/auth/index.js +275 -54
- package/node/auth/login.js +18 -0
- package/node/auth/mfa.js +18 -0
- package/node/auth/profile.js +34 -0
- package/node/auth/resetPhoneNumber.js +18 -0
- package/node/auth/roles.js +18 -0
- package/node/auth/securityPolicy.js +43 -0
- package/node/auth/signup.js +18 -0
- package/node/auth/socialLogin.js +18 -0
- package/node/auth/sso.js +18 -0
- package/node/auth/team.js +18 -0
- package/node/auth/tenants.js +18 -0
- package/node/common/index.js +44 -0
- package/node/connectivity/hooks.js +31 -0
- package/node/connectivity/index.js +17 -12
- package/node/index.js +111 -187
- package/node/subscriptions/hooks.js +131 -0
- package/node/subscriptions/index.js +15 -27
- package/node/vendor/hooks.js +31 -0
- package/node/vendor/index.js +17 -12
- package/package.json +12 -7
- package/subscriptions/hooks.d.ts +19 -19
- package/subscriptions/hooks.js +69 -0
- package/subscriptions/index.d.ts +1 -1
- package/subscriptions/index.js +1 -5
- package/vendor/hooks.d.ts +5 -5
- package/vendor/hooks.js +15 -0
- package/vendor/index.d.ts +1 -1
- package/vendor/index.js +1 -5
- package/FronteggStoreContext-d6c3b684.js +0 -9
- package/auditsMetadata-9ab88593.js +0 -35
- package/hooks-6400e233.js +0 -14
- package/hooks-7fc5d634.js +0 -64
- package/hooks-eaf879c9.js +0 -14
- package/node/FronteggStoreContext-6cfac56c.js +0 -18
- package/node/auditsMetadata-d15799a1.js +0 -42
- package/node/hooks-429ffd3a.js +0 -83
- package/node/hooks-5d5a445e.js +0 -17
- package/node/hooks-cf739b27.js +0 -17
- package/node/roles-f45dbc50.js +0 -215
- package/roles-f87bc6a0.js +0 -172
package/node/auth/index.js
CHANGED
|
@@ -1,54 +1,275 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
exports
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
exports
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
exports
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useAuth: true,
|
|
8
|
+
useAuthActions: true,
|
|
9
|
+
useOnRedirectTo: true,
|
|
10
|
+
useAuthRoutes: true,
|
|
11
|
+
useIsAuthenticated: true,
|
|
12
|
+
useAuthUser: true,
|
|
13
|
+
useAuthUserOrNull: true,
|
|
14
|
+
useLoginWithRedirect: true
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "useAuth", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _hooks.useAuth;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "useAuthActions", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return _hooks.useAuthActions;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "useAuthRoutes", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return _hooks.useAuthRoutes;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "useAuthUser", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return _hooks.useAuthUser;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "useAuthUserOrNull", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _hooks.useAuthUserOrNull;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "useIsAuthenticated", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return _hooks.useIsAuthenticated;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "useLoginWithRedirect", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return _hooks.useLoginWithRedirect;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "useOnRedirectTo", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () {
|
|
61
|
+
return _hooks.useOnRedirectTo;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
var _hooks = require("./hooks");
|
|
66
|
+
|
|
67
|
+
var _acceptInvitation = require("./acceptInvitation");
|
|
68
|
+
|
|
69
|
+
Object.keys(_acceptInvitation).forEach(function (key) {
|
|
70
|
+
if (key === "default" || key === "__esModule") return;
|
|
71
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
72
|
+
if (key in exports && exports[key] === _acceptInvitation[key]) return;
|
|
73
|
+
Object.defineProperty(exports, key, {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () {
|
|
76
|
+
return _acceptInvitation[key];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
var _activateAccount = require("./activateAccount");
|
|
82
|
+
|
|
83
|
+
Object.keys(_activateAccount).forEach(function (key) {
|
|
84
|
+
if (key === "default" || key === "__esModule") return;
|
|
85
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
86
|
+
if (key in exports && exports[key] === _activateAccount[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _activateAccount[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
var _apiTokens = require("./apiTokens");
|
|
96
|
+
|
|
97
|
+
Object.keys(_apiTokens).forEach(function (key) {
|
|
98
|
+
if (key === "default" || key === "__esModule") return;
|
|
99
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
100
|
+
if (key in exports && exports[key] === _apiTokens[key]) return;
|
|
101
|
+
Object.defineProperty(exports, key, {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () {
|
|
104
|
+
return _apiTokens[key];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
var _forgotPassword = require("./forgotPassword");
|
|
110
|
+
|
|
111
|
+
Object.keys(_forgotPassword).forEach(function (key) {
|
|
112
|
+
if (key === "default" || key === "__esModule") return;
|
|
113
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
114
|
+
if (key in exports && exports[key] === _forgotPassword[key]) return;
|
|
115
|
+
Object.defineProperty(exports, key, {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function () {
|
|
118
|
+
return _forgotPassword[key];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
var _resetPhoneNumber = require("./resetPhoneNumber");
|
|
124
|
+
|
|
125
|
+
Object.keys(_resetPhoneNumber).forEach(function (key) {
|
|
126
|
+
if (key === "default" || key === "__esModule") return;
|
|
127
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
128
|
+
if (key in exports && exports[key] === _resetPhoneNumber[key]) return;
|
|
129
|
+
Object.defineProperty(exports, key, {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function () {
|
|
132
|
+
return _resetPhoneNumber[key];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
var _login = require("./login");
|
|
138
|
+
|
|
139
|
+
Object.keys(_login).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
142
|
+
if (key in exports && exports[key] === _login[key]) return;
|
|
143
|
+
Object.defineProperty(exports, key, {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
get: function () {
|
|
146
|
+
return _login[key];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
var _mfa = require("./mfa");
|
|
152
|
+
|
|
153
|
+
Object.keys(_mfa).forEach(function (key) {
|
|
154
|
+
if (key === "default" || key === "__esModule") return;
|
|
155
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
156
|
+
if (key in exports && exports[key] === _mfa[key]) return;
|
|
157
|
+
Object.defineProperty(exports, key, {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () {
|
|
160
|
+
return _mfa[key];
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
var _profile = require("./profile");
|
|
166
|
+
|
|
167
|
+
Object.keys(_profile).forEach(function (key) {
|
|
168
|
+
if (key === "default" || key === "__esModule") return;
|
|
169
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
170
|
+
if (key in exports && exports[key] === _profile[key]) return;
|
|
171
|
+
Object.defineProperty(exports, key, {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function () {
|
|
174
|
+
return _profile[key];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
var _signup = require("./signup");
|
|
180
|
+
|
|
181
|
+
Object.keys(_signup).forEach(function (key) {
|
|
182
|
+
if (key === "default" || key === "__esModule") return;
|
|
183
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
184
|
+
if (key in exports && exports[key] === _signup[key]) return;
|
|
185
|
+
Object.defineProperty(exports, key, {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
get: function () {
|
|
188
|
+
return _signup[key];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
var _socialLogin = require("./socialLogin");
|
|
194
|
+
|
|
195
|
+
Object.keys(_socialLogin).forEach(function (key) {
|
|
196
|
+
if (key === "default" || key === "__esModule") return;
|
|
197
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
198
|
+
if (key in exports && exports[key] === _socialLogin[key]) return;
|
|
199
|
+
Object.defineProperty(exports, key, {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
get: function () {
|
|
202
|
+
return _socialLogin[key];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
var _team = require("./team");
|
|
208
|
+
|
|
209
|
+
Object.keys(_team).forEach(function (key) {
|
|
210
|
+
if (key === "default" || key === "__esModule") return;
|
|
211
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
212
|
+
if (key in exports && exports[key] === _team[key]) return;
|
|
213
|
+
Object.defineProperty(exports, key, {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function () {
|
|
216
|
+
return _team[key];
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
var _sso = require("./sso");
|
|
222
|
+
|
|
223
|
+
Object.keys(_sso).forEach(function (key) {
|
|
224
|
+
if (key === "default" || key === "__esModule") return;
|
|
225
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
226
|
+
if (key in exports && exports[key] === _sso[key]) return;
|
|
227
|
+
Object.defineProperty(exports, key, {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function () {
|
|
230
|
+
return _sso[key];
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
var _securityPolicy = require("./securityPolicy");
|
|
236
|
+
|
|
237
|
+
Object.keys(_securityPolicy).forEach(function (key) {
|
|
238
|
+
if (key === "default" || key === "__esModule") return;
|
|
239
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
240
|
+
if (key in exports && exports[key] === _securityPolicy[key]) return;
|
|
241
|
+
Object.defineProperty(exports, key, {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _securityPolicy[key];
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
var _tenants = require("./tenants");
|
|
250
|
+
|
|
251
|
+
Object.keys(_tenants).forEach(function (key) {
|
|
252
|
+
if (key === "default" || key === "__esModule") return;
|
|
253
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
254
|
+
if (key in exports && exports[key] === _tenants[key]) return;
|
|
255
|
+
Object.defineProperty(exports, key, {
|
|
256
|
+
enumerable: true,
|
|
257
|
+
get: function () {
|
|
258
|
+
return _tenants[key];
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
var _roles = require("./roles");
|
|
264
|
+
|
|
265
|
+
Object.keys(_roles).forEach(function (key) {
|
|
266
|
+
if (key === "default" || key === "__esModule") return;
|
|
267
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
268
|
+
if (key in exports && exports[key] === _roles[key]) return;
|
|
269
|
+
Object.defineProperty(exports, key, {
|
|
270
|
+
enumerable: true,
|
|
271
|
+
get: function () {
|
|
272
|
+
return _roles[key];
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useLoginState = exports.useLoginActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useLoginState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'loginState');
|
|
13
|
+
|
|
14
|
+
exports.useLoginState = useLoginState;
|
|
15
|
+
|
|
16
|
+
const useLoginActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.loginActions, _reduxStore.loginReducers);
|
|
17
|
+
|
|
18
|
+
exports.useLoginActions = useLoginActions;
|
package/node/auth/mfa.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMfaState = exports.useMfaActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useMfaState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'mfaState');
|
|
13
|
+
|
|
14
|
+
exports.useMfaState = useMfaState;
|
|
15
|
+
|
|
16
|
+
const useMfaActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.mfaActions, _reduxStore.mfaReducers);
|
|
17
|
+
|
|
18
|
+
exports.useMfaActions = useMfaActions;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useProfileState = exports.useProfileActions = exports.reloadProfileIfNeeded = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
11
|
+
|
|
12
|
+
var _hooks = require("./hooks");
|
|
13
|
+
|
|
14
|
+
const reloadProfileIfNeeded = () => {
|
|
15
|
+
const {
|
|
16
|
+
loading
|
|
17
|
+
} = useProfileState();
|
|
18
|
+
const {
|
|
19
|
+
loadProfile
|
|
20
|
+
} = useProfileActions();
|
|
21
|
+
(0, _react.useEffect)(() => {
|
|
22
|
+
!loading && loadProfile();
|
|
23
|
+
}, []);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.reloadProfileIfNeeded = reloadProfileIfNeeded;
|
|
27
|
+
|
|
28
|
+
const useProfileState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'profileState');
|
|
29
|
+
|
|
30
|
+
exports.useProfileState = useProfileState;
|
|
31
|
+
|
|
32
|
+
const useProfileActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.profileActions, _reduxStore.profileReducers);
|
|
33
|
+
|
|
34
|
+
exports.useProfileActions = useProfileActions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useResetPhoneNumberState = exports.useResetPhoneNumberActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useResetPhoneNumberState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'resetPhoneNumberState');
|
|
13
|
+
|
|
14
|
+
exports.useResetPhoneNumberState = useResetPhoneNumberState;
|
|
15
|
+
|
|
16
|
+
const useResetPhoneNumberActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.resetPhoneNumberActions, _reduxStore.resetPhoneNumberReducers);
|
|
17
|
+
|
|
18
|
+
exports.useResetPhoneNumberActions = useResetPhoneNumberActions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useRolesState = exports.useRolesActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useRolesState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'rolesState');
|
|
13
|
+
|
|
14
|
+
exports.useRolesState = useRolesState;
|
|
15
|
+
|
|
16
|
+
const useRolesActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.rolesActions, _reduxStore.rolesReducers);
|
|
17
|
+
|
|
18
|
+
exports.useRolesActions = useRolesActions;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSecurityPolicyState = exports.useSecurityPolicyActions = exports.usePublicPolicySettings = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
|
|
14
|
+
const useSecurityPolicyState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'securityPolicyState');
|
|
15
|
+
|
|
16
|
+
exports.useSecurityPolicyState = useSecurityPolicyState;
|
|
17
|
+
|
|
18
|
+
const useSecurityPolicyActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.securityPolicyActions, _reduxStore.securityPolicyReducers);
|
|
19
|
+
|
|
20
|
+
exports.useSecurityPolicyActions = useSecurityPolicyActions;
|
|
21
|
+
|
|
22
|
+
const usePublicPolicySettings = (loadOnMount = false) => {
|
|
23
|
+
const {
|
|
24
|
+
loading,
|
|
25
|
+
policy,
|
|
26
|
+
saving,
|
|
27
|
+
error
|
|
28
|
+
} = useSecurityPolicyState(state => state.publicPolicy);
|
|
29
|
+
const {
|
|
30
|
+
loadPublicSecurityPolicy
|
|
31
|
+
} = useSecurityPolicyActions();
|
|
32
|
+
(0, _react.useEffect)(() => {
|
|
33
|
+
(loadOnMount || !policy) && loadPublicSecurityPolicy();
|
|
34
|
+
}, [loadOnMount, loadPublicSecurityPolicy]);
|
|
35
|
+
return {
|
|
36
|
+
loading,
|
|
37
|
+
saving,
|
|
38
|
+
error,
|
|
39
|
+
policy
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.usePublicPolicySettings = usePublicPolicySettings;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSignUpState = exports.useSignUpActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useSignUpState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'signUpState');
|
|
13
|
+
|
|
14
|
+
exports.useSignUpState = useSignUpState;
|
|
15
|
+
|
|
16
|
+
const useSignUpActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.signUpActions, _reduxStore.signUpReducers);
|
|
17
|
+
|
|
18
|
+
exports.useSignUpActions = useSignUpActions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSocialLoginState = exports.useSocialLoginActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useSocialLoginState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'socialLoginState');
|
|
13
|
+
|
|
14
|
+
exports.useSocialLoginState = useSocialLoginState;
|
|
15
|
+
|
|
16
|
+
const useSocialLoginActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.socialLoginsActions, _reduxStore.socialLoginsReducer);
|
|
17
|
+
|
|
18
|
+
exports.useSocialLoginActions = useSocialLoginActions;
|
package/node/auth/sso.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSSOState = exports.useSSOActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useSSOState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'ssoState');
|
|
13
|
+
|
|
14
|
+
exports.useSSOState = useSSOState;
|
|
15
|
+
|
|
16
|
+
const useSSOActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.ssoActions, _reduxStore.ssoReducers);
|
|
17
|
+
|
|
18
|
+
exports.useSSOActions = useSSOActions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAuthTeamState = exports.useAuthTeamActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useAuthTeamState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'teamState');
|
|
13
|
+
|
|
14
|
+
exports.useAuthTeamState = useAuthTeamState;
|
|
15
|
+
|
|
16
|
+
const useAuthTeamActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.teamActions, _reduxStore.teamReducers);
|
|
17
|
+
|
|
18
|
+
exports.useAuthTeamActions = useAuthTeamActions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTenantsState = exports.useTenantsActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
|
|
10
|
+
var _hooks = require("./hooks");
|
|
11
|
+
|
|
12
|
+
const useTenantsState = stateMapper => (0, _hooks.stateHookGenerator)(stateMapper, 'tenantsState');
|
|
13
|
+
|
|
14
|
+
exports.useTenantsState = useTenantsState;
|
|
15
|
+
|
|
16
|
+
const useTenantsActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.tenantsActions, _reduxStore.tenantsReducers);
|
|
17
|
+
|
|
18
|
+
exports.useTenantsActions = useTenantsActions;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useShadowDom = exports.ShadowDomContext = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
13
|
+
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
|
|
16
|
+
const _excluded = ["urlStrategy", "onRedirectTo", "renderByRoute", "customLoader", "customStyles", "contextOptions"];
|
|
17
|
+
const ShadowDomContext = (0, _react.createContext)({});
|
|
18
|
+
exports.ShadowDomContext = ShadowDomContext;
|
|
19
|
+
|
|
20
|
+
const useShadowDom = () => {
|
|
21
|
+
const context = (0, _react.useContext)(ShadowDomContext);
|
|
22
|
+
const {
|
|
23
|
+
urlStrategy = 'path',
|
|
24
|
+
onRedirectTo = urlStrategy === 'path' ? path => window.history.pushState(null, '', path) : path => window.history.pushState(null, '', `#${path}`),
|
|
25
|
+
renderByRoute = false,
|
|
26
|
+
customLoader = false,
|
|
27
|
+
customStyles,
|
|
28
|
+
contextOptions
|
|
29
|
+
} = context,
|
|
30
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(context, _excluded);
|
|
31
|
+
return (0, _extends2.default)({
|
|
32
|
+
isShadowDom: true,
|
|
33
|
+
onRedirectTo,
|
|
34
|
+
renderByRoute,
|
|
35
|
+
customLoader,
|
|
36
|
+
customStyles,
|
|
37
|
+
urlStrategy,
|
|
38
|
+
contextOptions: (0, _extends2.default)({
|
|
39
|
+
requestCredentials: 'include'
|
|
40
|
+
}, contextOptions)
|
|
41
|
+
}, rest);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.useShadowDom = useShadowDom;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useConnectivityState = exports.useConnectivityActions = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _reactRedux = require("react-redux");
|
|
11
|
+
|
|
12
|
+
var _FronteggStoreContext = require("../FronteggStoreContext");
|
|
13
|
+
|
|
14
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
15
|
+
|
|
16
|
+
const useConnectivityState = stateMapper => {
|
|
17
|
+
return (0, _FronteggStoreContext.useSelector)(state => {
|
|
18
|
+
var _stateMapper;
|
|
19
|
+
|
|
20
|
+
return (_stateMapper = stateMapper == null ? void 0 : stateMapper(state[_reduxStore.connectivityStoreName])) != null ? _stateMapper : state[_reduxStore.connectivityStoreName];
|
|
21
|
+
}, _reactRedux.shallowEqual);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.useConnectivityState = useConnectivityState;
|
|
25
|
+
|
|
26
|
+
const useConnectivityActions = () => {
|
|
27
|
+
const dispatch = (0, _FronteggStoreContext.useDispatch)();
|
|
28
|
+
return (0, _react.useMemo)(() => (0, _reduxStore.bindActionCreators)(_reduxStore.connectivityActions, dispatch), [_reduxStore.connectivityActions]);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.useConnectivityActions = useConnectivityActions;
|