@finspringinnovations/fdsdk 0.0.1

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 (315) hide show
  1. package/README.md +184 -0
  2. package/lib/api/applicationApi.d.ts +1 -0
  3. package/lib/api/applicationApi.js +11 -0
  4. package/lib/api/bankApi.d.ts +352 -0
  5. package/lib/api/bankApi.js +54 -0
  6. package/lib/api/baseApi.d.ts +8 -0
  7. package/lib/api/baseApi.js +456 -0
  8. package/lib/api/customerApi.d.ts +855 -0
  9. package/lib/api/customerApi.js +213 -0
  10. package/lib/api/fdApi.d.ts +979 -0
  11. package/lib/api/fdApi.js +112 -0
  12. package/lib/api/fdCalculatorApi.d.ts +179 -0
  13. package/lib/api/fdCalculatorApi.js +36 -0
  14. package/lib/api/index.d.ts +14 -0
  15. package/lib/api/index.js +45 -0
  16. package/lib/api/interestRateApi.d.ts +585 -0
  17. package/lib/api/interestRateApi.js +101 -0
  18. package/lib/api/kycApi.d.ts +486 -0
  19. package/lib/api/kycApi.js +71 -0
  20. package/lib/api/masterDataApi.d.ts +158 -0
  21. package/lib/api/masterDataApi.js +32 -0
  22. package/lib/api/nomineeApi.d.ts +325 -0
  23. package/lib/api/nomineeApi.js +46 -0
  24. package/lib/api/onboardingApi.d.ts +192 -0
  25. package/lib/api/onboardingApi.js +41 -0
  26. package/lib/api/panApi.d.ts +0 -0
  27. package/lib/api/panApi.js +23 -0
  28. package/lib/api/paymentApi.d.ts +325 -0
  29. package/lib/api/paymentApi.js +46 -0
  30. package/lib/api/workflowApi.d.ts +654 -0
  31. package/lib/api/workflowApi.js +90 -0
  32. package/lib/assets/images/images.d.ts +4 -0
  33. package/lib/assets/images/images.js +10 -0
  34. package/lib/components/AadhaarInput.d.ts +13 -0
  35. package/lib/components/AadhaarInput.js +47 -0
  36. package/lib/components/ActionButton.d.ts +12 -0
  37. package/lib/components/ActionButton.js +87 -0
  38. package/lib/components/ActiveFDCard.d.ts +16 -0
  39. package/lib/components/ActiveFDCard.js +95 -0
  40. package/lib/components/AmountInput.d.ts +20 -0
  41. package/lib/components/AmountInput.js +144 -0
  42. package/lib/components/CheckboxOption.d.ts +11 -0
  43. package/lib/components/CheckboxOption.js +41 -0
  44. package/lib/components/CompanyHeader.d.ts +7 -0
  45. package/lib/components/CompanyHeader.js +57 -0
  46. package/lib/components/DropdownSelector.d.ts +9 -0
  47. package/lib/components/DropdownSelector.js +49 -0
  48. package/lib/components/EmptyState.d.ts +17 -0
  49. package/lib/components/EmptyState.js +44 -0
  50. package/lib/components/ErrorDisplay.d.ts +17 -0
  51. package/lib/components/ErrorDisplay.js +69 -0
  52. package/lib/components/FAQItem.d.ts +9 -0
  53. package/lib/components/FAQItem.js +52 -0
  54. package/lib/components/FDCard.d.ts +21 -0
  55. package/lib/components/FDCard.js +96 -0
  56. package/lib/components/FormDropdown.d.ts +18 -0
  57. package/lib/components/FormDropdown.js +155 -0
  58. package/lib/components/FormSection.d.ts +14 -0
  59. package/lib/components/FormSection.js +38 -0
  60. package/lib/components/Header.d.ts +14 -0
  61. package/lib/components/Header.js +52 -0
  62. package/lib/components/IFSCSearchResultCard.d.ts +13 -0
  63. package/lib/components/IFSCSearchResultCard.js +70 -0
  64. package/lib/components/InfoBox.d.ts +8 -0
  65. package/lib/components/InfoBox.js +39 -0
  66. package/lib/components/InterestRateCard.d.ts +8 -0
  67. package/lib/components/InterestRateCard.js +46 -0
  68. package/lib/components/LoadingIndicator.d.ts +12 -0
  69. package/lib/components/LoadingIndicator.js +30 -0
  70. package/lib/components/OTPInput.d.ts +17 -0
  71. package/lib/components/OTPInput.js +144 -0
  72. package/lib/components/PaymentDetailsCard.d.ts +20 -0
  73. package/lib/components/PaymentDetailsCard.js +68 -0
  74. package/lib/components/PendingFDBottomSheet.d.ts +18 -0
  75. package/lib/components/PendingFDBottomSheet.js +122 -0
  76. package/lib/components/SafeAreaWrapper.d.ts +13 -0
  77. package/lib/components/SafeAreaWrapper.js +41 -0
  78. package/lib/components/ScreenHeader.d.ts +11 -0
  79. package/lib/components/ScreenHeader.js +46 -0
  80. package/lib/components/StatusDisplay.d.ts +15 -0
  81. package/lib/components/StatusDisplay.js +88 -0
  82. package/lib/components/TextFieldWithLabel.d.ts +46 -0
  83. package/lib/components/TextFieldWithLabel.js +326 -0
  84. package/lib/components/TrustBox.d.ts +8 -0
  85. package/lib/components/TrustBox.js +45 -0
  86. package/lib/components/ValidationErrorAlert.d.ts +23 -0
  87. package/lib/components/ValidationErrorAlert.js +39 -0
  88. package/lib/components/ValidationMessage.d.ts +9 -0
  89. package/lib/components/ValidationMessage.js +98 -0
  90. package/lib/components/index.d.ts +35 -0
  91. package/lib/components/index.js +64 -0
  92. package/lib/config/apiConfig.d.ts +34 -0
  93. package/lib/config/apiConfig.js +158 -0
  94. package/lib/config/appDataConfig.d.ts +114 -0
  95. package/lib/config/appDataConfig.js +264 -0
  96. package/lib/config/encryptionConfig.d.ts +21 -0
  97. package/lib/config/encryptionConfig.js +61 -0
  98. package/lib/config/workflowConstants.d.ts +37 -0
  99. package/lib/config/workflowConstants.js +38 -0
  100. package/lib/constants/strings/bank.d.ts +72 -0
  101. package/lib/constants/strings/bank.js +86 -0
  102. package/lib/constants/strings/base64Images.d.ts +25 -0
  103. package/lib/constants/strings/base64Images.js +28 -0
  104. package/lib/constants/strings/common.d.ts +53 -0
  105. package/lib/constants/strings/common.js +62 -0
  106. package/lib/constants/strings/employee.d.ts +61 -0
  107. package/lib/constants/strings/employee.js +77 -0
  108. package/lib/constants/strings/faq.d.ts +14 -0
  109. package/lib/constants/strings/faq.js +20 -0
  110. package/lib/constants/strings/fd.d.ts +122 -0
  111. package/lib/constants/strings/fd.js +151 -0
  112. package/lib/constants/strings/home.d.ts +49 -0
  113. package/lib/constants/strings/home.js +62 -0
  114. package/lib/constants/strings/index.d.ts +16 -0
  115. package/lib/constants/strings/index.js +44 -0
  116. package/lib/constants/strings/kyc.d.ts +80 -0
  117. package/lib/constants/strings/kyc.js +94 -0
  118. package/lib/constants/strings/nominee.d.ts +64 -0
  119. package/lib/constants/strings/nominee.js +81 -0
  120. package/lib/hooks/useAuth.d.ts +25 -0
  121. package/lib/hooks/useAuth.js +39 -0
  122. package/lib/hooks/useFDData.d.ts +11 -0
  123. package/lib/hooks/useFDData.js +40 -0
  124. package/lib/index.d.ts +69 -0
  125. package/lib/index.js +182 -0
  126. package/lib/navigation/RootNavigator.d.ts +8 -0
  127. package/lib/navigation/RootNavigator.js +205 -0
  128. package/lib/navigation/SimpleNavigator.d.ts +11 -0
  129. package/lib/navigation/SimpleNavigator.js +107 -0
  130. package/lib/navigation/helpers.d.ts +11 -0
  131. package/lib/navigation/helpers.js +83 -0
  132. package/lib/navigation/index.d.ts +15 -0
  133. package/lib/navigation/index.js +42 -0
  134. package/lib/navigation/types.d.ts +113 -0
  135. package/lib/navigation/types.js +2 -0
  136. package/lib/navigation/workflowNavigator.d.ts +22 -0
  137. package/lib/navigation/workflowNavigator.js +104 -0
  138. package/lib/providers/ApiProvider.d.ts +7 -0
  139. package/lib/providers/ApiProvider.js +34 -0
  140. package/lib/providers/MasterDataProvider.d.ts +10 -0
  141. package/lib/providers/MasterDataProvider.js +54 -0
  142. package/lib/screens/AadhaarVerification.d.ts +7 -0
  143. package/lib/screens/AadhaarVerification.js +627 -0
  144. package/lib/screens/AddBankAccount.d.ts +22 -0
  145. package/lib/screens/AddBankAccount.js +381 -0
  146. package/lib/screens/BankDetail.d.ts +16 -0
  147. package/lib/screens/BankDetail.js +596 -0
  148. package/lib/screens/BookFD.d.ts +0 -0
  149. package/lib/screens/BookFD.js +315 -0
  150. package/lib/screens/Employee.d.ts +18 -0
  151. package/lib/screens/Employee.js +594 -0
  152. package/lib/screens/FDCalculator.d.ts +18 -0
  153. package/lib/screens/FDCalculator.js +759 -0
  154. package/lib/screens/FDList.d.ts +27 -0
  155. package/lib/screens/FDList.js +1008 -0
  156. package/lib/screens/FindIFSC.d.ts +16 -0
  157. package/lib/screens/FindIFSC.js +248 -0
  158. package/lib/screens/Home.d.ts +0 -0
  159. package/lib/screens/Home.js +143 -0
  160. package/lib/screens/NomineeDetail.d.ts +17 -0
  161. package/lib/screens/NomineeDetail.js +592 -0
  162. package/lib/screens/PayNow.d.ts +14 -0
  163. package/lib/screens/PayNow.js +230 -0
  164. package/lib/screens/Payment.d.ts +11 -0
  165. package/lib/screens/Payment.js +191 -0
  166. package/lib/screens/PaymentStatus.d.ts +16 -0
  167. package/lib/screens/PaymentStatus.js +397 -0
  168. package/lib/screens/ReviewKYC.d.ts +21 -0
  169. package/lib/screens/ReviewKYC.js +660 -0
  170. package/lib/state/paymentSession.d.ts +8 -0
  171. package/lib/state/paymentSession.js +13 -0
  172. package/lib/store/fdListSelectedSlice.d.ts +21 -0
  173. package/lib/store/fdListSelectedSlice.js +26 -0
  174. package/lib/store/hooks.d.ts +8 -0
  175. package/lib/store/hooks.js +31 -0
  176. package/lib/store/index.d.ts +3 -0
  177. package/lib/store/index.js +8 -0
  178. package/lib/store/onboardingSlice.d.ts +12 -0
  179. package/lib/store/onboardingSlice.js +32 -0
  180. package/lib/store/store.d.ts +13 -0
  181. package/lib/store/store.js +33 -0
  182. package/lib/theme/ThemeContext.d.ts +210 -0
  183. package/lib/theme/ThemeContext.js +90 -0
  184. package/lib/theme/colors.d.ts +80 -0
  185. package/lib/theme/colors.js +85 -0
  186. package/lib/theme/index.d.ts +34 -0
  187. package/lib/theme/index.js +69 -0
  188. package/lib/theme/shadows.d.ts +53 -0
  189. package/lib/theme/shadows.js +58 -0
  190. package/lib/theme/typography.d.ts +134 -0
  191. package/lib/theme/typography.js +143 -0
  192. package/lib/types/dataTypes.d.ts +34 -0
  193. package/lib/types/dataTypes.js +2 -0
  194. package/lib/types/workflowTypes.d.ts +2 -0
  195. package/lib/types/workflowTypes.js +2 -0
  196. package/lib/utils/apiLogger.d.ts +48 -0
  197. package/lib/utils/apiLogger.js +105 -0
  198. package/lib/utils/encryption.d.ts +28 -0
  199. package/lib/utils/encryption.js +113 -0
  200. package/lib/utils/getFDData.d.ts +48 -0
  201. package/lib/utils/getFDData.js +154 -0
  202. package/lib/utils/globalData.d.ts +2 -0
  203. package/lib/utils/globalData.js +10 -0
  204. package/package.json +76 -0
  205. package/src/api/applicationApi.ts +12 -0
  206. package/src/api/bankApi.ts +42 -0
  207. package/src/api/baseApi.ts +513 -0
  208. package/src/api/customerApi.ts +291 -0
  209. package/src/api/fdApi.ts +150 -0
  210. package/src/api/fdCalculatorApi.ts +41 -0
  211. package/src/api/index.ts +29 -0
  212. package/src/api/interestRateApi.ts +143 -0
  213. package/src/api/kycApi.ts +63 -0
  214. package/src/api/masterDataApi.ts +34 -0
  215. package/src/api/nomineeApi.ts +34 -0
  216. package/src/api/onboardingApi.ts +64 -0
  217. package/src/api/panApi.ts +25 -0
  218. package/src/api/paymentApi.ts +34 -0
  219. package/src/api/workflowApi.ts +94 -0
  220. package/src/assets/images/arrow-filled.png +0 -0
  221. package/src/assets/images/arrow-left.png +0 -0
  222. package/src/assets/images/backicon.png +0 -0
  223. package/src/assets/images/calendar.png +0 -0
  224. package/src/assets/images/chevron-down.png +0 -0
  225. package/src/assets/images/chevron-down@2x.png +0 -0
  226. package/src/assets/images/chevron-down@3x.png +0 -0
  227. package/src/assets/images/images.js +8 -0
  228. package/src/components/AadhaarInput.tsx +91 -0
  229. package/src/components/ActionButton.tsx +129 -0
  230. package/src/components/ActiveFDCard.tsx +158 -0
  231. package/src/components/AmountInput.tsx +217 -0
  232. package/src/components/CheckboxOption.tsx +93 -0
  233. package/src/components/CompanyHeader.tsx +78 -0
  234. package/src/components/DropdownSelector.tsx +77 -0
  235. package/src/components/EmptyState.tsx +109 -0
  236. package/src/components/ErrorDisplay.tsx +135 -0
  237. package/src/components/FAQItem.tsx +90 -0
  238. package/src/components/FDCard.tsx +165 -0
  239. package/src/components/FormDropdown.tsx +214 -0
  240. package/src/components/FormSection.tsx +86 -0
  241. package/src/components/Header.tsx +110 -0
  242. package/src/components/IFSCSearchResultCard.tsx +139 -0
  243. package/src/components/InfoBox.tsx +55 -0
  244. package/src/components/InterestRateCard.tsx +77 -0
  245. package/src/components/LoadingIndicator.tsx +63 -0
  246. package/src/components/OTPInput.tsx +213 -0
  247. package/src/components/PaymentDetailsCard.tsx +120 -0
  248. package/src/components/PendingFDBottomSheet.tsx +235 -0
  249. package/src/components/README.md +210 -0
  250. package/src/components/SafeAreaWrapper.tsx +68 -0
  251. package/src/components/ScreenHeader.tsx +83 -0
  252. package/src/components/StatusDisplay.tsx +139 -0
  253. package/src/components/TextFieldWithLabel.tsx +502 -0
  254. package/src/components/TrustBox.tsx +63 -0
  255. package/src/components/ValidationErrorAlert.tsx +57 -0
  256. package/src/components/ValidationMessage.tsx +134 -0
  257. package/src/components/index.tsx +47 -0
  258. package/src/config/apiConfig.ts +217 -0
  259. package/src/config/appDataConfig.ts +279 -0
  260. package/src/config/encryptionConfig.ts +65 -0
  261. package/src/config/workflowConstants.ts +43 -0
  262. package/src/constants/strings/README.md +146 -0
  263. package/src/constants/strings/bank.ts +92 -0
  264. package/src/constants/strings/base64Images.ts +29 -0
  265. package/src/constants/strings/common.ts +63 -0
  266. package/src/constants/strings/employee.ts +85 -0
  267. package/src/constants/strings/faq.ts +23 -0
  268. package/src/constants/strings/fd.ts +172 -0
  269. package/src/constants/strings/home.ts +67 -0
  270. package/src/constants/strings/index.ts +21 -0
  271. package/src/constants/strings/kyc.ts +100 -0
  272. package/src/constants/strings/nominee.ts +90 -0
  273. package/src/hooks/useAuth.ts +42 -0
  274. package/src/hooks/useFDData.ts +48 -0
  275. package/src/index.tsx +173 -0
  276. package/src/navigation/RootNavigator.tsx +352 -0
  277. package/src/navigation/SimpleNavigator.tsx +107 -0
  278. package/src/navigation/helpers.ts +85 -0
  279. package/src/navigation/index.tsx +81 -0
  280. package/src/navigation/types.ts +124 -0
  281. package/src/navigation/workflowNavigator.ts +131 -0
  282. package/src/providers/ApiProvider.tsx +43 -0
  283. package/src/providers/MasterDataProvider.tsx +30 -0
  284. package/src/screens/AadhaarVerification.tsx +809 -0
  285. package/src/screens/AddBankAccount.tsx +541 -0
  286. package/src/screens/BankDetail.tsx +826 -0
  287. package/src/screens/BookFD.tsx +330 -0
  288. package/src/screens/Employee.tsx +822 -0
  289. package/src/screens/FDCalculator.tsx +987 -0
  290. package/src/screens/FDList.tsx +1284 -0
  291. package/src/screens/FindIFSC.tsx +332 -0
  292. package/src/screens/Home.tsx +152 -0
  293. package/src/screens/NomineeDetail.tsx +800 -0
  294. package/src/screens/PayNow.tsx +282 -0
  295. package/src/screens/Payment.tsx +224 -0
  296. package/src/screens/PaymentStatus.tsx +561 -0
  297. package/src/screens/ReviewKYC.tsx +956 -0
  298. package/src/state/paymentSession.ts +13 -0
  299. package/src/store/fdListSelectedSlice.ts +42 -0
  300. package/src/store/hooks.ts +27 -0
  301. package/src/store/index.ts +3 -0
  302. package/src/store/onboardingSlice.ts +37 -0
  303. package/src/store/store.ts +35 -0
  304. package/src/theme/ThemeContext.tsx +82 -0
  305. package/src/theme/colors.ts +90 -0
  306. package/src/theme/index.ts +64 -0
  307. package/src/theme/shadows.ts +61 -0
  308. package/src/theme/typography.ts +151 -0
  309. package/src/types/dataTypes.ts +37 -0
  310. package/src/types/env.d.ts +93 -0
  311. package/src/types/workflowTypes.ts +12 -0
  312. package/src/utils/apiLogger.ts +166 -0
  313. package/src/utils/encryption.ts +159 -0
  314. package/src/utils/getFDData.ts +175 -0
  315. package/src/utils/globalData.ts +7 -0
package/src/index.tsx ADDED
@@ -0,0 +1,173 @@
1
+ // React Native crypto polyfill - MUST be imported first
2
+ import 'react-native-get-random-values';
3
+
4
+ // Main SDK exports
5
+ //import HomeComponent from './screens/Home';
6
+ //import BookFDComponent from './screens/BookFD';
7
+ import FDListComponent from './screens/FDList';
8
+ import AadhaarVerificationComponent from './screens/AadhaarVerification';
9
+ import ReviewKYCComponent from './screens/ReviewKYC';
10
+ import EmployeeComponent from './screens/Employee';
11
+ import NomineeDetailComponent from './screens/NomineeDetail';
12
+ import BankDetailComponent from './screens/BankDetail';
13
+ import AddBankAccountComponent from './screens/AddBankAccount';
14
+ import FindIFSCComponent from './screens/FindIFSC';
15
+ import PayNowComponent from './screens/PayNow';
16
+ import PaymentComponent from './screens/Payment';
17
+ import PaymentStatusComponent from './screens/PaymentStatus';
18
+ import PendingFDBottomSheetComponent from './components/PendingFDBottomSheet';
19
+
20
+ //export const Home = HomeComponent;
21
+ //export const BookFD = BookFDComponent;
22
+ export const FDList = FDListComponent;
23
+ export const AadhaarVerification = AadhaarVerificationComponent;
24
+ export const ReviewKYC = ReviewKYCComponent;
25
+ export const Employee = EmployeeComponent;
26
+ export const NomineeDetail = NomineeDetailComponent;
27
+ export const BankDetail = BankDetailComponent;
28
+ export const AddBankAccount = AddBankAccountComponent;
29
+ export const FindIFSC = FindIFSCComponent;
30
+ export const PayNow = PayNowComponent;
31
+ export const Payment = PaymentComponent;
32
+ export const PaymentStatus = PaymentStatusComponent;
33
+ export const PendingFDBottomSheet = PendingFDBottomSheetComponent;
34
+
35
+ // Export types
36
+ //export type { HomeProps } from './screens/Home';
37
+ //export type { BookFDProps, FDBookingData } from './screens/BookFD';
38
+ export type { FDListProps } from './screens/FDList';
39
+ export type { AadhaarVerificationProps } from './screens/AadhaarVerification';
40
+ export type { ReviewKYCProps, KYCData } from './screens/ReviewKYC';
41
+ export type { EmployeeProps, EmployeeData } from './screens/Employee';
42
+ export type { NomineeDetailProps, NomineeData } from './screens/NomineeDetail';
43
+ export type { BankDetailProps, BankData } from './screens/BankDetail';
44
+ export type { AddBankAccountProps, AddBankAccountData } from './screens/AddBankAccount';
45
+ export type { FindIFSCProps, IFSCData } from './screens/FindIFSC';
46
+ export type { PayNowProps } from './screens/PayNow';
47
+ export type { PaymentProps } from './screens/Payment';
48
+ export type { PaymentStatusProps } from './screens/PaymentStatus';
49
+ export type { FDCalculatorProps } from './screens/FDCalculator';
50
+
51
+ // Export navigation - Direct imports to ensure they work
52
+ import { SDKNavigationContainer, SimpleNavigator } from './navigation';
53
+ export { SDKNavigationContainer, SimpleNavigator };
54
+ export { SDKNavigationContainer as ShriramSDKNavigator };
55
+
56
+ // Export theme system
57
+ export * from './theme';
58
+ export { ThemeProvider, useTheme, useColors, useTypography, useShadows, useSpacing } from './theme/ThemeContext';
59
+
60
+ // Export API system
61
+ export * from './api';
62
+ export { ApiProvider } from './providers/ApiProvider';
63
+ export { MasterDataProvider, useMasterData } from './providers/MasterDataProvider';
64
+ export { useFDData } from './hooks/useFDData';
65
+ export { useAuth } from './hooks/useAuth';
66
+ export { store, useAppDispatch, useAppSelector } from './store';
67
+
68
+ // Export encryption utilities
69
+ export * from './utils/encryption';
70
+ export {
71
+ getEncryptionConfig,
72
+ getEncryptionConfigs,
73
+ getEnvironmentConfig as getEncryptionEnvironmentConfig,
74
+ validateEncryptionConfig
75
+ } from './config/encryptionConfig';
76
+
77
+ // Export configuration utilities
78
+ export * from './config/apiConfig';
79
+ export { debugApiConfig, debugApiCall, logEnvironmentInfo } from './config/apiConfig';
80
+
81
+ // Export app data configuration
82
+ export {
83
+ initializeSDK,
84
+ getAppData,
85
+ isSDKInitialized,
86
+ getUserInfoForAPI,
87
+ getUserDemographics,
88
+ validateAppData,
89
+ clearAppData,
90
+ initializeEnvironment,
91
+ getEnvironmentData,
92
+ isEnvironmentInitialized,
93
+ clearEnvironmentData,
94
+ clearAllData,
95
+ } from './config/appDataConfig';
96
+ export type { AppData, EnvironmentData } from './config/appDataConfig';
97
+
98
+ // Export validation utilities
99
+ export { showValidationErrorAlert, validateAndProceed } from './components/ValidationErrorAlert';
100
+ export type { ValidationErrorAlertProps } from './components/ValidationErrorAlert';
101
+
102
+ // Export workflow constants
103
+ export {
104
+ WORKFLOW_STATES,
105
+ WORKFLOW_TASKS,
106
+ WORKFLOW_CONSTANTS,
107
+ getWorkflowStateName,
108
+ getWorkflowTaskName,
109
+ } from './config/workflowConstants';
110
+ export type { WorkflowState, WorkflowTask } from './config/workflowConstants';
111
+
112
+ // Export logging utilities
113
+ export { apiLogger, ApiLogger } from './utils/apiLogger';
114
+ export type { LogConfig, RequestLogData, ResponseLogData } from './utils/apiLogger';
115
+
116
+ // Export encryption control utilities
117
+ export { toggleEncryption, isEncryptionEnabled, getCurrentApiConfig } from './api/baseApi';
118
+
119
+ // Export FD data retrieval utility
120
+ export { getFDData } from './utils/getFDData';
121
+ export type { FDDataResponse } from './utils/getFDData';
122
+
123
+ // Import theme types
124
+ import type { ThemeName, Theme } from './theme';
125
+
126
+ // SDK Configuration
127
+ export interface SDKConfig {
128
+ apiBaseUrl?: string;
129
+ theme?: ThemeName | Theme; // Allow theme name or custom theme object
130
+ environment?: 'development' | 'staging' | 'production';
131
+ }
132
+
133
+ // SDK Main Class
134
+ export class ShriramSDK {
135
+ private config: SDKConfig;
136
+
137
+ constructor(config: SDKConfig = {}) {
138
+ this.config = {
139
+ apiBaseUrl: 'https://api.shriram.com',
140
+ environment: 'production',
141
+ theme: 'primary' as ThemeName,
142
+ ...config,
143
+ };
144
+
145
+ // Log environment information when SDK instance is created
146
+ import('./config/apiConfig').then(({ logEnvironmentInfo }) => {
147
+ logEnvironmentInfo();
148
+ });
149
+ }
150
+
151
+ getConfig(): SDKConfig {
152
+ return this.config;
153
+ }
154
+
155
+ updateConfig(newConfig: Partial<SDKConfig>): void {
156
+ this.config = { ...this.config, ...newConfig };
157
+ }
158
+
159
+ // Utility methods
160
+ static getVersion(): string {
161
+ return '1.0.0';
162
+ }
163
+
164
+ static getPlatformInfo(): { platform: string; version: string } {
165
+ return {
166
+ platform: 'react-native',
167
+ version: '1.0.0',
168
+ };
169
+ }
170
+ }
171
+
172
+ // Default export
173
+ export default ShriramSDK;
@@ -0,0 +1,352 @@
1
+ import React, { useEffect } from 'react';
2
+ import { createStackNavigator } from '@react-navigation/stack';
3
+ import type { RootStackParamList, SDKNavigationConfig } from './types';
4
+ import { BackHandler, Platform } from 'react-native';
5
+ import { navigationRef } from './helpers';
6
+
7
+ // Import screens
8
+ import FDListScreen from '../screens/FDList';
9
+ import FDCalculatorScreen from '../screens/FDCalculator';
10
+ import AadhaarVerificationScreen from '../screens/AadhaarVerification';
11
+ import ReviewKYCScreen from '../screens/ReviewKYC';
12
+ import EmployeeScreen from '../screens/Employee';
13
+ import NomineeDetailScreen from '../screens/NomineeDetail';
14
+ import BankDetailScreen from '../screens/BankDetail';
15
+ import AddBankAccountScreen from '../screens/AddBankAccount';
16
+ import FindIFSCScreen from '../screens/FindIFSC';
17
+ import PayNowScreen from '../screens/PayNow';
18
+ import PaymentScreen from '../screens/Payment';
19
+ import PaymentStatusScreen from '../screens/PaymentStatus';
20
+
21
+ // Import navigation helpers
22
+ import { goBack, navigate, replace, pop } from './helpers';
23
+ import { getPaymentSession } from '../state/paymentSession';
24
+
25
+ const Stack = createStackNavigator<RootStackParamList>();
26
+
27
+ interface RootNavigatorProps {
28
+ config?: SDKNavigationConfig;
29
+ onExit?: (fdDetails?: any) => void;
30
+ }
31
+
32
+ const RootNavigator: React.FC<RootNavigatorProps> = ({
33
+ config = {},
34
+ onExit
35
+ }) => {
36
+ // Handle Android hardware back button
37
+ useEffect(() => {
38
+ if (Platform.OS !== 'android') return;
39
+
40
+ let lastBackPressTime = 0;
41
+
42
+ const onBackPress = () => {
43
+ // Check if navigation is ready
44
+ if (!navigationRef.current?.isReady()) {
45
+ return false;
46
+ }
47
+
48
+ const now = Date.now();
49
+
50
+ // Ignore synthetic back events triggered during forward navigation (debounce)
51
+ if (now - lastBackPressTime < 300) {
52
+ return false;
53
+ }
54
+
55
+ lastBackPressTime = now;
56
+
57
+ const currentRoute = navigationRef.current?.getCurrentRoute()?.name;
58
+
59
+ // Block back on Payment and PaymentStatus screens
60
+ if (currentRoute === "Payment" || currentRoute === "PaymentStatus") {
61
+ return true; // block hardware back
62
+ }
63
+
64
+ // FD Calculator should always redirect to FD List
65
+ if (currentRoute === "FDCalculator") {
66
+ navigationRef.current.navigate('FDList');
67
+ return true;
68
+ }
69
+
70
+ // Note: Screen-specific BackHandlers take priority over this global handler
71
+ // The following screens handle their own hardware back button:
72
+ // - Payment: BLOCKED (handled above)
73
+ // - PaymentStatus: BLOCKED (handled above)
74
+ // - FDList: → Main App (screen-specific handler)
75
+ // - FDCalculator: → FDList (handled above)
76
+ // - AadhaarVerification: previousState API → ReviewKYC (screen-specific handler)
77
+ // - ReviewKYC: previousState API → FDCalculator (screen-specific handler)
78
+ // - Employee: previousState API → ReviewKYC (screen-specific handler)
79
+ // - NomineeDetail: previousState API → Employee (screen-specific handler)
80
+ // - BankDetail: previousState API → NomineeDetail (screen-specific handler)
81
+ // - PayNow: previousState API → BankDetail (screen-specific handler)
82
+ // - AddBankAccount: → BankDetail (screen-specific handler)
83
+ // - FindIFSC: → AddBankAccount (screen-specific handler)
84
+
85
+ // Skip FDList - let screen-specific handler handle it
86
+ if (currentRoute === "FDList") {
87
+ return false; // Let screen-specific handler handle it
88
+ }
89
+
90
+ // Enable back navigation everywhere else - use the same goBack() helper that header back buttons use
91
+ goBack(); // This calls the same function as the header back button
92
+ return true;
93
+ };
94
+
95
+ const subscription = BackHandler.addEventListener("hardwareBackPress", onBackPress);
96
+
97
+ return () => {
98
+ subscription.remove();
99
+ };
100
+ }, []);
101
+
102
+ const {
103
+ initialRouteName = 'FDList',
104
+ customScreenOptions = {},
105
+ } = config;
106
+
107
+ // Default screen options
108
+ const defaultScreenOptions = {
109
+ headerShown: false,
110
+ cardStyle: { backgroundColor: '#f8f9fa' },
111
+ animationEnabled: true,
112
+ gestureEnabled: true,
113
+ ...customScreenOptions,
114
+ };
115
+
116
+ return (
117
+ <Stack.Navigator
118
+ initialRouteName={initialRouteName}
119
+ screenOptions={defaultScreenOptions}
120
+ >
121
+ <Stack.Screen
122
+ name="FDList"
123
+ options={{ title: 'Fixed Deposits' }}
124
+ >
125
+ {(props) => (
126
+ <FDListScreen
127
+ onGoBack={() => {
128
+ console.log('🔙 [RootNavigator] FDList onGoBack called, triggering onExit');
129
+ if (onExit) {
130
+ onExit();
131
+ } else {
132
+ console.warn('⚠️ [RootNavigator] onExit is undefined!');
133
+ }
134
+ }}
135
+ onSelectFD={(fdId) => {
136
+ // FD selected
137
+ }}
138
+ onNavigateToFDCalculator={(fdData) => {
139
+ navigate('FDCalculator', { fdData });
140
+ }}
141
+ {...props}
142
+ />
143
+ )}
144
+ </Stack.Screen>
145
+
146
+ <Stack.Screen
147
+ name="FDCalculator"
148
+ options={{ title: 'FD Calculator' }}
149
+ >
150
+ {(props) => (
151
+ <FDCalculatorScreen
152
+ onGoBack={() => goBack()}
153
+ onNavigateToReviewKYC={() => navigate('ReviewKYC', { fdData: props.route.params?.fdData })}
154
+ fdData={(props.route.params as any)?.fdData}
155
+ {...props}
156
+ />
157
+ )}
158
+ </Stack.Screen>
159
+
160
+ <Stack.Screen
161
+ name="AadhaarVerification"
162
+ options={{ title: 'Aadhaar Verification' }}
163
+ >
164
+ {(props) => (
165
+ <AadhaarVerificationScreen
166
+ onGoBack={() => goBack()}
167
+ onVerificationComplete={(aadhaarNumber) => {
168
+ // Navigate to Employee (occupation) screen after verification
169
+ navigate('Employee');
170
+ }}
171
+ {...props}
172
+ />
173
+ )}
174
+ </Stack.Screen>
175
+
176
+ <Stack.Screen
177
+ name="ReviewKYC"
178
+ options={{ title: 'Review KYC' }}
179
+ >
180
+ {(props) => (
181
+ <ReviewKYCScreen
182
+ onGoBack={() => goBack()}
183
+ onContinue={(kycData) => {
184
+ // Navigate to Employee screen after KYC review
185
+ navigate('Employee');
186
+ }}
187
+ {...props}
188
+ />
189
+ )}
190
+ </Stack.Screen>
191
+
192
+ <Stack.Screen
193
+ name="Employee"
194
+ options={{ title: 'Occupation' }}
195
+ >
196
+ {(props) => (
197
+ <EmployeeScreen
198
+ onGoBack={() => goBack()}
199
+ onContinue={() => {
200
+ // Navigate to NomineeDetail after Employee details
201
+ navigate('NomineeDetail');
202
+ }}
203
+ {...props}
204
+ />
205
+ )}
206
+ </Stack.Screen>
207
+
208
+ <Stack.Screen
209
+ name="NomineeDetail"
210
+ options={{ title: 'Nominee Details' }}
211
+ >
212
+ {(props) => (
213
+ <NomineeDetailScreen
214
+ onGoBack={() => goBack()}
215
+ onSave={(nomineeData) => {
216
+ // Navigate to BankDetail after Nominee details
217
+ navigate('BankDetail');
218
+ }}
219
+ {...props}
220
+ />
221
+ )}
222
+ </Stack.Screen>
223
+
224
+ <Stack.Screen
225
+ name="BankDetail"
226
+ options={{ title: 'Bank Details' }}
227
+ >
228
+ {(props) => (
229
+ <BankDetailScreen
230
+ onGoBack={() => goBack()}
231
+ onContinue={(bankData) => {
232
+ // Navigate to PayNow screen after Bank details
233
+ navigate('PayNow');
234
+ }}
235
+ onAddAccount={() => {
236
+ // Navigate to AddBankAccount screen
237
+ navigate('AddBankAccount');
238
+ }}
239
+ {...props}
240
+ />
241
+ )}
242
+ </Stack.Screen>
243
+
244
+ <Stack.Screen
245
+ name="AddBankAccount"
246
+ options={{ title: 'Add Bank Account' }}
247
+ >
248
+ {(props) => (
249
+ <AddBankAccountScreen
250
+ onGoBack={() => goBack()}
251
+ onContinue={(bankData) => {
252
+ // Go back to BankDetail screen after adding account
253
+ goBack();
254
+ }}
255
+ onFindIFSC={() => {
256
+ // Navigate to FindIFSC screen
257
+ navigate('FindIFSC');
258
+ }}
259
+ selectedIFSC={(() => {
260
+ const params = (props.route.params as any);
261
+ return params?.selectedIFSC;
262
+ })()}
263
+ {...props}
264
+ />
265
+ )}
266
+ </Stack.Screen>
267
+
268
+ <Stack.Screen
269
+ name="FindIFSC"
270
+ options={{ title: 'Find IFSC' }}
271
+ >
272
+ {(props) => (
273
+ <FindIFSCScreen
274
+ onGoBack={() => goBack()}
275
+ onSelect={(ifscData) => {
276
+ // Pop the FindIFSC screen and navigate to AddBankAccount with the selected data
277
+ pop(1); // Remove FindIFSC from stack
278
+ navigate('AddBankAccount', { selectedIFSC: ifscData });
279
+ }}
280
+ initialSearchTerm={(props.route.params as any)?.initialSearchTerm}
281
+ {...props}
282
+ />
283
+ )}
284
+ </Stack.Screen>
285
+
286
+ <Stack.Screen
287
+ name="PayNow"
288
+ options={{ title: 'Pay Now' }}
289
+ >
290
+ {(props) => (
291
+ <PayNowScreen
292
+ onGoBack={() => goBack()}
293
+ onConfirm={() => {
294
+ // onConfirm is now handled inside PayNow after createFD; keep fallback
295
+ }}
296
+ fdData={(props.route.params as any)?.fdData}
297
+ {...props}
298
+ />
299
+ )}
300
+ </Stack.Screen>
301
+
302
+ <Stack.Screen
303
+ name="Payment"
304
+ options={{ title: 'Payment' }}
305
+ >
306
+ {(props) => (
307
+ <PaymentScreen
308
+ onGoBack={() => goBack()}
309
+ paymentUrl={(getPaymentSession().paymentUrl) || ''}
310
+ onPaymentSuccess={(data) => {
311
+ navigate('PaymentStatus', {
312
+ status: 'success',
313
+ paymentData: data
314
+ } as any);
315
+ }}
316
+ onPaymentFailure={(error) => {
317
+ navigate('PaymentStatus', {
318
+ status: 'failed',
319
+ paymentData: error
320
+ } as any);
321
+ }}
322
+ {...props}
323
+ />
324
+ )}
325
+ </Stack.Screen>
326
+
327
+ <Stack.Screen
328
+ name="PaymentStatus"
329
+ options={{ title: 'Payment Status' }}
330
+ >
331
+ {(props) => (
332
+ <PaymentStatusScreen
333
+ status={(props.route.params as any)?.status || 'pending'}
334
+ transactionId={(props.route.params as any)?.transactionId}
335
+ fdData={(props.route.params as any)?.fdData}
336
+ onRetry={() => {
337
+ // Go back to Payment screen to retry
338
+ navigate('Payment');
339
+ }}
340
+ onContinue={(fdDetails) => {
341
+ // Exit SDK to main app after successful payment with FD details
342
+ onExit?.(fdDetails);
343
+ }}
344
+ {...props}
345
+ />
346
+ )}
347
+ </Stack.Screen>
348
+ </Stack.Navigator>
349
+ );
350
+ };
351
+
352
+ export default RootNavigator;
@@ -0,0 +1,107 @@
1
+ import React, { useState } from 'react';
2
+ //import Home from '../screens/Home';
3
+ import FDList from '../screens/FDList';
4
+ //import BookFD from '../screens/BookFD';
5
+ import FDCalculator from '../screens/FDCalculator';
6
+ //import type { FDBookingData } from '../screens/BookFD';
7
+
8
+ export type SimpleNavigationRoute = 'Home' | 'FDList' | 'BookFD' | 'FDCalculator';
9
+
10
+ export interface SimpleNavigationConfig {
11
+ initialRouteName?: SimpleNavigationRoute;
12
+ }
13
+
14
+ interface SimpleNavigatorProps {
15
+ config?: SimpleNavigationConfig;
16
+ onExit?: () => void;
17
+ }
18
+
19
+ const SimpleNavigator: React.FC<SimpleNavigatorProps> = ({ config, onExit }) => {
20
+ const [currentRoute, setCurrentRoute] = useState<SimpleNavigationRoute>(
21
+ config?.initialRouteName || 'FDList'
22
+ );
23
+ const [routeParams, setRouteParams] = useState<any>(null);
24
+
25
+ const navigate = (routeName: SimpleNavigationRoute, params?: any) => {
26
+ setCurrentRoute(routeName);
27
+ setRouteParams(params);
28
+ };
29
+
30
+ const goBack = () => {
31
+ // Simple back navigation logic
32
+ switch (currentRoute) {
33
+ case 'FDList':
34
+ // FDList is now the first screen, so exit SDK
35
+ if (onExit) {
36
+ onExit();
37
+ }
38
+ break;
39
+ case 'BookFD':
40
+ case 'FDCalculator':
41
+ setCurrentRoute('FDList');
42
+ setRouteParams(null);
43
+ break;
44
+ case 'Home':
45
+ // If somehow on Home, go back to FDList
46
+ setCurrentRoute('FDList');
47
+ setRouteParams(null);
48
+ break;
49
+ default:
50
+ if (onExit) {
51
+ onExit();
52
+ }
53
+ break;
54
+ }
55
+ };
56
+
57
+ // const handleBookingComplete = (data: FDBookingData) => {
58
+ // goBack(); // Go back to FD List after booking
59
+ // };
60
+
61
+ const renderCurrentScreen = () => {
62
+ switch (currentRoute) {
63
+ // case 'Home':
64
+ // return (
65
+ // <Home
66
+ // onNavigateToBookFD={() => navigate('BookFD')}
67
+ // onNavigateToFDList={() => navigate('FDList')}
68
+ // />
69
+ // );
70
+ case 'FDList':
71
+ return (
72
+ <FDList
73
+ onGoBack={goBack}
74
+ onSelectFD={(fdId: string) => {/* FD selected */ }}
75
+ onNavigateToFDCalculator={(fdData: any) => navigate('FDCalculator', { fdData })}
76
+ />
77
+ );
78
+ // case 'BookFD':
79
+ // return (
80
+ // <BookFD
81
+ // onGoBack={goBack}
82
+ // onBookingComplete={handleBookingComplete}
83
+ // fdData={routeParams?.fdData}
84
+ // />
85
+ // );
86
+ case 'FDCalculator':
87
+ return (
88
+ <FDCalculator
89
+ onGoBack={goBack}
90
+ fdData={routeParams?.fdData}
91
+ />
92
+ );
93
+ default:
94
+ return (
95
+ <FDList
96
+ onGoBack={goBack}
97
+ onSelectFD={(fdId: string) => {/* FD selected */ }}
98
+ onNavigateToFDCalculator={(fdData: any) => navigate('FDCalculator', { fdData })}
99
+ />
100
+ );
101
+ }
102
+ };
103
+
104
+ return renderCurrentScreen();
105
+ };
106
+
107
+ export default SimpleNavigator;