@frontegg/react-hooks 6.143.0-alpha.2 → 6.143.0-alpha.3
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/entitlements.d.ts +0 -7
- package/auth/entitlements.js +0 -12
- package/index.js +1 -1
- package/node/auth/entitlements.js +2 -15
- package/node/index.js +1 -1
- package/package.json +3 -3
package/auth/entitlements.d.ts
CHANGED
|
@@ -14,10 +14,3 @@ export declare const usePermissionEntitlements: (key: string) => Entitlement;
|
|
|
14
14
|
@returns if the user is entitled to the given feature or permission (check only one). Attaching the justification if not
|
|
15
15
|
*/
|
|
16
16
|
export declare const useEntitlements: (options: EntitledToOptions) => Entitlement;
|
|
17
|
-
/**
|
|
18
|
-
@param entitledToOptions including permission or feature key
|
|
19
|
-
@returns an action your can use to detect if the user is entitled to the given feature or permission (check only one). Attaching the justification if not
|
|
20
|
-
*/
|
|
21
|
-
export declare const useEntitlementsActions: () => {
|
|
22
|
-
isEntitledTo: (options: EntitledToOptions) => Entitlement;
|
|
23
|
-
};
|
package/auth/entitlements.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getPermissionEntitlements, getFeatureEntitlements, getEntitlements } from '@frontegg/redux-store';
|
|
2
2
|
import { useAuth } from './hooks';
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @returns entitlemenets state as stored in the user
|
|
@@ -34,15 +33,4 @@ export const usePermissionEntitlements = key => {
|
|
|
34
33
|
export const useEntitlements = options => {
|
|
35
34
|
const entitlements = useEntitlementsState();
|
|
36
35
|
return getEntitlements(entitlements, options);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
@param entitledToOptions including permission or feature key
|
|
41
|
-
@returns an action your can use to detect if the user is entitled to the given feature or permission (check only one). Attaching the justification if not
|
|
42
|
-
*/
|
|
43
|
-
export const useEntitlementsActions = () => {
|
|
44
|
-
const entitlements = useEntitlementsState();
|
|
45
|
-
return useMemo(() => ({
|
|
46
|
-
isEntitledTo: options => getEntitlements(entitlements, options)
|
|
47
|
-
}), [entitlements]);
|
|
48
36
|
};
|
package/index.js
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.usePermissionEntitlements = exports.useFeatureEntitlements = exports.
|
|
6
|
+
exports.usePermissionEntitlements = exports.useFeatureEntitlements = exports.useEntitlements = void 0;
|
|
7
7
|
var _reduxStore = require("@frontegg/redux-store");
|
|
8
8
|
var _hooks = require("./hooks");
|
|
9
|
-
var _react = require("react");
|
|
10
9
|
/**
|
|
11
10
|
* @returns entitlemenets state as stored in the user
|
|
12
11
|
*/
|
|
@@ -42,16 +41,4 @@ const useEntitlements = options => {
|
|
|
42
41
|
const entitlements = useEntitlementsState();
|
|
43
42
|
return (0, _reduxStore.getEntitlements)(entitlements, options);
|
|
44
43
|
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
@param entitledToOptions including permission or feature key
|
|
48
|
-
@returns an action your can use to detect if the user is entitled to the given feature or permission (check only one). Attaching the justification if not
|
|
49
|
-
*/
|
|
50
|
-
exports.useEntitlements = useEntitlements;
|
|
51
|
-
const useEntitlementsActions = () => {
|
|
52
|
-
const entitlements = useEntitlementsState();
|
|
53
|
-
return (0, _react.useMemo)(() => ({
|
|
54
|
-
isEntitledTo: options => (0, _reduxStore.getEntitlements)(entitlements, options)
|
|
55
|
-
}), [entitlements]);
|
|
56
|
-
};
|
|
57
|
-
exports.useEntitlementsActions = useEntitlementsActions;
|
|
44
|
+
exports.useEntitlements = useEntitlements;
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "6.143.0-alpha.
|
|
3
|
+
"version": "6.143.0-alpha.3",
|
|
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.143.0-alpha.
|
|
10
|
-
"@frontegg/types": "6.143.0-alpha.
|
|
9
|
+
"@frontegg/redux-store": "6.143.0-alpha.3",
|
|
10
|
+
"@frontegg/types": "6.143.0-alpha.3",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"react-redux": "^7.x"
|