@tap-payments/auth-jsconnect 2.0.35 → 2.0.36

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.
@@ -5,6 +5,8 @@ export declare const VAT_ID_LENGTH = 15;
5
5
  export declare const MAX_IBAN_VALUE = 34;
6
6
  export declare const FL_NUMBER_LENGTH = 8;
7
7
  export declare const CR_NUMBER_LENGTH = 10;
8
+ export declare const FL_MIN_LICENSE_LENGTH = 5;
9
+ export declare const CR_MIN_LICENSE_LENGTH = 5;
8
10
  export declare const KW_MIN_LICENSE_LENGTH = 3;
9
11
  export declare const KW_MAX_LICENSE_LENGTH = 50;
10
12
  export declare const SAUDI_NUMBER_LENGTH = 9;
@@ -5,6 +5,8 @@ export var VAT_ID_LENGTH = 15;
5
5
  export var MAX_IBAN_VALUE = 34;
6
6
  export var FL_NUMBER_LENGTH = 8;
7
7
  export var CR_NUMBER_LENGTH = 10;
8
+ export var FL_MIN_LICENSE_LENGTH = 5;
9
+ export var CR_MIN_LICENSE_LENGTH = 5;
8
10
  export var KW_MIN_LICENSE_LENGTH = 3;
9
11
  export var KW_MAX_LICENSE_LENGTH = 50;
10
12
  export var SAUDI_NUMBER_LENGTH = 9;
@@ -846,7 +846,8 @@ export var businessSlice = createSlice({
846
846
  var _a;
847
847
  return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
848
848
  });
849
- state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]];
849
+ var defaultActivities = (activities === null || activities === void 0 ? void 0 : activities[0]) ? [activities === null || activities === void 0 ? void 0 : activities[0]] : [];
850
+ state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : defaultActivities;
850
851
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
851
852
  state.data.businessTypeData.entityLegalName = (business_name === null || business_name === void 0 ? void 0 : business_name.en) || '';
852
853
  if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
@@ -450,7 +450,8 @@ export var entitySlice = createSlice({
450
450
  var _a;
451
451
  return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
452
452
  });
453
- state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]], operationStartDate: startDate || issuingDate });
453
+ var defaultActivities = (activities === null || activities === void 0 ? void 0 : activities[0]) ? [activities === null || activities === void 0 ? void 0 : activities[0]] : [];
454
+ state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : defaultActivities, operationStartDate: startDate || issuingDate });
454
455
  })
455
456
  .addCase(verifyEntityLeadOTP.rejected, function (state, action) {
456
457
  state.loading = false;
@@ -1,5 +1,5 @@
1
1
  import * as yup from 'yup';
2
- import { FL_NUMBER_LENGTH, CR_NUMBER_LENGTH, REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
2
+ import { REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, MAX_FILE_SIZE, VALID_FILE_FORMATS, FL_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH } from '../../../../constants';
3
3
  import { BusinessType } from '../../../../@types';
4
4
  var objectElements = {
5
5
  legal_name: yup.object().shape({
@@ -23,9 +23,9 @@ export var LicenseValidationSchema = yup.object().shape({
23
23
  if (length === 0)
24
24
  return true;
25
25
  if (isCR) {
26
- return length === CR_NUMBER_LENGTH ? true : this.createError({ message: 'cr_max_length' });
26
+ return length > CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
27
27
  }
28
- return length === FL_NUMBER_LENGTH ? true : this.createError({ message: 'fl_max_length' });
28
+ return length > FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
29
29
  }
30
30
  })
31
31
  .required('')
package/package.json CHANGED
@@ -1,129 +1,129 @@
1
- {
2
- "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.35",
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/react": "^18.0.15",
39
- "@types/react-calendar": "~3.5.1",
40
- "@types/react-dom": "^18.0.6",
41
- "@typescript-eslint/eslint-plugin": "^5.30.5",
42
- "@typescript-eslint/parser": "^5.30.5",
43
- "babel-loader": "^8.2.5",
44
- "copyfiles": "^2.4.1",
45
- "cross-env": "^7.0.3",
46
- "css-loader": "^6.7.1",
47
- "css-minimizer-webpack-plugin": "^4.0.0",
48
- "eslint": "^8.19.0",
49
- "eslint-config-airbnb": "^19.0.4",
50
- "eslint-config-prettier": "^8.5.0",
51
- "eslint-plugin-import": "^2.26.0",
52
- "eslint-plugin-jsx-a11y": "^6.6.0",
53
- "eslint-plugin-node": "^11.1.0",
54
- "eslint-plugin-prettier": "^4.2.1",
55
- "eslint-plugin-react": "^7.30.1",
56
- "eslint-plugin-react-hooks": "^4.6.0",
57
- "file-loader": "^6.2.0",
58
- "fork-ts-checker-webpack-plugin": "^7.2.12",
59
- "html-loader": "^3.1.2",
60
- "html-webpack-plugin": "^5.5.0",
61
- "husky": "^8.0.1",
62
- "lint-staged": "^13.0.3",
63
- "mini-css-extract-plugin": "^2.6.1",
64
- "prettier": "^2.7.1",
65
- "sass": "^1.53.0",
66
- "sass-loader": "^13.0.2",
67
- "style-loader": "^3.3.1",
68
- "terser-webpack-plugin": "^5.3.3",
69
- "tsc-alias": "^1.6.11",
70
- "typescript": "^4.7.4",
71
- "webpack": "^5.73.0",
72
- "webpack-cli": "^4.10.0",
73
- "webpack-dev-server": "^4.9.3",
74
- "webpack-merge": "^5.8.0"
75
- },
76
- "dependencies": {
77
- "@emotion/react": "^11.9.3",
78
- "@emotion/styled": "^11.9.3",
79
- "@fingerprintjs/fingerprintjs": "~3.3.4",
80
- "@hookform/resolvers": "^2.9.6",
81
- "@mui/icons-material": "^5.8.4",
82
- "@mui/material": "^5.8.7",
83
- "@reduxjs/toolkit": "^1.8.3",
84
- "axios": "^0.27.2",
85
- "device-detector-js": "^3.0.3",
86
- "i18next": "^21.8.14",
87
- "i18next-browser-languagedetector": "^6.1.4",
88
- "i18next-http-backend": "^1.4.1",
89
- "jsencrypt": "^2.3.1",
90
- "lodash-es": "^4.17.21",
91
- "lottie-web": "^5.9.6",
92
- "moment": "^2.29.4",
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-dropzone": "^14.2.2",
98
- "react-hook-form": "^7.33.1",
99
- "react-i18next": "^11.18.1",
100
- "react-multi-date-picker": "^3.3.4",
101
- "react-otp-input": "^2.4.0",
102
- "react-redux": "^8.0.2",
103
- "react-spring-bottom-sheet": "^3.4.1",
104
- "yup": "^0.32.11"
105
- },
106
- "peerDependencies": {
107
- "react": "^18.2.0",
108
- "react-dom": "^18.2.0"
109
- },
110
- "lint-staged": {
111
- "src/**/*.{ts,tsx,json,js,jsx}": [
112
- "yarn run prettier:fix",
113
- "yarn run lint",
114
- "git add ."
115
- ]
116
- },
117
- "browserslist": {
118
- "production": [
119
- ">0.2%",
120
- "not dead",
121
- "not op_mini all"
122
- ],
123
- "development": [
124
- "last 1 chrome version",
125
- "last 1 firefox version",
126
- "last 1 safari version"
127
- ]
128
- }
129
- }
1
+ {
2
+ "name": "@tap-payments/auth-jsconnect",
3
+ "version": "2.0.36",
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/react": "^18.0.15",
39
+ "@types/react-calendar": "~3.5.1",
40
+ "@types/react-dom": "^18.0.6",
41
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
42
+ "@typescript-eslint/parser": "^5.30.5",
43
+ "babel-loader": "^8.2.5",
44
+ "copyfiles": "^2.4.1",
45
+ "cross-env": "^7.0.3",
46
+ "css-loader": "^6.7.1",
47
+ "css-minimizer-webpack-plugin": "^4.0.0",
48
+ "eslint": "^8.19.0",
49
+ "eslint-config-airbnb": "^19.0.4",
50
+ "eslint-config-prettier": "^8.5.0",
51
+ "eslint-plugin-import": "^2.26.0",
52
+ "eslint-plugin-jsx-a11y": "^6.6.0",
53
+ "eslint-plugin-node": "^11.1.0",
54
+ "eslint-plugin-prettier": "^4.2.1",
55
+ "eslint-plugin-react": "^7.30.1",
56
+ "eslint-plugin-react-hooks": "^4.6.0",
57
+ "file-loader": "^6.2.0",
58
+ "fork-ts-checker-webpack-plugin": "^7.2.12",
59
+ "html-loader": "^3.1.2",
60
+ "html-webpack-plugin": "^5.5.0",
61
+ "husky": "^8.0.1",
62
+ "lint-staged": "^13.0.3",
63
+ "mini-css-extract-plugin": "^2.6.1",
64
+ "prettier": "^2.7.1",
65
+ "sass": "^1.53.0",
66
+ "sass-loader": "^13.0.2",
67
+ "style-loader": "^3.3.1",
68
+ "terser-webpack-plugin": "^5.3.3",
69
+ "tsc-alias": "^1.6.11",
70
+ "typescript": "^4.7.4",
71
+ "webpack": "^5.73.0",
72
+ "webpack-cli": "^4.10.0",
73
+ "webpack-dev-server": "^4.9.3",
74
+ "webpack-merge": "^5.8.0"
75
+ },
76
+ "dependencies": {
77
+ "@emotion/react": "^11.9.3",
78
+ "@emotion/styled": "^11.9.3",
79
+ "@fingerprintjs/fingerprintjs": "~3.3.4",
80
+ "@hookform/resolvers": "^2.9.6",
81
+ "@mui/icons-material": "^5.8.4",
82
+ "@mui/material": "^5.8.7",
83
+ "@reduxjs/toolkit": "^1.8.3",
84
+ "axios": "^0.27.2",
85
+ "device-detector-js": "^3.0.3",
86
+ "i18next": "^21.8.14",
87
+ "i18next-browser-languagedetector": "^6.1.4",
88
+ "i18next-http-backend": "^1.4.1",
89
+ "jsencrypt": "^2.3.1",
90
+ "lodash-es": "^4.17.21",
91
+ "lottie-web": "^5.9.6",
92
+ "moment": "^2.29.4",
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-dropzone": "^14.2.2",
98
+ "react-hook-form": "^7.33.1",
99
+ "react-i18next": "^11.18.1",
100
+ "react-multi-date-picker": "^3.3.4",
101
+ "react-otp-input": "^2.4.0",
102
+ "react-redux": "^8.0.2",
103
+ "react-spring-bottom-sheet": "^3.4.1",
104
+ "yup": "^0.32.11"
105
+ },
106
+ "peerDependencies": {
107
+ "react": "^18.2.0",
108
+ "react-dom": "^18.2.0"
109
+ },
110
+ "lint-staged": {
111
+ "src/**/*.{ts,tsx,json,js,jsx}": [
112
+ "yarn run prettier:fix",
113
+ "yarn run lint",
114
+ "git add ."
115
+ ]
116
+ },
117
+ "browserslist": {
118
+ "production": [
119
+ ">0.2%",
120
+ "not dead",
121
+ "not op_mini all"
122
+ ],
123
+ "development": [
124
+ "last 1 chrome version",
125
+ "last 1 firefox version",
126
+ "last 1 safari version"
127
+ ]
128
+ }
129
+ }