@tap-payments/auth-jsconnect 2.6.9-test → 2.6.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.
@@ -220,7 +220,6 @@ export interface LibConfig extends LibCallbacks {
220
220
  redirectUrl?: string;
221
221
  data?: Array<string>;
222
222
  mode?: 'popup' | 'page';
223
- authId?: string;
224
223
  boardMaturity?: boolean;
225
224
  }
226
225
  export interface OSDetails {
@@ -26,6 +26,7 @@ export interface SettingsData {
26
26
  merchant?: MerchantInfo;
27
27
  isMaturityExpress: boolean;
28
28
  isHijri: boolean;
29
+ authId?: string;
29
30
  }
30
31
  export interface SettingsState extends SharedState<SettingsData> {
31
32
  internalLoading: boolean;
@@ -146,13 +146,14 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
146
146
  });
147
147
  }); });
148
148
  export var onCloseComplete = createAsyncThunk('settings/onCloseComplete', function (merchantId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
149
- var settings, _a, postURL, redirectUrl, authId, bi, list, id, body, data, urlQueryStart;
149
+ var settings, _a, appConfig, authId, postURL, redirectUrl, bi, list, id, body, data, urlQueryStart;
150
150
  var _b, _c, _d, _e;
151
151
  return __generator(this, function (_f) {
152
152
  switch (_f.label) {
153
153
  case 0:
154
154
  settings = thunkApi.getState().settings;
155
- _a = settings.data.appConfig, postURL = _a.postURL, redirectUrl = _a.redirectUrl, authId = _a.authId;
155
+ _a = settings.data, appConfig = _a.appConfig, authId = _a.authId;
156
+ postURL = appConfig.postURL, redirectUrl = appConfig.redirectUrl;
156
157
  bi = settings.data.deviceInfo.browser.browser_id;
157
158
  return [4, API.entityService.getTerminalListUsingMerchantId(merchantId)];
158
159
  case 1:
@@ -189,6 +190,7 @@ var initialState = {
189
190
  internalLoading: true,
190
191
  data: {
191
192
  boardMaturity: true,
193
+ authId: '',
192
194
  open: true,
193
195
  isTapOrigin: true,
194
196
  isMaturityExpress: false,
@@ -209,7 +211,7 @@ export var settingsSlice = createSlice({
209
211
  initialState: initialState,
210
212
  reducers: {
211
213
  storeAuthId: function (state, action) {
212
- state.data.appConfig.authId = action.payload;
214
+ state.data.authId = action.payload;
213
215
  },
214
216
  updateInternalLoading: function (state, action) {
215
217
  state.internalLoading = action.payload;
@@ -64,16 +64,16 @@ import { defaultCountry } from '../../../constants';
64
64
  import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA } from '../../../utils';
65
65
  export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var _a, settings, connectExpress, countryCode, showBoard, data, _b, country_code, contact, phone, status, board_id, board_info_id, isRegistered, _c, boardInfo, boardData, error_1;
67
- var _d, _e;
68
- return __generator(this, function (_f) {
69
- switch (_f.label) {
67
+ var _d, _e, _f, _g;
68
+ return __generator(this, function (_h) {
69
+ switch (_h.label) {
70
70
  case 0:
71
71
  _a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
72
72
  countryCode = settings.data.businessCountry;
73
73
  showBoard = connectExpress.data.showBoard;
74
74
  return [4, API.leadService.retrieveLeadIdentity(leadId)];
75
75
  case 1:
76
- data = _f.sent();
76
+ data = _h.sent();
77
77
  _b = data || {}, country_code = _b.country_code, contact = _b.contact;
78
78
  if (country_code)
79
79
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
@@ -86,8 +86,11 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
86
86
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
87
87
  return [2, { data: data, countryCode: countryCode }];
88
88
  }
89
+ if ((_d = data === null || data === void 0 ? void 0 : data.identification) === null || _d === void 0 ? void 0 : _d.authentication_id) {
90
+ thunkApi.dispatch(storeAuthId((_e = data === null || data === void 0 ? void 0 : data.identification) === null || _e === void 0 ? void 0 : _e.authentication_id));
91
+ }
89
92
  if (isRegistered && !showBoard) {
90
- (_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, data);
93
+ (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, data);
91
94
  thunkApi.dispatch(handleOpen(false));
92
95
  return [2, { data: data, countryCode: countryCode }];
93
96
  }
@@ -96,19 +99,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
96
99
  return [2, { data: data, countryCode: countryCode }];
97
100
  }
98
101
  if (!(isRegistered && board_id && board_info_id)) return [3, 5];
99
- _f.label = 2;
102
+ _h.label = 2;
100
103
  case 2:
101
- _f.trys.push([2, 4, , 5]);
104
+ _h.trys.push([2, 4, , 5]);
102
105
  return [4, Promise.all([
103
106
  API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
104
107
  API.boardService.retrieveBoardDetails(board_id)
105
108
  ])];
106
109
  case 3:
107
- _c = _f.sent(), boardInfo = _c[0], boardData = _c[1];
110
+ _c = _h.sent(), boardInfo = _c[0], boardData = _c[1];
108
111
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
109
112
  return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
110
113
  case 4:
111
- error_1 = _f.sent();
114
+ error_1 = _h.sent();
112
115
  thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
113
116
  return [2, { data: data, countryCode: countryCode }];
114
117
  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.6.9-test",
3
+ "version": "2.6.10-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",