@tap-payments/auth-jsconnect 2.0.2 → 2.0.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.
Files changed (2) hide show
  1. package/build/api/axios.js +13 -13
  2. package/package.json +127 -127
@@ -79,28 +79,28 @@ export var removeAxiosGlobalHeaders = function (arr) {
79
79
  });
80
80
  };
81
81
  export var httpClient = function (config) { return __awaiter(void 0, void 0, void 0, function () {
82
- var data, description, error_1, response, data, description;
83
- var _a, _b;
84
- return __generator(this, function (_c) {
85
- switch (_c.label) {
82
+ var data, _a, description, error, err_1, response, data, _b, description, error;
83
+ var _c, _d;
84
+ return __generator(this, function (_e) {
85
+ switch (_e.label) {
86
86
  case 0:
87
- _c.trys.push([0, 2, , 3]);
87
+ _e.trys.push([0, 2, , 3]);
88
88
  return [4, instance(config)];
89
89
  case 1:
90
- data = (_c.sent()).data;
91
- if (data.errors && Array.isArray(data.errors)) {
92
- description = ((_a = data.errors) === null || _a === void 0 ? void 0 : _a[0]).description;
93
- throw new Error(description);
90
+ data = (_e.sent()).data;
91
+ _a = ((_c = data.errors) === null || _c === void 0 ? void 0 : _c[0]) || {}, description = _a.description, error = _a.error;
92
+ if (description || error) {
93
+ throw new Error(description, error);
94
94
  }
95
95
  return [2, data];
96
96
  case 2:
97
- error_1 = _c.sent();
98
- response = error_1.response;
97
+ err_1 = _e.sent();
98
+ response = err_1.response;
99
99
  data = (response || {}).data;
100
100
  if (typeof data === 'string')
101
101
  throw new Error(data);
102
- description = (((_b = data.errors) === null || _b === void 0 ? void 0 : _b[0]) || {}).description;
103
- throw new Error(description || 'Something went wrong');
102
+ _b = ((_d = data.errors) === null || _d === void 0 ? void 0 : _d[0]) || {}, description = _b.description, error = _b.error;
103
+ throw new Error(description || error || 'Something went wrong');
104
104
  case 3: return [2];
105
105
  }
106
106
  });
package/package.json CHANGED
@@ -1,127 +1,127 @@
1
- {
2
- "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.2",
4
- "description": "connect library, auth",
5
- "private": false,
6
- "main": "build/index.js",
7
- "module": "build/index.js",
8
- "types": "build/index.d.ts",
9
- "files": [
10
- "build",
11
- "README.md"
12
- ],
13
- "scripts": {
14
- "husky:setup": "npx husky install",
15
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
- "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
- "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
- "start": "cross-env NODE_ENV=development webpack serve",
20
- "build": "rm -rf build && cross-env NODE_ENV=production webpack",
21
- "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
- "tsc:alias": "tsc-alias -p tsconfig.json",
23
- "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public"
25
- },
26
- "keywords": [],
27
- "author": {
28
- "name": "Ahmed Elsharkawy",
29
- "email": "a.elsharkawy@tap.company"
30
- },
31
- "license": "ISC",
32
- "devDependencies": {
33
- "@babel/core": "^7.18.6",
34
- "@babel/preset-env": "^7.18.6",
35
- "@babel/preset-react": "^7.18.6",
36
- "@babel/preset-typescript": "^7.18.6",
37
- "@types/lodash-es": "^4.17.6",
38
- "@types/moment-hijri": "^2.1.0",
39
- "@types/react": "^18.0.15",
40
- "@types/react-calendar": "~3.5.1",
41
- "@types/react-dom": "^18.0.6",
42
- "@typescript-eslint/eslint-plugin": "^5.30.5",
43
- "@typescript-eslint/parser": "^5.30.5",
44
- "babel-loader": "^8.2.5",
45
- "copyfiles": "^2.4.1",
46
- "cross-env": "^7.0.3",
47
- "css-loader": "^6.7.1",
48
- "css-minimizer-webpack-plugin": "^4.0.0",
49
- "eslint": "^8.19.0",
50
- "eslint-config-airbnb": "^19.0.4",
51
- "eslint-config-prettier": "^8.5.0",
52
- "eslint-plugin-import": "^2.26.0",
53
- "eslint-plugin-jsx-a11y": "^6.6.0",
54
- "eslint-plugin-node": "^11.1.0",
55
- "eslint-plugin-prettier": "^4.2.1",
56
- "eslint-plugin-react": "^7.30.1",
57
- "eslint-plugin-react-hooks": "^4.6.0",
58
- "file-loader": "^6.2.0",
59
- "fork-ts-checker-webpack-plugin": "^7.2.12",
60
- "html-loader": "^3.1.2",
61
- "html-webpack-plugin": "^5.5.0",
62
- "husky": "^8.0.1",
63
- "lint-staged": "^13.0.3",
64
- "mini-css-extract-plugin": "^2.6.1",
65
- "prettier": "^2.7.1",
66
- "sass": "^1.53.0",
67
- "sass-loader": "^13.0.2",
68
- "style-loader": "^3.3.1",
69
- "terser-webpack-plugin": "^5.3.3",
70
- "tsc-alias": "^1.6.11",
71
- "typescript": "^4.7.4",
72
- "webpack": "^5.73.0",
73
- "webpack-cli": "^4.10.0",
74
- "webpack-dev-server": "^4.9.3",
75
- "webpack-merge": "^5.8.0"
76
- },
77
- "dependencies": {
78
- "@emotion/react": "^11.9.3",
79
- "@emotion/styled": "^11.9.3",
80
- "@fingerprintjs/fingerprintjs": "~3.3.4",
81
- "@hookform/resolvers": "^2.9.6",
82
- "@mui/icons-material": "^5.8.4",
83
- "@mui/material": "^5.8.7",
84
- "@reduxjs/toolkit": "^1.8.3",
85
- "axios": "^0.27.2",
86
- "device-detector-js": "^3.0.3",
87
- "i18next": "^21.8.14",
88
- "i18next-browser-languagedetector": "^6.1.4",
89
- "i18next-http-backend": "^1.4.1",
90
- "jsencrypt": "^3.2.1",
91
- "lodash-es": "^4.17.21",
92
- "moment-hijri": "~2.1.2",
93
- "react": "^18.2.0",
94
- "react-calendar": "~3.7.0",
95
- "react-device-detect": "^2.2.2",
96
- "react-dom": "^18.2.0",
97
- "react-hook-form": "^7.33.1",
98
- "react-i18next": "^11.18.1",
99
- "react-otp-input": "^2.4.0",
100
- "react-redux": "^8.0.2",
101
- "react-spring-bottom-sheet": "^3.4.1",
102
- "yup": "^0.32.11"
103
- },
104
- "peerDependencies": {
105
- "react": "^18.2.0",
106
- "react-dom": "^18.2.0"
107
- },
108
- "lint-staged": {
109
- "src/**/*.{ts,tsx,json,js,jsx}": [
110
- "yarn run prettier:fix",
111
- "yarn run lint",
112
- "git add ."
113
- ]
114
- },
115
- "browserslist": {
116
- "production": [
117
- ">0.2%",
118
- "not dead",
119
- "not op_mini all"
120
- ],
121
- "development": [
122
- "last 1 chrome version",
123
- "last 1 firefox version",
124
- "last 1 safari version"
125
- ]
126
- }
127
- }
1
+ {
2
+ "name": "@tap-payments/auth-jsconnect",
3
+ "version": "2.0.3",
4
+ "description": "connect library, auth",
5
+ "private": false,
6
+ "main": "build/index.js",
7
+ "module": "build/index.js",
8
+ "types": "build/index.d.ts",
9
+ "files": [
10
+ "build",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "husky:setup": "npx husky install",
15
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
+ "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
+ "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
+ "start": "cross-env NODE_ENV=development webpack serve",
20
+ "build": "rm -rf build && cross-env NODE_ENV=production webpack",
21
+ "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
+ "tsc:alias": "tsc-alias -p tsconfig.json",
23
+ "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
+ "push": "npm publish --access public"
25
+ },
26
+ "keywords": [],
27
+ "author": {
28
+ "name": "Ahmed Elsharkawy",
29
+ "email": "a.elsharkawy@tap.company"
30
+ },
31
+ "license": "ISC",
32
+ "devDependencies": {
33
+ "@babel/core": "^7.18.6",
34
+ "@babel/preset-env": "^7.18.6",
35
+ "@babel/preset-react": "^7.18.6",
36
+ "@babel/preset-typescript": "^7.18.6",
37
+ "@types/lodash-es": "^4.17.6",
38
+ "@types/moment-hijri": "^2.1.0",
39
+ "@types/react": "^18.0.15",
40
+ "@types/react-calendar": "~3.5.1",
41
+ "@types/react-dom": "^18.0.6",
42
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
43
+ "@typescript-eslint/parser": "^5.30.5",
44
+ "babel-loader": "^8.2.5",
45
+ "copyfiles": "^2.4.1",
46
+ "cross-env": "^7.0.3",
47
+ "css-loader": "^6.7.1",
48
+ "css-minimizer-webpack-plugin": "^4.0.0",
49
+ "eslint": "^8.19.0",
50
+ "eslint-config-airbnb": "^19.0.4",
51
+ "eslint-config-prettier": "^8.5.0",
52
+ "eslint-plugin-import": "^2.26.0",
53
+ "eslint-plugin-jsx-a11y": "^6.6.0",
54
+ "eslint-plugin-node": "^11.1.0",
55
+ "eslint-plugin-prettier": "^4.2.1",
56
+ "eslint-plugin-react": "^7.30.1",
57
+ "eslint-plugin-react-hooks": "^4.6.0",
58
+ "file-loader": "^6.2.0",
59
+ "fork-ts-checker-webpack-plugin": "^7.2.12",
60
+ "html-loader": "^3.1.2",
61
+ "html-webpack-plugin": "^5.5.0",
62
+ "husky": "^8.0.1",
63
+ "lint-staged": "^13.0.3",
64
+ "mini-css-extract-plugin": "^2.6.1",
65
+ "prettier": "^2.7.1",
66
+ "sass": "^1.53.0",
67
+ "sass-loader": "^13.0.2",
68
+ "style-loader": "^3.3.1",
69
+ "terser-webpack-plugin": "^5.3.3",
70
+ "tsc-alias": "^1.6.11",
71
+ "typescript": "^4.7.4",
72
+ "webpack": "^5.73.0",
73
+ "webpack-cli": "^4.10.0",
74
+ "webpack-dev-server": "^4.9.3",
75
+ "webpack-merge": "^5.8.0"
76
+ },
77
+ "dependencies": {
78
+ "@emotion/react": "^11.9.3",
79
+ "@emotion/styled": "^11.9.3",
80
+ "@fingerprintjs/fingerprintjs": "~3.3.4",
81
+ "@hookform/resolvers": "^2.9.6",
82
+ "@mui/icons-material": "^5.8.4",
83
+ "@mui/material": "^5.8.7",
84
+ "@reduxjs/toolkit": "^1.8.3",
85
+ "axios": "^0.27.2",
86
+ "device-detector-js": "^3.0.3",
87
+ "i18next": "^21.8.14",
88
+ "i18next-browser-languagedetector": "^6.1.4",
89
+ "i18next-http-backend": "^1.4.1",
90
+ "jsencrypt": "^3.2.1",
91
+ "lodash-es": "^4.17.21",
92
+ "moment-hijri": "~2.1.2",
93
+ "react": "^18.2.0",
94
+ "react-calendar": "~3.7.0",
95
+ "react-device-detect": "^2.2.2",
96
+ "react-dom": "^18.2.0",
97
+ "react-hook-form": "^7.33.1",
98
+ "react-i18next": "^11.18.1",
99
+ "react-otp-input": "^2.4.0",
100
+ "react-redux": "^8.0.2",
101
+ "react-spring-bottom-sheet": "^3.4.1",
102
+ "yup": "^0.32.11"
103
+ },
104
+ "peerDependencies": {
105
+ "react": "^18.2.0",
106
+ "react-dom": "^18.2.0"
107
+ },
108
+ "lint-staged": {
109
+ "src/**/*.{ts,tsx,json,js,jsx}": [
110
+ "yarn run prettier:fix",
111
+ "yarn run lint",
112
+ "git add ."
113
+ ]
114
+ },
115
+ "browserslist": {
116
+ "production": [
117
+ ">0.2%",
118
+ "not dead",
119
+ "not op_mini all"
120
+ ],
121
+ "development": [
122
+ "last 1 chrome version",
123
+ "last 1 firefox version",
124
+ "last 1 safari version"
125
+ ]
126
+ }
127
+ }