@tap-payments/auth-jsconnect 2.1.56-test → 2.1.59-test
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.
- package/README.md +34 -34
- package/build/@types/app.d.ts +1 -0
- package/build/app/settings.d.ts +0 -1
- package/build/app/settings.js +6 -16
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/constants/app.js +32 -2
- package/build/features/app/bank/bankStore.d.ts +5 -1
- package/build/features/app/bank/bankStore.js +62 -57
- package/build/features/app/brand/brandStore.d.ts +5 -1
- package/build/features/app/brand/brandStore.js +70 -65
- package/build/features/app/connectExpress/connectExpressStore.js +9 -3
- package/build/features/app/entity/entityStore.d.ts +5 -1
- package/build/features/app/entity/entityStore.js +75 -70
- package/build/features/app/individual/individualStore.d.ts +5 -1
- package/build/features/app/individual/individualStore.js +88 -83
- package/build/features/app/tax/taxStore.d.ts +5 -1
- package/build/features/app/tax/taxStore.js +51 -46
- package/build/features/auth/Auth.d.ts +3 -2
- package/build/features/auth/Auth.js +5 -13
- package/build/features/bank/Bank.d.ts +4 -2
- package/build/features/bank/Bank.js +35 -35
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/bank/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/bank/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/brand/Brand.d.ts +4 -2
- package/build/features/brand/Brand.js +35 -34
- package/build/features/brand/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/brand/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/brand/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/brand/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/business/Business.d.ts +3 -2
- package/build/features/business/Business.js +5 -13
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -98
- package/build/features/connect/Connect.d.ts +3 -2
- package/build/features/connect/Connect.js +5 -13
- package/build/features/connectExpress/ConnectExpress.d.ts +0 -1
- package/build/features/connectExpress/ConnectExpress.js +3 -6
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +1 -1
- package/build/features/connectExpress/screens/Mobile/Mobile.js +6 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -9
- package/build/features/connectExpress/screens/NID/IDNumber.js +7 -2
- package/build/features/connectExpress/screens/NID/NID.js +6 -5
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +3 -7
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -100
- package/build/features/entity/Entity.d.ts +4 -2
- package/build/features/entity/Entity.js +35 -36
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/entity/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/entity/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/featuresScreens.js +25 -0
- package/build/features/individual/Individual.d.ts +4 -2
- package/build/features/individual/Individual.js +35 -36
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/individual/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/individual/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/password/Password.d.ts +4 -2
- package/build/features/password/Password.js +5 -13
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +6 -4
- package/build/features/shared/DataLoading/DataLoading.d.ts +5 -0
- package/build/features/shared/DataLoading/DataLoading.js +55 -0
- package/build/features/shared/DataLoading/index.d.ts +2 -0
- package/build/features/shared/DataLoading/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -1
- package/build/features/signIn/SignIn.d.ts +3 -2
- package/build/features/signIn/SignIn.js +4 -13
- package/build/features/tax/Tax.d.ts +4 -2
- package/build/features/tax/Tax.js +35 -37
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/tax/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/tax/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.d.ts +2 -2
- package/build/hooks/useAppConfig.js +5 -3
- package/build/hooks/useVerifyToken.d.ts +15 -0
- package/build/hooks/useVerifyToken.js +25 -0
- package/build/index.d.ts +11 -11
- package/build/index.js +12 -22
- package/package.json +1 -1
- package/build/features/connectExpress/screens/Brand/Brand.d.ts +0 -0
- package/build/features/connectExpress/screens/Brand/Brand.js +0 -1
- package/build/features/connectExpress/screens/Brand/BrandList.d.ts +0 -10
- package/build/features/connectExpress/screens/Brand/BrandList.js +0 -106
- package/build/features/connectExpress/screens/Brand/BrandName.d.ts +0 -8
- package/build/features/connectExpress/screens/Brand/BrandName.js +0 -142
- package/build/features/connectExpress/screens/Brand/SalesChannels.d.ts +0 -5
- package/build/features/connectExpress/screens/Brand/SalesChannels.js +0 -38
- package/build/features/connectExpress/screens/Brand/Segments.d.ts +0 -8
- package/build/features/connectExpress/screens/Brand/Segments.js +0 -74
- package/build/features/connectExpress/screens/Brand/TAC.d.ts +0 -6
- package/build/features/connectExpress/screens/Brand/TAC.js +0 -84
- package/build/features/connectExpress/screens/Brand/TeamSize.d.ts +0 -8
- package/build/features/connectExpress/screens/Brand/TeamSize.js +0 -74
- package/build/features/connectExpress/screens/Brand/index.d.ts +0 -0
- package/build/features/connectExpress/screens/Brand/index.js +0 -1
- package/build/features/connectExpress/screens/Brand/validation.d.ts +0 -38
- package/build/features/connectExpress/screens/Brand/validation.js +0 -134
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
import { REGEX_WEBSITE, REGEX_BRAND_NAME, LINKEDIN_URL, SOCIAL_USERNAME, DIGITS_ONLY, REGEX_ALPHANUMERIC } from '../../../../constants';
|
|
11
|
-
import * as yup from 'yup';
|
|
12
|
-
var validationSalesChannels = function (channels) {
|
|
13
|
-
if (channels === void 0) { channels = []; }
|
|
14
|
-
var dic = {};
|
|
15
|
-
var typeDic = {};
|
|
16
|
-
channels.forEach(function (channel) {
|
|
17
|
-
var _a, _b, _c;
|
|
18
|
-
if ((_a = channel.sub) === null || _a === void 0 ? void 0 : _a.length) {
|
|
19
|
-
var key_1 = (_b = channel.code) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
20
|
-
if (key_1)
|
|
21
|
-
dic[key_1] = [];
|
|
22
|
-
channel.sub.forEach(function (sub) {
|
|
23
|
-
dic[key_1].push(sub.address || '');
|
|
24
|
-
typeDic[sub.code] = sub.address || '';
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
var key = (_c = channel.code) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
29
|
-
if (key)
|
|
30
|
-
dic[key] = [channel.address || ''];
|
|
31
|
-
typeDic[key] = channel.address || '';
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
for (var key in dic) {
|
|
35
|
-
var values = dic[key];
|
|
36
|
-
var atLestOne = values.every(function (item) { return item === ''; });
|
|
37
|
-
if (atLestOne)
|
|
38
|
-
return "enter_at_least_one_".concat(key);
|
|
39
|
-
}
|
|
40
|
-
for (var key in typeDic) {
|
|
41
|
-
var value = typeDic[key];
|
|
42
|
-
if (key === 'website' && value && !value.match(REGEX_WEBSITE)) {
|
|
43
|
-
return 'invalid_url';
|
|
44
|
-
}
|
|
45
|
-
if (key === 'linkedin' && value && !value.match(LINKEDIN_URL)) {
|
|
46
|
-
return 'invalid_linkedin_profile_url';
|
|
47
|
-
}
|
|
48
|
-
if (key === 'facebook' && value && !value.match(SOCIAL_USERNAME)) {
|
|
49
|
-
return 'invalid_facebook_username';
|
|
50
|
-
}
|
|
51
|
-
if (key === 'instagram' && value && !value.match(SOCIAL_USERNAME)) {
|
|
52
|
-
return 'invalid_instagram_username';
|
|
53
|
-
}
|
|
54
|
-
if (key === 'twitter' && value && !value.match(SOCIAL_USERNAME)) {
|
|
55
|
-
return 'invalid_twitter_username';
|
|
56
|
-
}
|
|
57
|
-
if (key === 'physical_store' && value && value.length < 3) {
|
|
58
|
-
return 'invalid_physical_store_location';
|
|
59
|
-
}
|
|
60
|
-
if (key === 'ios' && value && !value.match(REGEX_ALPHANUMERIC)) {
|
|
61
|
-
return 'invalid_ios_app';
|
|
62
|
-
}
|
|
63
|
-
if (key === 'android' && value && !value.match(REGEX_ALPHANUMERIC)) {
|
|
64
|
-
return 'invalid_android_app';
|
|
65
|
-
}
|
|
66
|
-
if (key === 'call_center' && value && !value.match(DIGITS_ONLY)) {
|
|
67
|
-
return 'invalid_call_center_number';
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
};
|
|
72
|
-
export var MerchantValidationSchema = function (isNewBrand) {
|
|
73
|
-
if (isNewBrand === void 0) { isNewBrand = true; }
|
|
74
|
-
if (isNewBrand)
|
|
75
|
-
return yup.object().shape({
|
|
76
|
-
brandName: yup
|
|
77
|
-
.string()
|
|
78
|
-
.test({
|
|
79
|
-
test: function (value) {
|
|
80
|
-
if ((value === null || value === void 0 ? void 0 : value.length) === 0)
|
|
81
|
-
return true;
|
|
82
|
-
if (value && value.length >= 3 && (value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
|
|
83
|
-
return true;
|
|
84
|
-
return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
.required('enter_brand_name_english_chars_numbers_space'),
|
|
88
|
-
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
89
|
-
segment: yup.object().required('alert_choose_segment'),
|
|
90
|
-
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
91
|
-
salesChannels: yup
|
|
92
|
-
.array()
|
|
93
|
-
.min(1, 'choose_atleast_one_channel')
|
|
94
|
-
.of(yup.object().shape({
|
|
95
|
-
id: yup.string().required('choose_atleast_one_channel')
|
|
96
|
-
}))
|
|
97
|
-
.test({
|
|
98
|
-
test: function (value) {
|
|
99
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
100
|
-
if (length === 0)
|
|
101
|
-
return true;
|
|
102
|
-
var channels = __spreadArray([], (value || []), true);
|
|
103
|
-
var result = validationSalesChannels(channels);
|
|
104
|
-
if (result === true)
|
|
105
|
-
return true;
|
|
106
|
-
return this.createError({ message: result });
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
.required('choose_atleast_one_channel')
|
|
110
|
-
});
|
|
111
|
-
return yup.object().shape({
|
|
112
|
-
salesChannels: yup
|
|
113
|
-
.array()
|
|
114
|
-
.min(1, 'choose_atleast_one_channel')
|
|
115
|
-
.of(yup.object().shape({
|
|
116
|
-
id: yup.string().required('choose_atleast_one_channel')
|
|
117
|
-
}))
|
|
118
|
-
.test({
|
|
119
|
-
test: function (value) {
|
|
120
|
-
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
121
|
-
if (length === 0)
|
|
122
|
-
return true;
|
|
123
|
-
var channels = __spreadArray([], (value || []), true);
|
|
124
|
-
var result = validationSalesChannels(channels);
|
|
125
|
-
if (result === true)
|
|
126
|
-
return true;
|
|
127
|
-
return this.createError({ message: result });
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
.required('choose_atleast_one_channel'),
|
|
131
|
-
segment: yup.object().required('alert_choose_segment'),
|
|
132
|
-
teamSize: yup.object().required('alert_choose_teamSize')
|
|
133
|
-
});
|
|
134
|
-
};
|