@tap-payments/auth-jsconnect 2.11.7-development → 2.11.7-sandbox

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.
@@ -137,6 +137,7 @@
137
137
  "capital_paid_hint": "00000",
138
138
  "capital_paid_input_label": "رأس المال المدفوع",
139
139
  "capital_paid_label": "رأس المال المدفوع ({{currency}})",
140
+ "capital_paid_input_label": "رأس المال المدفوع",
140
141
  "capital_paid_required": "Please Enter paid amount",
141
142
  "capital_share_count_hint": "00000",
142
143
  "capital_share_count_label": "عدد اسهم رأس المال",
@@ -144,6 +145,7 @@
144
145
  "capital_share_value_hint": "00000",
145
146
  "capital_share_value_input_label": "قيمة السهم",
146
147
  "capital_share_value_label": "قيمة السهم ({{currency}})",
148
+ "capital_share_value_input_label": "قيمة السهم",
147
149
  "capital_share_value_required": "Please Enter share value",
148
150
  "category": "الفئة",
149
151
  "category_name": "اسم الفئة",
@@ -284,6 +286,7 @@
284
286
  "expected_customers_to_serve": "عدد العملاء شهريا",
285
287
  "expected_sale_per_month": "البيع المتوقع في الشهر؟",
286
288
  "expected_sales_monthly": "البيع المتوقع في الشهر؟ ({{currency}})",
289
+ "expected_sale_per_month": "البيع المتوقع في الشهر؟",
287
290
  "expected_sales_yearly": "ما هي المبيعات المتوقعة لعملك شهريًا؟",
288
291
  "expected_served_monthly": "عدد العملاء شهريا",
289
292
  "expiry_date": "تاريخ الإنتهاء",
@@ -493,6 +496,7 @@
493
496
  "please_choose_is_authorized": "الرجاء التأكيد إذا كنت أنت المستخدم المصرح له",
494
497
  "please_choose_relative_pep": "هل أنت أو أحد أقاربك شخص مكشوف علنًا (PEP)",
495
498
  "please_enter_actual_income": "ما هو دخلك الشهري ({{currency}}) ؟ ",
499
+ "monthly_income": "ما هو دخلك الشهري؟ ",
496
500
  "please_enter_employer_name": "يرجى إدخال اسم منشأه العمل الخاص بك",
497
501
  "please_try_again_after_few_minutes": "يمكنك محاولة تسجيل الدخول مرة أخرى بعد {{minutes}} دقيقة",
498
502
  "powered_by": "بواسطة",
@@ -136,6 +136,7 @@
136
136
  "capital_paid_hint": "00000",
137
137
  "capital_paid_input_label": "Capital Paid",
138
138
  "capital_paid_label": "Capital Paid ({{currency}})",
139
+ "capital_paid_input_label": "Capital Paid",
139
140
  "capital_paid_required": "Please Enter paid amount",
140
141
  "capital_share_count_hint": "00000",
141
142
  "capital_share_count_label": "Capital Share Count",
@@ -143,6 +144,7 @@
143
144
  "capital_share_value_hint": "00000",
144
145
  "capital_share_value_input_label": "Capital Share Value",
145
146
  "capital_share_value_label": "Capital Share Value ({{currency}})",
147
+ "capital_share_value_input_label": "Capital Share Value",
146
148
  "capital_share_value_required": "Please Enter share value",
147
149
  "category": "Category",
148
150
  "category_name": "Category name",
@@ -292,6 +294,7 @@
292
294
  "expected_customers_to_serve": "Customers served per month",
293
295
  "expected_sale_per_month": "Expected sale per month?",
294
296
  "expected_sales_monthly": "Expected sale per month? ({{currency}})",
297
+ "expected_sale_per_month": "Expected sale per month?",
295
298
  "expected_sales_yearly": "What is the expected sales for your business per month?",
296
299
  "expected_served_monthly": "Customers served per month",
297
300
  "expiry_date": "Date of expiry",
@@ -509,6 +512,7 @@
509
512
  "please_choose_is_authorized": "Please tell us if you are the authorized user",
510
513
  "please_choose_relative_pep": "Are you or one of your relatives a Publicly Exposed Person (PEP)",
511
514
  "please_enter_actual_income": "Monthly income ({{currency}})",
515
+ "monthly_income": "Monthly income",
512
516
  "please_enter_employer_name": "Please enter the name of your employer",
513
517
  "please_try_again_after_few_minutes": "You can try to login again after {{minutes}} mins",
514
518
  "powered_by": "Powered by",
@@ -23,13 +23,13 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import { memo } from 'react';
25
25
  import { useTranslation } from 'react-i18next';
26
- import { alpha, styled } from '@mui/material/styles';
26
+ import { alpha, styled, useTheme } from '@mui/material/styles';
27
27
  import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
28
28
  import Card from '@mui/material/Card';
29
29
  import Box from '@mui/material/Box';
30
- import Typography from '@mui/material/Typography';
31
30
  import Icon from '../Icon';
32
31
  import Loader from '../Loader';
32
+ import TruncatedTooltipText from '../TruncatedTooltipText';
33
33
  var DeviceCardContainer = styled(Card, { shouldForwardProp: function (prop) { return !['showBorder'].includes(prop.toString()); } })(function (_a) {
34
34
  var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, background = _c.background, components = _c.components, showBorder = _a.showBorder;
35
35
  return (__assign({ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: spacing(2), borderRadius: spacing(0.5), boxShadow: 'none', width: '100%', backgroundColor: background.default, minHeight: spacing(14.125), position: 'relative' }, (showBorder && {
@@ -41,7 +41,8 @@ var DeviceDetails = styled(Box)(function (_a) {
41
41
  return ({
42
42
  display: 'flex',
43
43
  alignItems: 'center',
44
- gap: spacing(3.125)
44
+ gap: spacing(3.125),
45
+ width: '90%'
45
46
  });
46
47
  });
47
48
  var DeviceImage = styled(Icon)(function (_a) {
@@ -57,13 +58,10 @@ var DeviceInfo = styled(Box)(function (_a) {
57
58
  return ({
58
59
  display: 'flex',
59
60
  flexDirection: 'column',
60
- gap: spacing(1)
61
+ gap: spacing(1),
62
+ width: '80%'
61
63
  });
62
64
  });
63
- var DeviceTitle = styled(Typography)(function (_a) {
64
- var _b = _a.theme, typography = _b.typography, palette = _b.palette;
65
- return (__assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
66
- });
67
65
  var DeviceIdInfo = styled(Box)(function (_a) {
68
66
  var _b = _a.theme, typography = _b.typography, palette = _b.palette, spacing = _b.spacing;
69
67
  return (__assign(__assign({}, typography.caption_small), { color: alpha(palette.text.primary, 0.6), display: 'flex', flexDirection: 'column', gap: spacing(0.5) }));
@@ -90,6 +88,7 @@ var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
90
88
  export var DeviceCard = function (_a) {
91
89
  var image = _a.image, name = _a.name, deviceId = _a.deviceId, deviceIdLabel = _a.deviceIdLabel, isLinked = _a.isLinked, pairedWith = _a.pairedWith, onClick = _a.onClick, badge = _a.badge, border = _a.border, arrow = _a.arrow, loading = _a.loading, endAdornment = _a.endAdornment, rest = __rest(_a, ["image", "name", "deviceId", "deviceIdLabel", "isLinked", "pairedWith", "onClick", "badge", "border", "arrow", "loading", "endAdornment"]);
92
90
  var t = useTranslation().t;
91
+ var _b = useTheme(), typography = _b.typography, palette = _b.palette;
93
92
  var getEndComponent = function () {
94
93
  if (endAdornment)
95
94
  return endAdornment;
@@ -98,6 +97,6 @@ export var DeviceCard = function (_a) {
98
97
  if (arrow)
99
98
  return _jsx(ArrowIcon, {});
100
99
  };
101
- return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(DeviceTitle, { children: name }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId })] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
100
+ return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(TruncatedTooltipText, { text: name, style: __assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }) }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId })] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
102
101
  };
103
102
  export default memo(DeviceCard);
@@ -33,7 +33,7 @@ var StyledTooltip = styled(function (_a) {
33
33
  var _b;
34
34
  var theme = _a.theme;
35
35
  return (_b = {},
36
- _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }),
36
+ _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), zIndex: 2147483647 }),
37
37
  _b);
38
38
  });
39
39
  var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface TruncatedTooltipTextProps {
3
+ text: string;
4
+ style?: React.CSSProperties;
5
+ }
6
+ declare const TruncatedTooltipText: ({ text, style }: TruncatedTooltipTextProps) => JSX.Element;
7
+ export default TruncatedTooltipText;
@@ -0,0 +1,33 @@
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 { useRef, useState, useEffect } from 'react';
14
+ import Tooltip from '../Tooltip';
15
+ var TruncatedTooltipText = function (_a) {
16
+ var text = _a.text, style = _a.style;
17
+ var textRef = useRef(null);
18
+ var _b = useState(false), isTruncated = _b[0], setIsTruncated = _b[1];
19
+ var _c = useState(false), hasSpace = _c[0], setHasSpace = _c[1];
20
+ useEffect(function () {
21
+ if (text.includes(' ')) {
22
+ setHasSpace(true);
23
+ return;
24
+ }
25
+ var el = textRef === null || textRef === void 0 ? void 0 : textRef.current;
26
+ if (el) {
27
+ setIsTruncated(el.scrollWidth > el.clientWidth);
28
+ }
29
+ }, [text]);
30
+ var content = (_jsx("span", __assign({ ref: textRef, style: __assign({ whiteSpace: hasSpace ? 'break-spaces' : 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'block' }, style) }, { children: text })));
31
+ return isTruncated ? (_jsx(Tooltip, __assign({ title: text, placement: 'top' }, { children: content }))) : (content);
32
+ };
33
+ export default TruncatedTooltipText;
@@ -0,0 +1,2 @@
1
+ import TruncatedTooltipText from './TruncatedTooltipText';
2
+ export default TruncatedTooltipText;
@@ -0,0 +1,2 @@
1
+ import TruncatedTooltipText from './TruncatedTooltipText';
2
+ export default TruncatedTooltipText;
@@ -1,5 +1,6 @@
1
1
  import { ScreenStepNavigation, BusinessType, POSInfo, TerminalInfo } from '../@types';
2
2
  export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
3
+ export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
3
4
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
4
5
  export declare const CLIENT_ORIGIN: string;
5
6
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -1,6 +1,7 @@
1
1
  import { BusinessType } from '../@types';
2
2
  import { CONNECT_FLOWS } from './flows';
3
3
  export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
4
+ export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
4
5
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
5
6
  export var CLIENT_ORIGIN = window.location.origin;
6
7
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -255,7 +255,7 @@ export var unlinkTerminalDevice = createAsyncThunk('terminal/unlinkTerminalDevic
255
255
  _a = thunkApi.getState().terminal.data.terminalInfo.selectedTerminal, id = _a.id, device = _a.device;
256
256
  payload = {
257
257
  deviceId: id,
258
- initiator: 'terminal_device',
258
+ initiator: 'connect',
259
259
  device: {
260
260
  id: (device === null || device === void 0 ? void 0 : device.id) || ''
261
261
  }
@@ -54,12 +54,23 @@ var EntityName = function (_a) {
54
54
  var isCR = licenseType === BusinessType.CR;
55
55
  var _j = data.verify.responseBody || {}, entity = _j.entity, flows = _j.flows, entityTypes = _j.entityTypes;
56
56
  var _k = entity || {}, AOA_file = _k.AOA_file, id = _k.id, documents = _k.documents, data_status = _k.data_status, data_verification = _k.data_verification, legal_name = _k.legal_name, type = _k.type, license = _k.license;
57
+ var noneEditable = useDataNoneEditable(data_status, [
58
+ 'legal_name.en',
59
+ 'legal_name.ar',
60
+ 'type',
61
+ 'license.number',
62
+ 'license.additional_info',
63
+ 'license.issuing_date',
64
+ 'license.expiry_date',
65
+ 'documents',
66
+ 'AOA_file_id'
67
+ ]);
57
68
  var getSchema = function () {
58
69
  if (isSACountry)
59
- return EntityNameValidationSchema();
70
+ return EntityNameValidationSchema(noneEditable);
60
71
  if (isKWCountry)
61
- return EntityNameKWValidationSchema();
62
- return EntityNameOtherCountryValidationSchema();
72
+ return EntityNameKWValidationSchema(noneEditable);
73
+ return EntityNameOtherCountryValidationSchema(noneEditable);
63
74
  };
64
75
  var methods = useForm({
65
76
  resolver: yupResolver(getSchema()),
@@ -93,17 +104,6 @@ var EntityName = function (_a) {
93
104
  articleId: defaultArticleFile === null || defaultArticleFile === void 0 ? void 0 : defaultArticleFile.id
94
105
  }).isDirty;
95
106
  var originalReadOnly = useFormReadOnly(methods, { certificateId: defaultCertificateFiles, articleId: defaultArticleFile });
96
- var noneEditable = useDataNoneEditable(data_status, [
97
- 'legal_name.en',
98
- 'legal_name.ar',
99
- 'type',
100
- 'license.number',
101
- 'license.additional_info',
102
- 'license.issuing_date',
103
- 'license.expiry_date',
104
- 'documents',
105
- 'AOA_file_id'
106
- ]);
107
107
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
108
108
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
109
109
  var dataVerified = useDataVerified(data_verification, [
@@ -1,88 +1,90 @@
1
1
  import * as yup from 'yup';
2
- export declare const EntityNameValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
2
+ declare type NonEditableMap = Record<string, boolean>;
3
+ export declare const EntityNameValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
4
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
4
5
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
6
7
  licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
8
  unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
9
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
9
10
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
10
11
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
11
12
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
12
13
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
15
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
15
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
16
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
16
17
  licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
18
  unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
18
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
19
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
19
20
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
20
21
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
21
22
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
22
23
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
23
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
24
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
24
25
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
25
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
26
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
26
27
  licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
27
28
  unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
28
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
29
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
29
30
  expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
30
31
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
31
32
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
32
33
  }>>>;
33
- export declare const EntityNameKWValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
34
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
34
+ export declare const EntityNameKWValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
35
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
35
36
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
36
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
37
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
38
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
39
- expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
37
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
38
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
39
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
40
+ expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
40
41
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
41
42
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
42
43
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
43
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
44
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
44
45
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
45
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
46
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
47
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
48
- expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
46
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
47
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
48
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
49
+ expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
49
50
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
50
51
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
51
52
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
52
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
53
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
53
54
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
54
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
55
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
56
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
57
- expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
55
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
56
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
57
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
58
+ expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
58
59
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
59
60
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
60
61
  }>>>;
61
- export declare const EntityNameOtherCountryValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
62
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
62
+ export declare const EntityNameOtherCountryValidationSchema: (noneEditable: NonEditableMap) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
63
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
63
64
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
64
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
65
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
66
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
67
- expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
65
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
66
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
67
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
68
+ expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
68
69
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
69
70
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
70
71
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
71
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
72
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
72
73
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
73
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
74
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
75
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
76
- expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
74
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
75
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
76
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
77
+ expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
77
78
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
78
79
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
79
80
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
80
- legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
81
+ legalName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
81
82
  licenseType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
82
- entityType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
83
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
84
- issuingDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
85
- expiryDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
83
+ entityType: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
84
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
85
+ issuingDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
86
+ expiryDate: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
86
87
  certificateId: yup.ArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined, any[] | undefined>;
87
88
  articleId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
88
89
  }>>>;
90
+ export {};
@@ -1,63 +1,56 @@
1
1
  import * as yup from 'yup';
2
2
  import { BusinessType } from '../../../../@types';
3
3
  import { KW_MIN_LICENSE_LENGTH, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
4
- export var EntityNameValidationSchema = function () {
4
+ export var EntityNameValidationSchema = function (noneEditable) {
5
5
  return yup.object().shape({
6
- legalName: yup
7
- .string()
8
- .required('')
9
- .test({
10
- test: function (value) {
11
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
12
- if (length === 0)
13
- return true;
14
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
15
- }
16
- }),
6
+ legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
7
+ ? yup.string().optional()
8
+ : yup
9
+ .string()
10
+ .required('')
11
+ .test({
12
+ test: function (value) {
13
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
14
+ if (length === 0)
15
+ return true;
16
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
17
+ }
18
+ }),
17
19
  licenseType: yup.string().optional(),
18
- entityType: yup.string().required('entity_type_required'),
20
+ entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
19
21
  licenseNumber: yup.string().optional(),
20
- unifiedNumber: yup.string().test({
21
- name: 'unifiedNumber',
22
- message: '',
23
- test: function (value) {
24
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
25
- if (length >= UNIFIED_NUMBER_MIN_LENGTH)
26
- return true;
27
- if (length === 0)
28
- return this.createError({ message: '' });
29
- return this.createError({ message: 'unified_number_required' });
30
- }
31
- }),
32
- issuingDate: yup.string().required('choose_any_issuing_date'),
22
+ unifiedNumber: noneEditable['license.additional_info']
23
+ ? yup.string().optional()
24
+ : yup.string().when('licenseType', function (licenseType) {
25
+ var isCR = licenseType === BusinessType.CR;
26
+ if (!isCR) {
27
+ return yup.string().optional();
28
+ }
29
+ return yup
30
+ .string()
31
+ .required('')
32
+ .test({
33
+ test: function (value) {
34
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
35
+ if (length >= UNIFIED_NUMBER_MIN_LENGTH)
36
+ return true;
37
+ if (length === 0)
38
+ return this.createError({ message: '' });
39
+ return this.createError({ message: 'unified_number_required' });
40
+ }
41
+ });
42
+ }),
43
+ issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
33
44
  expiryDate: yup.string().optional(),
34
45
  certificateId: yup.array().optional(),
35
46
  articleId: yup.string().optional()
36
47
  });
37
48
  };
38
- export var EntityNameKWValidationSchema = function () {
49
+ export var EntityNameKWValidationSchema = function (noneEditable) {
39
50
  return yup.object().shape({
40
- legalName: yup
41
- .string()
42
- .required('')
43
- .test({
44
- test: function (value) {
45
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
46
- if (length === 0)
47
- return true;
48
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
49
- }
50
- }),
51
- licenseType: yup.string().optional(),
52
- entityType: yup.string().required('entity_type_required'),
53
- licenseNumber: yup
54
- .string()
55
- .when('licenseType', function (licenseType) {
56
- var isCR = licenseType === BusinessType.CR;
57
- if (!isCR) {
58
- return yup.string().optional();
59
- }
60
- return yup
51
+ legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
52
+ ? yup.string().optional()
53
+ : yup
61
54
  .string()
62
55
  .required('')
63
56
  .test({
@@ -65,37 +58,44 @@ export var EntityNameKWValidationSchema = function () {
65
58
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
66
59
  if (length === 0)
67
60
  return true;
68
- return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
61
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
62
+ }
63
+ }),
64
+ licenseType: yup.string().optional(),
65
+ entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
66
+ licenseNumber: noneEditable['license.number']
67
+ ? yup.string().optional()
68
+ : yup
69
+ .string()
70
+ .when('licenseType', function (licenseType) {
71
+ var isCR = licenseType === BusinessType.CR;
72
+ if (!isCR) {
73
+ return yup.string().optional();
69
74
  }
70
- });
71
- })
72
- .required(''),
73
- issuingDate: yup.string().required('choose_any_issuing_date'),
74
- expiryDate: yup.string().required('choose_any_expiry_date'),
75
+ return yup
76
+ .string()
77
+ .required('')
78
+ .test({
79
+ test: function (value) {
80
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
81
+ if (length === 0)
82
+ return true;
83
+ return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
84
+ }
85
+ });
86
+ })
87
+ .required(''),
88
+ issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
89
+ expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
75
90
  certificateId: yup.array().optional(),
76
91
  articleId: yup.string().optional()
77
92
  });
78
93
  };
79
- export var EntityNameOtherCountryValidationSchema = function () {
94
+ export var EntityNameOtherCountryValidationSchema = function (noneEditable) {
80
95
  return yup.object().shape({
81
- legalName: yup
82
- .string()
83
- .required('')
84
- .test({
85
- test: function (value) {
86
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
87
- if (length === 0)
88
- return true;
89
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
90
- }
91
- }),
92
- licenseType: yup.string().optional(),
93
- entityType: yup.string().required('entity_type_required'),
94
- licenseNumber: yup
95
- .string()
96
- .when('licenseType', function (licenseType) {
97
- var isCR = licenseType === BusinessType.CR;
98
- return yup
96
+ legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
97
+ ? yup.string().optional()
98
+ : yup
99
99
  .string()
100
100
  .required('')
101
101
  .test({
@@ -103,13 +103,32 @@ export var EntityNameOtherCountryValidationSchema = function () {
103
103
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
104
104
  if (length === 0)
105
105
  return true;
106
- return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: isCR ? 'cr_kw_max_length' : 'fl_max_length' });
106
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
107
107
  }
108
- });
109
- })
110
- .required(''),
111
- issuingDate: yup.string().required('choose_any_issuing_date'),
112
- expiryDate: yup.string().required('choose_any_expiry_date'),
108
+ }),
109
+ licenseType: yup.string().optional(),
110
+ entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
111
+ licenseNumber: noneEditable['license.number']
112
+ ? yup.string().optional()
113
+ : yup
114
+ .string()
115
+ .when('licenseType', function (licenseType) {
116
+ var isCR = licenseType === BusinessType.CR;
117
+ return yup
118
+ .string()
119
+ .required('')
120
+ .test({
121
+ test: function (value) {
122
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
123
+ if (length === 0)
124
+ return true;
125
+ return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: isCR ? 'cr_kw_max_length' : 'fl_max_length' });
126
+ }
127
+ });
128
+ })
129
+ .required(''),
130
+ issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
131
+ expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
113
132
  certificateId: yup.array().optional(),
114
133
  articleId: yup.string().optional()
115
134
  });
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
3
3
  import { objectHasValues } from './object';
4
4
  import { isDisasterRecoveryEnv, isSA } from './string';
5
5
  export var sleep = function (milliseconds) {
@@ -17,7 +17,7 @@ export var setBaseUrl = function (publicKey, region) {
17
17
  var isProd = publicKey.includes('pk_live');
18
18
  var _a = region.split('-'), country = _a[0], envType = _a[1];
19
19
  if (!isProd) {
20
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
20
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
21
21
  return;
22
22
  }
23
23
  if (isSA(country)) {
@@ -44,7 +44,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
44
44
  window.history.replaceState({}, '', newUrl);
45
45
  };
46
46
  export var openConnect = function (pk, countryCode) {
47
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
47
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
48
48
  if (countryCode) {
49
49
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.11.7-development",
3
+ "version": "2.11.7-sandbox",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -21,7 +21,7 @@
21
21
  "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
22
  "tsc:alias": "tsc-alias -p tsconfig.json",
23
23
  "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public --tag development"
24
+ "push": "npm publish --access public --tag sandbox"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {