@tap-payments/auth-jsconnect 2.6.3-test → 2.6.5-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.
Files changed (41) hide show
  1. package/build/@types/app.d.ts +4 -0
  2. package/build/app/settings.d.ts +5 -1
  3. package/build/app/settings.js +43 -4
  4. package/build/features/app/bank/bankStore.d.ts +1 -0
  5. package/build/features/app/bank/bankStore.js +28 -1
  6. package/build/features/app/brand/brandStore.d.ts +1 -0
  7. package/build/features/app/brand/brandStore.js +28 -1
  8. package/build/features/app/connectExpress/connectExpressStore.d.ts +1 -7
  9. package/build/features/app/connectExpress/connectExpressStore.js +44 -71
  10. package/build/features/app/entity/entityStore.d.ts +1 -0
  11. package/build/features/app/entity/entityStore.js +28 -1
  12. package/build/features/app/individual/individualStore.d.ts +1 -0
  13. package/build/features/app/individual/individualStore.js +28 -1
  14. package/build/features/app/password/passwordStore.d.ts +1 -0
  15. package/build/features/app/password/passwordStore.js +28 -1
  16. package/build/features/app/tax/taxStore.d.ts +1 -0
  17. package/build/features/app/tax/taxStore.js +28 -1
  18. package/build/features/bank/Bank.d.ts +1 -0
  19. package/build/features/bank/Bank.js +4 -4
  20. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  21. package/build/features/brand/Brand.d.ts +1 -0
  22. package/build/features/brand/Brand.js +4 -4
  23. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  24. package/build/features/connectExpress/ConnectExpress.d.ts +0 -1
  25. package/build/features/connectExpress/ConnectExpress.js +6 -13
  26. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -0
  27. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  28. package/build/features/entity/Entity.d.ts +1 -0
  29. package/build/features/entity/Entity.js +4 -4
  30. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  31. package/build/features/individual/Individual.d.ts +1 -0
  32. package/build/features/individual/Individual.js +4 -4
  33. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  34. package/build/features/password/Password.d.ts +1 -0
  35. package/build/features/password/Password.js +16 -4
  36. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  37. package/build/features/tax/Tax.d.ts +1 -0
  38. package/build/features/tax/Tax.js +4 -4
  39. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  40. package/build/hooks/useAppConfig.js +4 -3
  41. package/package.json +1 -1
@@ -36,11 +36,11 @@ import { taxFeatureScreens } from '../featuresScreens';
36
36
  import { taxSelector, verifyLeadToken } from '../app/tax/taxStore';
37
37
  import Background from '../shared/Background';
38
38
  var Tax = memo(function (_a) {
39
- var verifyToken = _a.verifyToken, props = __rest(_a, ["verifyToken"]);
39
+ var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
40
40
  var theme = useAppTheme().theme;
41
- var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
41
+ var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading, internalLoading = _b.internalLoading;
42
42
  var _c = useAppSelector(taxSelector), customLoading = _c.customLoading, taxError = _c.error, loading = _c.loading;
43
- useAppConfig(__assign(__assign({ navigation: TAX_SCREENS_NAVIGATION }, props), { disableSettingFetching: !!verifyToken }));
43
+ useAppConfig(__assign(__assign({ configToken: configToken, navigation: TAX_SCREENS_NAVIGATION }, props), { disableSettingFetching: !!verifyToken }));
44
44
  useErrorListener(taxError || error);
45
45
  useStepStartedListener();
46
46
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, featureScreensNavigation = data.featureScreensNavigation, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress;
@@ -55,7 +55,7 @@ var Tax = memo(function (_a) {
55
55
  navigation: featureScreensNavigation,
56
56
  open: open,
57
57
  internalToken: verifyToken,
58
- settingLoading: settingLoading
58
+ settingLoading: configToken ? internalLoading : settingLoading
59
59
  });
60
60
  var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
61
61
  return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: taxFeatureScreens.map(function (_a, index) {
@@ -11,12 +11,21 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { memo } from 'react';
14
- import { useAppSelector } from '../../../../hooks';
15
- import { taxSelector } from '../../../app/tax/taxStore';
14
+ import { settingsSelector } from '../../../../app/settings';
15
+ import { useAppSelector, useAppDispatch } from '../../../../hooks';
16
+ import { SCOPE_AUTH } from '../../../../constants';
17
+ import { onCloseCompleteTax, taxSelector } from '../../../app/tax/taxStore';
16
18
  import SuccessFlowButtons from '../../../shared/SuccessFlowButtons';
17
19
  var SuccessWithFlowButtons = function () {
18
- var data = useAppSelector(taxSelector).data;
19
- var _a = data.verify.responseBody || {}, flows = _a.flows, entity = _a.entity, brand = _a.brand, bank = _a.bank_account, merchant = _a.merchant, user = _a.user, business = _a.business, board_id = _a.board_id, board_info_id = _a.board_info_id, name = _a.name, individuals = _a.individuals;
20
- return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [] }));
20
+ var dispatch = useAppDispatch();
21
+ var _a = useAppSelector(taxSelector), data = _a.data, loading = _a.loading;
22
+ var settingsData = useAppSelector(settingsSelector).data;
23
+ var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
24
+ var redirectUrl = settingsData.appConfig.redirectUrl;
25
+ var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
26
+ var onClose = function () {
27
+ dispatch(onCloseCompleteTax());
28
+ };
29
+ return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication && redirectUrl ? onClose : undefined }));
21
30
  };
22
31
  export default memo(SuccessWithFlowButtons);
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { useEffect } from 'react';
24
- import { handleActiveFlowScreens, handleSetAppConfig, handleLanguage, handleOpen, handleIsTapOrigin, fetchAppSettingsSync, handelBoardMaturity, settingsSelector } from '../app/settings';
24
+ import { handleActiveFlowScreens, handleSetAppConfig, handleLanguage, handleOpen, handleIsTapOrigin, fetchAppSettingsSync, handelBoardMaturity, settingsSelector, updateInternalLoading } from '../app/settings';
25
25
  import { useAppDispatch } from './useAppDispatch';
26
26
  import { useAppSelector } from './useAppSelector';
27
27
  import { isTapDomain, removeRequestHeaders, setBaseUrl } from '../utils';
@@ -43,8 +43,9 @@ export var useAppConfig = function (_a) {
43
43
  useEffect(function () {
44
44
  if (rest.open === false)
45
45
  return;
46
- if (!disableSettingFetching)
46
+ if (!disableSettingFetching && !configToken)
47
47
  removeRequestHeaders();
48
+ dispatch(updateInternalLoading(true));
48
49
  checkDomain();
49
50
  setBaseUrl(publicKey);
50
51
  setAppConfig();
@@ -52,7 +53,7 @@ export var useAppConfig = function (_a) {
52
53
  dispatch(handelBoardMaturity(boardMaturity));
53
54
  if (!data.isMaturityExpress)
54
55
  dispatch(handleLanguage(rest.language));
55
- if (!disableSettingFetching)
56
+ if (!disableSettingFetching || configToken)
56
57
  dispatch(fetchAppSettingsSync({
57
58
  disableCountries: disableCountries,
58
59
  disableLocale: disableLocale,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.6.3-test",
3
+ "version": "2.6.5-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",