@frontegg/redux-store 7.40.0-alpha.1 → 7.40.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.
@@ -1,4 +1,4 @@
1
- import { FronteggApiError } from '@frontegg/rest-api';
1
+ import { FronteggApiError, GENERIC_ERROR_MESSAGE, GENERIC_ERROR_CODE } from '@frontegg/rest-api';
2
2
  export const isFronteggApiError = error => Boolean(error == null ? void 0 : error.statusCode);
3
3
  export const isError = error => {
4
4
  if (error instanceof Error) {
@@ -8,7 +8,6 @@ export const isError = error => {
8
8
  //using 'instanceof Error' wont work if the error is thrown in different window/frame/iframe than where the check is happening https://stackoverflow.com/a/30469297
9
9
  return (error == null ? void 0 : error.message) && (error == null ? void 0 : error.stack) && (error == null ? void 0 : error.name) === 'Error';
10
10
  };
11
- const GENERIC_ERROR_MESSAGE = `We're facing some difficulties, Please try again`;
12
11
  export const errorHandler = (error, fallback) => {
13
12
  if (!error) {
14
13
  return fallback;
@@ -22,5 +21,5 @@ export const errorHandler = (error, fallback) => {
22
21
  } else if (typeof error === 'string') {
23
22
  console.error(error);
24
23
  }
25
- return fallback != null ? fallback : new FronteggApiError(GENERIC_ERROR_MESSAGE, 500, null);
24
+ return fallback != null ? fallback : new FronteggApiError(GENERIC_ERROR_MESSAGE, 500, null, GENERIC_ERROR_CODE);
26
25
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.40.0-alpha.1
1
+ /** @license Frontegg v7.40.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.
@@ -16,7 +16,6 @@ const isError = error => {
16
16
  return (error == null ? void 0 : error.message) && (error == null ? void 0 : error.stack) && (error == null ? void 0 : error.name) === 'Error';
17
17
  };
18
18
  exports.isError = isError;
19
- const GENERIC_ERROR_MESSAGE = `We're facing some difficulties, Please try again`;
20
19
  const errorHandler = (error, fallback) => {
21
20
  if (!error) {
22
21
  return fallback;
@@ -30,6 +29,6 @@ const errorHandler = (error, fallback) => {
30
29
  } else if (typeof error === 'string') {
31
30
  console.error(error);
32
31
  }
33
- return fallback != null ? fallback : new _restApi.FronteggApiError(GENERIC_ERROR_MESSAGE, 500, null);
32
+ return fallback != null ? fallback : new _restApi.FronteggApiError(_restApi.GENERIC_ERROR_MESSAGE, 500, null, _restApi.GENERIC_ERROR_CODE);
34
33
  };
35
34
  exports.errorHandler = errorHandler;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.40.0-alpha.1
1
+ /** @license Frontegg v7.40.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/redux-store",
3
- "version": "7.40.0-alpha.1",
3
+ "version": "7.40.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
9
  "@frontegg/entitlements-javascript-commons": "1.1.2",
10
- "@frontegg/rest-api": "7.40.0-alpha.1",
10
+ "@frontegg/rest-api": "7.40.0",
11
11
  "fast-deep-equal": "3.1.3",
12
12
  "get-value": "^3.0.1",
13
13
  "proxy-compare": "^3.0.0",