@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.
@@ -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
@@ -18,3 +18,4 @@ export * from './sessions';
18
18
  export * from './sessionsPolicy';
19
19
  export * from './restrictions';
20
20
  export * from './provisioning';
21
+ export * from './impersonate';
package/auth/index.js CHANGED
@@ -17,4 +17,5 @@ export * from './roles';
17
17
  export * from './sessions';
18
18
  export * from './sessionsPolicy';
19
19
  export * from './restrictions';
20
- export * from './provisioning';
20
+ export * from './provisioning';
21
+ export * from './impersonate';
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.65.0-alpha.1
1
+ /** @license Frontegg v6.66.0-alpha.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -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;
@@ -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
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.65.0-alpha.1
1
+ /** @license Frontegg v6.66.0-alpha.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/react-hooks",
3
- "version": "6.65.0-alpha.1",
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.65.0-alpha.1",
10
- "@frontegg/types": "6.65.0-alpha.1",
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
  },