@tap-payments/auth-jsconnect 1.0.51 → 1.0.54

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 (105) hide show
  1. package/build/@types/app.d.ts +3 -3
  2. package/build/@types/form.d.ts +23 -3
  3. package/build/api/data.d.ts +1 -1
  4. package/build/api/data.js +2 -2
  5. package/build/api/entity.d.ts +5 -2
  6. package/build/api/index.d.ts +4 -4
  7. package/build/api/lead.d.ts +1 -1
  8. package/build/app/rootReducer.d.ts +4 -0
  9. package/build/app/rootReducer.js +9 -1
  10. package/build/app/store.d.ts +8 -0
  11. package/build/assets/locales/ar.json +2 -1
  12. package/build/assets/locales/en.json +3 -2
  13. package/build/components/AnimationFlow/AnimationFlow.d.ts +3 -1
  14. package/build/components/AnimationFlow/AnimationFlow.js +9 -1
  15. package/build/components/AnimationFlow/Error.d.ts +6 -0
  16. package/build/components/AnimationFlow/Error.js +32 -0
  17. package/build/components/AnimationFlow/Loader.d.ts +2 -0
  18. package/build/components/AnimationFlow/Loader.js +16 -0
  19. package/build/components/Loader/Loader.d.ts +1 -0
  20. package/build/components/Loader/Loader.js +1 -1
  21. package/build/components/SimpleList/SimpleList.js +1 -0
  22. package/build/constants/app.d.ts +24 -0
  23. package/build/constants/app.js +61 -19
  24. package/build/constants/dummy.d.ts +2 -0
  25. package/build/constants/dummy.js +12 -6
  26. package/build/features/app/bank/bankStore.d.ts +36 -0
  27. package/build/features/app/bank/bankStore.js +218 -0
  28. package/build/features/app/business/businessStore.d.ts +2 -3
  29. package/build/features/app/business/businessStore.js +79 -85
  30. package/build/features/app/connect/connectStore.js +31 -30
  31. package/build/features/app/individual/individualStore.d.ts +36 -0
  32. package/build/features/app/individual/individualStore.js +222 -0
  33. package/build/features/app/password/passwordStore.d.ts +36 -0
  34. package/build/features/app/password/passwordStore.js +218 -0
  35. package/build/features/app/tax/taxStore.d.ts +38 -0
  36. package/build/features/app/tax/taxStore.js +271 -0
  37. package/build/features/bank/Bank.d.ts +2 -1
  38. package/build/features/bank/Bank.js +17 -7
  39. package/build/features/bank/screens/BankDetails/BankDetails.js +1 -2
  40. package/build/features/bank/screens/Verify/OTPInput.d.ts +5 -0
  41. package/build/features/bank/screens/Verify/OTPInput.js +42 -0
  42. package/build/features/bank/screens/Verify/Verify.d.ts +5 -0
  43. package/build/features/bank/screens/Verify/Verify.js +78 -0
  44. package/build/features/bank/screens/Verify/index.d.ts +2 -0
  45. package/build/features/bank/screens/Verify/index.js +2 -0
  46. package/build/features/bank/screens/Verify/validation.d.ts +8 -0
  47. package/build/features/bank/screens/Verify/validation.js +4 -0
  48. package/build/features/business/Business.js +2 -2
  49. package/build/features/business/screens/Activities/Activities.js +8 -8
  50. package/build/features/business/screens/Activities/ActivitiesList.js +7 -7
  51. package/build/features/business/screens/Activities/SalesChannels.js +1 -1
  52. package/build/features/business/screens/BusinessType/CRNumber.d.ts +2 -1
  53. package/build/features/business/screens/BusinessType/CRNumber.js +2 -2
  54. package/build/features/business/screens/BusinessType/CompanyLicense.js +2 -1
  55. package/build/features/business/screens/BusinessType/FLNumber.d.ts +2 -1
  56. package/build/features/business/screens/BusinessType/FLNumber.js +2 -2
  57. package/build/features/business/screens/BusinessType/FreelanceLicense.js +2 -1
  58. package/build/features/business/screens/Confirm/Confirm.js +1 -1
  59. package/build/features/business/screens/Customers/Customers.js +3 -3
  60. package/build/features/business/screens/Customers/ExpectedCustomers.js +3 -3
  61. package/build/features/connect/Connect.js +2 -2
  62. package/build/features/connect/screens/Merchant/BrandList.d.ts +0 -2
  63. package/build/features/connect/screens/Merchant/BrandList.js +16 -40
  64. package/build/features/connect/screens/Merchant/Merchant.js +42 -23
  65. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +2 -1
  66. package/build/features/connect/screens/Merchant/SocialMedia.js +30 -3
  67. package/build/features/connect/screens/Merchant/validation.d.ts +6 -1
  68. package/build/features/connect/screens/Merchant/validation.js +67 -7
  69. package/build/features/connect/screens/Mobile/MobileNumber.js +1 -1
  70. package/build/features/featuresScreens.js +20 -10
  71. package/build/features/individual/Individual.d.ts +2 -1
  72. package/build/features/individual/Individual.js +17 -9
  73. package/build/features/individual/screens/Verify/OTPInput.d.ts +5 -0
  74. package/build/features/individual/screens/Verify/OTPInput.js +42 -0
  75. package/build/features/individual/screens/Verify/Verify.d.ts +5 -0
  76. package/build/features/individual/screens/Verify/Verify.js +78 -0
  77. package/build/features/individual/screens/Verify/index.d.ts +2 -0
  78. package/build/features/individual/screens/Verify/index.js +2 -0
  79. package/build/features/individual/screens/Verify/validation.d.ts +8 -0
  80. package/build/features/individual/screens/Verify/validation.js +4 -0
  81. package/build/features/password/Password.d.ts +2 -1
  82. package/build/features/password/Password.js +17 -9
  83. package/build/features/password/screens/Verify/OTPInput.d.ts +5 -0
  84. package/build/features/password/screens/Verify/OTPInput.js +42 -0
  85. package/build/features/password/screens/Verify/Verify.d.ts +5 -0
  86. package/build/features/password/screens/Verify/Verify.js +78 -0
  87. package/build/features/password/screens/Verify/index.d.ts +2 -0
  88. package/build/features/password/screens/Verify/index.js +2 -0
  89. package/build/features/password/screens/Verify/validation.d.ts +8 -0
  90. package/build/features/password/screens/Verify/validation.js +4 -0
  91. package/build/features/tax/Tax.d.ts +2 -1
  92. package/build/features/tax/Tax.js +17 -9
  93. package/build/features/tax/screens/Success/Success.js +6 -0
  94. package/build/features/tax/screens/TaxDetails/TaxDetails.js +6 -7
  95. package/build/features/tax/screens/Verify/OTPInput.d.ts +5 -0
  96. package/build/features/tax/screens/Verify/OTPInput.js +42 -0
  97. package/build/features/tax/screens/Verify/Verify.d.ts +5 -0
  98. package/build/features/tax/screens/Verify/Verify.js +78 -0
  99. package/build/features/tax/screens/Verify/index.d.ts +2 -0
  100. package/build/features/tax/screens/Verify/index.js +2 -0
  101. package/build/features/tax/screens/Verify/validation.d.ts +8 -0
  102. package/build/features/tax/screens/Verify/validation.js +4 -0
  103. package/build/hooks/useAppDispatch.d.ts +4 -0
  104. package/build/utils/string.js +0 -1
  105. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,42 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import Box from '@mui/material/Box/Box';
15
+ import { styled } from '@mui/material/styles';
16
+ import OTPField from '../../../shared/OTP';
17
+ import { useController, useFormContext } from 'react-hook-form';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
+ var BoxStyled = styled(Box)(function (_a) {
21
+ var theme = _a.theme;
22
+ return ({
23
+ display: 'flex',
24
+ flexDirection: 'column',
25
+ fontFamily: theme.typography.fontFamily
26
+ });
27
+ });
28
+ var OTPInput = function (_a) {
29
+ var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
30
+ var t = useTranslation().t;
31
+ var otpControl = useController({ name: 'otp', control: control });
32
+ var handleOnOTPChange = function (otp) {
33
+ otpControl.field.onChange(otp);
34
+ };
35
+ var handleOnResendOTP = function () {
36
+ if (otpControl.field.value)
37
+ setValue('otp', '', { shouldValidate: true });
38
+ };
39
+ var otpValue = otpControl.field.value;
40
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
41
+ };
42
+ export default React.memo(OTPInput);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,78 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useAppDispatch } from '../../../../hooks';
15
+ import { useTranslation } from 'react-i18next';
16
+ import { useSelector } from 'react-redux';
17
+ import { useForm, FormProvider } from 'react-hook-form';
18
+ import { yupResolver } from '@hookform/resolvers/yup';
19
+ import Box from '@mui/material/Box/Box';
20
+ import { styled } from '@mui/material/styles';
21
+ import { handlePrevScreenStep } from '../../../../app/settings';
22
+ import { useLanguage } from '../../../../hooks';
23
+ import { maskPhone } from '../../../../utils';
24
+ import Form from '../../../../components/Form';
25
+ import Text from '../../../../components/Text';
26
+ import { ScreenContainer } from '../../../shared/Containers';
27
+ import { taxSelector, clearError, resetOTPScreen, verifyTaxLeadOTP } from '../../../app/tax/taxStore';
28
+ import Button from '../../../shared/Button';
29
+ import { OTPValidation } from './validation';
30
+ import OTPInput from './OTPInput';
31
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
32
+ var theme = _a.theme;
33
+ return ({
34
+ background: theme.palette.common.white,
35
+ border: '1px solid',
36
+ borderColor: theme.palette.divider,
37
+ direction: theme.direction,
38
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
39
+ marginBottom: theme.spacing(5.75)
40
+ });
41
+ });
42
+ var OTPTitleStyled = styled(Text)(function (_a) {
43
+ var theme = _a.theme;
44
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
45
+ });
46
+ var FormStyled = styled(Form)(function () { return ({
47
+ display: 'flex',
48
+ flexDirection: 'column'
49
+ }); });
50
+ var VerifyNumber = function (_a) {
51
+ var _b, _c, _d;
52
+ var dispatch = useAppDispatch();
53
+ var _e = useSelector(taxSelector), data = _e.data, loading = _e.loading, error = _e.error;
54
+ var methods = useForm({
55
+ resolver: yupResolver(OTPValidation),
56
+ defaultValues: data.otpData,
57
+ mode: 'onChange'
58
+ });
59
+ var t = useTranslation().t;
60
+ var isAr = useLanguage().isAr;
61
+ React.useEffect(function () {
62
+ if (error)
63
+ dispatch(clearError());
64
+ return function () {
65
+ dispatch(resetOTPScreen());
66
+ };
67
+ }, [methods.formState.isValid]);
68
+ var onSubmit = function (formData) {
69
+ dispatch(verifyTaxLeadOTP(formData));
70
+ };
71
+ var onBack = function () {
72
+ dispatch(handlePrevScreenStep());
73
+ };
74
+ var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
75
+ var disabled = !methods.formState.isValid || !!error || !phone;
76
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, type: 'submit', isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
+ };
78
+ export default React.memo(VerifyNumber);
@@ -0,0 +1,2 @@
1
+ import OTP from './Verify';
2
+ export default OTP;
@@ -0,0 +1,2 @@
1
+ import OTP from './Verify';
2
+ export default OTP;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var OTPValidation = yup.object().shape({
3
+ otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
+ });
@@ -2,4 +2,8 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
2
2
  settings: import("../app/settings").SettingsState;
3
3
  connect: import("../features/app/connect/connectStore").ConnectState;
4
4
  business: import("../features/app/business/businessStore").BusinessState;
5
+ bank: import("../features/app/bank/bankStore").BankState;
6
+ tax: import("../features/app/tax/taxStore").TaxState;
7
+ individual: import("../features/app/individual/individualStore").IndividualState;
8
+ password: import("../features/app/password/passwordStore").PasswordState;
5
9
  }, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
@@ -60,7 +60,6 @@ export var capitalizeTheFirstLetterOfEachWord = function (words) {
60
60
  return separateWord.join(' ');
61
61
  };
62
62
  export var getRequestHeaders = function (deviceInfo) {
63
- console.log(deviceInfo);
64
63
  var app = deviceInfo.app, browser = deviceInfo.browser, connection = deviceInfo.connection, device = deviceInfo.device, source = deviceInfo.source;
65
64
  return {
66
65
  al: encryptString(app.language || ''),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "1.0.51",
3
+ "version": "1.0.54",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",