@frontegg/react-hooks 7.105.0-alpha.0 → 7.105.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.
@@ -22,3 +22,12 @@ export declare const useEmailDomainRestrictions: () => {
22
22
  restrictions: import("dist/@frontegg/rest-api").DomainRestriction[];
23
23
  } | undefined;
24
24
  };
25
+ export declare const useCountryRestrictions: () => {
26
+ loading: boolean;
27
+ saving: boolean | undefined;
28
+ error: any;
29
+ data: {
30
+ config: import("dist/@frontegg/rest-api").CountryRestrictionConfig;
31
+ restrictions: import("dist/@frontegg/rest-api").CountryRestrictionRule[];
32
+ } | undefined;
33
+ };
@@ -57,4 +57,26 @@ export const useEmailDomainRestrictions = () => {
57
57
  error,
58
58
  data
59
59
  };
60
+ };
61
+ export const useCountryRestrictions = () => {
62
+ const {
63
+ loading,
64
+ data,
65
+ saving,
66
+ error
67
+ } = useRestrictionsState().countryRestrictions;
68
+ const {
69
+ loadCountryRestrictions
70
+ } = useRestrictionsActions();
71
+ useEffect(() => {
72
+ if (!data && !loading) {
73
+ loadCountryRestrictions();
74
+ }
75
+ }, [loadCountryRestrictions, data, loading]);
76
+ return {
77
+ loading,
78
+ saving,
79
+ error,
80
+ data
81
+ };
60
82
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.105.0-alpha.0
1
+ /** @license Frontegg v7.105.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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = void 0;
6
+ exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = exports.useCountryRestrictions = void 0;
7
7
  exports.useRestrictionsState = useRestrictionsState;
8
8
  var _react = require("react");
9
9
  var _FronteggStoreContext = require("../../FronteggStoreContext");
@@ -67,4 +67,27 @@ const useEmailDomainRestrictions = () => {
67
67
  data
68
68
  };
69
69
  };
70
- exports.useEmailDomainRestrictions = useEmailDomainRestrictions;
70
+ exports.useEmailDomainRestrictions = useEmailDomainRestrictions;
71
+ const useCountryRestrictions = () => {
72
+ const {
73
+ loading,
74
+ data,
75
+ saving,
76
+ error
77
+ } = useRestrictionsState().countryRestrictions;
78
+ const {
79
+ loadCountryRestrictions
80
+ } = useRestrictionsActions();
81
+ (0, _react.useEffect)(() => {
82
+ if (!data && !loading) {
83
+ loadCountryRestrictions();
84
+ }
85
+ }, [loadCountryRestrictions, data, loading]);
86
+ return {
87
+ loading,
88
+ saving,
89
+ error,
90
+ data
91
+ };
92
+ };
93
+ exports.useCountryRestrictions = useCountryRestrictions;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.105.0-alpha.0
1
+ /** @license Frontegg v7.105.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": "7.105.0-alpha.0",
3
+ "version": "7.105.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": "7.105.0-alpha.0",
10
- "@frontegg/types": "7.105.0-alpha.0",
9
+ "@frontegg/redux-store": "7.105.0",
10
+ "@frontegg/types": "7.105.0",
11
11
  "@types/react": "*",
12
12
  "@types/react-is": "^17.0.7",
13
13
  "get-value": "^3.0.1",