@frontegg/react-hooks 7.0.0-alpha.9 → 7.2.0-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/auth/index.d.ts +1 -0
- package/auth/index.js +1 -0
- package/auth/unlockAccount.d.ts +5 -0
- package/auth/unlockAccount.js +10 -0
- package/index.js +1 -1
- package/node/auth/index.js +12 -0
- package/node/auth/unlockAccount.js +18 -0
- package/node/index.js +1 -1
- package/package.json +3 -3
package/auth/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { useAuthState, useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, useLoginWithRedirectV2, } from './hooks';
|
|
2
2
|
export * from './acceptInvitation';
|
|
3
|
+
export * from './unlockAccount';
|
|
3
4
|
export * from './activateAccount';
|
|
4
5
|
export * from './allAccounts';
|
|
5
6
|
export * from './apiTokens';
|
package/auth/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { useAuthState, useAuth, useAuthActions, useOnRedirectTo, useAuthRoutes, useIsAuthenticated, useAuthUser, useAuthUserOrNull, useLoginWithRedirect, useLoginWithRedirectV2 } from './hooks';
|
|
2
2
|
export * from './acceptInvitation';
|
|
3
|
+
export * from './unlockAccount';
|
|
3
4
|
export * from './activateAccount';
|
|
4
5
|
export * from './allAccounts';
|
|
5
6
|
export * from './apiTokens';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UnlockAccountActions, UnlockAccountState } from '@frontegg/redux-store';
|
|
2
|
+
export declare type UnlockAccountStateMapper<S> = (state: UnlockAccountState) => S;
|
|
3
|
+
export declare function useUnlockAccountState(): UnlockAccountState;
|
|
4
|
+
export declare function useUnlockAccountState<S>(stateMapper: UnlockAccountStateMapper<S>): S;
|
|
5
|
+
export declare const useUnlockAccountActions: () => UnlockAccountActions;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useStore } from '../FronteggStoreContext';
|
|
2
|
+
import { useSnapshot } from '../useSnapshot';
|
|
3
|
+
const defaultMapper = state => state;
|
|
4
|
+
export function useUnlockAccountState(stateMapper = defaultMapper) {
|
|
5
|
+
const state = useStore().store.auth.unlockAccountState;
|
|
6
|
+
return stateMapper(useSnapshot(state));
|
|
7
|
+
}
|
|
8
|
+
export const useUnlockAccountActions = () => {
|
|
9
|
+
return useStore().stateActions.auth.unlockAccountActions;
|
|
10
|
+
};
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -88,6 +88,18 @@ Object.keys(_acceptInvitation).forEach(function (key) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
|
+
var _unlockAccount = require("./unlockAccount");
|
|
92
|
+
Object.keys(_unlockAccount).forEach(function (key) {
|
|
93
|
+
if (key === "default" || key === "__esModule") return;
|
|
94
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
95
|
+
if (key in exports && exports[key] === _unlockAccount[key]) return;
|
|
96
|
+
Object.defineProperty(exports, key, {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _unlockAccount[key];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
91
103
|
var _activateAccount = require("./activateAccount");
|
|
92
104
|
Object.keys(_activateAccount).forEach(function (key) {
|
|
93
105
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUnlockAccountActions = void 0;
|
|
7
|
+
exports.useUnlockAccountState = useUnlockAccountState;
|
|
8
|
+
var _FronteggStoreContext = require("../FronteggStoreContext");
|
|
9
|
+
var _useSnapshot = require("../useSnapshot");
|
|
10
|
+
const defaultMapper = state => state;
|
|
11
|
+
function useUnlockAccountState(stateMapper = defaultMapper) {
|
|
12
|
+
const state = (0, _FronteggStoreContext.useStore)().store.auth.unlockAccountState;
|
|
13
|
+
return stateMapper((0, _useSnapshot.useSnapshot)(state));
|
|
14
|
+
}
|
|
15
|
+
const useUnlockAccountActions = () => {
|
|
16
|
+
return (0, _FronteggStoreContext.useStore)().stateActions.auth.unlockAccountActions;
|
|
17
|
+
};
|
|
18
|
+
exports.useUnlockAccountActions = useUnlockAccountActions;
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-alpha.0",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
|
-
"@frontegg/redux-store": "7.
|
|
10
|
-
"@frontegg/types": "7.
|
|
9
|
+
"@frontegg/redux-store": "7.2.0-alpha.0",
|
|
10
|
+
"@frontegg/types": "7.2.0-alpha.0",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"get-value": "^3.0.1"
|
|
13
13
|
},
|