@tap-payments/auth-jsconnect 1.0.59 → 1.0.60

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.
@@ -154,7 +154,7 @@ export var settingsSlice = createSlice({
154
154
  },
155
155
  handleActiveFlowScreens: function (state, action) {
156
156
  state.data.featureScreensNavigation = action.payload;
157
- state.data.activeScreen = action.payload[5];
157
+ state.data.activeScreen = action.payload[0];
158
158
  },
159
159
  handleSetAppConfig: function (state, action) {
160
160
  var _a = action.payload, appInfo = _a.appInfo, businessCountryCode = _a.businessCountryCode, language = _a.language, onError = _a.onError, onFlowCompleted = _a.onFlowCompleted, publicKey = _a.publicKey;
@@ -223,5 +223,13 @@
223
223
  "add_other_fl": "Add Freelance",
224
224
  "add_other_cr": "Add CR",
225
225
  "cr_number": "CR Number",
226
- "fl_number": "FL Number"
226
+ "fl_number": "FL Number",
227
+ "tax_flow_completed": "Tax",
228
+ "individual_flow_completed": "Individual",
229
+ "bank_flow_completed": "Bank",
230
+ "password_flow_completed": "Password",
231
+ "tax_flow_pending": "Tax",
232
+ "individual_flow_pending": "Individual",
233
+ "bank_flow_pending": "Bank",
234
+ "password_flow_pending": "Password"
227
235
  }
@@ -237,5 +237,13 @@
237
237
  "add_other_fl": "Add Freelance",
238
238
  "add_other_cr": "Add CR",
239
239
  "cr_number": "CR Number",
240
- "fl_number": "FL Number"
240
+ "fl_number": "FL Number",
241
+ "tax_flow_completed": "Tax",
242
+ "individual_flow_completed": "Individual",
243
+ "bank_flow_completed": "Bank",
244
+ "password_flow_completed": "Password",
245
+ "tax_flow_pending": "Tax",
246
+ "individual_flow_pending": "Individual",
247
+ "bank_flow_pending": "Bank",
248
+ "password_flow_pending": "Password"
241
249
  }
@@ -63,18 +63,18 @@ export var BUSINESS_SCREENS_NAVIGATION = [
63
63
  prev: 'BUSINESS_VERIFY_NUMBER_STEP',
64
64
  order: 2
65
65
  },
66
- {
67
- name: 'BUSINESS_OTP_STEP',
68
- next: 'BUSINESS_BUSINESS_TYPE_STEP',
69
- prev: 'BUSINESS_IDBOD_STEP',
70
- order: 3
71
- },
72
66
  {
73
67
  name: 'BUSINESS_BUSINESS_TYPE_STEP',
74
68
  next: 'BUSINESS_ACTIVITIES_STEP',
75
69
  prev: 'BUSINESS_IDBOD_STEP',
76
70
  order: 2
77
71
  },
72
+ {
73
+ name: 'BUSINESS_OTP_STEP',
74
+ next: 'BUSINESS_BUSINESS_TYPE_STEP',
75
+ prev: 'BUSINESS_IDBOD_STEP',
76
+ order: 3
77
+ },
78
78
  {
79
79
  name: 'BUSINESS_CONFIRM_STEP',
80
80
  next: 'BUSINESS_ACTIVITIES_STEP',
@@ -98,6 +98,12 @@ export var BUSINESS_SCREENS_NAVIGATION = [
98
98
  next: '',
99
99
  prev: 'BUSINESS_CUSTOMERS_STEP',
100
100
  order: 6
101
+ },
102
+ {
103
+ name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
104
+ next: '',
105
+ prev: '',
106
+ order: 6
101
107
  }
102
108
  ];
103
109
  export var INDIVIDUAL_SCREENS_NAVIGATION = [
@@ -37,4 +37,8 @@ export declare const ICONS_NAMES: {
37
37
  GMAIL_ICON: string;
38
38
  OUTLOOK_ICON: string;
39
39
  APPLE_MAIL_ICON: string;
40
+ TAX_ICON: string;
41
+ BANK_ICON: string;
42
+ INDIVIDUAL_ICON: string;
43
+ PASSWORD_ICON: string;
40
44
  };
@@ -35,6 +35,10 @@ export var ICONS_NAMES = {
35
35
  EMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/email.png',
36
36
  MOBILE_ICON: 'https://dash.b-cdn.net/icons/menu/mobile.svg',
37
37
  GMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/gmail-icon.svg',
38
- OUTLOOK_ICON: 'https://dash.b-cdn.net/icons/menu/outlook-mail.svg',
39
- APPLE_MAIL_ICON: 'https://dash.b-cdn.net/icons/menu/mail-ios.svg'
38
+ OUTLOOK_ICON: 'https://dash.b-cdn.net/icons/menu/outlook-icon.svg',
39
+ APPLE_MAIL_ICON: 'https://dash.b-cdn.net/icons/menu/apple-icon.svg',
40
+ TAX_ICON: 'https://email-templates.b-cdn.net/file.png',
41
+ BANK_ICON: 'https://email-templates.b-cdn.net/dollar_square.png',
42
+ INDIVIDUAL_ICON: 'https://email-templates.b-cdn.net/user.png',
43
+ PASSWORD_ICON: 'https://email-templates.b-cdn.net/lock_square.png'
40
44
  };
@@ -79,10 +79,9 @@ export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi
79
79
  });
80
80
  }); });
81
81
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
82
- var payload, data, leadResponse, steps, hasBusinessCompleted;
83
- var _a;
84
- return __generator(this, function (_b) {
85
- switch (_b.label) {
82
+ var payload, data, leadResponse;
83
+ return __generator(this, function (_a) {
84
+ switch (_a.label) {
86
85
  case 0:
87
86
  payload = {
88
87
  service_name: 'tap_email',
@@ -90,31 +89,25 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
90
89
  };
91
90
  return [4, API.leadService.verifyLeadToken(payload)];
92
91
  case 1:
93
- data = (_b.sent()).data;
92
+ data = (_a.sent()).data;
94
93
  leadResponse = undefined;
95
94
  if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
96
95
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
97
96
  case 2:
98
- leadResponse = _b.sent();
99
- steps = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.steps;
100
- hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
101
- if (hasBusinessCompleted) {
102
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SUCCESS_STEP'));
103
- return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
104
- }
97
+ leadResponse = _a.sent();
105
98
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
106
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_IDBOD_STEP'));
99
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
107
100
  }
108
101
  if (data.step_name === 'business_info') {
109
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_BUSINESS_TYPE_STEP'));
102
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
110
103
  }
111
- _b.label = 3;
104
+ _a.label = 3;
112
105
  case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
113
106
  }
114
107
  });
115
108
  }); });
116
109
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
117
- var _a, business, settings, isNID, responseBody, payload, data;
110
+ var _a, business, settings, isNID, responseBody, payload, data, steps, hasBusinessCompleted;
118
111
  var _b, _c, _d;
119
112
  return __generator(this, function (_e) {
120
113
  switch (_e.label) {
@@ -134,11 +127,16 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
134
127
  data = (_e.sent()).data;
135
128
  if (!data.errors) {
136
129
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
130
+ steps = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps) || [];
131
+ hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
137
132
  if (isNID) {
138
133
  thunkApi.dispatch(handleNextScreenStep());
139
134
  }
140
135
  else {
141
- if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
136
+ if (hasBusinessCompleted) {
137
+ thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
138
+ }
139
+ else if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
142
140
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
143
141
  }
144
142
  else {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,79 @@
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
+ import { memo } from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { styled } from '@mui/material/styles';
16
+ import Box from '@mui/material/Box';
17
+ import Text from '../../../../components/Text';
18
+ import Container from '../../../shared/Containers/ScreenContainer';
19
+ import { FlowsButtons } from '../../../shared/Button';
20
+ import { ICONS_NAMES } from '../../../../constants';
21
+ var TextContainerStyled = styled(Box)(function (_a) {
22
+ var _b;
23
+ var theme = _a.theme;
24
+ return (_b = {
25
+ background: theme.palette.common.white,
26
+ border: '1px solid',
27
+ width: '100%',
28
+ borderColor: theme.palette.divider,
29
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25)
30
+ },
31
+ _b[theme.breakpoints.up('sm')] = {
32
+ marginBottom: theme.spacing(7.5)
33
+ },
34
+ _b);
35
+ });
36
+ var TitleStyled = styled(Text)(function (_a) {
37
+ var theme = _a.theme;
38
+ return (__assign({ fontWeight: theme.typography.fontWeightRegular, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), lineHeight: 1.75, padding: '0px 20px' }, theme.typography.subtitle2));
39
+ });
40
+ var ContainerStyled = styled(Container)(function (_a) {
41
+ var theme = _a.theme;
42
+ return ({
43
+ justifyContent: 'space-between',
44
+ minHeight: theme.spacing(30),
45
+ alignItems: 'center'
46
+ });
47
+ });
48
+ var ButtonGroupStyled = styled(Box)(function (_a) {
49
+ var theme = _a.theme;
50
+ return ({
51
+ width: '100%'
52
+ });
53
+ });
54
+ var SuccessWithFlowButtons = function () {
55
+ var t = useTranslation().t;
56
+ return (_jsxs(ContainerStyled, { children: [_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [t('ide_successfully_verified_message'), " "] }) }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: [
57
+ {
58
+ title: t('tax_flow_completed'),
59
+ href: '#',
60
+ src: ICONS_NAMES.TAX_ICON
61
+ },
62
+ {
63
+ title: t('individual_flow_completed'),
64
+ href: '#',
65
+ src: ICONS_NAMES.INDIVIDUAL_ICON
66
+ },
67
+ {
68
+ title: t('bank_flow_completed'),
69
+ href: '#',
70
+ src: ICONS_NAMES.BANK_ICON
71
+ },
72
+ {
73
+ title: t('password_flow_completed'),
74
+ href: '#',
75
+ src: ICONS_NAMES.PASSWORD_ICON
76
+ }
77
+ ] }) })] }));
78
+ };
79
+ export default memo(SuccessWithFlowButtons);
@@ -0,0 +1,2 @@
1
+ import SuccessWithFlowButtons from './SuccessWithFlowButtons';
2
+ export default SuccessWithFlowButtons;
@@ -0,0 +1,2 @@
1
+ import SuccessWithFlowButtons from './SuccessWithFlowButtons';
2
+ export default SuccessWithFlowButtons;
@@ -11,6 +11,7 @@ import BusinessOTPPage from './business/screens/OTP';
11
11
  import BusinessTypePage from './business/screens/BusinessType';
12
12
  import ActivitiesPage from './business/screens/Activities';
13
13
  import SuccessPage from './business/screens/Success';
14
+ import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
14
15
  import PasswordVerifyPage from './password/screens/Verify';
15
16
  import CreatePasswordPage from './password/screens/CreatePassword';
16
17
  import SuccessPasswordPage from './password/screens/Success';
@@ -75,7 +76,8 @@ export var businessFeatureScreens = [
75
76
  name: 'BUSINESS_CUSTOMERS_STEP',
76
77
  element: CustomersPage
77
78
  },
78
- { name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage }
79
+ { name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage },
80
+ { name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP', element: SuccessWithFlowButtonsPage }
79
81
  ];
80
82
  export var passwordFeatureScreens = [
81
83
  {
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '../../../components/Button';
3
+ declare type buttonProps = {
4
+ title: string;
5
+ href: string;
6
+ src: string;
7
+ };
8
+ export interface EmailProvidersButtonsProps extends ButtonProps {
9
+ buttons: buttonProps[];
10
+ }
11
+ export default function FlowsButtons({ buttons }: EmailProvidersButtonsProps): JSX.Element;
12
+ export {};
@@ -0,0 +1,57 @@
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 Button from '../../../components/Button';
14
+ import { alpha, styled } from '@mui/material/styles';
15
+ import Box from '@mui/material/Box';
16
+ import Link from '@mui/material/Link';
17
+ var Image = styled('img')(function (_a) {
18
+ var theme = _a.theme;
19
+ return ({
20
+ width: theme.spacing(3),
21
+ height: theme.spacing(3),
22
+ fontSize: theme.spacing(3),
23
+ marginInlineStart: theme.spacing(1)
24
+ });
25
+ });
26
+ var ButtonBoxStyled = styled(Box)(function (_a) {
27
+ var theme = _a.theme;
28
+ return ({
29
+ margin: theme.spacing(0, 2.5, 2.5, 2.5)
30
+ });
31
+ });
32
+ var ButtonStyled = styled(Button)(function (_a) {
33
+ var theme = _a.theme;
34
+ return ({
35
+ width: '100%',
36
+ paddingInlineStart: theme.spacing(0.75),
37
+ backgroundColor: theme.palette.common.white,
38
+ border: "1px solid ".concat(theme.palette.primary.main),
39
+ color: theme.palette.primary.main,
40
+ '&:hover': {
41
+ backgroundColor: theme.palette.primary.main,
42
+ color: theme.palette.common.white
43
+ },
44
+ '&:disabled': {
45
+ backgroundColor: theme.palette.common.white,
46
+ color: alpha(theme.palette.primary.main, 0.3)
47
+ }
48
+ });
49
+ });
50
+ export default function FlowsButtons(_a) {
51
+ var buttons = _a.buttons;
52
+ return (_jsx(ButtonBoxStyled, { children: buttons.map(function (_a, index) {
53
+ var title = _a.title, href = _a.href, src = _a.src;
54
+ var isLast = index === buttons.length - 1;
55
+ return (_jsx(Link, __assign({ href: href, underline: 'none', target: '_blank' }, { children: _jsx(ButtonStyled, __assign({ sx: { mb: isLast ? 0 : 1.8 }, startIcon: _jsx(Image, { src: src, alt: title }), type: 'button' }, { children: title })) }), index));
56
+ }) }));
57
+ }
@@ -2,5 +2,6 @@ import Button from './Button';
2
2
  import AbsherButton from './AbsherButton';
3
3
  import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
- export { AbsherButton, MobileButton, EmailProvidersButton };
5
+ import FlowsButtons from './FlowsButtons';
6
+ export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons };
6
7
  export default Button;
@@ -2,5 +2,6 @@ import Button from './Button';
2
2
  import AbsherButton from './AbsherButton';
3
3
  import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
- export { AbsherButton, MobileButton, EmailProvidersButton };
5
+ import FlowsButtons from './FlowsButtons';
6
+ export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons };
6
7
  export default Button;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",