@tap-payments/auth-jsconnect 2.8.95-development → 2.8.97-beta

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.
@@ -12,5 +12,5 @@ export interface DatePickerProps extends CalendarProps {
12
12
  isDob?: boolean;
13
13
  isVerified?: boolean;
14
14
  }
15
- declare const _default: React.MemoExoticComponent<({ open, disabled, dir, readOnly, onDateChange, onClick, onDatePicked, value, isDob, isVerified, ...rest }: DatePickerProps) => JSX.Element>;
15
+ declare const _default: React.MemoExoticComponent<({ open, disabled, dir, readOnly, onDateChange, onClick, onDatePicked, value, isDob, isVerified, minDate, maxDate, ...rest }: DatePickerProps) => JSX.Element>;
16
16
  export default _default;
@@ -71,7 +71,7 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
71
71
  });
72
72
  });
73
73
  var DatePicker = function (_a) {
74
- var _b = _a.open, open = _b === void 0 ? false : _b, disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, isDob = _a.isDob, isVerified = _a.isVerified, rest = __rest(_a, ["open", "disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value", "isDob", "isVerified"]);
74
+ var _b = _a.open, open = _b === void 0 ? false : _b, disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, isDob = _a.isDob, isVerified = _a.isVerified, minDate = _a.minDate, maxDate = _a.maxDate, rest = __rest(_a, ["open", "disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value", "isDob", "isVerified", "minDate", "maxDate"]);
75
75
  var _c = React.useState(), date = _c[0], setDate = _c[1];
76
76
  var _d = React.useState(null), anchor = _d[0], setAnchor = _d[1];
77
77
  var _e = React.useState(open), openCalender = _e[0], setOpenCalender = _e[1];
@@ -111,6 +111,6 @@ var DatePicker = function (_a) {
111
111
  return (_jsxs(Container, __assign({ openCalender: openCalender, disabled: disabled, id: 'arabic-container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? formateDate(date) : '', placeholder: DATE_FORMAT, onClick: function (e) {
112
112
  if (!disabled)
113
113
  toggleCalender(e);
114
- }, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: dir === 'rtl' ? arabic_ar : arabic_en, maxDate: rest.maxDate || defaultMax, minDate: defaultMin, format: DATE_FORMAT, onChange: handleOnDateChange, value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), className: 'custom-container' }, rest)), _jsx(Divider, {})] }))] })));
114
+ }, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: dir === 'rtl' ? arabic_ar : arabic_en, maxDate: maxDate || defaultMax, minDate: minDate || defaultMin, format: DATE_FORMAT, onChange: handleOnDateChange, value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), className: 'custom-container' }, rest)), _jsx(Divider, {})] }))] })));
115
115
  };
116
116
  export default memo(DatePicker);
@@ -13,5 +13,5 @@ export interface DatePickerProps extends CalendarProps {
13
13
  isDob?: boolean;
14
14
  isVerified?: boolean;
15
15
  }
16
- declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, open, ...rest }: DatePickerProps) => JSX.Element>;
16
+ declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, open, minDate, maxDate, ...rest }: DatePickerProps) => JSX.Element>;
17
17
  export default _default;
@@ -67,7 +67,7 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
67
67
  });
68
68
  });
69
69
  var DatePicker = function (_a) {
70
- var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, open = _a.open, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified", "open"]);
70
+ var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, open = _a.open, minDate = _a.minDate, maxDate = _a.maxDate, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified", "open", "minDate", "maxDate"]);
71
71
  var _b = useState(), date = _b[0], setDate = _b[1];
72
72
  var _c = React.useState(null), anchor = _c[0], setAnchor = _c[1];
73
73
  var _d = React.useState(open), openCalender = _d[0], setOpenCalender = _d[1];
@@ -106,6 +106,6 @@ var DatePicker = function (_a) {
106
106
  return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? convertToEnglishDateFormat(date) : '', placeholder: 'YYYY-MM-DD', onClick: function (e) {
107
107
  if (!disabled)
108
108
  toggleCalender(e);
109
- }, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate: rest.maxDate || defaultMax, minDate: rest.minDate || defaultMin })), _jsx(Divider, {})] }))] })));
109
+ }, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate: maxDate || defaultMax, minDate: minDate || defaultMin })), _jsx(Divider, {})] }))] })));
110
110
  };
111
111
  export default memo(DatePicker);
@@ -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) {
@@ -12,6 +12,7 @@ export declare const ENDPOINT_PATHS: {
12
12
  SANDBOX_BASE_URL: string;
13
13
  PRODUCTION_BASE_URL: string;
14
14
  DEV_BASE_URL: string;
15
+ BETA_BASE_URL: string;
15
16
  BUSINESS_COUNTRIES: string;
16
17
  COUNTRIES: string;
17
18
  IP: string;
@@ -1,6 +1,7 @@
1
1
  var SANDBOX_BASE_URL = 'https://connect-mw.sandbox.tap.company/middleware';
2
2
  var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
3
3
  var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
4
+ var BETA_BASE_URL = 'https://connect-mw.beta.tap.company/middleware';
4
5
  var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
5
6
  var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
6
7
  var CURRENCY_PATH = 'https://utilities.tap.company/api/v1/currency/iso';
@@ -69,6 +70,7 @@ export var ENDPOINT_PATHS = {
69
70
  SANDBOX_BASE_URL: SANDBOX_BASE_URL,
70
71
  PRODUCTION_BASE_URL: PRODUCTION_BASE_URL,
71
72
  DEV_BASE_URL: DEV_BASE_URL,
73
+ BETA_BASE_URL: BETA_BASE_URL,
72
74
  BUSINESS_COUNTRIES: API_BUSINESS_COUNTRIES,
73
75
  COUNTRIES: API_COUNTRIES,
74
76
  IP: IP_PATH,
@@ -1,5 +1,7 @@
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
+ export declare const CONNECT_BETA_URL = "https://connect.beta.tap.company";
3
5
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
4
6
  export declare const CLIENT_ORIGIN: string;
5
7
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -1,5 +1,7 @@
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
+ export var CONNECT_BETA_URL = 'https://connect.beta.tap.company';
3
5
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
4
6
  export var CLIENT_ORIGIN = window.location.origin;
5
7
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -395,7 +397,8 @@ export var BUSINESS_SCREENS_NAVIGATION = [
395
397
  'BUSINESS_ACTIVITIES_STEP',
396
398
  'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
397
399
  'BUSINESS_CIVIL_ID_STEP',
398
- 'BUSINESS_VERIFY_BRAND_INFO'
400
+ 'BUSINESS_VERIFY_BRAND_INFO',
401
+ 'BUSINESS_DOB_STEP'
399
402
  ],
400
403
  prev: '',
401
404
  order: 1
@@ -2,6 +2,7 @@ import { RootState } from '../../../app/store';
2
2
  import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams, DOBFormValues } from '../../../@types';
3
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  data: any;
5
+ verifyNextStepName: any;
5
6
  isicActivityList: any;
6
7
  leadData: any;
7
8
  token: string;
@@ -12,6 +13,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
12
13
  data: any;
13
14
  isRequireOTP: boolean;
14
15
  token: string;
16
+ verifyNextStepName: any;
15
17
  isicActivityList?: undefined;
16
18
  leadData?: undefined;
17
19
  brandData?: undefined;
@@ -19,9 +21,11 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
19
21
  }, string, {}>;
20
22
  export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
21
23
  data: any;
24
+ verifyNextStepName: any;
22
25
  }, void, {}>;
23
26
  export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
24
27
  data: any;
28
+ verifyNextStepName: any;
25
29
  isicActivityList: any;
26
30
  formData: {
27
31
  isNID: boolean;
@@ -100,6 +100,9 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
100
100
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && (isSA(countryIso2) || isOtherThanKWOrSA(countryIso2))) {
101
101
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
102
102
  }
103
+ if (data.step_name === COLLECT_DOB_INFO_NAFATH) {
104
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_DOB_STEP'));
105
+ }
103
106
  if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 19];
104
107
  _a = leadData || {}, steps = _a.steps, brand = _a.brand, board_id = _a.board_id, business_id = _a.business_id, entity = _a.entity;
105
108
  brandID = brand === null || brand === void 0 ? void 0 : brand.id;
@@ -165,13 +168,14 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
165
168
  _d.label = 19;
166
169
  case 19: return [2, {
167
170
  data: data,
171
+ verifyNextStepName: data.step_name,
168
172
  isicActivityList: isicActivityList,
169
173
  leadData: __assign(__assign({}, leadData), { flows: (boardData === null || boardData === void 0 ? void 0 : boardData.info) || [] }),
170
174
  token: token,
171
175
  brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
172
176
  boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id
173
177
  }];
174
- case 20: return [2, { data: data, isRequireOTP: true, token: token }];
178
+ case 20: return [2, { data: data, isRequireOTP: true, token: token, verifyNextStepName: data.step_name }];
175
179
  }
176
180
  });
177
181
  }); });
@@ -188,7 +192,7 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
188
192
  return [4, API.leadService.verifyLeadToken(payload)];
189
193
  case 1:
190
194
  data = (_a.sent()).data;
191
- return [2, { data: data }];
195
+ return [2, { data: data, verifyNextStepName: data.step_name }];
192
196
  }
193
197
  });
194
198
  }); });
@@ -248,11 +252,11 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
248
252
  case 6:
249
253
  if (!isNID) return [3, 7];
250
254
  thunkApi.dispatch(handleNextScreenStep());
251
- return [3, 22];
255
+ return [3, 23];
252
256
  case 7:
253
257
  if (!(isIdentityAuthStep && isKW(countryIso2))) return [3, 8];
254
258
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
255
- return [3, 22];
259
+ return [3, 23];
256
260
  case 8:
257
261
  if (!hasBusinessCompleted) return [3, 12];
258
262
  if (!board_id) return [3, 11];
@@ -266,44 +270,48 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
266
270
  _k.label = 11;
267
271
  case 11:
268
272
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP')); });
269
- return [3, 22];
273
+ return [3, 23];
270
274
  case 12:
271
275
  if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 13];
272
276
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP')); });
273
- return [3, 22];
277
+ return [3, 23];
274
278
  case 13:
275
- if (!hasBusinessCustomersCompleted) return [3, 14];
276
- sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP')); });
277
- return [3, 22];
279
+ if (!(data.step_name === COLLECT_DOB_INFO_NAFATH)) return [3, 14];
280
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_DOB_STEP')); });
281
+ return [3, 23];
278
282
  case 14:
279
- if (!hasBusinessCRActivitiesCompleted) return [3, 18];
280
- return [4, API.dataService.getActivitiesIsIc()];
283
+ if (!hasBusinessCustomersCompleted) return [3, 15];
284
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP')); });
285
+ return [3, 23];
281
286
  case 15:
287
+ if (!hasBusinessCRActivitiesCompleted) return [3, 19];
288
+ return [4, API.dataService.getActivitiesIsIc()];
289
+ case 16:
282
290
  list = (_k.sent()).list;
283
291
  isicActivityList = list || [];
284
292
  return [4, thunkApi.dispatch(retrieveDataList())];
285
- case 16:
293
+ case 17:
286
294
  _k.sent();
287
295
  return [4, API.brandService.retrieveBrand(brandID)];
288
- case 17:
296
+ case 18:
289
297
  brandData = _k.sent();
290
298
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP')); });
291
- return [3, 22];
292
- case 18:
293
- if (!hasBusinessCRInfoCompleted) return [3, 21];
294
- return [4, API.dataService.getActivitiesIsIc()];
299
+ return [3, 23];
295
300
  case 19:
301
+ if (!hasBusinessCRInfoCompleted) return [3, 22];
302
+ return [4, API.dataService.getActivitiesIsIc()];
303
+ case 20:
296
304
  list = (_k.sent()).list;
297
305
  isicActivityList = list || [];
298
306
  return [4, API.brandService.retrieveBrand(brandID)];
299
- case 20:
307
+ case 21:
300
308
  brandData = _k.sent();
301
309
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP')); });
302
- return [3, 22];
303
- case 21:
310
+ return [3, 23];
311
+ case 22:
304
312
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP')); });
305
- _k.label = 22;
306
- case 22: return [2, { data: data, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
313
+ _k.label = 23;
314
+ case 23: return [2, { data: data, verifyNextStepName: data.step_name, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
307
315
  }
308
316
  });
309
317
  }); });
@@ -476,14 +484,14 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
476
484
  });
477
485
  }); });
478
486
  export var updateLeadDOB = createAsyncThunk('business/updateLeadDOB', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
479
- var _a, settings, business, stepName, lead_id, requestBody, data;
480
- var _b, _c;
481
- return __generator(this, function (_d) {
482
- switch (_d.label) {
487
+ var _a, settings, business, stepName, _b, lead_id, verifyNextStepName, requestBody, data;
488
+ var _c, _d, _e, _f;
489
+ return __generator(this, function (_g) {
490
+ switch (_g.label) {
483
491
  case 0:
484
492
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
485
493
  stepName = BUSINESS_STEP_NAMES.BUSINESS_DOB_INFO;
486
- lead_id = (business.data.verify.responseBody || {}).lead_id;
494
+ _b = business.data.verify.responseBody || {}, lead_id = _b.lead_id, verifyNextStepName = _b.verifyNextStepName;
487
495
  requestBody = {
488
496
  id: lead_id || '',
489
497
  date_of_birth: params.dob,
@@ -492,9 +500,19 @@ export var updateLeadDOB = createAsyncThunk('business/updateLeadDOB', function (
492
500
  };
493
501
  return [4, API.leadService.updateLead(requestBody)];
494
502
  case 1:
495
- data = _d.sent();
503
+ data = _g.sent();
504
+ if (!(verifyNextStepName === COLLECT_DOB_INFO_NAFATH)) return [3, 4];
505
+ return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: data.business_id, entityId: (_c = data.entity) === null || _c === void 0 ? void 0 : _c.id }))];
506
+ case 2:
507
+ _g.sent();
508
+ if (!isSA((_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2)) return [3, 4];
509
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
510
+ case 3:
511
+ _g.sent();
512
+ _g.label = 4;
513
+ case 4:
496
514
  thunkApi.dispatch(handleNextScreenStep());
497
- (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
515
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
498
516
  return [2, { data: data, formData: params }];
499
517
  }
500
518
  });
@@ -919,9 +937,9 @@ export var businessSlice = createSlice({
919
937
  var _a, _b, _c, _d, _e;
920
938
  state.error = null;
921
939
  state.customLoading = false;
922
- var _f = action.payload, data = _f.data, boardId = _f.boardId, brandData = _f.brandData, leadData = _f.leadData, token = _f.token, isRequireOTP = _f.isRequireOTP, isicActivityList = _f.isicActivityList;
940
+ var _f = action.payload, data = _f.data, boardId = _f.boardId, brandData = _f.brandData, leadData = _f.leadData, token = _f.token, isRequireOTP = _f.isRequireOTP, isicActivityList = _f.isicActivityList, verifyNextStepName = _f.verifyNextStepName;
923
941
  var responseBody = state.data.verify.responseBody;
924
- state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id }), (brandData && { brand: brandData }));
942
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id, verifyNextStepName: verifyNextStepName }), (brandData && { brand: brandData }));
925
943
  var _g = leadData || {}, identification = _g.identification, date_of_birth = _g.date_of_birth;
926
944
  if (identification === null || identification === void 0 ? void 0 : identification.id)
927
945
  state.data.nidData.nid = identification.id;
@@ -965,13 +983,13 @@ export var businessSlice = createSlice({
965
983
  .addCase(resendOTP.fulfilled, function (state, action) {
966
984
  var _a;
967
985
  state.error = null;
968
- var data = action.payload.data;
986
+ var _b = action.payload, data = _b.data, verifyNextStepName = _b.verifyNextStepName;
969
987
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
970
988
  if (description) {
971
989
  state.error = description;
972
990
  return;
973
991
  }
974
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
992
+ state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { verifyNextStepName: verifyNextStepName });
975
993
  })
976
994
  .addCase(resendOTP.rejected, function (state, action) {
977
995
  state.error = action.error.message;
@@ -984,10 +1002,10 @@ export var businessSlice = createSlice({
984
1002
  var _a, _b, _c, _d, _e;
985
1003
  state.loading = false;
986
1004
  state.error = null;
987
- var _f = action.payload, data = _f.data, formData = _f.formData, brand = _f.brand, leadData = _f.leadData, isicActivityList = _f.isicActivityList;
1005
+ var _f = action.payload, data = _f.data, formData = _f.formData, brand = _f.brand, leadData = _f.leadData, isicActivityList = _f.isicActivityList, verifyNextStepName = _f.verifyNextStepName;
988
1006
  state.data.otpData = formData;
989
1007
  state.data.otpData.responseBody = data;
990
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
1008
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { verifyNextStepName: verifyNextStepName }), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
991
1009
  var _g = leadData || {}, identification = _g.identification, date_of_birth = _g.date_of_birth;
992
1010
  if (identification === null || identification === void 0 ? void 0 : identification.id)
993
1011
  state.data.nidData.nid = identification.id;
@@ -778,7 +778,7 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
778
778
  case 6:
779
779
  count++;
780
780
  return [3, 1];
781
- case 7: throw new Error('paci_verification_failed');
781
+ case 7: throw new Error('nafath_verification_failed');
782
782
  }
783
783
  });
784
784
  }); });
@@ -1175,6 +1175,7 @@ export var individualSlice = createSlice({
1175
1175
  state.data.individualData.isAuthorized = is_authorized;
1176
1176
  })
1177
1177
  .addCase(retrieveIndividualInfo.rejected, function (state, action) {
1178
+ state.addOrRequestDetailLoading = false;
1178
1179
  state.error = action.error.message;
1179
1180
  })
1180
1181
  .addCase(getIndividualList.pending, function (state) {
@@ -63,7 +63,7 @@ import Input from '../../../shared/Input';
63
63
  import { ScreenContainer } from '../../../shared/Containers';
64
64
  import { checkBrandNameAvailability, brandSelector } from '../../../app/brand/brandStore';
65
65
  import { EndAdornment } from '../../../shared/EndAdornment';
66
- import { removeAllOtherThanCharsNumbersAndSpace, removeLeadingSpace } from '../../../../utils';
66
+ import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
67
67
  import { BRAND_NAME_MAX_LENGTH } from '../../../../constants';
68
68
  var LabelContainerStyled = styled(Box)(function (_a) {
69
69
  var theme = _a.theme;
@@ -123,7 +123,7 @@ var BrandName = function (_a) {
123
123
  }); }, 500);
124
124
  var handleBrandNameChange = function (_a) {
125
125
  var target = _a.target;
126
- var value = removeLeadingSpace(removeAllOtherThanCharsNumbersAndSpace(target.value));
126
+ var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
127
127
  brandControl.field.onChange(value);
128
128
  };
129
129
  React.useEffect(function () {
@@ -22,6 +22,7 @@ import Button from '../../../shared/Button';
22
22
  import { ScreenContainer } from '../../../shared/Containers';
23
23
  import { businessSelector, clearError, updateLeadDOB } from '../../../app/business/businessStore';
24
24
  import Collapse from '../../../../components/Collapse';
25
+ import { COLLECT_DOB_INFO_NAFATH } from '../../../../constants';
25
26
  import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
26
27
  import { DOBValidationSchema } from './validation';
27
28
  import DOB from './DOB';
@@ -30,11 +31,12 @@ var FormStyled = styled(Form)(function () { return ({
30
31
  flexDirection: 'column'
31
32
  }); });
32
33
  var DOBForm = function (_a) {
33
- var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
34
+ var _b;
35
+ var _c = React.useState(false), collapse = _c[0], setCollapse = _c[1];
34
36
  var isAr = useLanguage().isAr;
35
37
  var dispatch = useAppDispatch();
36
38
  var t = useTranslation().t;
37
- var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
39
+ var _d = useAppSelector(businessSelector), data = _d.data, loading = _d.loading, error = _d.error;
38
40
  var settingsData = useAppSelector(settingsSelector).data;
39
41
  var methods = useForm({
40
42
  resolver: yupResolver(DOBValidationSchema),
@@ -64,6 +66,7 @@ var DOBForm = function (_a) {
64
66
  dispatch(handlePrevScreenStep());
65
67
  };
66
68
  var disabled = !methods.formState.isValid;
67
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ sx: { mt: 10 }, loading: loading, onBackClicked: onBack, isAr: isAr, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
69
+ var disableBack = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verifyNextStepName) === COLLECT_DOB_INFO_NAFATH;
70
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ sx: { mt: 10 }, loading: loading, disableBack: disableBack, onBackClicked: onBack, isAr: isAr, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
68
71
  };
69
72
  export default React.memo(DOBForm);
@@ -63,7 +63,7 @@ import { checkBrandNameAvailability, connectSelector } from '../../../app/connec
63
63
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
64
64
  import { debounce } from 'lodash-es';
65
65
  import { EndAdornment } from '../../../shared/EndAdornment';
66
- import { removeAllOtherThanCharsNumbersAndSpace, removeLeadingSpace } from '../../../../utils';
66
+ import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
67
67
  import { BRAND_NAME_MAX_LENGTH } from '../../../../constants';
68
68
  var LabelContainerStyled = styled(Box)(function (_a) {
69
69
  var theme = _a.theme;
@@ -121,7 +121,7 @@ var BrandName = function (_a) {
121
121
  }); }, 500);
122
122
  var handleBrandNameChange = function (_a) {
123
123
  var target = _a.target;
124
- var value = removeLeadingSpace(removeAllOtherThanCharsNumbersAndSpace(target.value));
124
+ var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
125
125
  brandControl.field.onChange(value);
126
126
  };
127
127
  React.useEffect(function () {
@@ -63,7 +63,7 @@ import Input from '../../../shared/Input';
63
63
  import { EndAdornment } from '../../../shared/EndAdornment';
64
64
  import { ScreenContainer } from '../../../shared/Containers';
65
65
  import { checkBrandNameAvailabilityAsync, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
66
- import { removeAllOtherThanCharsNumbersAndSpace, removeLeadingSpace } from '../../../../utils';
66
+ import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
67
67
  import { BRAND_NAME_MAX_LENGTH } from '../../../../constants';
68
68
  var LabelContainerStyled = styled(Box)(function (_a) {
69
69
  var theme = _a.theme;
@@ -121,7 +121,7 @@ var BrandName = function (_a) {
121
121
  }); }, 500);
122
122
  var handleBrandNameChange = function (_a) {
123
123
  var target = _a.target;
124
- var value = removeLeadingSpace(removeAllOtherThanCharsNumbersAndSpace(target.value));
124
+ var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
125
125
  brandControl.field.onChange(value);
126
126
  };
127
127
  React.useEffect(function () {
@@ -8,6 +8,7 @@ interface CustomCalenderProps extends CalendarProps {
8
8
  disabled?: boolean;
9
9
  isVerified?: boolean;
10
10
  maxDate?: Date;
11
+ minDate?: Date;
11
12
  }
12
- declare const CustomCalender: ({ onDateClicked, onDateChange, defaultValue, isDob, disabled, isVerified, maxDate }: CustomCalenderProps) => JSX.Element;
13
+ declare const CustomCalender: ({ onDateClicked, onDateChange, defaultValue, isDob, disabled, isVerified, maxDate, minDate }: CustomCalenderProps) => JSX.Element;
13
14
  export default CustomCalender;
@@ -29,7 +29,7 @@ var SwitchBoxStyled = styled(Box)(function (_a) {
29
29
  } }));
30
30
  });
31
31
  var CustomCalender = function (_a) {
32
- var onDateClicked = _a.onDateClicked, onDateChange = _a.onDateChange, defaultValue = _a.defaultValue, isDob = _a.isDob, disabled = _a.disabled, isVerified = _a.isVerified, maxDate = _a.maxDate;
32
+ var onDateClicked = _a.onDateClicked, onDateChange = _a.onDateChange, defaultValue = _a.defaultValue, isDob = _a.isDob, disabled = _a.disabled, isVerified = _a.isVerified, maxDate = _a.maxDate, minDate = _a.minDate;
33
33
  var t = useTranslation().t;
34
34
  var theme = useTheme();
35
35
  var data = useAppSelector(settingsSelector).data;
@@ -39,13 +39,13 @@ var CustomCalender = function (_a) {
39
39
  var onSwitchCalender = function () {
40
40
  dispatch(handleSwitchCalender(!isHijriCalender));
41
41
  };
42
- return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !isHijriCalender }, { children: _jsx(DatePicker, { open: open, defaultValue: defaultValue, readOnly: true, disabled: disabled, isVerified: isVerified, dir: 'ltr', locale: 'en', isDob: isDob, maxDate: maxDate, onDateChange: onDateChange, onClick: function () {
42
+ return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !isHijriCalender }, { children: _jsx(DatePicker, { open: open, defaultValue: defaultValue, readOnly: true, disabled: disabled, isVerified: isVerified, dir: 'ltr', locale: 'en', isDob: isDob, maxDate: maxDate, minDate: minDate, onDateChange: onDateChange, onClick: function () {
43
43
  onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true);
44
44
  setOpen(true);
45
45
  }, onDatePicked: function () {
46
46
  onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false);
47
47
  setOpen(false);
48
- } }) })), _jsx(Collapse, __assign({ in: isHijriCalender }, { children: _jsx(ArabicDatePicker, { open: open, readOnly: true, disabled: disabled, isVerified: isVerified, dir: theme.direction, isDob: isDob, maxDate: maxDate, onClick: function () {
48
+ } }) })), _jsx(Collapse, __assign({ in: isHijriCalender }, { children: _jsx(ArabicDatePicker, { open: open, readOnly: true, disabled: disabled, isVerified: isVerified, dir: theme.direction, isDob: isDob, maxDate: maxDate, minDate: minDate, onClick: function () {
49
49
  onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true);
50
50
  setOpen(true);
51
51
  }, onDatePicked: function () {
@@ -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_BETA_URL } from '../constants';
3
3
  import { objectHasValues } from './object';
4
4
  export var sleep = function (milliseconds) {
5
5
  if (milliseconds === void 0) { milliseconds = 1000; }
@@ -14,10 +14,10 @@ export var dangerousMessage = function (message, callBack) {
14
14
  export var setBaseUrl = function (publicKey) {
15
15
  var isProd = publicKey.includes('pk_live');
16
16
  if (isProd) {
17
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
17
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
18
18
  return;
19
19
  }
20
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
20
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
21
21
  };
22
22
  export var updateLocationUrlWithCountry = function (countryIso2) {
23
23
  var country = countryIso2.toLowerCase();
@@ -36,7 +36,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
36
36
  window.history.replaceState({}, '', newUrl);
37
37
  };
38
38
  export var openConnect = function (pk, countryCode) {
39
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
39
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
40
40
  if (countryCode) {
41
41
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.95-development",
3
+ "version": "2.8.97-beta",
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 beta"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {