Merge branch 'rendering_engine' of github.cmd.navi-tech.in:medici/Address-Verification-App into ui-lib-aliasing
This commit is contained in:
28
App.tsx
28
App.tsx
@@ -9,19 +9,14 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import {SafeAreaView, Text, View} from 'react-native';
|
||||
import data from './src/data/templateData.json';
|
||||
import userData from './src/data/userData.json';
|
||||
import RenderingEngine from './src/components/formRenderingEngine';
|
||||
import {Provider} from 'react-redux';
|
||||
import store, {persistor} from './src/store/store';
|
||||
import {PersistGate} from 'redux-persist/integration/react';
|
||||
|
||||
import {NavigationContainer} from '@react-navigation/native';
|
||||
import {createNativeStackNavigator} from '@react-navigation/native-stack';
|
||||
import Widget from './src/components/form';
|
||||
import {navigationRef} from './src/components/utlis/navigationUtlis';
|
||||
import FullScreenLoader from 'RN-UI-LIB/src/components/FullScreenLoader';
|
||||
import ProtectedRouter from './ProtectedRouter';
|
||||
|
||||
function HomeScreen() {
|
||||
return (
|
||||
@@ -36,32 +31,13 @@ function HomeScreen() {
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
const App = () => {
|
||||
// const [hasBeenManuplated, setHasBeenManuplated] = useState<boolean>(false);
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate
|
||||
loading={<FullScreenLoader loading />}
|
||||
persistor={persistor}>
|
||||
<NavigationContainer ref={navigationRef}>
|
||||
<Stack.Navigator>
|
||||
<Stack.Screen
|
||||
name="Home"
|
||||
component={HomeScreen}
|
||||
options={{
|
||||
header: () => null,
|
||||
}}
|
||||
/>
|
||||
{Object.keys(data.widgets).map(key => (
|
||||
<Stack.Screen
|
||||
key={key}
|
||||
name={key}
|
||||
component={Widget}
|
||||
options={{
|
||||
header: () => null,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</Stack.Navigator>
|
||||
<ProtectedRouter />
|
||||
</NavigationContainer>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
|
||||
86
ProtectedRouter.tsx
Normal file
86
ProtectedRouter.tsx
Normal file
@@ -0,0 +1,86 @@
|
||||
import {createNativeStackNavigator} from '@react-navigation/native-stack';
|
||||
import React from 'react';
|
||||
import {View} from 'react-native';
|
||||
import {SafeAreaView} from 'react-native-safe-area-context';
|
||||
import {useSelector} from 'react-redux';
|
||||
import Widget from './src/components/form';
|
||||
import RenderingEngine from './src/components/formRenderingEngine';
|
||||
import Login from './src/components/login';
|
||||
import OtpInput from './src/components/login/OtpInput';
|
||||
import {RootState} from './src/store/store';
|
||||
import data from './src/data/templateData.json';
|
||||
import userData from './src/data/userData.json';
|
||||
import {getUniqueId} from 'react-native-device-info';
|
||||
import {useAppDispatch} from './src/hooks';
|
||||
import {setAuthData} from './src/reducer/commonSlice';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
const LoginScreen = () => <Login />;
|
||||
|
||||
const OTPScreen = () => <OtpInput />;
|
||||
|
||||
const HomeScreen = () => (
|
||||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
|
||||
<SafeAreaView>
|
||||
<RenderingEngine data={data} userData={userData} />
|
||||
</SafeAreaView>
|
||||
</View>
|
||||
);
|
||||
|
||||
const ProtectedRouter = () => {
|
||||
const {isLoggedIn, deviceId} = useSelector(
|
||||
(state: RootState) => state.common.userData,
|
||||
);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
if (!deviceId) {
|
||||
getUniqueId().then(id => dispatch(setAuthData({deviceId: id})));
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack.Navigator>
|
||||
{isLoggedIn ? (
|
||||
<>
|
||||
<Stack.Screen
|
||||
name="Home"
|
||||
component={HomeScreen}
|
||||
options={{
|
||||
header: () => null,
|
||||
}}
|
||||
/>
|
||||
{Object.keys(data.widgets).map(key => (
|
||||
<Stack.Screen
|
||||
key={key}
|
||||
name={key}
|
||||
component={Widget}
|
||||
options={{
|
||||
header: () => null,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Stack.Screen
|
||||
name="Login"
|
||||
component={LoginScreen}
|
||||
options={{
|
||||
header: () => null,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="OTP"
|
||||
component={OTPScreen}
|
||||
options={{
|
||||
header: () => null,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Stack.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProtectedRouter;
|
||||
@@ -1,3 +1,16 @@
|
||||
module.exports = {
|
||||
presets: ['module:metro-react-native-babel-preset'],
|
||||
plugins: [
|
||||
[
|
||||
require.resolve('babel-plugin-module-resolver'),
|
||||
{
|
||||
cwd: 'babelrc',
|
||||
extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js'],
|
||||
alias: {
|
||||
'@cuteapp': './app'
|
||||
}
|
||||
}
|
||||
],
|
||||
'jest-hoist'
|
||||
],
|
||||
};
|
||||
|
||||
15
package.json
15
package.json
@@ -13,18 +13,20 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-async-storage/async-storage": "1.17.11",
|
||||
"@react-native-firebase/app": "^16.4.6",
|
||||
"@react-native-firebase/database": "^16.4.6",
|
||||
"@react-navigation/native": "^6.0.16",
|
||||
"@react-navigation/native-stack": "^6.9.4",
|
||||
"@react-native-firebase/app": "16.4.6",
|
||||
"@react-native-firebase/database": "16.4.6",
|
||||
"@react-navigation/native": "6.0.16",
|
||||
"@react-navigation/native-stack": "6.9.4",
|
||||
"@reduxjs/toolkit": "1.9.1",
|
||||
"axios": "1.2.1",
|
||||
"react": "18.1.0",
|
||||
"react-hook-form": "7.40.0",
|
||||
"react-native": "0.70.6",
|
||||
"react-native-device-info": "10.3.0",
|
||||
"react-native-image-picker": "4.10.2",
|
||||
"react-native-pager-view": "6.1.2",
|
||||
"react-native-safe-area-context": "^4.4.1",
|
||||
"react-native-screens": "^3.18.2",
|
||||
"react-native-safe-area-context": "4.4.1",
|
||||
"react-native-screens": "3.18.2",
|
||||
"react-native-svg": "13.6.0",
|
||||
"react-native-tab-view": "3.3.2",
|
||||
"react-native-toast-message": "2.1.5",
|
||||
@@ -44,6 +46,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "5.45.0",
|
||||
"@typescript-eslint/parser": "5.37.0",
|
||||
"babel-jest": "26.6.3",
|
||||
"babel-plugin-module-resolver": "^4.1.0",
|
||||
"eslint": "8.28.0",
|
||||
"eslint-config-airbnb-typescript": "17.0.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
|
||||
69
src/action/authActions.ts
Normal file
69
src/action/authActions.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import {setAuthData} from '../reducer/commonSlice';
|
||||
import axiosInstance, {ApiKeys, getApiUrl} from '../components/utlis/apiHelper';
|
||||
import {
|
||||
setFormLoading,
|
||||
setGetOTPError,
|
||||
setShowOTPScreen,
|
||||
setVerifyOTPError,
|
||||
setVerifyOTPSuccess,
|
||||
} from '../components/login/loginSlice';
|
||||
import {Dispatch} from '@reduxjs/toolkit';
|
||||
import {navigateToScreen} from '../components/utlis/navigationUtlis';
|
||||
|
||||
export interface GenerateOTPPayload {
|
||||
phoneNumber: string;
|
||||
}
|
||||
|
||||
export interface VerifyOTPPayload {
|
||||
otp: string;
|
||||
otpToken: string;
|
||||
}
|
||||
|
||||
export const generateOTP =
|
||||
({phoneNumber}: GenerateOTPPayload, isResendOTP?: boolean) =>
|
||||
(dispatch: Dispatch) => {
|
||||
const url = getApiUrl(ApiKeys.GENERATE_OTP);
|
||||
dispatch(setFormLoading(true));
|
||||
axiosInstance
|
||||
.post(url, {phoneNumber: Number(phoneNumber)})
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
if (response?.data?.data?.otpToken) {
|
||||
dispatch(
|
||||
setShowOTPScreen({
|
||||
phoneNumber,
|
||||
otpToken: response?.data?.data?.otpToken,
|
||||
}),
|
||||
);
|
||||
!isResendOTP && navigateToScreen('OTP');
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
if (err.response.status === 404) {
|
||||
dispatch(
|
||||
setGetOTPError('Enter a registered mobile number'),
|
||||
);
|
||||
} else {
|
||||
dispatch(setGetOTPError(err.response?.data?.message));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const verifyOTP =
|
||||
({otp, otpToken}: VerifyOTPPayload) =>
|
||||
(dispatch: Dispatch) => {
|
||||
const url = getApiUrl(ApiKeys.VERIFY_OTP);
|
||||
|
||||
dispatch(setFormLoading(true));
|
||||
axiosInstance
|
||||
.post(url, {otp, otpToken}, {headers: {donotHandleError: true}})
|
||||
.then((response: any) => {
|
||||
const {sessionToken} = response?.data?.data;
|
||||
dispatch(setAuthData({sessionToken, isLoggedIn: true}));
|
||||
dispatch(setVerifyOTPSuccess('OTP verified'));
|
||||
})
|
||||
.catch(err => {
|
||||
dispatch(setVerifyOTPError('Invalid OTP, try again'));
|
||||
});
|
||||
};
|
||||
44
src/components/countdown/index.tsx
Normal file
44
src/components/countdown/index.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import {useEffect, useRef, useState} from 'react';
|
||||
|
||||
interface CountdownProps {
|
||||
startFrom: number;
|
||||
stopAt?: number;
|
||||
interval?: number;
|
||||
decrementBy?: number;
|
||||
step?: (current: number) => void;
|
||||
onComplete?: () => void;
|
||||
}
|
||||
|
||||
export const Countdown = (props: CountdownProps) => {
|
||||
const {
|
||||
startFrom = 0,
|
||||
stopAt = 0,
|
||||
interval = 1000,
|
||||
decrementBy = 1,
|
||||
step,
|
||||
onComplete,
|
||||
} = props;
|
||||
const [ticker, setTicker] = useState(startFrom);
|
||||
const intervalRef = useRef<any>();
|
||||
useEffect(() => {
|
||||
const tick = () => {
|
||||
const newTickerValue = ticker - decrementBy;
|
||||
|
||||
if (newTickerValue < stopAt) {
|
||||
clearTimeout(intervalRef.current);
|
||||
onComplete && onComplete();
|
||||
return;
|
||||
}
|
||||
|
||||
step && step(newTickerValue);
|
||||
setTicker(newTickerValue);
|
||||
};
|
||||
|
||||
clearTimeout(intervalRef.current);
|
||||
intervalRef.current = setTimeout(tick, interval);
|
||||
|
||||
return () => clearTimeout(intervalRef.current);
|
||||
}, [ticker]);
|
||||
|
||||
return <>{ticker}</>;
|
||||
};
|
||||
@@ -9,12 +9,12 @@ import TextArea from './components/TextArea';
|
||||
import TextInput from './components/TextInput';
|
||||
|
||||
const Component = {
|
||||
TextInput: TextInput,
|
||||
TextArea: TextArea,
|
||||
RadioButton: RadioButton,
|
||||
ImageUpload: ImageUpload,
|
||||
Checkbox: Checkbox,
|
||||
Rating: Rating,
|
||||
TextInput,
|
||||
TextArea,
|
||||
RadioButton,
|
||||
ImageUpload,
|
||||
Checkbox,
|
||||
Rating,
|
||||
};
|
||||
|
||||
interface IQuestionRenderingEngine {
|
||||
|
||||
103
src/components/login/OtpInput.tsx
Normal file
103
src/components/login/OtpInput.tsx
Normal file
@@ -0,0 +1,103 @@
|
||||
import React from 'react';
|
||||
import {Controller, useForm} from 'react-hook-form';
|
||||
import {StyleSheet} from 'react-native';
|
||||
import {SafeAreaView} from 'react-native-safe-area-context';
|
||||
import {useSelector} from 'react-redux';
|
||||
import Button from '../../../RN-UI-LIB/src/components/Button';
|
||||
import Heading from '../../../RN-UI-LIB/src/components/Heading';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
import TextInput from '../../../RN-UI-LIB/src/components/TextInput';
|
||||
import BackArrowIcon from '../../../RN-UI-LIB/src/Icons/BackArrowIcon';
|
||||
import {GenericStyles} from '../../../RN-UI-LIB/src/styles';
|
||||
import {COLORS} from '../../../RN-UI-LIB/src/styles/colors';
|
||||
import {
|
||||
verifyOTP,
|
||||
VerifyOTPPayload,
|
||||
} from '../../action/authActions';
|
||||
import {useAppDispatch} from '../../hooks';
|
||||
import {RootState} from '../../store/store';
|
||||
import {navigateToScreen} from '../utlis/navigationUtlis';
|
||||
import OtpText from './OtpText';
|
||||
|
||||
interface IOtpForm {
|
||||
otp: string;
|
||||
}
|
||||
|
||||
const OtpInput = () => {
|
||||
const {
|
||||
handleSubmit,
|
||||
control,
|
||||
formState: {errors, isValid},
|
||||
} = useForm<IOtpForm>();
|
||||
|
||||
const {phoneNumber, otpToken, verifyOTPError, isLoading} = useSelector(
|
||||
(state: RootState) => state.loginInfo,
|
||||
);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleVerifyOTP = (data: IOtpForm) => {
|
||||
const payload: VerifyOTPPayload = {
|
||||
otp: data.otp,
|
||||
otpToken,
|
||||
};
|
||||
dispatch(verifyOTP(payload));
|
||||
};
|
||||
|
||||
const handleBackClick = () => {
|
||||
navigateToScreen('Login');
|
||||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView
|
||||
style={[
|
||||
GenericStyles.p16,
|
||||
GenericStyles.whiteBackground,
|
||||
GenericStyles.fill,
|
||||
GenericStyles.justifyContentCenter,
|
||||
]}>
|
||||
<BackArrowIcon
|
||||
style={GenericStyles.mb8}
|
||||
onPress={handleBackClick}
|
||||
/>
|
||||
<Heading dark>Enter OTP</Heading>
|
||||
<Text light style={[GenericStyles.mb24, GenericStyles.mt4]}>
|
||||
OTP sent to <Text>{phoneNumber}</Text>{' '}
|
||||
<Text style={styles.clickableText} onPress={handleBackClick}>
|
||||
Change
|
||||
</Text>
|
||||
</Text>
|
||||
<Controller
|
||||
control={control}
|
||||
render={({field: {onChange, onBlur, value}}) => (
|
||||
<TextInput
|
||||
keyboardType="phone-pad"
|
||||
placeholder="Enter OTP"
|
||||
onBlur={onBlur}
|
||||
onChangeText={value => onChange(value)}
|
||||
value={value}
|
||||
maxLength={4}
|
||||
/>
|
||||
)}
|
||||
name="otp"
|
||||
rules={{required: true, minLength: 4}}
|
||||
/>
|
||||
<OtpText />
|
||||
<Button
|
||||
title="Verify OTP"
|
||||
onPress={handleSubmit(handleVerifyOTP)}
|
||||
style={[GenericStyles.w100, GenericStyles.mt24]}
|
||||
disabled={!isValid || isLoading}
|
||||
showLoader={isLoading}
|
||||
/>
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
clickableText: {
|
||||
color: COLORS.BASE.BLUE,
|
||||
},
|
||||
});
|
||||
|
||||
export default OtpInput;
|
||||
66
src/components/login/OtpText.tsx
Normal file
66
src/components/login/OtpText.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import React, {useState} from 'react';
|
||||
import {useSelector} from 'react-redux';
|
||||
import {generateOTP} from '../../action/authActions';
|
||||
import {useAppDispatch} from '../../hooks';
|
||||
import {RootState} from '../../store/store';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
import {Countdown} from '../countdown';
|
||||
import {StyleSheet} from 'react-native';
|
||||
import {COLORS} from '../../../RN-UI-LIB/src/styles/colors';
|
||||
|
||||
const OtpText = () => {
|
||||
const [countDownComplete, setCountDownComplete] = useState<boolean>(false);
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const {phoneNumber, verifyOTPError} = useSelector(
|
||||
(state: RootState) => state.loginInfo,
|
||||
);
|
||||
|
||||
const handleResendOTP = () => {
|
||||
dispatch(generateOTP({phoneNumber}, true));
|
||||
};
|
||||
|
||||
if (verifyOTPError) {
|
||||
return (
|
||||
<Text style={styles.errorText}>
|
||||
{verifyOTPError}{' '}
|
||||
<Text style={styles.clickableText} onPress={handleResendOTP}>
|
||||
Resend OTP
|
||||
</Text>
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
if (countDownComplete) {
|
||||
return (
|
||||
<Text light>
|
||||
Enter 4 digits OTP or{' '}
|
||||
<Text style={styles.clickableText} onPress={handleResendOTP}>
|
||||
Resend OTP
|
||||
</Text>
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Text light>
|
||||
Resend OTP in{' '}
|
||||
<Countdown
|
||||
onComplete={() => {
|
||||
setCountDownComplete(true);
|
||||
}}
|
||||
startFrom={30}
|
||||
/>{' '}
|
||||
second
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
clickableText: {
|
||||
color: COLORS.BASE.BLUE,
|
||||
},
|
||||
errorText: {
|
||||
color: COLORS.TEXT.RED,
|
||||
},
|
||||
});
|
||||
|
||||
export default OtpText;
|
||||
77
src/components/login/index.tsx
Normal file
77
src/components/login/index.tsx
Normal file
@@ -0,0 +1,77 @@
|
||||
import React from 'react';
|
||||
import {Controller, useForm} from 'react-hook-form';
|
||||
import {SafeAreaView} from 'react-native-safe-area-context';
|
||||
import {useSelector} from 'react-redux';
|
||||
import Button from '../../../RN-UI-LIB/src/components/Button';
|
||||
import Heading from '../../../RN-UI-LIB/src/components/Heading';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
import TextInput from '../../../RN-UI-LIB/src/components/TextInput';
|
||||
import {GenericStyles} from '../../../RN-UI-LIB/src/styles';
|
||||
import NaviLogoIcon from '../../../RN-UI-LIB/src/Icons/NaviLogoIcon';
|
||||
import {generateOTP, GenerateOTPPayload} from '../../action/authActions';
|
||||
import {useAppDispatch} from '../../hooks';
|
||||
import {RootState} from '../../store/store';
|
||||
|
||||
interface ILoginForm {
|
||||
phoneNumber: string;
|
||||
}
|
||||
|
||||
const Login = () => {
|
||||
const {
|
||||
handleSubmit,
|
||||
control,
|
||||
formState: {errors, isValid},
|
||||
} = useForm<ILoginForm>();
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const {phoneNumber, OTPError, isLoading} = useSelector(
|
||||
(state: RootState) => state.loginInfo,
|
||||
);
|
||||
|
||||
const handleGenerateOTP = (data: GenerateOTPPayload) => {
|
||||
dispatch(generateOTP(data));
|
||||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView
|
||||
style={[
|
||||
GenericStyles.p16,
|
||||
GenericStyles.whiteBackground,
|
||||
GenericStyles.fill,
|
||||
GenericStyles.justifyContentCenter,
|
||||
]}>
|
||||
<NaviLogoIcon style={GenericStyles.mb8} />
|
||||
<Heading dark>Login to ...</Heading>
|
||||
<Text light style={[GenericStyles.mb24, GenericStyles.mt4]}>
|
||||
Use your registered mobile number
|
||||
</Text>
|
||||
<Controller
|
||||
control={control}
|
||||
render={({field: {onChange, onBlur, value}}) => (
|
||||
<TextInput
|
||||
keyboardType="phone-pad"
|
||||
placeholder="Enter here"
|
||||
onBlur={onBlur}
|
||||
onChangeText={value => onChange(value)}
|
||||
value={value}
|
||||
maxLength={10}
|
||||
defaultValue={phoneNumber}
|
||||
error={Boolean(OTPError)}
|
||||
errorMessage={OTPError}
|
||||
/>
|
||||
)}
|
||||
name="phoneNumber"
|
||||
rules={{required: true, minLength: 10}}
|
||||
/>
|
||||
<Button
|
||||
title="Get OTP"
|
||||
onPress={handleSubmit(handleGenerateOTP)}
|
||||
style={[GenericStyles.w100, GenericStyles.mt24]}
|
||||
disabled={!isValid || isLoading}
|
||||
showLoader={isLoading}
|
||||
/>
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
export default Login;
|
||||
52
src/components/login/loginSlice.ts
Normal file
52
src/components/login/loginSlice.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import {createSlice} from '@reduxjs/toolkit';
|
||||
|
||||
const initialState = {
|
||||
phoneNumber: '',
|
||||
otpToken: '',
|
||||
getOTPSuccess: {},
|
||||
OTPError: '',
|
||||
verifyOTPSuccess: '',
|
||||
verifyOTPError: '',
|
||||
isLoading: false,
|
||||
};
|
||||
|
||||
const loginSlice = createSlice({
|
||||
name: 'auth',
|
||||
initialState,
|
||||
reducers: {
|
||||
setShowOTPScreen: (state, action) => {
|
||||
const {phoneNumber, otpToken} = action.payload;
|
||||
state.phoneNumber = phoneNumber || state.phoneNumber;
|
||||
state.otpToken = otpToken;
|
||||
state.isLoading = false;
|
||||
state.OTPError = '';
|
||||
state.verifyOTPError = '';
|
||||
},
|
||||
setGetOTPError: (state, action) => {
|
||||
state.OTPError = action.payload;
|
||||
state.isLoading = false;
|
||||
},
|
||||
setVerifyOTPSuccess: (state, action) => {
|
||||
state.verifyOTPSuccess = action.payload;
|
||||
state.verifyOTPError = '';
|
||||
state.isLoading = false;
|
||||
},
|
||||
setVerifyOTPError: (state, action) => {
|
||||
state.verifyOTPError = action.payload;
|
||||
state.isLoading = false;
|
||||
},
|
||||
setFormLoading: (state, action) => {
|
||||
state.isLoading = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
setGetOTPError,
|
||||
setVerifyOTPError,
|
||||
setVerifyOTPSuccess,
|
||||
setShowOTPScreen,
|
||||
setFormLoading,
|
||||
} = loginSlice.actions;
|
||||
|
||||
export default loginSlice.reducer;
|
||||
139
src/components/utlis/apiHelper.ts
Normal file
139
src/components/utlis/apiHelper.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
import axios from 'axios';
|
||||
import {Dispatch} from '@reduxjs/toolkit';
|
||||
import {setAuthData} from '../../reducer/commonSlice';
|
||||
import {toast} from '../../../RN-UI-LIB/src/components/toast';
|
||||
import {navigateToScreen} from './navigationUtlis';
|
||||
import {GLOBAL} from '../../constants/Global';
|
||||
|
||||
const MOCK_DIR = '__mocks__';
|
||||
|
||||
// set this to `true` to use mock data for local development
|
||||
// to connect with real apis this should be set to `false`
|
||||
const USE_MOCK = false;
|
||||
|
||||
export enum ApiKeys {
|
||||
GENERATE_OTP,
|
||||
VERIFY_OTP,
|
||||
}
|
||||
|
||||
const API_URLS: Record<ApiKeys, string> = {} as Record<ApiKeys, string>;
|
||||
API_URLS[ApiKeys.GENERATE_OTP] = '/auth/otp/generate';
|
||||
API_URLS[ApiKeys.VERIFY_OTP] = '/auth/otp/verify';
|
||||
|
||||
const MOCK_API_URLS: Record<ApiKeys, string> = {} as Record<ApiKeys, string>;
|
||||
|
||||
let dispatch: Dispatch<any>;
|
||||
|
||||
const getErrorMessage = (err: any) => {
|
||||
if (err?.response?.data?.title) {
|
||||
return err?.response?.data?.title;
|
||||
}
|
||||
const errorContent = err?.response?.data?.message
|
||||
? JSON.parse(err?.response?.data?.message)
|
||||
: '';
|
||||
return errorContent?.detail || errorContent?.message || errorContent || err;
|
||||
};
|
||||
|
||||
export function getApiUrl(
|
||||
apiKey: ApiKeys,
|
||||
params?: Record<string, string | number>,
|
||||
queryParams?: Record<string, string | number>,
|
||||
) {
|
||||
if (USE_MOCK) {
|
||||
return `${MOCK_DIR}/${MOCK_API_URLS[apiKey]}`;
|
||||
}
|
||||
|
||||
let apiUrl = API_URLS[apiKey];
|
||||
|
||||
// replace all {placeholders} with their values in params
|
||||
if (params) {
|
||||
Object.keys(params).forEach(paramKey => {
|
||||
apiUrl = apiUrl.split(`{${paramKey}}`).join(`${params[paramKey]}`);
|
||||
// apiUrl = apiUrl.replaceAll(`{${paramKey}}`, `${params[paramKey]}`);
|
||||
});
|
||||
}
|
||||
|
||||
if (queryParams) {
|
||||
apiUrl +=
|
||||
'?' +
|
||||
Object.keys(queryParams)
|
||||
.map(key => `${key}=${queryParams[key]}`)
|
||||
.join('&');
|
||||
}
|
||||
|
||||
return `${apiUrl}`;
|
||||
}
|
||||
// status code to be retried on
|
||||
const errorsToRetry = [500, 503];
|
||||
|
||||
const axiosInstance = axios.create();
|
||||
|
||||
axiosInstance.interceptors.request.use(request => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
// request['retry'] = request['retry'] && request['retry'] < 4 ? request['retry'] : 3;
|
||||
request.retry = request?.retry < 4 ? request.retry : 3;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
request.headers['request-start-time'] = new Date().getTime();
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
request.headers['sessionToken'] = GLOBAL.SESSION_TOKEN || '';
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
request.headers['deviceId'] = GLOBAL.DEVICE_ID || '';
|
||||
return request;
|
||||
});
|
||||
|
||||
axiosInstance.interceptors.response.use(
|
||||
response => {
|
||||
if (response.config.headers) {
|
||||
const start = response.config.headers['request-start-time'];
|
||||
const end = new Date().getTime();
|
||||
const milliseconds = end - Number(start);
|
||||
response.headers['request-duration'] = String(milliseconds);
|
||||
}
|
||||
return response;
|
||||
},
|
||||
error => {
|
||||
const {config, response} = error;
|
||||
if (
|
||||
!config ||
|
||||
config.retry <= 1 ||
|
||||
!errorsToRetry.includes(error.response.status)
|
||||
) {
|
||||
const errorString = getErrorMessage(error);
|
||||
if (!config.headers.donotHandleError) {
|
||||
toast({type: 'error', text1: errorString});
|
||||
}
|
||||
|
||||
if (response.status === 401) {
|
||||
dispatch &&
|
||||
dispatch(
|
||||
setAuthData({sessionToken: '', isLoggedIn: false}),
|
||||
);
|
||||
navigateToScreen('Login');
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
config.retry -= 1;
|
||||
const delayRetryRequest = new Promise<void>(resolve => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 0);
|
||||
});
|
||||
return delayRetryRequest.then(() => axiosInstance(config));
|
||||
},
|
||||
);
|
||||
|
||||
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
||||
axiosInstance.defaults.baseURL = `https://dev-longhorn-server.np.navi-tech.in/av/`;
|
||||
|
||||
// TODO:: Ideally should happen through middlewares.
|
||||
// export const registerNavigateAndDispatch = (
|
||||
// navigateParam: NavigateFunction,
|
||||
// dispatchParam: Dispatch<any>
|
||||
// ) => ((navigate = navigateParam), (dispatch = dispatchParam));
|
||||
|
||||
export default axiosInstance;
|
||||
9
src/constants/Global.ts
Normal file
9
src/constants/Global.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const GLOBAL = {
|
||||
SESSION_TOKEN: '',
|
||||
DEVICE_ID: '',
|
||||
};
|
||||
|
||||
export const setGlobalUserData = (token?: string, deviceId?: string) => {
|
||||
if (token) GLOBAL.SESSION_TOKEN = token;
|
||||
if (deviceId) GLOBAL.DEVICE_ID = deviceId;
|
||||
};
|
||||
6
src/hooks/index.ts
Normal file
6
src/hooks/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import {TypedUseSelectorHook, useDispatch, useSelector} from 'react-redux';
|
||||
import type {RootState, AppDispatch} from '../store/store';
|
||||
|
||||
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
||||
export const useAppDispatch: () => AppDispatch = useDispatch;
|
||||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
|
||||
42
src/reducer/commonSlice.ts
Normal file
42
src/reducer/commonSlice.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import {createSlice} from '@reduxjs/toolkit';
|
||||
import {GLOBAL, setGlobalUserData} from '../constants/Global';
|
||||
|
||||
export interface User {
|
||||
isLoggedIn: boolean;
|
||||
deviceId: string;
|
||||
sessionToken: string;
|
||||
}
|
||||
|
||||
export interface CommonState {
|
||||
userData: User;
|
||||
}
|
||||
|
||||
const initialState = {
|
||||
userData: {
|
||||
isLoggedIn: false,
|
||||
sessionToken: GLOBAL.SESSION_TOKEN || '',
|
||||
deviceId: GLOBAL.DEVICE_ID || '',
|
||||
} as User,
|
||||
} as CommonState;
|
||||
|
||||
console.log('initialState', initialState);
|
||||
export const commonSlice = createSlice({
|
||||
name: 'common',
|
||||
initialState,
|
||||
reducers: {
|
||||
setAuthData: (state, action) => {
|
||||
if (action.payload) {
|
||||
state.userData = {...state.userData, ...action.payload};
|
||||
setGlobalUserData(
|
||||
state.userData.sessionToken,
|
||||
state.userData.deviceId,
|
||||
);
|
||||
console.log("new global", GLOBAL);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {setAuthData} = commonSlice.actions;
|
||||
|
||||
export default commonSlice.reducer;
|
||||
@@ -1,10 +1,12 @@
|
||||
import {combineReducers} from 'redux';
|
||||
import loginSlice from '../components/login/loginSlice';
|
||||
import caseReducer from './caseReducre';
|
||||
import formReducer from './formData';
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
caseDetail: caseReducer,
|
||||
formData: formReducer,
|
||||
loginInfo: loginSlice
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
||||
@@ -13,16 +13,20 @@ import {
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
|
||||
import caseReducer from '../reducer/caseReducre';
|
||||
import commonSlice from '../reducer/commonSlice';
|
||||
import loginSlice from '../components/login/loginSlice';
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
case: caseReducer,
|
||||
common: commonSlice,
|
||||
loginInfo: loginSlice
|
||||
});
|
||||
|
||||
const persistConfig = {
|
||||
key: 'root',
|
||||
version: 1,
|
||||
storage: AsyncStorage,
|
||||
whitelist: ['case'],
|
||||
whitelist: ['case', 'common'],
|
||||
};
|
||||
|
||||
const persistedReducer = persistReducer(persistConfig, rootReducer);
|
||||
@@ -40,3 +44,4 @@ export const persistor = persistStore(store);
|
||||
export default store;
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
export type AppDispatch = typeof store.dispatch;
|
||||
184
yarn.lock
184
yarn.lock
@@ -1591,9 +1591,9 @@
|
||||
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
|
||||
|
||||
"@types/node@*":
|
||||
version "18.11.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
|
||||
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
|
||||
version "18.11.11"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.11.tgz#1d455ac0211549a8409d3cdb371cd55cc971e8dc"
|
||||
integrity sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==
|
||||
|
||||
"@types/normalize-package-data@^2.4.0":
|
||||
version "2.4.1"
|
||||
@@ -1625,9 +1625,9 @@
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react@*":
|
||||
version "18.0.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44"
|
||||
integrity sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==
|
||||
version "18.0.26"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.26.tgz#8ad59fc01fef8eaf5c74f4ea392621749f0b7917"
|
||||
integrity sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
"@types/scheduler" "*"
|
||||
@@ -1681,7 +1681,7 @@
|
||||
dependencies:
|
||||
"@types/yargs-parser" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@5.45.0", "@typescript-eslint/eslint-plugin@^5.30.5":
|
||||
"@typescript-eslint/eslint-plugin@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.45.0.tgz#ffa505cf961d4844d38cfa19dcec4973a6039e41"
|
||||
integrity sha512-CXXHNlf0oL+Yg021cxgOdMHNTXD17rHkq7iW6RFHoybdFgQBjU3yIXhhcPpGwr1CjZlo6ET8C6tzX5juQoXeGA==
|
||||
@@ -1696,6 +1696,21 @@
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^5.30.5":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.45.1.tgz#ee5b51405f6c9ee7e60e4006d68c69450d3b4536"
|
||||
integrity sha512-cOizjPlKEh0bXdFrBLTrI/J6B/QMlhwE9auOov53tgB+qMukH6/h8YAK/qw+QJGct/PTbdh2lytGyipxCcEtAw==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.45.1"
|
||||
"@typescript-eslint/type-utils" "5.45.1"
|
||||
"@typescript-eslint/utils" "5.45.1"
|
||||
debug "^4.3.4"
|
||||
ignore "^5.2.0"
|
||||
natural-compare-lite "^1.4.0"
|
||||
regexpp "^3.2.0"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@5.37.0":
|
||||
version "5.37.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.37.0.tgz#c382077973f3a4ede7453fb14cadcad3970cbf3b"
|
||||
@@ -1707,13 +1722,13 @@
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/parser@^5.30.5":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.45.0.tgz#b18a5f6b3cf1c2b3e399e9d2df4be40d6b0ddd0e"
|
||||
integrity sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.45.1.tgz#6440ec283fa1373a12652d4e2fef4cb6e7b7e8c6"
|
||||
integrity sha512-JQ3Ep8bEOXu16q0ztsatp/iQfDCtvap7sp/DKo7DWltUquj5AfCOpX2zSzJ8YkAVnrQNqQ5R62PBz2UtrfmCkA==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.45.0"
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
"@typescript-eslint/typescript-estree" "5.45.0"
|
||||
"@typescript-eslint/scope-manager" "5.45.1"
|
||||
"@typescript-eslint/types" "5.45.1"
|
||||
"@typescript-eslint/typescript-estree" "5.45.1"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.37.0":
|
||||
@@ -1732,6 +1747,14 @@
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
"@typescript-eslint/visitor-keys" "5.45.0"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.45.1":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.45.1.tgz#5b87d025eec7035d879b99c260f03be5c247883c"
|
||||
integrity sha512-D6fCileR6Iai7E35Eb4Kp+k0iW7F1wxXYrOhX/3dywsOJpJAQ20Fwgcf+P/TDtvQ7zcsWsrJaglaQWDhOMsspQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.45.1"
|
||||
"@typescript-eslint/visitor-keys" "5.45.1"
|
||||
|
||||
"@typescript-eslint/type-utils@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.45.0.tgz#aefbc954c40878fcebeabfb77d20d84a3da3a8b2"
|
||||
@@ -1742,6 +1765,16 @@
|
||||
debug "^4.3.4"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/type-utils@5.45.1":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.45.1.tgz#cb7d300c3c95802cea9f87c7f8be363cf8f8538c"
|
||||
integrity sha512-aosxFa+0CoYgYEl3aptLe1svP910DJq68nwEJzyQcrtRhC4BN0tJAvZGAe+D0tzjJmFXe+h4leSsiZhwBa2vrA==
|
||||
dependencies:
|
||||
"@typescript-eslint/typescript-estree" "5.45.1"
|
||||
"@typescript-eslint/utils" "5.45.1"
|
||||
debug "^4.3.4"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@5.37.0":
|
||||
version "5.37.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.37.0.tgz#09e4870a5f3af7af3f84e08d792644a87d232261"
|
||||
@@ -1752,6 +1785,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.45.0.tgz#794760b9037ee4154c09549ef5a96599621109c5"
|
||||
integrity sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==
|
||||
|
||||
"@typescript-eslint/types@5.45.1":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.45.1.tgz#8e1883041cee23f1bb7e1343b0139f97f6a17c14"
|
||||
integrity sha512-HEW3U0E5dLjUT+nk7b4lLbOherS1U4ap+b9pfu2oGsW3oPu7genRaY9dDv3nMczC1rbnRY2W/D7SN05wYoGImg==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.37.0":
|
||||
version "5.37.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.37.0.tgz#956dcf5c98363bcb97bdd5463a0a86072ff79355"
|
||||
@@ -1778,7 +1816,20 @@
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.45.0", "@typescript-eslint/utils@^5.10.0":
|
||||
"@typescript-eslint/typescript-estree@5.45.1":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.1.tgz#b3dc37f0c4f0fe73e09917fc735e6f96eabf9ba4"
|
||||
integrity sha512-76NZpmpCzWVrrb0XmYEpbwOz/FENBi+5W7ipVXAsG3OoFrQKJMiaqsBMbvGRyLtPotGqUfcY7Ur8j0dksDJDng==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.45.1"
|
||||
"@typescript-eslint/visitor-keys" "5.45.1"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.45.0.tgz#9cca2996eee1b8615485a6918a5c763629c7acf5"
|
||||
integrity sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==
|
||||
@@ -1792,6 +1843,20 @@
|
||||
eslint-utils "^3.0.0"
|
||||
semver "^7.3.7"
|
||||
|
||||
"@typescript-eslint/utils@5.45.1", "@typescript-eslint/utils@^5.10.0":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.45.1.tgz#39610c98bde82c4792f2a858b29b7d0053448be2"
|
||||
integrity sha512-rlbC5VZz68+yjAzQBc4I7KDYVzWG2X/OrqoZrMahYq3u8FFtmQYc+9rovo/7wlJH5kugJ+jQXV5pJMnofGmPRw==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@types/semver" "^7.3.12"
|
||||
"@typescript-eslint/scope-manager" "5.45.1"
|
||||
"@typescript-eslint/types" "5.45.1"
|
||||
"@typescript-eslint/typescript-estree" "5.45.1"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
semver "^7.3.7"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.37.0":
|
||||
version "5.37.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.37.0.tgz#7b72dd343295ea11e89b624995abc7103c554eee"
|
||||
@@ -1808,6 +1873,14 @@
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.45.1":
|
||||
version "5.45.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.1.tgz#204428430ad6a830d24c5ac87c71366a1cfe1948"
|
||||
integrity sha512-cy9ln+6rmthYWjH9fmx+5FU/JDpjQb586++x2FZlveq7GdGuLLW9a2Jcst2TGekH82bXpfmRNSwP9tyEs6RjvQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.45.1"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@xmldom/xmldom@~0.7.0":
|
||||
version "0.7.9"
|
||||
resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.9.tgz#7f9278a50e737920e21b297b8a35286e9942c056"
|
||||
@@ -2088,6 +2161,15 @@ axe-core@^4.4.3:
|
||||
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.5.2.tgz#823fdf491ff717ac3c58a52631d4206930c1d9f7"
|
||||
integrity sha512-u2MVsXfew5HBvjsczCv+xlwdNnB1oQR9HlAcsejZttNjKKSkeDNVwB1vMThIUIFI9GoT57Vtk8iQLwqOfAkboA==
|
||||
|
||||
axios@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.1.tgz#44cf04a3c9f0c2252ebd85975361c026cb9f864a"
|
||||
integrity sha512-I88cFiGu9ryt/tfVEi4kX2SITsvDddTajXTOFmt2uK1ZVA8LytjtdeyefdQWEf5PU8w+4SSJDoYnggflB5tW4A==
|
||||
dependencies:
|
||||
follow-redirects "^1.15.0"
|
||||
form-data "^4.0.0"
|
||||
proxy-from-env "^1.1.0"
|
||||
|
||||
axobject-query@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
|
||||
@@ -2417,9 +2499,9 @@ camelcase@^6.0.0:
|
||||
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
||||
|
||||
caniuse-lite@^1.0.30001400:
|
||||
version "1.0.30001434"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001434.tgz#ec1ec1cfb0a93a34a0600d37903853030520a4e5"
|
||||
integrity sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA==
|
||||
version "1.0.30001436"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz#22d7cbdbbbb60cdc4ca1030ccd6dea9f5de4848b"
|
||||
integrity sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==
|
||||
|
||||
capture-exit@^2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -2757,9 +2839,9 @@ data-urls@^2.0.0:
|
||||
whatwg-url "^8.0.0"
|
||||
|
||||
dayjs@^1.8.15:
|
||||
version "1.11.6"
|
||||
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.6.tgz#2e79a226314ec3ec904e3ee1dd5a4f5e5b1c7afb"
|
||||
integrity sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ==
|
||||
version "1.11.7"
|
||||
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
|
||||
integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
|
||||
|
||||
debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
|
||||
version "2.6.9"
|
||||
@@ -2788,14 +2870,14 @@ decamelize@^1.2.0:
|
||||
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
|
||||
|
||||
decimal.js@^10.2.1:
|
||||
version "10.4.2"
|
||||
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.2.tgz#0341651d1d997d86065a2ce3a441fbd0d8e8b98e"
|
||||
integrity sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA==
|
||||
version "10.4.3"
|
||||
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23"
|
||||
integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
|
||||
integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==
|
||||
decode-uri-component@^0.2.0, decode-uri-component@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
deep-is@^0.1.3, deep-is@~0.1.3:
|
||||
version "0.1.4"
|
||||
@@ -3488,9 +3570,9 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
|
||||
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
|
||||
|
||||
fastq@^1.6.0:
|
||||
version "1.13.0"
|
||||
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c"
|
||||
integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.14.0.tgz#107f69d7295b11e0fccc264e1fc6389f623731ce"
|
||||
integrity sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==
|
||||
dependencies:
|
||||
reusify "^1.0.4"
|
||||
|
||||
@@ -3606,6 +3688,11 @@ flow-parser@^0.121.0:
|
||||
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.121.0.tgz#9f9898eaec91a9f7c323e9e992d81ab5c58e618f"
|
||||
integrity sha512-1gIBiWJNR0tKUNv8gZuk7l9rVX06OuLzY9AoGio7y/JT4V1IZErEMEq2TJS+PFcw/y0RshZ1J/27VfK1UQzYVg==
|
||||
|
||||
follow-redirects@^1.15.0:
|
||||
version "1.15.2"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
|
||||
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
|
||||
|
||||
for-in@^0.1.3:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1"
|
||||
@@ -3632,6 +3719,15 @@ form-data@^3.0.0:
|
||||
combined-stream "^1.0.8"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
form-data@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
|
||||
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.8"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fragment-cache@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
|
||||
@@ -5018,17 +5114,17 @@ kleur@^3.0.3:
|
||||
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
|
||||
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
|
||||
|
||||
language-subtag-registry@~0.3.2:
|
||||
language-subtag-registry@^0.3.20:
|
||||
version "0.3.22"
|
||||
resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d"
|
||||
integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==
|
||||
|
||||
language-tags@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a"
|
||||
integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.6.tgz#c087cc42cd92eb71f0925e9e271d4f8be5a93430"
|
||||
integrity sha512-HNkaCgM8wZgE/BZACeotAAgpL9FUjEnhgF0FVQMIgH//zqTPreLYMb3rWYkYAqPoF75Jwuycp1da7uz66cfFQg==
|
||||
dependencies:
|
||||
language-subtag-registry "~0.3.2"
|
||||
language-subtag-registry "^0.3.20"
|
||||
|
||||
leven@^3.1.0:
|
||||
version "3.1.0"
|
||||
@@ -6127,6 +6223,11 @@ prop-types@^15.8.1:
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.13.1"
|
||||
|
||||
proxy-from-env@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
|
||||
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
|
||||
|
||||
psl@^1.1.33:
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
|
||||
@@ -6146,11 +6247,11 @@ punycode@^2.1.0, punycode@^2.1.1:
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
query-string@^7.0.0:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.1.tgz#754620669db978625a90f635f12617c271a088e1"
|
||||
integrity sha512-MplouLRDHBZSG9z7fpuAAcI7aAYjDLhtsiVZsevsfaHWDS2IDdORKbSd1kWUA+V4zyva/HZoSfpwnYMMQDhb0w==
|
||||
version "7.1.3"
|
||||
resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328"
|
||||
integrity sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==
|
||||
dependencies:
|
||||
decode-uri-component "^0.2.0"
|
||||
decode-uri-component "^0.2.2"
|
||||
filter-obj "^1.1.0"
|
||||
split-on-first "^1.0.0"
|
||||
strict-uri-encode "^2.0.0"
|
||||
@@ -6213,6 +6314,11 @@ react-native-codegen@^0.70.6:
|
||||
jscodeshift "^0.13.1"
|
||||
nullthrows "^1.1.1"
|
||||
|
||||
react-native-device-info@^10.3.0:
|
||||
version "10.3.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-10.3.0.tgz#6bab64d84d3415dd00cc446c73ec5e2e61fddbe7"
|
||||
integrity sha512-/ziZN1sA1REbJTv5mQZ4tXggcTvSbct+u5kCaze8BmN//lbxcTvWsU6NQd4IihLt89VkbX+14IGc9sVApSxd/w==
|
||||
|
||||
react-native-gradle-plugin@^0.70.3:
|
||||
version "0.70.3"
|
||||
resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz#cbcf0619cbfbddaa9128701aa2d7b4145f9c4fc8"
|
||||
|
||||
Reference in New Issue
Block a user