@tap-payments/auth-jsconnect 2.8.78-sandbox → 2.8.81-development

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.
@@ -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)), zIndex: 2147483647 }),
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)) }),
37
37
  _b);
38
38
  });
39
39
  var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
@@ -1,6 +1,5 @@
1
1
  import { ScreenStepNavigation, BusinessType } 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";
4
3
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
5
4
  export declare const CLIENT_ORIGIN: string;
6
5
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -1,6 +1,5 @@
1
1
  import { BusinessType } from '../@types';
2
2
  export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
3
- export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
4
3
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
5
4
  export var CLIENT_ORIGIN = window.location.origin;
6
5
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -308,14 +308,13 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
308
308
  });
309
309
  }); });
310
310
  export var verifyNafath = createAsyncThunk('business/verifyNafathParams', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
311
- var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
312
- var _c, _d, _e, _f;
313
- return __generator(this, function (_g) {
314
- switch (_g.label) {
311
+ var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess;
312
+ var _b, _c, _d, _e;
313
+ return __generator(this, function (_f) {
314
+ switch (_f.label) {
315
315
  case 0:
316
316
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
317
317
  responseBody = business.data.nidData.responseBody;
318
- _b = business.data.verify.responseBody || {}, business_id = _b.business_id, entity = _b.entity;
319
318
  expiry = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.expiry) || 120;
320
319
  interval = 5;
321
320
  maxCalls = Math.floor(expiry / interval);
@@ -323,28 +322,28 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
323
322
  return [2, { response: null }];
324
323
  }
325
324
  count = 1;
326
- _g.label = 1;
325
+ _f.label = 1;
327
326
  case 1:
328
327
  if (!(count <= maxCalls)) return [3, 8];
329
328
  return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
330
329
  case 2:
331
- data = _g.sent();
332
- isSuccess = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
330
+ data = _f.sent();
331
+ isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
333
332
  if (!isSuccess) return [3, 5];
334
- return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
333
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id }))];
335
334
  case 3:
336
- _g.sent();
337
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
338
- (_f = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _f === void 0 ? void 0 : _f.call(params);
335
+ _f.sent();
336
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
337
+ (_e = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params);
339
338
  return [4, sleep(3000)];
340
339
  case 4:
341
- _g.sent();
340
+ _f.sent();
342
341
  thunkApi.dispatch(handleNextScreenStep());
343
342
  return [2, { response: data }];
344
343
  case 5: return [4, sleep(interval * 1000)];
345
344
  case 6:
346
- _g.sent();
347
- _g.label = 7;
345
+ _f.sent();
346
+ _f.label = 7;
348
347
  case 7:
349
348
  count++;
350
349
  return [3, 1];
@@ -426,7 +425,7 @@ export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (p
426
425
  });
427
426
  }); });
428
427
  export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
429
- var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, dob, requestBody, data, business_id, entity, screen;
428
+ var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, requestBody, data, business_id, entity, screen;
430
429
  var _b, _c;
431
430
  return __generator(this, function (_d) {
432
431
  switch (_d.label) {
@@ -436,7 +435,6 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
436
435
  stepName = BUSINESS_STEP_NAMES.IDENTITY_AUTH;
437
436
  lead_id = (business.data.verify.responseBody || {}).lead_id;
438
437
  countryIso2 = settings.data.businessCountry.iso2;
439
- dob = dateFormat(new Date(params.dob));
440
438
  if (isOtherThanKWOrSA(countryIso2)) {
441
439
  identification_id_type = IDENTIFICATION_TYPE.NID;
442
440
  }
@@ -447,26 +445,21 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
447
445
  issued_country_code: countryIso2,
448
446
  type: identification_id_type
449
447
  },
450
- date_of_birth: dob,
451
448
  step_name: stepName,
452
- encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type', 'date_of_birth']
449
+ encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type']
453
450
  };
454
451
  return [4, API.leadService.updateLead(requestBody)];
455
452
  case 1:
456
453
  data = _d.sent();
457
454
  business_id = data.business_id, entity = data.entity;
458
455
  screen = 'BUSINESS_VERIFY_NAFATH_STEP';
459
- if (!isOtherThanKWOrSA(countryIso2)) return [3, 4];
456
+ if (!isOtherThanKWOrSA(countryIso2)) return [3, 3];
460
457
  screen = 'BUSINESS_BUSINESS_TYPE_STEP';
461
458
  return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
462
459
  case 2:
463
460
  _d.sent();
464
- if (!isSA(countryIso2)) return [3, 4];
465
- return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
461
+ _d.label = 3;
466
462
  case 3:
467
- _d.sent();
468
- _d.label = 4;
469
- case 4:
470
463
  thunkApi.dispatch(handleNextScreenStep(screen));
471
464
  (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
472
465
  return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }) }];
@@ -185,6 +185,8 @@ export declare const createCivilIDAuthIdentityAsync: import("@reduxjs/toolkit").
185
185
  }>;
186
186
  export declare const createNIDNafathAuthIdentityAsync: import("@reduxjs/toolkit").AsyncThunk<{
187
187
  response: {
188
+ random: any;
189
+ expiry: any;
188
190
  verify_token: any;
189
191
  };
190
192
  formData: NIDFormValues;
@@ -624,13 +624,13 @@ export var createCivilIDAuthIdentityAsync = createAsyncThunk('connectExpress/cre
624
624
  });
625
625
  }); });
626
626
  export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/createNIDNafathAuthIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
627
- var _a, settings, connectExpress, nid, dob, nidType, countryCode, authData, requestBody, data;
627
+ var _a, settings, connectExpress, nid, nidType, countryCode, authData, requestBody, data;
628
628
  var _b, _c, _d;
629
629
  return __generator(this, function (_e) {
630
630
  switch (_e.label) {
631
631
  case 0:
632
632
  _a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
633
- nid = params.nid, dob = params.dob;
633
+ nid = params.nid;
634
634
  nidType = IDENTIFICATION_TYPE.NAFATH;
635
635
  countryCode = settings.data.businessCountry.iso2;
636
636
  if (isOtherThanKWOrSA(countryCode)) {
@@ -644,10 +644,9 @@ export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/c
644
644
  issued_country_code: countryCode,
645
645
  type: nidType
646
646
  },
647
- date_of_birth: dob,
648
647
  country_code: countryCode,
649
648
  step_name: CONNECT_EXPRESS_STEP_NAMES.IDENTITY_AUTH,
650
- encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type', 'date_of_birth']
649
+ encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type']
651
650
  };
652
651
  return [4, API.leadService.updateLead(requestBody)];
653
652
  case 1:
@@ -664,7 +663,7 @@ export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/c
664
663
  _e.label = 4;
665
664
  case 4:
666
665
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody);
667
- return [2, { response: { verify_token: data.verify_token }, formData: params }];
666
+ return [2, { response: { random: data.random, expiry: data.expiry, verify_token: data.verify_token }, formData: params }];
668
667
  }
669
668
  });
670
669
  }); });
@@ -691,7 +690,7 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
691
690
  data = _d.sent();
692
691
  isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
693
692
  if (!isSuccess) return [3, 4];
694
- return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
693
+ return [4, thunkApi.dispatch(getLeadByIdAsync(data.auth.lead_id)).unwrap()];
695
694
  case 3:
696
695
  _d.sent();
697
696
  needToCollectMoreInfo = data.step_name === 'collect_info';
@@ -21,21 +21,18 @@ import Form from '../../../../components/Form';
21
21
  import Button from '../../../shared/Button';
22
22
  import { ScreenContainer } from '../../../shared/Containers';
23
23
  import { businessSelector, clearError, updateLeadIdentity } from '../../../app/business/businessStore';
24
- import Collapse from '../../../../components/Collapse';
25
24
  import { deepCopy, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
26
25
  import { NIDOtherCountryValidationSchema, NIDValidationSchema } from './validation';
27
26
  import ID from './ID';
28
- import DOB from './DOB';
29
27
  var FormStyled = styled(Form)(function () { return ({
30
28
  display: 'flex',
31
29
  flexDirection: 'column'
32
30
  }); });
33
31
  var IDBOD = function (_a) {
34
- var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
35
32
  var isAr = useLanguage().isAr;
36
33
  var dispatch = useAppDispatch();
37
34
  var t = useTranslation().t;
38
- var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
35
+ var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
39
36
  var settingsData = useAppSelector(settingsSelector).data;
40
37
  var isOtherCountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
41
38
  var methods = useForm({
@@ -59,10 +56,7 @@ var IDBOD = function (_a) {
59
56
  var onSubmit = function (data) {
60
57
  dispatch(updateLeadIdentity(deepCopy(data)));
61
58
  };
62
- var handleCollapseOpenClose = function (flag) {
63
- setCollapse(flag);
64
- };
65
59
  var disabled = !methods.formState.isValid;
66
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ID, {}) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, disableBack: true, isAr: isAr, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
60
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ID, {}), _jsx(Button, __assign({ sx: { mt: 10 }, loading: loading, disableBack: true, isAr: isAr, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
67
61
  };
68
62
  export default React.memo(IDBOD);
@@ -1,21 +1,15 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
3
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
4
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
5
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
6
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
7
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
8
  }>>>;
12
9
  export declare const NIDOtherCountryValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
10
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
15
11
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
16
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
17
12
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
13
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
19
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
20
14
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
21
15
  }>>>;
@@ -1,6 +1,5 @@
1
1
  import * as yup from 'yup';
2
2
  export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('enter_valid_birth_date'),
4
3
  nid: yup
5
4
  .string()
6
5
  .matches(/^(1|2)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
@@ -8,6 +7,5 @@ export var NIDValidationSchema = yup.object().shape({
8
7
  .required('signup_invalid_national_id')
9
8
  });
10
9
  export var NIDOtherCountryValidationSchema = yup.object().shape({
11
- dob: yup.string().min(5).required('enter_valid_birth_date'),
12
10
  nid: yup.string().min(3, 'signup_invalid_national_id').required('signup_invalid_national_id')
13
11
  });
@@ -22,21 +22,18 @@ import { clearError, connectExpressSelector, createNIDNafathAuthIdentityAsync }
22
22
  import Form from '../../../../components/Form';
23
23
  import Button from '../../../shared/Button';
24
24
  import { ScreenContainer } from '../../../shared/Containers';
25
- import Collapse from '../../../../components/Collapse';
26
25
  import IDNumber from './IDNumber';
27
- import DOB from './DOB';
28
26
  import { deepCopy, isOtherThanKWOrSA } from '../../../../utils';
29
27
  var FormStyled = styled(Form)(function () { return ({
30
28
  display: 'flex',
31
29
  flexDirection: 'column'
32
30
  }); });
33
31
  var NID = function (_a) {
34
- var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
35
32
  var isAr = useLanguage().isAr;
36
33
  var dispatch = useAppDispatch();
37
34
  var t = useTranslation().t;
38
35
  var settingsData = useAppSelector(settingsSelector).data;
39
- var _c = useAppSelector(connectExpressSelector), data = _c.data, loading = _c.loading, error = _c.error;
36
+ var _b = useAppSelector(connectExpressSelector), data = _b.data, loading = _b.loading, error = _b.error;
40
37
  var isOtherCountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
41
38
  var methods = useForm({
42
39
  resolver: yupResolver(isOtherCountry ? NIDOtherCountryValidationSchema : NIDValidationSchema),
@@ -50,13 +47,10 @@ var NID = function (_a) {
50
47
  var onSubmit = function (data) {
51
48
  dispatch(createNIDNafathAuthIdentityAsync(deepCopy(data)));
52
49
  };
53
- var handleCollapseOpenClose = function (flag) {
54
- setCollapse(flag);
55
- };
56
50
  var onBack = function () {
57
51
  dispatch(handlePrevScreenStep());
58
52
  };
59
53
  var disabled = !methods.formState.isValid;
60
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
54
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { show: true }), _jsx(Button, __assign({ sx: { mt: 10 }, loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
61
55
  };
62
56
  export default React.memo(NID);
@@ -1,21 +1,15 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
3
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
4
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
5
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
6
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
7
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
8
  }>>>;
12
9
  export declare const NIDOtherCountryValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
10
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
15
11
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
16
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
17
12
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
13
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
19
- dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
20
14
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
21
15
  }>>>;
@@ -1,6 +1,5 @@
1
1
  import * as yup from 'yup';
2
2
  export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('enter_valid_birth_date'),
4
3
  nid: yup
5
4
  .string()
6
5
  .matches(/^(1|2)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
@@ -8,6 +7,5 @@ export var NIDValidationSchema = yup.object().shape({
8
7
  .required('signup_invalid_national_id')
9
8
  });
10
9
  export var NIDOtherCountryValidationSchema = yup.object().shape({
11
- dob: yup.string().min(5).required('enter_valid_birth_date'),
12
10
  nid: yup.string().min(3, 'signup_invalid_national_id').required('signup_invalid_national_id')
13
11
  });
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
3
3
  export var sleep = function (milliseconds) {
4
4
  if (milliseconds === void 0) { milliseconds = 1000; }
5
5
  return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
@@ -16,7 +16,7 @@ export var setBaseUrl = function (publicKey) {
16
16
  axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
17
17
  return;
18
18
  }
19
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
19
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
20
20
  };
21
21
  export var updateLocationUrlWithCountry = function (countryIso2) {
22
22
  var country = countryIso2.toLowerCase();
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
35
35
  window.history.replaceState({}, '', newUrl);
36
36
  };
37
37
  export var openConnect = function (pk, countryCode) {
38
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
38
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
39
39
  if (countryCode) {
40
40
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.78-sandbox",
3
+ "version": "2.8.81-development",
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 sandbox"
24
+ "push": "npm publish --access public --tag development"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- interface BODProps {
3
- onDateClicked?: (flag: boolean) => void;
4
- }
5
- declare const _default: React.MemoExoticComponent<({ onDateClicked }: BODProps) => import("react/jsx-runtime").JSX.Element>;
6
- export default _default;
@@ -1,45 +0,0 @@
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 { useTranslation } from 'react-i18next';
15
- import { useController, useFormContext } from 'react-hook-form';
16
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
- import { styled, alpha } from '@mui/material/styles';
18
- import Text from '../../../../components/Text';
19
- import { ScreenContainer } from '../../../shared/Containers';
20
- import Calender from '../../../shared/Calender';
21
- import { businessSelector, clearError } from '../../../app/business/businessStore';
22
- var InputLabelStyled = styled(Text)(function (_a) {
23
- var theme = _a.theme;
24
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption), { cursor: 'pointer' }));
25
- });
26
- var BOD = function (_a) {
27
- var _b;
28
- var onDateClicked = _a.onDateClicked;
29
- var t = useTranslation().t;
30
- var control = useFormContext().control;
31
- var dispatch = useAppDispatch();
32
- var dobControl = useController({ control: control, name: 'dob' });
33
- var error = useAppSelector(businessSelector).error;
34
- var handleBirthDateChange = function (data) {
35
- if (error)
36
- dispatch(clearError());
37
- dobControl.field.onChange(data);
38
- };
39
- var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
40
- return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
41
- var spacing = _a.spacing;
42
- return spacing(2.5, 2.5, 1.5, 2.5);
43
- } } }, { children: t('enter_birth_date') })), _jsx(Calender, { isDob: true, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleBirthDateChange })] }));
44
- };
45
- export default React.memo(BOD);
@@ -1,5 +0,0 @@
1
- interface DOBProps {
2
- onDateClicked?: (flag: boolean) => void;
3
- }
4
- declare const DOB: ({ onDateClicked }: DOBProps) => import("react/jsx-runtime").JSX.Element;
5
- export default DOB;
@@ -1,47 +0,0 @@
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 { useTranslation } from 'react-i18next';
14
- import { useController, useFormContext } from 'react-hook-form';
15
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
16
- import { ScreenContainer } from '../../../shared/Containers';
17
- import { alpha, styled } from '@mui/material/styles';
18
- import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
19
- import Text from '../../../../components/Text';
20
- import Calender from '../../../shared/Calender';
21
- var InputLabelStyled = styled(Text)(function (_a) {
22
- var theme = _a.theme;
23
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
24
- });
25
- var DOB = function (_a) {
26
- var _b;
27
- var onDateClicked = _a.onDateClicked;
28
- var t = useTranslation().t;
29
- var control = useFormContext().control;
30
- var dispatch = useAppDispatch();
31
- var dobControl = useController({ control: control, name: 'dob' });
32
- var error = useAppSelector(connectExpressSelector).error;
33
- var handleBirthDateChange = function (data) {
34
- dobControl.field.onChange(data);
35
- handleClearError();
36
- };
37
- var handleClearError = function () {
38
- if (error)
39
- dispatch(clearError());
40
- };
41
- var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
42
- return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
43
- var spacing = _a.spacing;
44
- return spacing(2.5, 2.5, 1.5, 2.5);
45
- } } }, { children: t('enter_birth_date') })), _jsx(Calender, { isDob: true, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleBirthDateChange })] }));
46
- };
47
- export default DOB;