@frontegg/react-hooks 6.126.0-alpha.1 → 6.127.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/entitlements.d.ts +2 -2
- package/auth/entitlements.js +3 -3
- package/index.js +1 -1
- package/node/auth/entitlements.js +3 -3
- package/node/index.js +1 -1
- package/package.json +3 -3
package/auth/entitlements.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Entitlement, EntitledToOptions } from '@frontegg/redux-store';
|
|
2
2
|
/**
|
|
3
|
-
@param
|
|
3
|
+
@param key
|
|
4
4
|
@returns if the user is entitled to the given feature. Attaching the justification if not
|
|
5
5
|
*/
|
|
6
|
-
export declare const useFeatureEntitlements: (
|
|
6
|
+
export declare const useFeatureEntitlements: (key: string) => Entitlement;
|
|
7
7
|
/**
|
|
8
8
|
@param key
|
|
9
9
|
@returns if the user is entitled to the given permission. Attaching the justification if not
|
package/auth/entitlements.js
CHANGED
|
@@ -9,12 +9,12 @@ const useEntitlementsState = () => useAuth(({
|
|
|
9
9
|
}) => user == null ? void 0 : user.entitlements);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
@param
|
|
12
|
+
@param key
|
|
13
13
|
@returns if the user is entitled to the given feature. Attaching the justification if not
|
|
14
14
|
*/
|
|
15
|
-
export const useFeatureEntitlements =
|
|
15
|
+
export const useFeatureEntitlements = key => {
|
|
16
16
|
const entitlements = useEntitlementsState();
|
|
17
|
-
return getFeatureEntitlements(entitlements,
|
|
17
|
+
return getFeatureEntitlements(entitlements, key);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
/**
|
package/index.js
CHANGED
|
@@ -14,12 +14,12 @@ const useEntitlementsState = () => (0, _hooks.useAuth)(({
|
|
|
14
14
|
}) => user == null ? void 0 : user.entitlements);
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
@param
|
|
17
|
+
@param key
|
|
18
18
|
@returns if the user is entitled to the given feature. Attaching the justification if not
|
|
19
19
|
*/
|
|
20
|
-
const useFeatureEntitlements =
|
|
20
|
+
const useFeatureEntitlements = key => {
|
|
21
21
|
const entitlements = useEntitlementsState();
|
|
22
|
-
return (0, _reduxStore.getFeatureEntitlements)(entitlements,
|
|
22
|
+
return (0, _reduxStore.getFeatureEntitlements)(entitlements, key);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/**
|
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.127.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.127.0-alpha.0",
|
|
10
|
+
"@frontegg/types": "6.127.0-alpha.0",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"react-redux": "^7.x"
|