@tap-payments/auth-jsconnect 2.7.6-test → 2.7.7-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.
@@ -81,17 +81,17 @@ export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateB
81
81
  });
82
82
  }); });
83
83
  export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
84
- var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, _c, boardInfo, boardData, error_1;
85
- var _d, _e, _f, _g, _h, _j;
86
- return __generator(this, function (_k) {
87
- switch (_k.label) {
84
+ var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, screen_1, _c, boardInfo, boardData, error_1;
85
+ var _d, _e, _f, _g, _h;
86
+ return __generator(this, function (_j) {
87
+ switch (_j.label) {
88
88
  case 0:
89
89
  _a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
90
90
  countryCode = settings.data.businessCountry;
91
91
  showBoard = connectExpress.data.showBoard;
92
92
  return [4, API.leadService.retrieveLeadIdentity(leadId)];
93
93
  case 1:
94
- data = _k.sent();
94
+ data = _j.sent();
95
95
  _b = data || {}, country_code = _b.country_code, contact = _b.contact;
96
96
  if (country_code)
97
97
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
@@ -99,7 +99,7 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
99
99
  if (phone === null || phone === void 0 ? void 0 : phone.country_code)
100
100
  countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
101
101
  status = data.status, board_id = data.board_id, board_info_id = data.board_info_id;
102
- if (!(data === null || data === void 0 ? void 0 : data.country_code) && !((_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2)) {
102
+ if (!country_code && !((_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2)) {
103
103
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
104
104
  return [2, { data: data, countryCode: countryCode }];
105
105
  }
@@ -108,21 +108,26 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
108
108
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
109
109
  return [2, { data: data, countryCode: countryCode }];
110
110
  }
111
- if (!isRegistered && (data === null || data === void 0 ? void 0 : data.country_code) && !((_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2)) {
112
- thunkApi.dispatch(handleSetCountryByIso2(data.country_code));
113
- if (isOtherThanKWOrSA(data.country_code) || isKW(data.country_code))
114
- thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
111
+ if (!isRegistered && country_code) {
112
+ screen_1 = 'CONNECT_EXPRESS_NID_STEP';
113
+ if (!isSA(data.country_code))
114
+ screen_1 = 'CONNECT_EXPRESS_MOBILE_STEP';
115
+ thunkApi.dispatch(handleCurrentActiveScreen(screen_1));
115
116
  return [2, { data: data, countryCode: countryCode }];
116
117
  }
117
- if (!isRegistered && (isKW(settings.data.businessCountry.iso2) || isOtherThanKWOrSA(settings.data.businessCountry.iso2))) {
118
+ if (!isRegistered && !isSA(settings.data.businessCountry.iso2)) {
118
119
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
119
120
  return [2, { data: data, countryCode: countryCode }];
120
121
  }
121
- if ((_f = data === null || data === void 0 ? void 0 : data.identification) === null || _f === void 0 ? void 0 : _f.authentication_id) {
122
- thunkApi.dispatch(storeAuthId((_g = data === null || data === void 0 ? void 0 : data.identification) === null || _g === void 0 ? void 0 : _g.authentication_id));
122
+ if (!isRegistered && isSA(settings.data.businessCountry.iso2)) {
123
+ thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_NID_STEP'));
124
+ return [2, { data: data, countryCode: countryCode }];
125
+ }
126
+ if ((_e = data === null || data === void 0 ? void 0 : data.identification) === null || _e === void 0 ? void 0 : _e.authentication_id) {
127
+ thunkApi.dispatch(storeAuthId((_f = data === null || data === void 0 ? void 0 : data.identification) === null || _f === void 0 ? void 0 : _f.authentication_id));
123
128
  }
124
129
  if (isRegistered && !showBoard) {
125
- (_j = (_h = settings.data.appConfig).onFlowCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, data);
130
+ (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, data);
126
131
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
127
132
  return [2, { data: data, countryCode: countryCode }];
128
133
  }
@@ -131,19 +136,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
131
136
  return [2, { data: data, countryCode: countryCode }];
132
137
  }
133
138
  if (!(isRegistered && board_id && board_info_id)) return [3, 5];
134
- _k.label = 2;
139
+ _j.label = 2;
135
140
  case 2:
136
- _k.trys.push([2, 4, , 5]);
141
+ _j.trys.push([2, 4, , 5]);
137
142
  return [4, Promise.all([
138
143
  API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
139
144
  API.boardService.retrieveBoardDetails(board_id)
140
145
  ])];
141
146
  case 3:
142
- _c = _k.sent(), boardInfo = _c[0], boardData = _c[1];
147
+ _c = _j.sent(), boardInfo = _c[0], boardData = _c[1];
143
148
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
144
149
  return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
145
150
  case 4:
146
- error_1 = _k.sent();
151
+ error_1 = _j.sent();
147
152
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
148
153
  return [2, { data: data, countryCode: countryCode }];
149
154
  case 5: return [2, { data: data, countryCode: countryCode }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.7.6-test",
3
+ "version": "2.7.7-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",