@tap-payments/auth-jsconnect 2.11.14-sandbox → 2.11.15-sandbox

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 (84) hide show
  1. package/build/@types/app.d.ts +1 -0
  2. package/build/api/auth.d.ts +2 -1
  3. package/build/api/axios.js +9 -1
  4. package/build/api/headers.d.ts +1 -0
  5. package/build/api/headers.js +15 -0
  6. package/build/api/index.d.ts +5 -4
  7. package/build/api/index.js +2 -1
  8. package/build/app/rootReducer.d.ts +1 -0
  9. package/build/app/rootReducer.js +2 -0
  10. package/build/app/session.d.ts +17 -0
  11. package/build/app/session.js +28 -0
  12. package/build/app/settings.js +1 -1
  13. package/build/app/store.d.ts +2 -0
  14. package/build/assets/locales/ar.json +4 -1
  15. package/build/assets/locales/en.json +4 -1
  16. package/build/components/DeviceCard/DeviceCard.d.ts +3 -2
  17. package/build/components/DeviceCard/DeviceCard.js +2 -2
  18. package/build/constants/app.d.ts +4 -0
  19. package/build/constants/app.js +37 -12
  20. package/build/constants/dummy.d.ts +2 -29
  21. package/build/constants/dummy.js +4 -4
  22. package/build/constants/flows.d.ts +10 -22
  23. package/build/constants/flows.js +10 -23
  24. package/build/features/app/auth/authStore.js +7 -1
  25. package/build/features/app/bank/bankStore.js +3 -1
  26. package/build/features/app/board/boardStore.js +3 -1
  27. package/build/features/app/brand/brandStore.js +3 -1
  28. package/build/features/app/business/businessStore.js +3 -1
  29. package/build/features/app/connect/connectStore.d.ts +6 -0
  30. package/build/features/app/connect/connectStore.js +106 -8
  31. package/build/features/app/connectExpress/connectExpressStore.d.ts +4 -0
  32. package/build/features/app/connectExpress/connectExpressStore.js +105 -8
  33. package/build/features/app/entity/entityStore.js +3 -1
  34. package/build/features/app/individual/individualStore.js +3 -1
  35. package/build/features/app/kyc/kycStore.d.ts +5 -5
  36. package/build/features/app/kyc/kycStore.js +4 -1
  37. package/build/features/app/password/passwordStore.js +5 -1
  38. package/build/features/app/tax/taxStore.js +3 -1
  39. package/build/features/app/terminal/terminalStore.js +39 -12
  40. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
  41. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
  42. package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
  43. package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +2 -2
  44. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  45. package/build/features/connect/Connect.js +3 -2
  46. package/build/features/connect/screens/OTPSessionExpired/OTPInput.d.ts +5 -0
  47. package/build/features/connect/screens/OTPSessionExpired/OTPInput.js +58 -0
  48. package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.d.ts +3 -0
  49. package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.js +86 -0
  50. package/build/features/connect/screens/OTPSessionExpired/index.d.ts +2 -0
  51. package/build/features/connect/screens/OTPSessionExpired/index.js +2 -0
  52. package/build/features/connect/screens/OTPSessionExpired/validation.d.ts +8 -0
  53. package/build/features/connect/screens/OTPSessionExpired/validation.js +4 -0
  54. package/build/features/connectExpress/ConnectExpress.js +3 -2
  55. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
  56. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
  57. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +2 -2
  58. package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
  59. package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.js +58 -0
  60. package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  61. package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
  62. package/build/features/connectExpress/screens/OTPSessionExpired/index.d.ts +2 -0
  63. package/build/features/connectExpress/screens/OTPSessionExpired/index.js +2 -0
  64. package/build/features/connectExpress/screens/OTPSessionExpired/validation.d.ts +8 -0
  65. package/build/features/connectExpress/screens/OTPSessionExpired/validation.js +4 -0
  66. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
  67. package/build/features/featuresScreens.js +10 -0
  68. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
  69. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
  70. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
  71. package/build/features/shared/Address/CountryList.d.ts +1 -1
  72. package/build/features/shared/Address/InputSelect.d.ts +1 -1
  73. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +1 -1
  74. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +2 -2
  75. package/build/features/terminal/screens/shared/POSDeviceList.js +3 -1
  76. package/build/features/terminal/screens/shared/styles.d.ts +1 -1
  77. package/build/hooks/index.d.ts +1 -0
  78. package/build/hooks/index.js +1 -0
  79. package/build/hooks/useAppDispatch.d.ts +1 -0
  80. package/build/hooks/useSessionExpiryHandler.d.ts +8 -0
  81. package/build/hooks/useSessionExpiryHandler.js +71 -0
  82. package/build/utils/error.d.ts +2 -0
  83. package/build/utils/error.js +6 -0
  84. package/package.json +1 -1
@@ -52,6 +52,7 @@ export interface ScreenStepNavigation {
52
52
  next: string | string[];
53
53
  prev: string | string[];
54
54
  order: number;
55
+ back?: string;
55
56
  }
56
57
  export interface FeatureScreenStep {
57
58
  element: React.MemoExoticComponent<any> | React.ComponentType<any>;
@@ -47,6 +47,7 @@ export declare type CreateAuthBody = {
47
47
  user_id?: string;
48
48
  login?: boolean;
49
49
  };
50
+ export declare type CreateAuthSessionExpiredBody = Omit<CreateAuthBody, 'user_credentail'>;
50
51
  export declare type CreateNafathAuthBody = {
51
52
  country: string;
52
53
  scope: string;
@@ -140,7 +141,7 @@ declare const authService: {
140
141
  getVerifyAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
141
142
  getTokenVerify: (token: string, config?: AxiosRequestConfig) => Promise<any>;
142
143
  createAuthKitNID: (data: CreateAuthBody) => Promise<any>;
143
- createExpressAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<any>;
144
+ createExpressAuth: (data: CreateAuthBody | CreateAuthSessionExpiredBody, config?: AxiosRequestConfig) => Promise<any>;
144
145
  verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
145
146
  createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
146
147
  getVerifyExpressAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
@@ -47,7 +47,15 @@ var instance = axios.create({
47
47
  instance.interceptors.request.use(function (config) {
48
48
  return encryptionContractTransformer(config);
49
49
  }, function (error) { return Promise.reject(error); });
50
- instance.interceptors.response.use(function (response) { return response; }, function (error) {
50
+ instance.interceptors.response.use(function (response) {
51
+ var _a, _b, _c;
52
+ var errors = (_a = response.data) === null || _a === void 0 ? void 0 : _a.errors;
53
+ if (((_b = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _b === void 0 ? void 0 : _b.code) === '7014')
54
+ throw new Error('session_expired');
55
+ if (((_c = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _c === void 0 ? void 0 : _c.code) === '7013')
56
+ throw new Error('session_invalid');
57
+ return response;
58
+ }, function (error) {
51
59
  return Promise.reject(error);
52
60
  });
53
61
  var encryptionContractTransformer = function (config) {
@@ -3,3 +3,4 @@ export declare const getAuthHeaders: (authSession?: string) => {
3
3
  } | {
4
4
  st?: undefined;
5
5
  };
6
+ export declare const setAuthSessionToGlobalHeaders: (authSession?: string) => void;
@@ -1,3 +1,18 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { getAxiosHeaders, setAxiosGlobalHeaders } from './axios';
1
13
  export var getAuthHeaders = function (authSession) {
2
14
  return authSession ? { st: authSession } : {};
3
15
  };
16
+ export var setAuthSessionToGlobalHeaders = function (authSession) {
17
+ setAxiosGlobalHeaders(__assign(__assign({}, getAxiosHeaders()), (authSession && { st: authSession })));
18
+ };
@@ -1,6 +1,6 @@
1
1
  import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, getAxiosHeaders } from './axios';
2
2
  import { ValidateOperatorBody, ConfirmBody } from './operator';
3
- import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody } from './auth';
3
+ import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody, CreateAuthSessionExpiredBody } from './auth';
4
4
  import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody, ExpressLeadVerifyBody } from './lead';
5
5
  import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
6
6
  import { EntityInfoBody, EntityBankUpdateBody, BankDocumentInfo, UpdateEntityBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, UpdateEntityAOAFileBody, RemoveEntityActivity, MerchantListBody, CreateEntityBody } from './entity';
@@ -14,6 +14,7 @@ import { UploadFileBody } from './file';
14
14
  import { DocumentUpdateBody, DocumentInfo, DocumentBody } from './document';
15
15
  import { InitBody } from './init';
16
16
  import { GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps } from './terminal';
17
+ import { setAuthSessionToGlobalHeaders } from './headers';
17
18
  declare const API: {
18
19
  locationService: {
19
20
  getIP: () => Promise<any>;
@@ -38,7 +39,7 @@ declare const API: {
38
39
  getVerifyAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
39
40
  getTokenVerify: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
40
41
  createAuthKitNID: (data: CreateAuthBody) => Promise<any>;
41
- createExpressAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
42
+ createExpressAuth: (data: CreateAuthBody | CreateAuthSessionExpiredBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
42
43
  verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
43
44
  createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
44
45
  getVerifyExpressAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
@@ -171,6 +172,6 @@ declare const API: {
171
172
  retrievePOSDevices: (merchants: string[]) => Promise<any>;
172
173
  };
173
174
  };
174
- export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody, GetUserListSegmentBody, CreateKYCAuthBody, GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps };
175
- export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
175
+ export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody, GetUserListSegmentBody, CreateKYCAuthBody, GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps, CreateAuthSessionExpiredBody };
176
+ export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders, setAuthSessionToGlobalHeaders };
176
177
  export default API;
@@ -17,6 +17,7 @@ import { fileService } from './file';
17
17
  import { documentService } from './document';
18
18
  import { initService } from './init';
19
19
  import { terminalService } from './terminal';
20
+ import { setAuthSessionToGlobalHeaders } from './headers';
20
21
  var API = {
21
22
  locationService: locationService,
22
23
  operatorService: operatorService,
@@ -37,5 +38,5 @@ var API = {
37
38
  initService: initService,
38
39
  terminalService: terminalService
39
40
  };
40
- export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
41
+ export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders, setAuthSessionToGlobalHeaders };
41
42
  export default API;
@@ -1,4 +1,5 @@
1
1
  declare const rootReducer: {
2
+ session: import("redux").Reducer<import("./session").SessionState, import("redux").AnyAction>;
2
3
  settings: import("redux").Reducer<import("./settings").SettingsState, import("redux").AnyAction>;
3
4
  connect: import("redux").Reducer<import("../features/app/connect/connectStore").ConnectState, import("redux").AnyAction>;
4
5
  business: import("redux").Reducer<import("../features/app/business/businessStore").BusinessState, import("redux").AnyAction>;
@@ -1,3 +1,4 @@
1
+ import session from './session';
1
2
  import settings from './settings';
2
3
  import connect from '../features/app/connect/connectStore';
3
4
  import business from '../features/app/business/businessStore';
@@ -14,6 +15,7 @@ import auth from '../features/app/auth/authStore';
14
15
  import kyc from '../features/app/kyc/kycStore';
15
16
  import terminal from '../features/app/terminal/terminalStore';
16
17
  var rootReducer = {
18
+ session: session,
17
19
  settings: settings,
18
20
  connect: connect,
19
21
  business: business,
@@ -0,0 +1,17 @@
1
+ import { RootState } from './store';
2
+ import { ActionState, SharedState } from '../@types';
3
+ export interface SessionData {
4
+ isExpired: boolean;
5
+ nextScreen: string;
6
+ }
7
+ export interface SessionState extends SharedState<SessionData> {
8
+ }
9
+ export declare const sessionSlice: import("@reduxjs/toolkit").Slice<SessionState, {
10
+ setSessionExpired: (state: SessionState) => void;
11
+ setNextScreen: (state: SessionState, action: ActionState<string>) => void;
12
+ resetSession: (state: SessionState) => void;
13
+ }, "session">;
14
+ export declare const setSessionExpired: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setNextScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetSession: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
15
+ declare const _default: import("redux").Reducer<SessionState, import("redux").AnyAction>;
16
+ export default _default;
17
+ export declare const sessionSelector: (state: RootState) => SessionState;
@@ -0,0 +1,28 @@
1
+ var _a;
2
+ import { createSlice } from '@reduxjs/toolkit';
3
+ var initialState = {
4
+ error: null,
5
+ loading: false,
6
+ data: {
7
+ isExpired: false,
8
+ nextScreen: ''
9
+ }
10
+ };
11
+ export var sessionSlice = createSlice({
12
+ name: 'session',
13
+ initialState: initialState,
14
+ reducers: {
15
+ setSessionExpired: function (state) {
16
+ state.data.isExpired = true;
17
+ },
18
+ setNextScreen: function (state, action) {
19
+ state.data.nextScreen = action.payload;
20
+ },
21
+ resetSession: function (state) {
22
+ state.data.isExpired = false;
23
+ }
24
+ }
25
+ });
26
+ export var setSessionExpired = (_a = sessionSlice.actions, _a.setSessionExpired), setNextScreen = _a.setNextScreen, resetSession = _a.resetSession;
27
+ export default sessionSlice.reducer;
28
+ export var sessionSelector = function (state) { return state.session; };
@@ -100,7 +100,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
100
100
  _e = _f, country_list = _e.country_list, ip_info = _e.ip_info, merchant = _e.merchant, operator = _e.operator, config = _e.config;
101
101
  list = __spreadArray([], ((country_list === null || country_list === void 0 ? void 0 : country_list.list) || []), true);
102
102
  _g = ip_info || {}, ip = _g.ip, latitude = _g.latitude, longitude = _g.longitude, country_code = _g.country_code;
103
- countries = sortCountries(list);
103
+ countries = sortCountries(list.filter(function (c) { return c.idd_prefix; }));
104
104
  if (config) {
105
105
  _h = config, operator_1 = _h.operator, scope = _h.scope, data = _h.data, lead = _h.lead, board = _h.board, interfaceData = _h.interface, redirect = _h.redirect, post = _h.post, platforms = _h.platforms, payment_provider = _h.payment_provider;
106
106
  _j = interfaceData || {}, locale_1 = _j.locale, edges = _j.edges;
@@ -1,5 +1,6 @@
1
1
  import { ThunkAction, Action } from '@reduxjs/toolkit';
2
2
  export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
3
+ session: import("./session").SessionState;
3
4
  settings: import("./settings").SettingsState;
4
5
  connect: import("../features/app/connect/connectStore").ConnectState;
5
6
  business: import("../features/app/business/businessStore").BusinessState;
@@ -16,6 +17,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
16
17
  kyc: import("../features/app/kyc/kycStore").KYCDataState;
17
18
  terminal: import("../features/app/terminal/terminalStore").TerminalDataState;
18
19
  }, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
20
+ session: import("./session").SessionState;
19
21
  settings: import("./settings").SettingsState;
20
22
  connect: import("../features/app/connect/connectStore").ConnectState;
21
23
  business: import("../features/app/business/businessStore").BusinessState;
@@ -684,5 +684,8 @@
684
684
  "year": "السنة",
685
685
  "yes": "نعم",
686
686
  "your_brand_details": "تفاصيل علامتك التجارية",
687
- "يرجى التحقق من اسم تطبيق ابل": ""
687
+ "يرجى التحقق من اسم تطبيق ابل": "",
688
+ "session_expired_otp": "Session expired. Please verify your phone number to continue.",
689
+ "code_sent_to": "Code sent to ",
690
+ "session_invalid": "Session Invalid"
688
691
  }
@@ -711,5 +711,8 @@
711
711
  "website_label": "Website",
712
712
  "year": "Year",
713
713
  "yes": "Yes",
714
- "your_brand_details": "Your brand details"
714
+ "your_brand_details": "Your brand details",
715
+ "session_expired_otp": "Session expired. Please verify your phone number to continue.",
716
+ "code_sent_to": "Code sent to ",
717
+ "session_invalid": "Session Invalid"
715
718
  }
@@ -12,7 +12,8 @@ export interface DeviceCardProps extends CardProps {
12
12
  loading?: boolean;
13
13
  arrow?: boolean;
14
14
  endAdornment?: React.ReactNode;
15
+ titleSx?: React.CSSProperties;
15
16
  }
16
- export declare const DeviceCard: ({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, ...rest }: DeviceCardProps) => JSX.Element;
17
- declare const _default: React.MemoExoticComponent<({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, ...rest }: DeviceCardProps) => JSX.Element>;
17
+ export declare const DeviceCard: ({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, titleSx, ...rest }: DeviceCardProps) => JSX.Element;
18
+ declare const _default: React.MemoExoticComponent<({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, titleSx, ...rest }: DeviceCardProps) => JSX.Element>;
18
19
  export default _default;
@@ -86,7 +86,7 @@ var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
86
86
  })));
87
87
  });
88
88
  export var DeviceCard = function (_a) {
89
- var image = _a.image, name = _a.name, deviceId = _a.deviceId, deviceIdLabel = _a.deviceIdLabel, isLinked = _a.isLinked, pairedWith = _a.pairedWith, onClick = _a.onClick, badge = _a.badge, border = _a.border, arrow = _a.arrow, loading = _a.loading, endAdornment = _a.endAdornment, rest = __rest(_a, ["image", "name", "deviceId", "deviceIdLabel", "isLinked", "pairedWith", "onClick", "badge", "border", "arrow", "loading", "endAdornment"]);
89
+ var image = _a.image, name = _a.name, deviceId = _a.deviceId, deviceIdLabel = _a.deviceIdLabel, isLinked = _a.isLinked, pairedWith = _a.pairedWith, onClick = _a.onClick, badge = _a.badge, border = _a.border, arrow = _a.arrow, loading = _a.loading, endAdornment = _a.endAdornment, titleSx = _a.titleSx, rest = __rest(_a, ["image", "name", "deviceId", "deviceIdLabel", "isLinked", "pairedWith", "onClick", "badge", "border", "arrow", "loading", "endAdornment", "titleSx"]);
90
90
  var t = useTranslation().t;
91
91
  var _b = useTheme(), typography = _b.typography, palette = _b.palette;
92
92
  var getEndComponent = function () {
@@ -97,6 +97,6 @@ export var DeviceCard = function (_a) {
97
97
  if (arrow)
98
98
  return _jsx(ArrowIcon, {});
99
99
  };
100
- return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(TruncatedTooltipText, { text: name, style: __assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }) }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId })] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
100
+ return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(TruncatedTooltipText, { text: name, style: __assign(__assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }), titleSx) }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId })] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
101
101
  };
102
102
  export default memo(DeviceCard);
@@ -112,6 +112,8 @@ export declare const CONNECT_STEP_NAMES: {
112
112
  CONNECT_MOBILE_OWNERSHIP: string;
113
113
  CONNECT_MOBILE_OWNERSHIP_SKIPPED: string;
114
114
  CONNECT_SUCCESS: string;
115
+ CREATE_AUTH_SESSION_EXPIRED: string;
116
+ VERIFY_AUTH_SESSION_EXPIRED: string;
115
117
  };
116
118
  export declare const AUTH_STEP_NAMES: {
117
119
  CREATE_AUTH_MOBILE: string;
@@ -143,6 +145,8 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
143
145
  COLLECT_MOBILE_OWNERSHIP: string;
144
146
  COLLECT_MOBILE_OWNERSHIP_SKIPPED: string;
145
147
  VERIFY_AUTH_MOBILE_OTP: string;
148
+ CREATE_AUTH_SESSION_EXPIRED: string;
149
+ VERIFY_AUTH_SESSION_EXPIRED: string;
146
150
  };
147
151
  export declare const SignIn_STEP_NAMES: {
148
152
  CREATE_AUTH_MOBILE: string;
@@ -67,19 +67,22 @@ export var CONNECT_SCREENS_NAVIGATION = [
67
67
  name: 'CONNECT_VERIFY_PACI_STEP',
68
68
  next: 'CONNECT_INDIVIDUAL_STEP',
69
69
  prev: 'CONNECT_CIVIL_ID_STEP',
70
- order: 2
70
+ order: 2,
71
+ back: 'CONNECT_CIVIL_ID_STEP'
71
72
  },
72
73
  {
73
74
  name: 'CONNECT_VERIFY_NAFATH_STEP',
74
75
  next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_DOB_STEP'],
75
76
  prev: 'CONNECT_NID_STEP',
76
- order: 2
77
+ order: 2,
78
+ back: 'CONNECT_NID_STEP'
77
79
  },
78
80
  {
79
81
  name: 'CONNECT_OTP_STEP',
80
82
  next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'],
81
83
  prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP'],
82
- order: 2
84
+ order: 2,
85
+ back: 'CONNECT_MOBILE_STEP'
83
86
  },
84
87
  {
85
88
  name: 'CONNECT_DOB_STEP',
@@ -121,7 +124,13 @@ export var CONNECT_SCREENS_NAVIGATION = [
121
124
  name: 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP',
122
125
  next: '',
123
126
  prev: '',
124
- order: 5
127
+ order: 7
128
+ },
129
+ {
130
+ name: 'CONNECT_SESSION_EXPIRED_OTP_STEP',
131
+ next: '',
132
+ prev: '',
133
+ order: 8
125
134
  }
126
135
  ];
127
136
  export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
@@ -164,7 +173,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
164
173
  'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
165
174
  ],
166
175
  prev: 'CONNECT_EXPRESS_NID_STEP',
167
- order: 2
176
+ order: 2,
177
+ back: 'CONNECT_EXPRESS_NID_STEP'
168
178
  },
169
179
  {
170
180
  name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
@@ -174,7 +184,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
174
184
  'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
175
185
  ],
176
186
  prev: 'CONNECT_EXPRESS_CIVIL_ID_STEP',
177
- order: 2
187
+ order: 2,
188
+ back: 'CONNECT_EXPRESS_CIVIL_ID_STEP'
178
189
  },
179
190
  {
180
191
  name: 'CONNECT_EXPRESS_OTP_STEP',
@@ -187,7 +198,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
187
198
  'CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP'
188
199
  ],
189
200
  prev: 'CONNECT_EXPRESS_MOBILE_STEP',
190
- order: 2
201
+ order: 2,
202
+ back: 'CONNECT_EXPRESS_MOBILE_STEP'
191
203
  },
192
204
  {
193
205
  name: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
@@ -211,7 +223,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
211
223
  name: 'CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP',
212
224
  next: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
213
225
  prev: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
214
- order: 4
226
+ order: 4,
227
+ back: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
215
228
  },
216
229
  {
217
230
  name: 'CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP',
@@ -228,13 +241,15 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
228
241
  'COLLECT_MOBILE_OWNERSHIP'
229
242
  ],
230
243
  prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
231
- order: 4
244
+ order: 4,
245
+ back: 'CONNECT_EXPRESS_NID_MISSED_STEP'
232
246
  },
233
247
  {
234
248
  name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
235
249
  next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
236
250
  prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
237
- order: 4
251
+ order: 4,
252
+ back: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP'
238
253
  },
239
254
  {
240
255
  name: 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
@@ -323,6 +338,12 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
323
338
  next: '',
324
339
  prev: '',
325
340
  order: 12
341
+ },
342
+ {
343
+ name: 'CONNECT_EXPRESS_SESSION_EXPIRED_OTP_STEP',
344
+ next: '',
345
+ prev: '',
346
+ order: 13
326
347
  }
327
348
  ];
328
349
  export var AUTH_SCREENS_NAVIGATION = [
@@ -1205,7 +1226,9 @@ export var CONNECT_STEP_NAMES = {
1205
1226
  VERIFY_AUTH_PASSWORD: 'connect_verify_auth_password',
1206
1227
  CONNECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
1207
1228
  CONNECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
1208
- CONNECT_SUCCESS: 'connect_completed'
1229
+ CONNECT_SUCCESS: 'connect_completed',
1230
+ CREATE_AUTH_SESSION_EXPIRED: 'connect_create_auth_session_expired',
1231
+ VERIFY_AUTH_SESSION_EXPIRED: 'connect_verify_auth_session_expired'
1209
1232
  };
1210
1233
  export var AUTH_STEP_NAMES = {
1211
1234
  CREATE_AUTH_MOBILE: 'auth_create_auth_mobile',
@@ -1236,7 +1259,9 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
1236
1259
  CONNECT_EXPRESS_SUCCESS: 'connect_express_completed',
1237
1260
  COLLECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
1238
1261
  COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
1239
- VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile'
1262
+ VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile',
1263
+ CREATE_AUTH_SESSION_EXPIRED: 'connect_express_create_auth_session_expired',
1264
+ VERIFY_AUTH_SESSION_EXPIRED: 'connect_express_verify_auth_session_expired'
1240
1265
  };
1241
1266
  export var SignIn_STEP_NAMES = {
1242
1267
  CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
@@ -1,4 +1,4 @@
1
- import { BusinessCountryInfo } from '../@types';
1
+ import { BusinessCountryInfo, CountryCode } from '../@types';
2
2
  export declare const OTHER_BRAND: {
3
3
  id: string;
4
4
  code: string;
@@ -52,34 +52,7 @@ export declare const MONTHLY_INCOME_LIST: {
52
52
  };
53
53
  country_code: string[];
54
54
  }[];
55
- export declare const defaultCountry: {
56
- created: number;
57
- updated: number;
58
- countryId: string;
59
- name: {
60
- created: number;
61
- updated: number;
62
- textId: string;
63
- arabic: string;
64
- english: string;
65
- french: string;
66
- spanish: string;
67
- russian: string;
68
- chinese: string;
69
- };
70
- iso2: string;
71
- iso3: string;
72
- numeric: number;
73
- continent: string;
74
- capital: string;
75
- geoNameId: string;
76
- idd_prefix: number;
77
- logo: string;
78
- digits: number;
79
- supported_by_tap: boolean;
80
- min_digits: number;
81
- max_digits: number;
82
- };
55
+ export declare const defaultCountry: CountryCode;
83
56
  export declare const SOCIAL_MEDIA_LINKS: {
84
57
  twitter: string;
85
58
  facebook: string;
@@ -351,8 +351,8 @@ export var defaultCountry = {
351
351
  created: 1577690965000,
352
352
  updated: 1577691209000,
353
353
  textId: 'txt_vSW31311012NdeM7214',
354
- arabic: 'المملكة العربية السعودية',
355
354
  english: 'Saudi Arabia',
355
+ arabic: 'المملكة العربية السعودية',
356
356
  french: 'Arabie saoudite',
357
357
  spanish: 'Arabia Saudita',
358
358
  russian: 'Саудовская Аравия',
@@ -366,10 +366,10 @@ export var defaultCountry = {
366
366
  geoNameId: '102358',
367
367
  idd_prefix: 966,
368
368
  logo: getCountryLogoPNGPath('SA'),
369
- digits: 10,
369
+ digits: 9,
370
370
  supported_by_tap: true,
371
- min_digits: 10,
372
- max_digits: 10
371
+ min_digits: 9,
372
+ max_digits: 9
373
373
  };
374
374
  export var SOCIAL_MEDIA_LINKS = {
375
375
  twitter: 'https://twitter.com/gotapnow',
@@ -1,27 +1,15 @@
1
- export declare enum KYC_FLOWS {
2
- loadingData = "KYC_LOADING_DATA_STEP",
3
- alreadySubmitted = "ALREADY_SUBMITTED",
4
- tokenError = "TOKEN_ERROR_STEP",
5
- verify = "KYC_VERIFY_STEP",
6
- terms = "KYC_TERMS_STEP",
7
- users = "KYC_USERS_STEP",
8
- operatorError = "KYC_OPERATOR_ERROR_STEP",
9
- verifyPACI = "KYC_VERIFY_PACI_STEP",
10
- verifyNafath = "KYC_VERIFY_NAFATH_STEP",
11
- success = "KYC_SUCCESS_STEP"
12
- }
13
1
  export declare const CONNECT_FLOWS: {
14
2
  kyc: {
15
- loadingData: KYC_FLOWS;
16
- alreadySubmitted: KYC_FLOWS;
17
- tokenError: KYC_FLOWS;
18
- verify: KYC_FLOWS;
19
- terms: KYC_FLOWS;
20
- users: KYC_FLOWS;
21
- operatorError: KYC_FLOWS;
22
- verifyPACI: KYC_FLOWS;
23
- verifyNafath: KYC_FLOWS;
24
- success: KYC_FLOWS;
3
+ loadingData: string;
4
+ alreadySubmitted: string;
5
+ tokenError: string;
6
+ verify: string;
7
+ terms: string;
8
+ users: string;
9
+ operatorError: string;
10
+ verifyPACI: string;
11
+ verifyNafath: string;
12
+ success: string;
25
13
  };
26
14
  terminal: {
27
15
  loadingData: string;
@@ -1,28 +1,15 @@
1
- export var KYC_FLOWS;
2
- (function (KYC_FLOWS) {
3
- KYC_FLOWS["loadingData"] = "KYC_LOADING_DATA_STEP";
4
- KYC_FLOWS["alreadySubmitted"] = "ALREADY_SUBMITTED";
5
- KYC_FLOWS["tokenError"] = "TOKEN_ERROR_STEP";
6
- KYC_FLOWS["verify"] = "KYC_VERIFY_STEP";
7
- KYC_FLOWS["terms"] = "KYC_TERMS_STEP";
8
- KYC_FLOWS["users"] = "KYC_USERS_STEP";
9
- KYC_FLOWS["operatorError"] = "KYC_OPERATOR_ERROR_STEP";
10
- KYC_FLOWS["verifyPACI"] = "KYC_VERIFY_PACI_STEP";
11
- KYC_FLOWS["verifyNafath"] = "KYC_VERIFY_NAFATH_STEP";
12
- KYC_FLOWS["success"] = "KYC_SUCCESS_STEP";
13
- })(KYC_FLOWS || (KYC_FLOWS = {}));
14
1
  export var CONNECT_FLOWS = {
15
2
  kyc: {
16
- loadingData: KYC_FLOWS.loadingData,
17
- alreadySubmitted: KYC_FLOWS.alreadySubmitted,
18
- tokenError: KYC_FLOWS.tokenError,
19
- verify: KYC_FLOWS.verify,
20
- terms: KYC_FLOWS.terms,
21
- users: KYC_FLOWS.users,
22
- operatorError: KYC_FLOWS.operatorError,
23
- verifyPACI: KYC_FLOWS.verifyPACI,
24
- verifyNafath: KYC_FLOWS.verifyNafath,
25
- success: KYC_FLOWS.success
3
+ loadingData: 'KYC_LOADING_DATA_STEP',
4
+ alreadySubmitted: 'ALREADY_SUBMITTED',
5
+ tokenError: 'TOKEN_ERROR_STEP',
6
+ verify: 'KYC_VERIFY_STEP',
7
+ terms: 'KYC_TERMS_STEP',
8
+ users: 'KYC_USERS_STEP',
9
+ operatorError: 'KYC_OPERATOR_ERROR_STEP',
10
+ verifyPACI: 'KYC_VERIFY_PACI_STEP',
11
+ verifyNafath: 'KYC_VERIFY_NAFATH_STEP',
12
+ success: 'KYC_SUCCESS_STEP'
26
13
  },
27
14
  terminal: {
28
15
  loadingData: 'TERMINAL_LOADING_DATA_STEP',
@@ -69,7 +69,7 @@ var _a;
69
69
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
70
70
  import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
71
71
  import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
72
- import API from '../../../api';
72
+ import API, { setAuthSessionToGlobalHeaders } from '../../../api';
73
73
  import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
74
74
  import { findCountryByIddPrefix, isAuthenticationVerificationFailed, isNetworkError, isTimeoutError, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
75
75
  export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
@@ -206,6 +206,7 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
206
206
  })];
207
207
  case 1:
208
208
  data = _g.sent();
209
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
209
210
  sendCustomEventToGTM({
210
211
  event: 'Send Event',
211
212
  event_category: 'User Registration Flow',
@@ -251,6 +252,7 @@ export var verifyPasscode = createAsyncThunk('auth/verifyPasscode', function (pa
251
252
  })];
252
253
  case 1:
253
254
  data = _j.sent();
255
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
254
256
  if (((_e = data === null || data === void 0 ? void 0 : data.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success' && (data === null || data === void 0 ? void 0 : data.auth_session)) {
255
257
  if (scope === 'merchant') {
256
258
  openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
@@ -326,6 +328,7 @@ export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', fu
326
328
  return [4, API.authService.verifyAuth(payload)];
327
329
  case 1:
328
330
  data = _g.sent();
331
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
329
332
  if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MOBILE_OTP) {
330
333
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_OTP_STEP')); });
331
334
  return [2, data];
@@ -394,6 +397,7 @@ export var verifyEmailOtp = createAsyncThunk('auth/verifyEmailOtp', function (pa
394
397
  })];
395
398
  case 1:
396
399
  data = _g.sent();
400
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
397
401
  sendCustomEventToGTM({
398
402
  event: 'Send Event',
399
403
  event_category: 'User Registration Flow',
@@ -485,6 +489,7 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
485
489
  return [2, { value: data }];
486
490
  }
487
491
  if (isSuccess) {
492
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
488
493
  if (scope === 'merchant') {
489
494
  openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
490
495
  return [2, { value: data }];
@@ -610,6 +615,7 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
610
615
  case 5:
611
616
  isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
612
617
  if (isSuccess) {
618
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
613
619
  if (scope === 'merchant') {
614
620
  openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
615
621
  return [2, data];