@tap-payments/auth-jsconnect 2.8.2-test → 2.8.10-test

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.
@@ -417,7 +417,7 @@ export var createCivilIdAuthAsync = createAsyncThunk('connectExpress/createCivil
417
417
  });
418
418
  }); });
419
419
  export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
420
- var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, payload, data, authId, urlQueryStart, _e, brandList, entityList, isKuwait, next;
420
+ var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, payload, data, authId, urlQueryStart, _e, brandList, entityList, isKuwait, next;
421
421
  var _f, _g;
422
422
  return __generator(this, function (_h) {
423
423
  switch (_h.label) {
@@ -431,6 +431,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
431
431
  isScopeAuthentication = scope === SCOPE_AUTH;
432
432
  bi = settings.data.deviceInfo.browser.browser_id;
433
433
  isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
434
+ authDataHasValue = authData === null || authData === void 0 ? void 0 : authData.length;
434
435
  payload = {
435
436
  auth_token: auth_token,
436
437
  lead_id: leadId,
@@ -461,7 +462,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
461
462
  return [2, data];
462
463
  }
463
464
  }
464
- if (!(isScopeAuthentication && !data.new_user && !isDataHasIndividualOnly)) return [3, 3];
465
+ if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 3];
465
466
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
466
467
  case 2:
467
468
  _e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
@@ -483,7 +484,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
483
484
  });
484
485
  }); });
485
486
  export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
486
- var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, payload, data, authId, urlQueryStart, _e, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
487
+ var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, payload, data, authId, urlQueryStart, _e, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
487
488
  var _f, _g;
488
489
  return __generator(this, function (_h) {
489
490
  switch (_h.label) {
@@ -497,6 +498,7 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
497
498
  isScopeAuthentication = scope === SCOPE_AUTH;
498
499
  bi = settings.data.deviceInfo.browser.browser_id;
499
500
  isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
501
+ authDataHasValue = authData === null || authData === void 0 ? void 0 : authData.length;
500
502
  payload = {
501
503
  auth_token: auth_token,
502
504
  lead_id: leadId,
@@ -527,7 +529,7 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
527
529
  return [2, data];
528
530
  }
529
531
  }
530
- if (!(isScopeAuthentication && !data.new_user && !isDataHasIndividualOnly)) return [3, 3];
532
+ if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 3];
531
533
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
532
534
  case 2:
533
535
  _e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
@@ -553,7 +555,7 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
553
555
  });
554
556
  }); });
555
557
  export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
556
- var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, expiry, interval, maxCalls, count, data, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
558
+ var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
557
559
  var _d, _e, _f;
558
560
  return __generator(this, function (_g) {
559
561
  switch (_g.label) {
@@ -563,7 +565,8 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
563
565
  _b = settings.data.appConfig, scope = _b.scope, redirectUrl = _b.redirectUrl, authConfigData = _b.data;
564
566
  isScopeAuthentication = scope === SCOPE_AUTH;
565
567
  bi = settings.data.deviceInfo.browser.browser_id;
566
- isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authData.includes('individual');
568
+ isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
569
+ authDataHasValue = authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length;
567
570
  expiry = (authData === null || authData === void 0 ? void 0 : authData.expiry) || 120;
568
571
  interval = 3;
569
572
  maxCalls = Math.floor(expiry / interval);
@@ -593,7 +596,7 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
593
596
  return [2, data];
594
597
  }
595
598
  }
596
- if (!(isScopeAuthentication && !data.new_user && !isDataHasIndividualOnly)) return [3, 4];
599
+ if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 4];
597
600
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
598
601
  case 3:
599
602
  _c = _g.sent(), brandList = _c.brandList, entityList = _c.entityList;
@@ -868,10 +871,10 @@ export var checkBrandNameAvailabilityAsync = createAsyncThunk('connectExpress/ch
868
871
  });
869
872
  });
870
873
  export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAsync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
871
- var _a, connectExpress, settings, responseData, _b, postURL, scope, redirectUrl, mode, showBoard, platforms, payment_provider, authId, bi, body, data, leadData, board_id, board_info_id, _c, boardInfo, boardData, urlQueryStart;
872
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
873
- return __generator(this, function (_t) {
874
- switch (_t.label) {
874
+ var _a, connectExpress, settings, responseData, _b, postURL, scope, redirectUrl, mode, showBoard, platforms, payment_provider, authId, bi, body, data, leadData, board_id, board_info_id, _c, boardInfo, boardData, leadData, urlQueryStart;
875
+ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
876
+ return __generator(this, function (_w) {
877
+ switch (_w.label) {
875
878
  case 0:
876
879
  _a = thunkApi.getState(), connectExpress = _a.connectExpress, settings = _a.settings;
877
880
  responseData = connectExpress.data.responseData;
@@ -888,14 +891,14 @@ export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAs
888
891
  };
889
892
  return [4, API.accountService.expressCreateAccount(body)];
890
893
  case 1:
891
- data = _t.sent();
894
+ data = _w.sent();
892
895
  (_l = (_k = settings.data.appConfig).onCreated) === null || _l === void 0 ? void 0 : _l.call(_k, data);
893
896
  (_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, data);
894
897
  (_q = (_p = settings.data.appConfig).onStepCompleted) === null || _q === void 0 ? void 0 : _q.call(_p, settings.data.activeScreen.name, data);
895
898
  if (!showBoard) return [3, 4];
896
899
  return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
897
900
  case 2:
898
- leadData = (_t.sent()).data;
901
+ leadData = (_w.sent()).data;
899
902
  board_id = (_r = data.board_id) !== null && _r !== void 0 ? _r : leadData.board_id;
900
903
  board_info_id = (_s = data.board_info_id) !== null && _s !== void 0 ? _s : leadData.board_info_id;
901
904
  return [4, Promise.all([
@@ -903,10 +906,19 @@ export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAs
903
906
  API.boardService.retrieveBoardDetails(board_id)
904
907
  ])];
905
908
  case 3:
906
- _c = _t.sent(), boardInfo = _c[0], boardData = _c[1];
909
+ _c = _w.sent(), boardInfo = _c[0], boardData = _c[1];
907
910
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
908
911
  return [2, { boardInfo: boardInfo, boardData: boardData, account: data }];
909
912
  case 4:
913
+ if (!(scope === SCOPE_AUTH)) return [3, 7];
914
+ return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
915
+ case 5:
916
+ leadData = (_w.sent()).data;
917
+ return [4, thunkApi.dispatch(onCloseComplete({ merchantId: (_t = data === null || data === void 0 ? void 0 : data.merchant) === null || _t === void 0 ? void 0 : _t.id, brandId: (_u = leadData === null || leadData === void 0 ? void 0 : leadData.brand) === null || _u === void 0 ? void 0 : _u.id, entityId: (_v = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _v === void 0 ? void 0 : _v.id }))];
918
+ case 6:
919
+ _w.sent();
920
+ return [2, { account: data }];
921
+ case 7:
910
922
  if (redirectUrl && mode === 'page') {
911
923
  urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
912
924
  window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
@@ -6,20 +6,8 @@ interface VerifyLeadTokenProps {
6
6
  }
7
7
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
8
8
  data: any;
9
- individualData: any;
10
- boardResponse: {
11
- user: any;
12
- brand: any;
13
- bank_account: any;
14
- entity: any;
15
- merchant: any;
16
- name: any;
17
- contact: any;
18
- individuals: any;
19
- business: any;
20
- entityTypes: any;
21
- notification: any;
22
- };
9
+ entityData: any;
10
+ entityTypes: any;
23
11
  token: string;
24
12
  }, VerifyLeadTokenProps, {
25
13
  state?: unknown;
@@ -45,20 +33,8 @@ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
45
33
  }>;
46
34
  export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
47
35
  data: any;
48
- individualData: any;
49
- boardResponse: {
50
- user: any;
51
- brand: any;
52
- bank_account: any;
53
- entity: any;
54
- merchant: any;
55
- name: any;
56
- contact: any;
57
- individuals: any;
58
- business: any;
59
- entityTypes: any;
60
- notification: any;
61
- };
36
+ entityData: any;
37
+ entityTypes: any;
62
38
  formData: OTPFormValues;
63
39
  }, OTPFormValues, {
64
40
  state?: unknown;
@@ -71,6 +47,7 @@ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<
71
47
  rejectedMeta?: unknown;
72
48
  }>;
73
49
  export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
50
+ data: any;
74
51
  flows: any;
75
52
  }, void, {
76
53
  state?: unknown;
@@ -82,9 +59,12 @@ export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<
82
59
  fulfilledMeta?: unknown;
83
60
  rejectedMeta?: unknown;
84
61
  }>;
85
- export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
86
- data: any;
87
- }, string, {
62
+ type RetrieveBoardProps = {
63
+ boardId: string;
64
+ individualId: string;
65
+ individualType: string;
66
+ };
67
+ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<any, RetrieveBoardProps, {
88
68
  state?: unknown;
89
69
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
90
70
  extra?: unknown;
@@ -122,8 +102,11 @@ export declare const updateEntityCapital: import("@reduxjs/toolkit").AsyncThunk<
122
102
  rejectedMeta?: unknown;
123
103
  }>;
124
104
  export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
125
- response: any;
126
- formData: void;
105
+ data: any;
106
+ flows?: undefined;
107
+ } | {
108
+ data: any;
109
+ flows: any;
127
110
  } | undefined, void, {
128
111
  state?: unknown;
129
112
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;