@finspringinnovations/fixeddepositsdk 1.0.0
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.
- package/README.md +128 -0
- package/lib/api/applicationApi.d.ts +1 -0
- package/lib/api/applicationApi.js +11 -0
- package/lib/api/bankApi.d.ts +352 -0
- package/lib/api/bankApi.js +54 -0
- package/lib/api/baseApi.d.ts +6 -0
- package/lib/api/baseApi.js +406 -0
- package/lib/api/customerApi.d.ts +855 -0
- package/lib/api/customerApi.js +241 -0
- package/lib/api/fdApi.d.ts +979 -0
- package/lib/api/fdApi.js +112 -0
- package/lib/api/fdCalculatorApi.d.ts +179 -0
- package/lib/api/fdCalculatorApi.js +36 -0
- package/lib/api/index.d.ts +14 -0
- package/lib/api/index.js +45 -0
- package/lib/api/interestRateApi.d.ts +585 -0
- package/lib/api/interestRateApi.js +101 -0
- package/lib/api/kycApi.d.ts +486 -0
- package/lib/api/kycApi.js +71 -0
- package/lib/api/masterDataApi.d.ts +158 -0
- package/lib/api/masterDataApi.js +35 -0
- package/lib/api/nomineeApi.d.ts +325 -0
- package/lib/api/nomineeApi.js +46 -0
- package/lib/api/onboardingApi.d.ts +192 -0
- package/lib/api/onboardingApi.js +41 -0
- package/lib/api/panApi.d.ts +0 -0
- package/lib/api/panApi.js +23 -0
- package/lib/api/paymentApi.d.ts +325 -0
- package/lib/api/paymentApi.js +46 -0
- package/lib/api/workflowApi.d.ts +654 -0
- package/lib/api/workflowApi.js +90 -0
- package/lib/assets/images/images.d.ts +6 -0
- package/lib/assets/images/images.js +12 -0
- package/lib/components/AadhaarInput.d.ts +13 -0
- package/lib/components/AadhaarInput.js +47 -0
- package/lib/components/ActionButton.d.ts +12 -0
- package/lib/components/ActionButton.js +87 -0
- package/lib/components/ActiveFDCard.d.ts +18 -0
- package/lib/components/ActiveFDCard.js +116 -0
- package/lib/components/AmountInput.d.ts +20 -0
- package/lib/components/AmountInput.js +142 -0
- package/lib/components/CheckboxOption.d.ts +11 -0
- package/lib/components/CheckboxOption.js +41 -0
- package/lib/components/CompanyHeader.d.ts +7 -0
- package/lib/components/CompanyHeader.js +59 -0
- package/lib/components/DropdownSelector.d.ts +9 -0
- package/lib/components/DropdownSelector.js +49 -0
- package/lib/components/EmptyState.d.ts +17 -0
- package/lib/components/EmptyState.js +44 -0
- package/lib/components/ErrorDisplay.d.ts +17 -0
- package/lib/components/ErrorDisplay.js +69 -0
- package/lib/components/FAQItem.d.ts +9 -0
- package/lib/components/FAQItem.js +52 -0
- package/lib/components/FDCard.d.ts +23 -0
- package/lib/components/FDCard.js +116 -0
- package/lib/components/FormDropdown.d.ts +18 -0
- package/lib/components/FormDropdown.js +155 -0
- package/lib/components/FormSection.d.ts +14 -0
- package/lib/components/FormSection.js +38 -0
- package/lib/components/Header.d.ts +14 -0
- package/lib/components/Header.js +52 -0
- package/lib/components/IFSCSearchResultCard.d.ts +13 -0
- package/lib/components/IFSCSearchResultCard.js +70 -0
- package/lib/components/InfoBox.d.ts +8 -0
- package/lib/components/InfoBox.js +39 -0
- package/lib/components/InterestRateCard.d.ts +8 -0
- package/lib/components/InterestRateCard.js +46 -0
- package/lib/components/LoadingIndicator.d.ts +12 -0
- package/lib/components/LoadingIndicator.js +30 -0
- package/lib/components/OTPInput.d.ts +17 -0
- package/lib/components/OTPInput.js +144 -0
- package/lib/components/PaymentDetailsCard.d.ts +20 -0
- package/lib/components/PaymentDetailsCard.js +68 -0
- package/lib/components/PendingFDBottomSheet.d.ts +19 -0
- package/lib/components/PendingFDBottomSheet.js +122 -0
- package/lib/components/SafeAreaWrapper.d.ts +13 -0
- package/lib/components/SafeAreaWrapper.js +41 -0
- package/lib/components/ScreenHeader.d.ts +11 -0
- package/lib/components/ScreenHeader.js +46 -0
- package/lib/components/StatusDisplay.d.ts +15 -0
- package/lib/components/StatusDisplay.js +88 -0
- package/lib/components/TextFieldWithLabel.d.ts +46 -0
- package/lib/components/TextFieldWithLabel.js +326 -0
- package/lib/components/TrustBox.d.ts +8 -0
- package/lib/components/TrustBox.js +46 -0
- package/lib/components/ValidationErrorAlert.d.ts +23 -0
- package/lib/components/ValidationErrorAlert.js +39 -0
- package/lib/components/ValidationMessage.d.ts +9 -0
- package/lib/components/ValidationMessage.js +98 -0
- package/lib/components/index.d.ts +35 -0
- package/lib/components/index.js +64 -0
- package/lib/config/apiConfig.d.ts +34 -0
- package/lib/config/apiConfig.js +158 -0
- package/lib/config/appDataConfig.d.ts +159 -0
- package/lib/config/appDataConfig.js +310 -0
- package/lib/config/encryptionConfig.d.ts +21 -0
- package/lib/config/encryptionConfig.js +61 -0
- package/lib/config/workflowConstants.d.ts +62 -0
- package/lib/config/workflowConstants.js +63 -0
- package/lib/constants/strings/bank.d.ts +72 -0
- package/lib/constants/strings/bank.js +86 -0
- package/lib/constants/strings/base64Images.d.ts +26 -0
- package/lib/constants/strings/base64Images.js +29 -0
- package/lib/constants/strings/common.d.ts +53 -0
- package/lib/constants/strings/common.js +62 -0
- package/lib/constants/strings/employee.d.ts +61 -0
- package/lib/constants/strings/employee.js +77 -0
- package/lib/constants/strings/faq.d.ts +14 -0
- package/lib/constants/strings/faq.js +20 -0
- package/lib/constants/strings/fd.d.ts +122 -0
- package/lib/constants/strings/fd.js +151 -0
- package/lib/constants/strings/home.d.ts +49 -0
- package/lib/constants/strings/home.js +62 -0
- package/lib/constants/strings/index.d.ts +16 -0
- package/lib/constants/strings/index.js +44 -0
- package/lib/constants/strings/kyc.d.ts +80 -0
- package/lib/constants/strings/kyc.js +94 -0
- package/lib/constants/strings/nominee.d.ts +64 -0
- package/lib/constants/strings/nominee.js +81 -0
- package/lib/hooks/useAuth.d.ts +25 -0
- package/lib/hooks/useAuth.js +39 -0
- package/lib/hooks/useFDData.d.ts +11 -0
- package/lib/hooks/useFDData.js +40 -0
- package/lib/index.d.ts +48 -0
- package/lib/index.js +161 -0
- package/lib/navigation/RootNavigator.d.ts +9 -0
- package/lib/navigation/RootNavigator.js +459 -0
- package/lib/navigation/SimpleNavigator.d.ts +11 -0
- package/lib/navigation/SimpleNavigator.js +114 -0
- package/lib/navigation/helpers.d.ts +11 -0
- package/lib/navigation/helpers.js +83 -0
- package/lib/navigation/index.d.ts +17 -0
- package/lib/navigation/index.js +42 -0
- package/lib/navigation/types.d.ts +139 -0
- package/lib/navigation/types.js +2 -0
- package/lib/navigation/workflowNavigator.d.ts +22 -0
- package/lib/navigation/workflowNavigator.js +104 -0
- package/lib/providers/ApiProvider.d.ts +7 -0
- package/lib/providers/ApiProvider.js +16 -0
- package/lib/providers/MasterDataProvider.d.ts +10 -0
- package/lib/providers/MasterDataProvider.js +54 -0
- package/lib/screens/AadhaarVerification.d.ts +7 -0
- package/lib/screens/AadhaarVerification.js +627 -0
- package/lib/screens/AddBankAccount.d.ts +22 -0
- package/lib/screens/AddBankAccount.js +381 -0
- package/lib/screens/BankDetail.d.ts +16 -0
- package/lib/screens/BankDetail.js +596 -0
- package/lib/screens/Employee.d.ts +18 -0
- package/lib/screens/Employee.js +594 -0
- package/lib/screens/FDCalculator.d.ts +18 -0
- package/lib/screens/FDCalculator.js +767 -0
- package/lib/screens/FDList.d.ts +28 -0
- package/lib/screens/FDList.js +1853 -0
- package/lib/screens/FindIFSC.d.ts +16 -0
- package/lib/screens/FindIFSC.js +248 -0
- package/lib/screens/NomineeDetail.d.ts +17 -0
- package/lib/screens/NomineeDetail.js +592 -0
- package/lib/screens/PayNow.d.ts +14 -0
- package/lib/screens/PayNow.js +230 -0
- package/lib/screens/Payment.d.ts +11 -0
- package/lib/screens/Payment.js +191 -0
- package/lib/screens/PaymentStatus.d.ts +16 -0
- package/lib/screens/PaymentStatus.js +431 -0
- package/lib/screens/ReviewKYC.d.ts +23 -0
- package/lib/screens/ReviewKYC.js +727 -0
- package/lib/state/paymentSession.d.ts +8 -0
- package/lib/state/paymentSession.js +13 -0
- package/lib/store/fdListSelectedSlice.d.ts +21 -0
- package/lib/store/fdListSelectedSlice.js +26 -0
- package/lib/store/hooks.d.ts +8 -0
- package/lib/store/hooks.js +8 -0
- package/lib/store/index.d.ts +3 -0
- package/lib/store/index.js +8 -0
- package/lib/store/onboardingSlice.d.ts +12 -0
- package/lib/store/onboardingSlice.js +32 -0
- package/lib/store/store.d.ts +13 -0
- package/lib/store/store.js +27 -0
- package/lib/theme/ThemeContext.d.ts +210 -0
- package/lib/theme/ThemeContext.js +92 -0
- package/lib/theme/colors.d.ts +80 -0
- package/lib/theme/colors.js +85 -0
- package/lib/theme/index.d.ts +35 -0
- package/lib/theme/index.js +78 -0
- package/lib/theme/shadows.d.ts +53 -0
- package/lib/theme/shadows.js +58 -0
- package/lib/theme/typography.d.ts +134 -0
- package/lib/theme/typography.js +143 -0
- package/lib/types/dataTypes.d.ts +34 -0
- package/lib/types/dataTypes.js +2 -0
- package/lib/types/workflowTypes.d.ts +2 -0
- package/lib/types/workflowTypes.js +2 -0
- package/lib/utils/apiLogger.d.ts +48 -0
- package/lib/utils/apiLogger.js +105 -0
- package/lib/utils/encryption.d.ts +28 -0
- package/lib/utils/encryption.js +113 -0
- package/lib/utils/getFDData.d.ts +48 -0
- package/lib/utils/getFDData.js +145 -0
- package/lib/utils/globalData.d.ts +2 -0
- package/lib/utils/globalData.js +10 -0
- package/package.json +51 -0
- package/src/api/applicationApi.ts +12 -0
- package/src/api/bankApi.ts +42 -0
- package/src/api/baseApi.ts +463 -0
- package/src/api/customerApi.ts +324 -0
- package/src/api/fdApi.ts +150 -0
- package/src/api/fdCalculatorApi.ts +41 -0
- package/src/api/index.ts +29 -0
- package/src/api/interestRateApi.ts +143 -0
- package/src/api/kycApi.ts +63 -0
- package/src/api/masterDataApi.ts +37 -0
- package/src/api/nomineeApi.ts +34 -0
- package/src/api/onboardingApi.ts +64 -0
- package/src/api/panApi.ts +25 -0
- package/src/api/paymentApi.ts +34 -0
- package/src/api/workflowApi.ts +94 -0
- package/src/assets/images/Mahindra.png +0 -0
- package/src/assets/images/arrow-filled.png +0 -0
- package/src/assets/images/arrow-left.png +0 -0
- package/src/assets/images/backicon.png +0 -0
- package/src/assets/images/calendar.png +0 -0
- package/src/assets/images/chevron-down.png +0 -0
- package/src/assets/images/chevron-down@2x.png +0 -0
- package/src/assets/images/chevron-down@3x.png +0 -0
- package/src/assets/images/images.js +10 -0
- package/src/assets/images/shriram_logo.png +0 -0
- package/src/components/AadhaarInput.tsx +91 -0
- package/src/components/ActionButton.tsx +129 -0
- package/src/components/ActiveFDCard.tsx +188 -0
- package/src/components/AmountInput.tsx +217 -0
- package/src/components/CheckboxOption.tsx +93 -0
- package/src/components/CompanyHeader.tsx +80 -0
- package/src/components/DropdownSelector.tsx +77 -0
- package/src/components/EmptyState.tsx +109 -0
- package/src/components/ErrorDisplay.tsx +135 -0
- package/src/components/FAQItem.tsx +90 -0
- package/src/components/FDCard.tsx +186 -0
- package/src/components/FormDropdown.tsx +214 -0
- package/src/components/FormSection.tsx +86 -0
- package/src/components/Header.tsx +110 -0
- package/src/components/IFSCSearchResultCard.tsx +139 -0
- package/src/components/InfoBox.tsx +55 -0
- package/src/components/InterestRateCard.tsx +77 -0
- package/src/components/LoadingIndicator.tsx +63 -0
- package/src/components/OTPInput.tsx +213 -0
- package/src/components/PaymentDetailsCard.tsx +120 -0
- package/src/components/PendingFDBottomSheet.tsx +237 -0
- package/src/components/README.md +210 -0
- package/src/components/SafeAreaWrapper.tsx +68 -0
- package/src/components/ScreenHeader.tsx +83 -0
- package/src/components/StatusDisplay.tsx +139 -0
- package/src/components/TextFieldWithLabel.tsx +502 -0
- package/src/components/TrustBox.tsx +63 -0
- package/src/components/ValidationErrorAlert.tsx +57 -0
- package/src/components/ValidationMessage.tsx +134 -0
- package/src/components/index.tsx +47 -0
- package/src/config/apiConfig.ts +217 -0
- package/src/config/appDataConfig.ts +358 -0
- package/src/config/encryptionConfig.ts +65 -0
- package/src/config/workflowConstants.ts +70 -0
- package/src/constants/strings/README.md +146 -0
- package/src/constants/strings/bank.ts +92 -0
- package/src/constants/strings/base64Images.ts +31 -0
- package/src/constants/strings/common.ts +63 -0
- package/src/constants/strings/employee.ts +85 -0
- package/src/constants/strings/faq.ts +23 -0
- package/src/constants/strings/fd.ts +172 -0
- package/src/constants/strings/home.ts +67 -0
- package/src/constants/strings/index.ts +21 -0
- package/src/constants/strings/kyc.ts +100 -0
- package/src/constants/strings/nominee.ts +90 -0
- package/src/hooks/useAuth.ts +42 -0
- package/src/hooks/useFDData.ts +48 -0
- package/src/index.tsx +139 -0
- package/src/navigation/RootNavigator.tsx +687 -0
- package/src/navigation/SimpleNavigator.tsx +123 -0
- package/src/navigation/helpers.ts +85 -0
- package/src/navigation/index.tsx +84 -0
- package/src/navigation/types.ts +146 -0
- package/src/navigation/workflowNavigator.ts +131 -0
- package/src/providers/ApiProvider.tsx +23 -0
- package/src/providers/MasterDataProvider.tsx +30 -0
- package/src/screens/AadhaarVerification.tsx +809 -0
- package/src/screens/AddBankAccount.tsx +541 -0
- package/src/screens/BankDetail.tsx +826 -0
- package/src/screens/Employee.tsx +822 -0
- package/src/screens/FDCalculator.tsx +1002 -0
- package/src/screens/FDList.tsx +2199 -0
- package/src/screens/FindIFSC.tsx +332 -0
- package/src/screens/NomineeDetail.tsx +800 -0
- package/src/screens/PayNow.tsx +282 -0
- package/src/screens/Payment.tsx +224 -0
- package/src/screens/PaymentStatus.tsx +595 -0
- package/src/screens/ReviewKYC.tsx +1062 -0
- package/src/state/paymentSession.ts +13 -0
- package/src/store/fdListSelectedSlice.ts +42 -0
- package/src/store/hooks.ts +6 -0
- package/src/store/index.ts +3 -0
- package/src/store/onboardingSlice.ts +37 -0
- package/src/store/store.ts +27 -0
- package/src/theme/ThemeContext.tsx +84 -0
- package/src/theme/colors.ts +90 -0
- package/src/theme/index.ts +85 -0
- package/src/theme/shadows.ts +61 -0
- package/src/theme/typography.ts +151 -0
- package/src/types/dataTypes.ts +37 -0
- package/src/types/env.d.ts +93 -0
- package/src/types/workflowTypes.ts +12 -0
- package/src/utils/apiLogger.ts +166 -0
- package/src/utils/encryption.ts +159 -0
- package/src/utils/getFDData.ts +165 -0
- package/src/utils/globalData.ts +7 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, Image } from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/Ionicons';
|
|
4
|
+
import { base64Images } from '../constants/strings/base64Images';
|
|
5
|
+
import { useColors } from '../theme/ThemeContext';
|
|
6
|
+
|
|
7
|
+
export type MessageType = 'error' | 'success' | 'loading';
|
|
8
|
+
|
|
9
|
+
export interface ValidationMessageProps {
|
|
10
|
+
type: MessageType;
|
|
11
|
+
message: string;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ValidationMessage: React.FC<ValidationMessageProps> = ({
|
|
16
|
+
type,
|
|
17
|
+
message,
|
|
18
|
+
visible = true,
|
|
19
|
+
}) => {
|
|
20
|
+
const colors = useColors();
|
|
21
|
+
const styles = createStyles(colors);
|
|
22
|
+
|
|
23
|
+
if (!visible || !message) return null;
|
|
24
|
+
|
|
25
|
+
const getIconName = (): string => {
|
|
26
|
+
switch (type) {
|
|
27
|
+
case 'error':
|
|
28
|
+
return 'warning';
|
|
29
|
+
case 'success':
|
|
30
|
+
return 'checkmark-circle';
|
|
31
|
+
case 'loading':
|
|
32
|
+
return 'time';
|
|
33
|
+
default:
|
|
34
|
+
return 'information-circle';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const getIconColor = (): string => {
|
|
39
|
+
switch (type) {
|
|
40
|
+
case 'error':
|
|
41
|
+
return colors.error;
|
|
42
|
+
case 'success':
|
|
43
|
+
return colors.success;
|
|
44
|
+
case 'loading':
|
|
45
|
+
return colors.primary;
|
|
46
|
+
default:
|
|
47
|
+
return colors.textLight;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const getTextStyle = () => {
|
|
52
|
+
switch (type) {
|
|
53
|
+
case 'error':
|
|
54
|
+
return styles.errorText;
|
|
55
|
+
case 'success':
|
|
56
|
+
return styles.successText;
|
|
57
|
+
case 'loading':
|
|
58
|
+
return styles.loadingText;
|
|
59
|
+
default:
|
|
60
|
+
return styles.defaultText;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<View style={[styles.container, type === 'loading' && styles.loadingContainer]}>
|
|
66
|
+
{type === 'success' ? (
|
|
67
|
+
<Image
|
|
68
|
+
source={{ uri: base64Images.greenTick }}
|
|
69
|
+
style={styles.imageIcon}
|
|
70
|
+
resizeMode="contain"
|
|
71
|
+
/>
|
|
72
|
+
) : type === 'error' ? (
|
|
73
|
+
<Image
|
|
74
|
+
source={{ uri: base64Images.error }}
|
|
75
|
+
style={styles.imageIcon}
|
|
76
|
+
resizeMode="contain"
|
|
77
|
+
/>
|
|
78
|
+
) : (
|
|
79
|
+
<Icon
|
|
80
|
+
name={getIconName()}
|
|
81
|
+
size={16}
|
|
82
|
+
color={getIconColor()}
|
|
83
|
+
style={styles.icon}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
<Text style={getTextStyle()}>{message}</Text>
|
|
87
|
+
</View>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const createStyles = (colors: any) => StyleSheet.create({
|
|
92
|
+
container: {
|
|
93
|
+
flexDirection: 'row',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
marginTop: -8,
|
|
96
|
+
marginBottom: 16,
|
|
97
|
+
},
|
|
98
|
+
loadingContainer: {
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
},
|
|
101
|
+
icon: {
|
|
102
|
+
marginRight: 6,
|
|
103
|
+
},
|
|
104
|
+
imageIcon: {
|
|
105
|
+
width: 16,
|
|
106
|
+
height: 16,
|
|
107
|
+
marginRight: 6,
|
|
108
|
+
},
|
|
109
|
+
errorText: {
|
|
110
|
+
fontSize: 12,
|
|
111
|
+
color: colors.error,
|
|
112
|
+
fontWeight: '500',
|
|
113
|
+
flex: 1,
|
|
114
|
+
},
|
|
115
|
+
successText: {
|
|
116
|
+
fontSize: 12,
|
|
117
|
+
color: colors.success,
|
|
118
|
+
fontWeight: '500',
|
|
119
|
+
flex: 1,
|
|
120
|
+
},
|
|
121
|
+
loadingText: {
|
|
122
|
+
fontSize: 12,
|
|
123
|
+
color: colors.primary,
|
|
124
|
+
fontWeight: '500',
|
|
125
|
+
},
|
|
126
|
+
defaultText: {
|
|
127
|
+
fontSize: 12,
|
|
128
|
+
color: colors.textLight,
|
|
129
|
+
fontWeight: '500',
|
|
130
|
+
flex: 1,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export default ValidationMessage;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export { default as Header } from './Header';
|
|
2
|
+
export { default as ActiveFDCard } from './ActiveFDCard';
|
|
3
|
+
export { default as FDCard } from './FDCard';
|
|
4
|
+
export { default as PendingFDBottomSheet } from './PendingFDBottomSheet';
|
|
5
|
+
export { default as AmountInput } from './AmountInput';
|
|
6
|
+
export { default as DropdownSelector } from './DropdownSelector';
|
|
7
|
+
export { default as InterestRateCard } from './InterestRateCard';
|
|
8
|
+
export { default as CheckboxOption } from './CheckboxOption';
|
|
9
|
+
export { default as TrustBox } from './TrustBox';
|
|
10
|
+
export { default as FAQItem } from './FAQItem';
|
|
11
|
+
export { default as CompanyHeader } from './CompanyHeader';
|
|
12
|
+
export { default as InfoBox } from './InfoBox';
|
|
13
|
+
|
|
14
|
+
// New Aadhaar Verification Components
|
|
15
|
+
export { default as AadhaarInput } from './AadhaarInput';
|
|
16
|
+
export { default as OTPInput } from './OTPInput';
|
|
17
|
+
export { default as ValidationMessage } from './ValidationMessage';
|
|
18
|
+
export { default as ActionButton } from './ActionButton';
|
|
19
|
+
export { default as ScreenHeader } from './ScreenHeader';
|
|
20
|
+
|
|
21
|
+
// Reusable Form Components
|
|
22
|
+
export { default as TextFieldWithLabel } from './TextFieldWithLabel';
|
|
23
|
+
export type { TextFieldWithLabelProps, BaseTextFieldProps } from './TextFieldWithLabel';
|
|
24
|
+
|
|
25
|
+
// Payment Components
|
|
26
|
+
export { default as PaymentDetailsCard } from './PaymentDetailsCard';
|
|
27
|
+
export type { PaymentDetailsCardProps } from './PaymentDetailsCard';
|
|
28
|
+
|
|
29
|
+
// Form Components
|
|
30
|
+
export { default as FormDropdown } from './FormDropdown';
|
|
31
|
+
export type { FormDropdownProps } from './FormDropdown';
|
|
32
|
+
export { default as FormSection } from './FormSection';
|
|
33
|
+
export type { FormSectionProps } from './FormSection';
|
|
34
|
+
|
|
35
|
+
// Status and Display Components
|
|
36
|
+
export { default as StatusDisplay } from './StatusDisplay';
|
|
37
|
+
export type { StatusDisplayProps } from './StatusDisplay';
|
|
38
|
+
export { default as LoadingIndicator } from './LoadingIndicator';
|
|
39
|
+
export type { LoadingIndicatorProps } from './LoadingIndicator';
|
|
40
|
+
export { default as ErrorDisplay } from './ErrorDisplay';
|
|
41
|
+
export type { ErrorDisplayProps } from './ErrorDisplay';
|
|
42
|
+
export { default as EmptyState } from './EmptyState';
|
|
43
|
+
export type { EmptyStateProps } from './EmptyState';
|
|
44
|
+
|
|
45
|
+
// IFSC Search Components
|
|
46
|
+
export { default as IFSCSearchResultCard } from './IFSCSearchResultCard';
|
|
47
|
+
export type { IFSCSearchResultCardProps } from './IFSCSearchResultCard';
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// API Configuration with values from main app
|
|
2
|
+
import 'react-native-get-random-values';
|
|
3
|
+
import { getEnvironmentData } from './appDataConfig';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const logEnvLoaderValues = () => {
|
|
7
|
+
// Environment values logging removed for security
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type Environment = 'development' | 'staging' | 'production';
|
|
11
|
+
|
|
12
|
+
// Secure API configuration interface
|
|
13
|
+
export interface ApiConfig {
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
timeout: number;
|
|
16
|
+
retryAttempts: number;
|
|
17
|
+
enableEncryption: boolean;
|
|
18
|
+
enableLogging: boolean;
|
|
19
|
+
headers: Record<string, string>;
|
|
20
|
+
// New encryption toggle parameter
|
|
21
|
+
allowEncryptionToggle?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Environment detection - using hardcoded default
|
|
25
|
+
export const getEnvironment = (): Environment => {
|
|
26
|
+
// Default to development for hardcoded configuration
|
|
27
|
+
return 'development';
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Common configuration shared by all environments
|
|
31
|
+
const COMMON_CONFIG = {
|
|
32
|
+
timeout: 60000,
|
|
33
|
+
retryAttempts: 3,
|
|
34
|
+
enableEncryption: true,
|
|
35
|
+
enableLogging: true,
|
|
36
|
+
allowEncryptionToggle: true,
|
|
37
|
+
headersBase: {
|
|
38
|
+
'X-Client-Version': '1.0.0',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
const API_ENDPOINTS = {
|
|
44
|
+
development: {
|
|
45
|
+
...COMMON_CONFIG,
|
|
46
|
+
baseUrl: '',
|
|
47
|
+
headers: {
|
|
48
|
+
...COMMON_CONFIG.headersBase,
|
|
49
|
+
'X-Environment': 'development',
|
|
50
|
+
'X-API-Key': '',
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
} as const;
|
|
54
|
+
|
|
55
|
+
// Get API configuration for current environment
|
|
56
|
+
export const getApiConfig = (env?: Environment): ApiConfig => {
|
|
57
|
+
// Get environment data from main app first
|
|
58
|
+
const environmentData = getEnvironmentData();
|
|
59
|
+
|
|
60
|
+
// Use environment from EnvironmentData if available, otherwise use parameter or default
|
|
61
|
+
// const currentEnv = env || environmentData?.environment || getEnvironment();
|
|
62
|
+
const config = API_ENDPOINTS.development;
|
|
63
|
+
|
|
64
|
+
// Create a new config object to avoid read-only issues
|
|
65
|
+
let finalConfig = { ...config };
|
|
66
|
+
|
|
67
|
+
// Override configuration with values from main app if available
|
|
68
|
+
if (environmentData) {
|
|
69
|
+
// Override base URL if provided by main app
|
|
70
|
+
if (environmentData.apiBaseUrl) {
|
|
71
|
+
// finalConfig.baseUrl = environmentData.apiBaseUrl as any;
|
|
72
|
+
finalConfig = { ...finalConfig, baseUrl: environmentData.apiBaseUrl as any };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Override API key if provided by main app
|
|
76
|
+
if (environmentData.apiKey) {
|
|
77
|
+
finalConfig.headers = { ...finalConfig.headers, 'X-API-Key': environmentData.apiKey as any };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Override environment if provided by main app
|
|
81
|
+
if (environmentData.environment) {
|
|
82
|
+
finalConfig.headers = { ...finalConfig.headers, 'X-Environment': environmentData.environment as any };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Use secure logger for API configuration logging
|
|
87
|
+
|
|
88
|
+
// Validate configuration
|
|
89
|
+
if (!finalConfig.baseUrl) {
|
|
90
|
+
throw new Error(`Missing API base URL `);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
...finalConfig,
|
|
95
|
+
baseUrl: sanitizeUrl(finalConfig.baseUrl),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// Sanitize and validate URL
|
|
100
|
+
const sanitizeUrl = (url: string): string => {
|
|
101
|
+
if (!url || typeof url !== 'string') {
|
|
102
|
+
throw new Error(`Invalid API URL: ${url}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Trim leading and trailing spaces
|
|
106
|
+
let sanitized = url.trim();
|
|
107
|
+
|
|
108
|
+
// Basic URL validation - check if it starts with http:// or https://
|
|
109
|
+
if (!sanitized.match(/^https?:\/\//)) {
|
|
110
|
+
throw new Error(`Invalid API URL format: ${sanitized}`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Ensure HTTPS in production
|
|
114
|
+
if (getEnvironment() === 'production' && !sanitized.startsWith('https://')) {
|
|
115
|
+
throw new Error('Production API must use HTTPS');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Remove trailing slash
|
|
119
|
+
return sanitized.replace(/\/$/, '');
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// Get secure headers for API requests
|
|
123
|
+
export const getSecureHeaders = (env?: Environment): Record<string, string> => {
|
|
124
|
+
const config = getApiConfig(env);
|
|
125
|
+
//const currentEnv = env || getEnvironment();
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
...config.headers,
|
|
129
|
+
'Content-Type': 'application/json',
|
|
130
|
+
'Accept': 'application/json',
|
|
131
|
+
'User-Agent': `FDSDK/'1.0.0'`,
|
|
132
|
+
'X-Timestamp': Date.now().toString(),
|
|
133
|
+
'X-Request-ID': generateRequestId(),
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Generate unique request ID
|
|
138
|
+
const generateRequestId = (): string => {
|
|
139
|
+
return `req_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// Validate environment configuration
|
|
143
|
+
export const validateApiConfig = (config: ApiConfig): boolean => {
|
|
144
|
+
const errors: string[] = [];
|
|
145
|
+
|
|
146
|
+
if (!config.baseUrl) {
|
|
147
|
+
errors.push('Base URL is required');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (config.timeout < 5000) {
|
|
151
|
+
errors.push('Timeout should be at least 5 seconds');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (config.retryAttempts < 0 || config.retryAttempts > 5) {
|
|
155
|
+
errors.push('Retry attempts should be between 0 and 5');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Validate URL format without using new URL (React Native compatible)
|
|
159
|
+
if (config.baseUrl && !config.baseUrl.match(/^https?:\/\//)) {
|
|
160
|
+
errors.push('Invalid base URL format - must start with http:// or https://');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (errors.length > 0) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return true;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// Get environment-specific configuration
|
|
171
|
+
export const getEnvironmentConfig = () => {
|
|
172
|
+
const env = getEnvironment();
|
|
173
|
+
const config = getApiConfig(env);
|
|
174
|
+
|
|
175
|
+
return {
|
|
176
|
+
environment: env,
|
|
177
|
+
config,
|
|
178
|
+
isProduction: env === 'production',
|
|
179
|
+
isDevelopment: env === 'development',
|
|
180
|
+
isStaging: env === 'staging',
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// Debug configuration (works in all environments now)
|
|
185
|
+
export const debugApiConfig = (): void => {
|
|
186
|
+
// API Configuration debug complete
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// New utility to help clients debug 403 errors
|
|
190
|
+
export const debugApiCall = (endpoint: string, method: string = 'GET') => {
|
|
191
|
+
const config = getApiConfig();
|
|
192
|
+
const headers = getSecureHeaders();
|
|
193
|
+
|
|
194
|
+
// API Call debug complete
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
url: `${config.baseUrl || ''}/${endpoint}`,
|
|
198
|
+
headers,
|
|
199
|
+
environment: getEnvironment(),
|
|
200
|
+
encryptionEnabled: config.enableEncryption,
|
|
201
|
+
hasApiKey: !!headers['X-API-Key']
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// Environment logging utility
|
|
206
|
+
export const logEnvironmentInfo = (): void => {
|
|
207
|
+
// Environment logging removed for security
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
// Function to log environment details (can be called from anywhere)
|
|
212
|
+
export const logEnvironmentDetails = () => {
|
|
213
|
+
// Environment details logging removed for security
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// Export default configuration
|
|
217
|
+
export default getApiConfig;
|