@tap-payments/auth-jsconnect 2.8.81-development → 2.8.82-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.
@@ -341,9 +341,9 @@ export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth'
341
341
  }); });
342
342
  export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
343
343
  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;
344
- var _d, _e;
345
- return __generator(this, function (_f) {
346
- switch (_f.label) {
344
+ var _d, _e, _f, _g, _h;
345
+ return __generator(this, function (_j) {
346
+ switch (_j.label) {
347
347
  case 0:
348
348
  _a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
349
349
  authData = (connectExpress.data.responseData || {}).authData;
@@ -356,18 +356,18 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
356
356
  interval = 3;
357
357
  maxCalls = Math.floor(expiry / interval);
358
358
  count = 1;
359
- _f.label = 1;
359
+ _j.label = 1;
360
360
  case 1:
361
361
  if (!(count <= maxCalls)) return [3, 9];
362
362
  if (thunkApi.signal.aborted) {
363
363
  return [3, 9];
364
364
  }
365
- return [4, API.authService.getVerifyAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
365
+ return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
366
366
  case 2:
367
- data = _f.sent();
368
- isSuccess = ((_d = data.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'success';
367
+ data = _j.sent();
368
+ isSuccess = ((_e = (_d = data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success';
369
369
  if (!isSuccess) return [3, 6];
370
- authId = data.id;
370
+ authId = (_f = data.auth) === null || _f === void 0 ? void 0 : _f.id;
371
371
  thunkApi.dispatch(storeAuthId(authId));
372
372
  if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
373
373
  if (settings.data.appConfig.mode === 'popup') {
@@ -384,19 +384,19 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
384
384
  if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 4];
385
385
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
386
386
  case 3:
387
- _c = _f.sent(), brandList = _c.brandList, entityList = _c.entityList;
387
+ _c = _j.sent(), brandList = _c.brandList, entityList = _c.entityList;
388
388
  if (brandList.length && entityList.length) {
389
389
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
390
390
  return [2, data];
391
391
  }
392
- _f.label = 4;
393
- case 4: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead_id)).unwrap()];
392
+ _j.label = 4;
393
+ case 4: return [4, thunkApi.dispatch(getLeadByIdAsync((_g = data.lead) === null || _g === void 0 ? void 0 : _g.id)).unwrap()];
394
394
  case 5:
395
- _f.sent();
395
+ _j.sent();
396
396
  stepName = data.step_name;
397
397
  needToCollectMoreInfo = stepName === 'collect_info';
398
398
  creatingAccount = stepName === 'create_account';
399
- (_e = params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params);
399
+ (_h = params.onSuccess) === null || _h === void 0 ? void 0 : _h.call(params);
400
400
  if (creatingAccount) {
401
401
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
402
402
  }
@@ -406,8 +406,8 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
406
406
  return [2, data];
407
407
  case 6: return [4, sleep(interval * 1000)];
408
408
  case 7:
409
- _f.sent();
410
- _f.label = 8;
409
+ _j.sent();
410
+ _j.label = 8;
411
411
  case 8:
412
412
  count++;
413
413
  return [3, 1];
@@ -669,9 +669,9 @@ export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/c
669
669
  }); });
670
670
  export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNafathIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
671
671
  var connectExpress, authData, expiry, interval, maxCalls, count, data, isSuccess, needToCollectMoreInfo, creatingAccount;
672
- var _a, _b, _c;
673
- return __generator(this, function (_d) {
674
- switch (_d.label) {
672
+ var _a, _b, _c, _d;
673
+ return __generator(this, function (_e) {
674
+ switch (_e.label) {
675
675
  case 0:
676
676
  connectExpress = thunkApi.getState().connectExpress;
677
677
  authData = (connectExpress.data.responseData || {}).authData;
@@ -679,7 +679,7 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
679
679
  interval = 3;
680
680
  maxCalls = Math.floor(expiry / interval);
681
681
  count = 1;
682
- _d.label = 1;
682
+ _e.label = 1;
683
683
  case 1:
684
684
  if (!(count <= maxCalls)) return [3, 7];
685
685
  if (thunkApi.signal.aborted) {
@@ -687,15 +687,15 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
687
687
  }
688
688
  return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
689
689
  case 2:
690
- data = _d.sent();
690
+ data = _e.sent();
691
691
  isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
692
692
  if (!isSuccess) return [3, 4];
693
- return [4, thunkApi.dispatch(getLeadByIdAsync(data.auth.lead_id)).unwrap()];
693
+ return [4, thunkApi.dispatch(getLeadByIdAsync((_c = data.lead) === null || _c === void 0 ? void 0 : _c.id)).unwrap()];
694
694
  case 3:
695
- _d.sent();
695
+ _e.sent();
696
696
  needToCollectMoreInfo = data.step_name === 'collect_info';
697
697
  creatingAccount = data.step_name === 'create_account';
698
- (_c = params.onSuccess) === null || _c === void 0 ? void 0 : _c.call(params);
698
+ (_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
699
699
  if (creatingAccount) {
700
700
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
701
701
  }
@@ -705,8 +705,8 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
705
705
  return [2, data];
706
706
  case 4: return [4, sleep(interval * 1000)];
707
707
  case 5:
708
- _d.sent();
709
- _d.label = 6;
708
+ _e.sent();
709
+ _e.label = 6;
710
710
  case 6:
711
711
  count++;
712
712
  return [3, 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.81-development",
3
+ "version": "2.8.82-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",