@frontegg/react-hooks 6.65.0-alpha.1 → 6.66.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/impersonate.d.ts +5 -0
- package/auth/impersonate.js +9 -0
- package/auth/index.d.ts +1 -0
- package/auth/index.js +2 -1
- package/index.js +1 -1
- package/node/auth/impersonate.js +21 -0
- package/node/auth/index.js +14 -0
- package/node/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImpersonateState, ImpersonateActions } from '@frontegg/redux-store';
|
|
2
|
+
export declare type ImpersonateStateMapper<S> = (state: ImpersonateState) => S;
|
|
3
|
+
export declare function useImpersonateState(): ImpersonateState;
|
|
4
|
+
export declare function useImpersonateState<S>(stateMapper: ImpersonateStateMapper<S>): S;
|
|
5
|
+
export declare const useImpersonateActions: () => ImpersonateActions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { impersonateActions, impersonateReducers } from '@frontegg/redux-store';
|
|
2
|
+
import { reducerActionsGenerator, stateHookGenerator } from './hooks';
|
|
3
|
+
|
|
4
|
+
const defaultMapper = state => state;
|
|
5
|
+
|
|
6
|
+
export function useImpersonateState(stateMapper = defaultMapper) {
|
|
7
|
+
return stateHookGenerator(stateMapper, 'impersonateState');
|
|
8
|
+
}
|
|
9
|
+
export const useImpersonateActions = () => reducerActionsGenerator(impersonateActions, impersonateReducers);
|
package/auth/index.d.ts
CHANGED
package/auth/index.js
CHANGED
package/index.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useImpersonateActions = void 0;
|
|
7
|
+
exports.useImpersonateState = useImpersonateState;
|
|
8
|
+
|
|
9
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
10
|
+
|
|
11
|
+
var _hooks = require("./hooks");
|
|
12
|
+
|
|
13
|
+
const defaultMapper = state => state;
|
|
14
|
+
|
|
15
|
+
function useImpersonateState(stateMapper = defaultMapper) {
|
|
16
|
+
return (0, _hooks.stateHookGenerator)(stateMapper, 'impersonateState');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const useImpersonateActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.impersonateActions, _reduxStore.impersonateReducers);
|
|
20
|
+
|
|
21
|
+
exports.useImpersonateActions = useImpersonateActions;
|
package/node/auth/index.js
CHANGED
|
@@ -328,4 +328,18 @@ Object.keys(_provisioning).forEach(function (key) {
|
|
|
328
328
|
return _provisioning[key];
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
var _impersonate = require("./impersonate");
|
|
334
|
+
|
|
335
|
+
Object.keys(_impersonate).forEach(function (key) {
|
|
336
|
+
if (key === "default" || key === "__esModule") return;
|
|
337
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
338
|
+
if (key in exports && exports[key] === _impersonate[key]) return;
|
|
339
|
+
Object.defineProperty(exports, key, {
|
|
340
|
+
enumerable: true,
|
|
341
|
+
get: function () {
|
|
342
|
+
return _impersonate[key];
|
|
343
|
+
}
|
|
344
|
+
});
|
|
331
345
|
});
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.66.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": "6.
|
|
10
|
-
"@frontegg/types": "6.
|
|
9
|
+
"@frontegg/redux-store": "6.66.0-alpha.0",
|
|
10
|
+
"@frontegg/types": "6.66.0-alpha.0",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"react-redux": "^7.x"
|
|
13
13
|
},
|