@frontegg/react-hooks 7.27.0 → 7.28.0-alpha.1

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.
@@ -13,14 +13,14 @@ export declare const useFeatureEntitlements: (key: string, customAttributes?: Cu
13
13
  */
14
14
  export declare const usePermissionEntitlements: (key: string, customAttributes?: CustomAttributes) => Entitlement;
15
15
  /**
16
- @param entitledToOptions including permission or feature key
16
+ @param options
17
17
  @param customAttributes user attributes
18
18
  @returns if the user is entitled to the given feature or permission and attributes (check only one). Attaching the justification if not
19
19
  */
20
20
  export declare const useEntitlements: (options: EntitledToOptions, customAttributes?: CustomAttributes) => Entitlement;
21
21
  /**
22
- @param entitledToOptions including permission or feature key
23
- @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
22
+ @returns an action your can use to detect if the user is entitled to the given feature or permission (check only one).
23
+ Attaching the justification if not
24
24
  */
25
25
  export declare const useEntitlementsActions: () => {
26
26
  isEntitledTo: (options: EntitledToOptions, customAttributes?: CustomAttributes) => Entitlement;
@@ -7,7 +7,7 @@ import { useSnapshot } from '../useSnapshot';
7
7
  import { getEntitlements, getFeatureEntitlements, getPermissionEntitlements } from '@frontegg/redux-store';
8
8
 
9
9
  /**
10
- * @returns entitlemenets state as stored in the user
10
+ * @returns entitlements state as stored in the user
11
11
  */
12
12
  const useEntitlementsState = () => {
13
13
  var _useSnapshot$user$ent, _useSnapshot$user;
@@ -24,7 +24,7 @@ const useUserState = () => {
24
24
 
25
25
  /**
26
26
  * @param customAttributes user attributes
27
- * @returns is entitled query data including: entitlements state and final attributes (consumer and frontegg)
27
+ * @returns is entitled query data including entitlement state and final attributes (consumer and frontegg)
28
28
  */
29
29
  const useEntitlementsQueryData = customAttributes => {
30
30
  const user = useUserState();
@@ -72,7 +72,7 @@ export const usePermissionEntitlements = (key, customAttributes) => {
72
72
  };
73
73
 
74
74
  /**
75
- @param entitledToOptions including permission or feature key
75
+ @param options
76
76
  @param customAttributes user attributes
77
77
  @returns if the user is entitled to the given feature or permission and attributes (check only one). Attaching the justification if not
78
78
  */
@@ -88,8 +88,8 @@ export const useEntitlements = (options, customAttributes) => {
88
88
  };
89
89
 
90
90
  /**
91
- @param entitledToOptions including permission or feature key
92
- @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
91
+ @returns an action your can use to detect if the user is entitled to the given feature or permission (check only one).
92
+ Attaching the justification if not
93
93
  */
94
94
  export const useEntitlementsActions = () => {
95
95
  // this code is duplicated because React is yelling when using useEntitlementsQueryData inside the isEntitledTo function because it's not a hook
@@ -6,10 +6,10 @@ export declare const useIpRestrictions: (loadOnMount?: boolean) => {
6
6
  saving: boolean | undefined;
7
7
  error: any;
8
8
  data: {
9
- config: import("@frontegg/rest-api").IPRestrictionsConfig;
10
- restrictions: import("@frontegg/rest-api").IpRestriction[];
9
+ config: import("dist/@frontegg/rest-api").IPRestrictionsConfig;
10
+ restrictions: import("dist/@frontegg/rest-api").IpRestriction[];
11
11
  } | undefined;
12
- pagination: import("@frontegg/rest-api").GetIPRestrictionsParams;
12
+ pagination: import("dist/@frontegg/rest-api").GetIPRestrictionsParams;
13
13
  totalPages: number;
14
14
  userIpValid: boolean;
15
15
  };
@@ -18,7 +18,7 @@ export declare const useEmailDomainRestrictions: (loadOnMount?: boolean) => {
18
18
  saving: boolean | undefined;
19
19
  error: any;
20
20
  data: {
21
- config: import("@frontegg/rest-api").DomainRestrictionConfig;
22
- restrictions: import("@frontegg/rest-api").DomainRestriction[];
21
+ config: import("dist/@frontegg/rest-api").DomainRestrictionConfig;
22
+ restrictions: import("dist/@frontegg/rest-api").DomainRestriction[];
23
23
  } | undefined;
24
24
  };
package/index.d.ts CHANGED
@@ -5,5 +5,6 @@ export * from './subscriptions';
5
5
  export * from './vendor';
6
6
  export * from './common';
7
7
  export * from './flags';
8
+ export * from './useSnapshot';
8
9
  export * from './FronteggProvider';
9
10
  export * from './FronteggStoreContext';
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.27.0
1
+ /** @license Frontegg v7.28.0-alpha.1
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.
@@ -10,5 +10,6 @@ export * from './subscriptions';
10
10
  export * from './vendor';
11
11
  export * from './common';
12
12
  export * from './flags';
13
+ export * from './useSnapshot';
13
14
  export * from './FronteggProvider';
14
15
  export * from './FronteggStoreContext';
@@ -12,7 +12,7 @@ var _FronteggStoreContext = require("../FronteggStoreContext");
12
12
  var _useSnapshot = require("../useSnapshot");
13
13
  var _reduxStore = require("@frontegg/redux-store");
14
14
  /**
15
- * @returns entitlemenets state as stored in the user
15
+ * @returns entitlements state as stored in the user
16
16
  */
17
17
  const useEntitlementsState = () => {
18
18
  var _useSnapshot$user$ent, _useSnapshot$user;
@@ -29,7 +29,7 @@ const useUserState = () => {
29
29
 
30
30
  /**
31
31
  * @param customAttributes user attributes
32
- * @returns is entitled query data including: entitlements state and final attributes (consumer and frontegg)
32
+ * @returns is entitled query data including entitlement state and final attributes (consumer and frontegg)
33
33
  */
34
34
  const useEntitlementsQueryData = customAttributes => {
35
35
  const user = useUserState();
@@ -78,7 +78,7 @@ const usePermissionEntitlements = (key, customAttributes) => {
78
78
  };
79
79
 
80
80
  /**
81
- @param entitledToOptions including permission or feature key
81
+ @param options
82
82
  @param customAttributes user attributes
83
83
  @returns if the user is entitled to the given feature or permission and attributes (check only one). Attaching the justification if not
84
84
  */
@@ -95,8 +95,8 @@ const useEntitlements = (options, customAttributes) => {
95
95
  };
96
96
 
97
97
  /**
98
- @param entitledToOptions including permission or feature key
99
- @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
98
+ @returns an action your can use to detect if the user is entitled to the given feature or permission (check only one).
99
+ Attaching the justification if not
100
100
  */
101
101
  exports.useEntitlements = useEntitlements;
102
102
  const useEntitlementsActions = () => {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.27.0
1
+ /** @license Frontegg v7.28.0-alpha.1
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.
@@ -85,6 +85,17 @@ Object.keys(_flags).forEach(function (key) {
85
85
  }
86
86
  });
87
87
  });
88
+ var _useSnapshot = require("./useSnapshot");
89
+ Object.keys(_useSnapshot).forEach(function (key) {
90
+ if (key === "default" || key === "__esModule") return;
91
+ if (key in exports && exports[key] === _useSnapshot[key]) return;
92
+ Object.defineProperty(exports, key, {
93
+ enumerable: true,
94
+ get: function () {
95
+ return _useSnapshot[key];
96
+ }
97
+ });
98
+ });
88
99
  var _FronteggProvider = require("./FronteggProvider");
89
100
  Object.keys(_FronteggProvider).forEach(function (key) {
90
101
  if (key === "default" || key === "__esModule") return;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/react-hooks",
3
- "version": "7.27.0",
3
+ "version": "7.28.0-alpha.1",
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.27.0",
10
- "@frontegg/types": "7.27.0",
9
+ "@frontegg/redux-store": "7.28.0-alpha.1",
10
+ "@frontegg/types": "7.28.0-alpha.1",
11
11
  "@types/react": "*",
12
12
  "@types/react-is": "^17.0.7",
13
13
  "get-value": "^3.0.1",
@@ -20,7 +20,7 @@ export declare const usePaymentMethodActions: () => {
20
20
  submitPaymentMethod: () => Promise<void>;
21
21
  submitPaymentMethodError: (error: string) => Promise<void>;
22
22
  submitPaymentMethodSuccess: () => Promise<void>;
23
- updatePaymentMethodBillingDetails: (payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithId<import("@frontegg/rest-api").ISubscriptionUpdatePaymentMethodBillingDetails>>) => Promise<void>;
23
+ updatePaymentMethodBillingDetails: (payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithId<import("dist/@frontegg/rest-api").ISubscriptionUpdatePaymentMethodBillingDetails>>) => Promise<void>;
24
24
  };
25
25
  export declare const useInvoices: () => InvoicesState;
26
26
  export declare const useInvoicesActions: () => {