@onairos/react-native 3.4.0 → 3.5.4
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 +62 -13
- package/lib/commonjs/api/index.js +9 -145
- package/lib/commonjs/assets/animations/loaderani.json +1 -0
- package/lib/commonjs/assets/animations/persona-animation.json +1 -0
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/chatgpt.png +0 -0
- package/lib/commonjs/assets/icons/claude.png +0 -0
- package/lib/commonjs/assets/icons/gemini.png +0 -0
- package/lib/commonjs/assets/icons/grok.png +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/chatgpt.png +0 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/claude.png +0 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- package/lib/commonjs/assets/images/gemini.png +0 -0
- package/lib/commonjs/assets/images/grok.png +0 -0
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +9 -0
- package/lib/commonjs/components/BrandMark.js +10 -0
- package/lib/commonjs/components/CodeInput.js +9 -0
- package/lib/commonjs/components/EmailInput.js +8 -0
- package/lib/commonjs/components/GoogleButton.js +9 -0
- package/lib/commonjs/components/HeadingGroup.js +9 -0
- package/lib/commonjs/components/LLMDataInputModal.js +14 -0
- package/lib/commonjs/components/ModalHeader.js +9 -0
- package/lib/commonjs/components/ModalSheet.js +9 -0
- package/lib/commonjs/components/Onairos.js +14 -374
- package/lib/commonjs/components/OnairosButton.js +13 -309
- package/lib/commonjs/components/OnairosSignInButton.js +12 -0
- package/lib/commonjs/components/Overlay.js +13 -483
- package/lib/commonjs/components/PersonaImage.js +10 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
- package/lib/commonjs/components/PinCreationScreen.js +12 -0
- package/lib/commonjs/components/PinInput.js +9 -302
- package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
- package/lib/commonjs/components/PlatformList.js +10 -137
- package/lib/commonjs/components/PlatformToggle.js +9 -0
- package/lib/commonjs/components/PrimaryButton.js +10 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
- package/lib/commonjs/components/SignInStep.js +12 -0
- package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +21 -0
- package/lib/commonjs/components/icons/Basicproficon.js +8 -0
- package/lib/commonjs/components/icons/Basicprofile.js +8 -0
- package/lib/commonjs/components/icons/Checkbox.js +8 -0
- package/lib/commonjs/components/icons/Checkmark.js +8 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
- package/lib/commonjs/components/icons/Contenticon.js +8 -0
- package/lib/commonjs/components/icons/EnochE.js +8 -0
- package/lib/commonjs/components/icons/Personalityicon.js +8 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
- package/lib/commonjs/components/icons/Userpreferences.js +8 -0
- package/lib/commonjs/components/icons/index.js +17 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
- package/lib/commonjs/components/onboarding/PinInput.js +10 -283
- package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
- package/lib/commonjs/config/api.js +7 -0
- package/lib/commonjs/constants/index.js +7 -83
- package/lib/commonjs/context/AuthContext.js +10 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
- package/lib/commonjs/hooks/useConnections.js +8 -159
- package/lib/commonjs/hooks/useCredentials.js +10 -177
- package/lib/commonjs/hooks/useUserConnections.js +10 -0
- package/lib/commonjs/index.js +35 -106
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +31 -38
- package/lib/commonjs/services/apiClient.js +8 -0
- package/lib/commonjs/services/apiKeyService.js +9 -946
- package/lib/commonjs/services/authService.js +10 -0
- package/lib/commonjs/services/biometricPinService.js +8 -0
- package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
- package/lib/commonjs/services/chatGPTConversationService.js +9 -0
- package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
- package/lib/commonjs/services/claudeConversationService.js +9 -0
- package/lib/commonjs/services/connectedAccountsService.js +10 -0
- package/lib/commonjs/services/googleAuthService.js +11 -0
- package/lib/commonjs/services/imageCompressionService.js +7 -0
- package/lib/commonjs/services/jwtStorageService.js +7 -0
- package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
- package/lib/commonjs/services/linkedinProfileService.js +9 -0
- package/lib/commonjs/services/linkedinScrapingService.js +8 -0
- package/lib/commonjs/services/llmDataStorage.js +8 -0
- package/lib/commonjs/services/mobileTrainingService.js +8 -0
- package/lib/commonjs/services/oauthService.js +11 -390
- package/lib/commonjs/services/pinEncryptionService.js +8 -0
- package/lib/commonjs/services/pinStorageUtils.js +7 -0
- package/lib/commonjs/services/platformAuthService.js +12 -1067
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/trainingApiHelpers.js +7 -0
- package/lib/commonjs/services/userConnectionsService.js +10 -0
- package/lib/commonjs/services/youtubeMigrationService.js +10 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/types/ambient.d.js +1 -2
- package/lib/commonjs/types/declarations.d.js +1 -2
- package/lib/commonjs/types/index.js +1 -6
- package/lib/commonjs/types/node-fix.d.js +1 -2
- package/lib/commonjs/types/node-override.d.js +1 -2
- package/lib/commonjs/types/opacity.d.js +1 -2
- package/lib/commonjs/types.js +1 -14
- package/lib/commonjs/utils/Portal.js +8 -98
- package/lib/commonjs/utils/api.js +9 -129
- package/lib/commonjs/utils/assetRegistry.js +33 -0
- package/lib/commonjs/utils/auth.js +9 -111
- package/lib/commonjs/utils/crypto.js +8 -62
- package/lib/commonjs/utils/debugHelper.js +1 -64
- package/lib/commonjs/utils/encryption.js +7 -76
- package/lib/commonjs/utils/eventUtils.js +1 -0
- package/lib/commonjs/utils/haptics.js +9 -0
- package/lib/commonjs/utils/imagePreloader.js +1 -0
- package/lib/commonjs/utils/networkDiagnostics.js +8 -0
- package/lib/commonjs/utils/onairosApi.js +9 -350
- package/lib/commonjs/utils/programmaticFlow.js +9 -117
- package/lib/commonjs/utils/retryHelper.js +1 -220
- package/lib/commonjs/utils/secureStorage.js +10 -349
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +9 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/api/index.js +1 -139
- package/lib/module/assets/animations/loaderani.json +1 -0
- package/lib/module/assets/animations/persona-animation.json +1 -0
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/chatgpt.png +0 -0
- package/lib/module/assets/icons/claude.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/gemini.png +0 -0
- package/lib/module/assets/icons/grok.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/chatgpt.png +0 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/claude.png +0 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- package/lib/module/assets/images/gemini.png +0 -0
- package/lib/module/assets/images/grok.png +0 -0
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +1 -0
- package/lib/module/components/BrandMark.js +1 -0
- package/lib/module/components/CodeInput.js +1 -0
- package/lib/module/components/EmailInput.js +1 -0
- package/lib/module/components/GoogleButton.js +1 -0
- package/lib/module/components/HeadingGroup.js +1 -0
- package/lib/module/components/LLMDataInputModal.js +8 -0
- package/lib/module/components/ModalHeader.js +1 -0
- package/lib/module/components/ModalSheet.js +1 -0
- package/lib/module/components/Onairos.js +1 -367
- package/lib/module/components/OnairosButton.js +1 -302
- package/lib/module/components/OnairosSignInButton.js +1 -0
- package/lib/module/components/Overlay.js +1 -474
- package/lib/module/components/PersonaImage.js +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +1 -0
- package/lib/module/components/PinCreationScreen.js +1 -0
- package/lib/module/components/PinInput.js +1 -293
- package/lib/module/components/PlatformConnectorsStep.js +1 -0
- package/lib/module/components/PlatformList.js +1 -129
- package/lib/module/components/PlatformToggle.js +1 -0
- package/lib/module/components/PrimaryButton.js +1 -0
- package/lib/module/components/SignInMatchAnimation.js +1 -0
- package/lib/module/components/SignInStep.js +1 -0
- package/lib/module/components/UniversalOnboarding.js +1 -1693
- package/lib/module/components/VerificationStep.js +1 -0
- package/lib/module/components/WelcomeScreen.js +1 -0
- package/lib/module/components/icons/Basicproficon.js +1 -0
- package/lib/module/components/icons/Basicprofile.js +1 -0
- package/lib/module/components/icons/Checkbox.js +1 -0
- package/lib/module/components/icons/Checkmark.js +1 -0
- package/lib/module/components/icons/Contentanalysis.js +1 -0
- package/lib/module/components/icons/Contenticon.js +1 -0
- package/lib/module/components/icons/EnochE.js +1 -0
- package/lib/module/components/icons/Personalityicon.js +1 -0
- package/lib/module/components/icons/Personalityprofile.js +1 -0
- package/lib/module/components/icons/Personalitytraits.js +1 -0
- package/lib/module/components/icons/Userpreferences.js +1 -0
- package/lib/module/components/icons/index.js +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +1 -818
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
- package/lib/module/components/onboarding/PinInput.js +1 -274
- package/lib/module/components/onboarding/PlatformConnector.js +1 -240
- package/lib/module/config/api.js +1 -0
- package/lib/module/constants/index.js +1 -77
- package/lib/module/context/AuthContext.js +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +1 -0
- package/lib/module/hooks/useConnections.js +1 -152
- package/lib/module/hooks/useCredentials.js +6 -169
- package/lib/module/hooks/useUserConnections.js +1 -0
- package/lib/module/index.js +1 -32
- package/lib/module/services/SDK_API_KEY_VALIDATION.md +31 -38
- package/lib/module/services/apiClient.js +1 -0
- package/lib/module/services/apiKeyService.js +1 -919
- package/lib/module/services/authService.js +1 -0
- package/lib/module/services/biometricPinService.js +1 -0
- package/lib/module/services/chatGPTConversationExtractor.js +1 -0
- package/lib/module/services/chatGPTConversationService.js +1 -0
- package/lib/module/services/claudeConversationExtractor.js +1 -0
- package/lib/module/services/claudeConversationService.js +1 -0
- package/lib/module/services/connectedAccountsService.js +1 -0
- package/lib/module/services/googleAuthService.js +1 -0
- package/lib/module/services/imageCompressionService.js +1 -0
- package/lib/module/services/jwtStorageService.js +1 -0
- package/lib/module/services/linkedinDOMExtractor.js +1 -0
- package/lib/module/services/linkedinProfileService.js +1 -0
- package/lib/module/services/linkedinScrapingService.js +1 -0
- package/lib/module/services/llmDataStorage.js +1 -0
- package/lib/module/services/mobileTrainingService.js +1 -0
- package/lib/module/services/oauthService.js +1 -380
- package/lib/module/services/pinEncryptionService.js +7 -0
- package/lib/module/services/pinStorageUtils.js +1 -0
- package/lib/module/services/platformAuthService.js +1 -1041
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/trainingApiHelpers.js +1 -0
- package/lib/module/services/userConnectionsService.js +1 -0
- package/lib/module/services/youtubeMigrationService.js +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/types.js +1 -10
- package/lib/module/utils/Portal.js +1 -90
- package/lib/module/utils/api.js +1 -117
- package/lib/module/utils/assetRegistry.js +33 -0
- package/lib/module/utils/auth.js +1 -99
- package/lib/module/utils/crypto.js +1 -54
- package/lib/module/utils/debugHelper.js +1 -54
- package/lib/module/utils/encryption.js +1 -67
- package/lib/module/utils/eventUtils.js +1 -0
- package/lib/module/utils/haptics.js +8 -0
- package/lib/module/utils/imagePreloader.js +1 -0
- package/lib/module/utils/networkDiagnostics.js +1 -0
- package/lib/module/utils/onairosApi.js +1 -333
- package/lib/module/utils/programmaticFlow.js +1 -111
- package/lib/module/utils/retryHelper.js +1 -211
- package/lib/module/utils/secureStorage.js +6 -330
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/module/utils/webviewScripts/claude.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/package.json +62 -39
- package/lib/commonjs/api/index.js.map +0 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js +0 -228
- package/lib/commonjs/components/DataRequestModal.js.map +0 -1
- package/lib/commonjs/components/DataRequestScreen.js +0 -329
- package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
- package/lib/commonjs/components/EmailVerificationModal.js +0 -320
- package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
- package/lib/commonjs/components/Onairos.js.map +0 -1
- package/lib/commonjs/components/OnairosButton.js.map +0 -1
- package/lib/commonjs/components/Overlay.js.map +0 -1
- package/lib/commonjs/components/PinInput.js.map +0 -1
- package/lib/commonjs/components/PlatformList.js.map +0 -1
- package/lib/commonjs/components/TrainingModal.js +0 -717
- package/lib/commonjs/components/TrainingModal.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
- package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/constants/index.js.map +0 -1
- package/lib/commonjs/hooks/useConnections.js.map +0 -1
- package/lib/commonjs/hooks/useCredentials.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/services/apiKeyService.js.map +0 -1
- package/lib/commonjs/services/oauthService.js.map +0 -1
- package/lib/commonjs/services/platformAuthService.js.map +0 -1
- package/lib/commonjs/types/ambient.d.js.map +0 -1
- package/lib/commonjs/types/declarations.d.js.map +0 -1
- package/lib/commonjs/types/index.d.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/types/node-fix.d.js.map +0 -1
- package/lib/commonjs/types/node-override.d.js.map +0 -1
- package/lib/commonjs/types/opacity.d.js.map +0 -1
- package/lib/commonjs/types/types.d.js.map +0 -1
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/Portal.js.map +0 -1
- package/lib/commonjs/utils/api.js.map +0 -1
- package/lib/commonjs/utils/auth.js.map +0 -1
- package/lib/commonjs/utils/crypto.js.map +0 -1
- package/lib/commonjs/utils/debugHelper.js.map +0 -1
- package/lib/commonjs/utils/encryption.js.map +0 -1
- package/lib/commonjs/utils/onairosApi.js.map +0 -1
- package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
- package/lib/commonjs/utils/retryHelper.js.map +0 -1
- package/lib/commonjs/utils/secureStorage.js.map +0 -1
- package/lib/module/api/index.js.map +0 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js +0 -220
- package/lib/module/components/DataRequestModal.js.map +0 -1
- package/lib/module/components/DataRequestScreen.js +0 -321
- package/lib/module/components/DataRequestScreen.js.map +0 -1
- package/lib/module/components/EmailVerificationModal.js +0 -311
- package/lib/module/components/EmailVerificationModal.js.map +0 -1
- package/lib/module/components/Onairos.js.map +0 -1
- package/lib/module/components/OnairosButton.js.map +0 -1
- package/lib/module/components/Overlay.js.map +0 -1
- package/lib/module/components/PinInput.js.map +0 -1
- package/lib/module/components/PlatformList.js.map +0 -1
- package/lib/module/components/TrainingModal.js +0 -708
- package/lib/module/components/TrainingModal.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/module/components/onboarding/PinInput.js.map +0 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/module/components/screens/ConnectorScreen.js +0 -138
- package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/module/components/screens/LoadingScreen.js +0 -83
- package/lib/module/components/screens/LoadingScreen.js.map +0 -1
- package/lib/module/components/screens/PinCreationScreen.js +0 -53
- package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/module/constants/index.js.map +0 -1
- package/lib/module/hooks/useConnections.js.map +0 -1
- package/lib/module/hooks/useCredentials.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/services/apiKeyService.js.map +0 -1
- package/lib/module/services/oauthService.js.map +0 -1
- package/lib/module/services/platformAuthService.js.map +0 -1
- package/lib/module/types/ambient.d.js.map +0 -1
- package/lib/module/types/declarations.d.js.map +0 -1
- package/lib/module/types/index.d.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/types/node-fix.d.js.map +0 -1
- package/lib/module/types/node-override.d.js.map +0 -1
- package/lib/module/types/opacity.d.js.map +0 -1
- package/lib/module/types/types.d.js.map +0 -1
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils/Portal.js.map +0 -1
- package/lib/module/utils/api.js.map +0 -1
- package/lib/module/utils/auth.js.map +0 -1
- package/lib/module/utils/crypto.js.map +0 -1
- package/lib/module/utils/debugHelper.js.map +0 -1
- package/lib/module/utils/encryption.js.map +0 -1
- package/lib/module/utils/onairosApi.js.map +0 -1
- package/lib/module/utils/programmaticFlow.js.map +0 -1
- package/lib/module/utils/retryHelper.js.map +0 -1
- package/lib/module/utils/secureStorage.js.map +0 -1
- package/lib/typescript/api/index.d.ts +0 -8
- package/lib/typescript/api/index.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestModal.d.ts +0 -11
- package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
- package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
- package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
- package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
- package/lib/typescript/components/Onairos.d.ts +0 -4
- package/lib/typescript/components/Onairos.d.ts.map +0 -1
- package/lib/typescript/components/OnairosButton.d.ts +0 -12
- package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
- package/lib/typescript/components/Overlay.d.ts +0 -4
- package/lib/typescript/components/Overlay.d.ts.map +0 -1
- package/lib/typescript/components/PinInput.d.ts +0 -4
- package/lib/typescript/components/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/PlatformList.d.ts +0 -4
- package/lib/typescript/components/PlatformList.d.ts.map +0 -1
- package/lib/typescript/components/TrainingModal.d.ts +0 -4
- package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
- package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
- package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
- package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/constants/index.d.ts +0 -53
- package/lib/typescript/constants/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnections.d.ts +0 -9
- package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
- package/lib/typescript/hooks/useCredentials.d.ts +0 -9
- package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -18
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/services/apiKeyService.d.ts +0 -132
- package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
- package/lib/typescript/services/oauthService.d.ts +0 -50
- package/lib/typescript/services/oauthService.d.ts.map +0 -1
- package/lib/typescript/services/platformAuthService.d.ts +0 -144
- package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts +0 -231
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -270
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils/Portal.d.ts +0 -14
- package/lib/typescript/utils/Portal.d.ts.map +0 -1
- package/lib/typescript/utils/api.d.ts +0 -6
- package/lib/typescript/utils/api.d.ts.map +0 -1
- package/lib/typescript/utils/auth.d.ts +0 -6
- package/lib/typescript/utils/auth.d.ts.map +0 -1
- package/lib/typescript/utils/crypto.d.ts +0 -4
- package/lib/typescript/utils/crypto.d.ts.map +0 -1
- package/lib/typescript/utils/debugHelper.d.ts +0 -29
- package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
- package/lib/typescript/utils/encryption.d.ts +0 -19
- package/lib/typescript/utils/encryption.d.ts.map +0 -1
- package/lib/typescript/utils/onairosApi.d.ts +0 -87
- package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
- package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
- package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
- package/lib/typescript/utils/retryHelper.d.ts +0 -69
- package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
- package/lib/typescript/utils/secureStorage.d.ts +0 -94
- package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
- package/src/api/index.ts +0 -111
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/onairos_logo.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestModal.tsx +0 -227
- package/src/components/DataRequestScreen.tsx +0 -356
- package/src/components/EmailVerificationModal.tsx +0 -364
- package/src/components/Onairos.tsx +0 -425
- package/src/components/OnairosButton.tsx +0 -359
- package/src/components/Overlay.tsx +0 -506
- package/src/components/PinInput.tsx +0 -343
- package/src/components/PlatformList.tsx +0 -145
- package/src/components/TrainingModal.tsx +0 -737
- package/src/components/UniversalOnboarding.tsx +0 -1839
- package/src/components/UniversalOnboarding.tsx.new +0 -455
- package/src/components/onboarding/OAuthWebView.tsx +0 -838
- package/src/components/onboarding/OnboardingHeader.tsx +0 -70
- package/src/components/onboarding/PinInput.tsx +0 -356
- package/src/components/onboarding/PlatformConnector.tsx +0 -302
- package/src/components/screens/ConnectorScreen.tsx +0 -153
- package/src/components/screens/LoadingScreen.tsx +0 -100
- package/src/components/screens/PinCreationScreen.tsx +0 -67
- package/src/constants/index.ts +0 -83
- package/src/hooks/useConnections.ts +0 -163
- package/src/hooks/useCredentials.ts +0 -175
- package/src/index.js +0 -14
- package/src/index.ts +0 -50
- package/src/services/SDK_API_KEY_VALIDATION.md +0 -428
- package/src/services/apiKeyService.ts +0 -979
- package/src/services/oauthService.ts +0 -412
- package/src/services/platformAuthService.ts +0 -1113
- package/src/types/ambient.d.ts +0 -29
- package/src/types/declarations.d.ts +0 -26
- package/src/types/index.d.ts +0 -274
- package/src/types/index.ts +0 -244
- package/src/types/node-fix.d.ts +0 -19
- package/src/types/node-override.d.ts +0 -24
- package/src/types/opacity.d.ts +0 -16
- package/src/types/types.d.ts +0 -18
- package/src/types.ts +0 -298
- package/src/utils/Portal.tsx +0 -83
- package/src/utils/api.js +0 -112
- package/src/utils/auth.js +0 -104
- package/src/utils/crypto.js +0 -60
- package/src/utils/debugHelper.ts +0 -53
- package/src/utils/encryption.ts +0 -69
- package/src/utils/onairosApi.ts +0 -391
- package/src/utils/programmaticFlow.ts +0 -113
- package/src/utils/retryHelper.ts +0 -275
- package/src/utils/secureStorage.ts +0 -361
- package/types/index.d.ts +0 -218
- package/types/node-env.d.ts +0 -15
- /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
ScrollView,
|
|
8
|
-
Image,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
11
|
-
import { COLORS } from '../constants';
|
|
12
|
-
|
|
13
|
-
interface DataRequestScreenProps {
|
|
14
|
-
onAccept: () => void;
|
|
15
|
-
onDecline: () => void;
|
|
16
|
-
requestData: Record<string, any>;
|
|
17
|
-
AppName: string;
|
|
18
|
-
appIcon?: any;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const DataRequestScreen: React.FC<DataRequestScreenProps> = ({
|
|
22
|
-
onAccept,
|
|
23
|
-
onDecline,
|
|
24
|
-
requestData,
|
|
25
|
-
AppName,
|
|
26
|
-
appIcon,
|
|
27
|
-
}) => {
|
|
28
|
-
|
|
29
|
-
// Basic data requests that are always shown
|
|
30
|
-
const basicRequests = [
|
|
31
|
-
{
|
|
32
|
-
key: 'basic_profile',
|
|
33
|
-
name: 'Basic Profile',
|
|
34
|
-
description: 'Your basic social media profile information',
|
|
35
|
-
reward: 'Personalized experience',
|
|
36
|
-
icon: 'person'
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: 'content_analysis',
|
|
40
|
-
name: 'Content Analysis',
|
|
41
|
-
description: 'Analysis of your posts and interactions',
|
|
42
|
-
reward: 'Better recommendations',
|
|
43
|
-
icon: 'analytics'
|
|
44
|
-
}
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
const renderDataRequest = (data: any, key: string, isBasic = false) => {
|
|
48
|
-
let name, description, reward, icon;
|
|
49
|
-
|
|
50
|
-
if (isBasic) {
|
|
51
|
-
({ name, description, reward, icon } = data);
|
|
52
|
-
} else {
|
|
53
|
-
// Handle new format (personality_traits, sentiment_analysis)
|
|
54
|
-
if ('name' in data && 'description' in data && 'reward' in data) {
|
|
55
|
-
name = data.name;
|
|
56
|
-
description = data.description;
|
|
57
|
-
reward = data.reward;
|
|
58
|
-
icon = key === 'personality_traits' ? 'psychology' : 'analytics';
|
|
59
|
-
} else if ('type' in data && 'descriptions' in data && 'reward' in data) {
|
|
60
|
-
// Handle old format (Small, Medium, Large)
|
|
61
|
-
name = `${key} - ${data.type}`;
|
|
62
|
-
description = data.descriptions;
|
|
63
|
-
reward = data.reward;
|
|
64
|
-
icon = 'data_usage';
|
|
65
|
-
} else {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<View key={key} style={styles.dataRequestContainer}>
|
|
72
|
-
<View style={styles.dataRequestHeader}>
|
|
73
|
-
<View style={styles.iconContainer}>
|
|
74
|
-
<Icon
|
|
75
|
-
name={icon}
|
|
76
|
-
size={24}
|
|
77
|
-
color={COLORS.primary}
|
|
78
|
-
/>
|
|
79
|
-
</View>
|
|
80
|
-
<View style={styles.requestContent}>
|
|
81
|
-
<Text style={styles.dataRequestName}>{name}</Text>
|
|
82
|
-
<Text style={styles.dataRequestDescription}>{description}</Text>
|
|
83
|
-
<View style={styles.rewardContainer}>
|
|
84
|
-
<Icon name="star" size={16} color="#FFD700" />
|
|
85
|
-
<Text style={styles.rewardText}>{reward}</Text>
|
|
86
|
-
</View>
|
|
87
|
-
</View>
|
|
88
|
-
</View>
|
|
89
|
-
</View>
|
|
90
|
-
);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const renderCustomRequests = () => {
|
|
94
|
-
return Object.entries(requestData).map(([key, data]) => {
|
|
95
|
-
// Skip if data is undefined or doesn't have the expected structure
|
|
96
|
-
if (!data || typeof data !== 'object') return null;
|
|
97
|
-
return renderDataRequest(data, key, false);
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<View style={styles.container}>
|
|
103
|
-
{/* Header */}
|
|
104
|
-
<View style={styles.header}>
|
|
105
|
-
<View style={styles.titleContainer}>
|
|
106
|
-
<Text style={styles.title}>Data Sharing Request</Text>
|
|
107
|
-
<Text style={styles.subtitle}>
|
|
108
|
-
{AppName} would like access to the following data
|
|
109
|
-
</Text>
|
|
110
|
-
</View>
|
|
111
|
-
|
|
112
|
-
{/* App Icon Flow: Onairos → Your App */}
|
|
113
|
-
<View style={styles.iconFlow}>
|
|
114
|
-
<Image
|
|
115
|
-
source={require('../assets/images/onairos_logo.png')}
|
|
116
|
-
style={styles.onairosIcon}
|
|
117
|
-
resizeMode="contain"
|
|
118
|
-
/>
|
|
119
|
-
<Icon name="arrow-forward" size={24} color="#666" style={styles.arrowIcon} />
|
|
120
|
-
{appIcon ? (
|
|
121
|
-
<Image
|
|
122
|
-
source={appIcon}
|
|
123
|
-
style={styles.appIcon}
|
|
124
|
-
resizeMode="contain"
|
|
125
|
-
/>
|
|
126
|
-
) : (
|
|
127
|
-
<View style={styles.appIconPlaceholder}>
|
|
128
|
-
<Text style={styles.appIconText}>
|
|
129
|
-
{AppName.charAt(0).toUpperCase()}
|
|
130
|
-
</Text>
|
|
131
|
-
</View>
|
|
132
|
-
)}
|
|
133
|
-
</View>
|
|
134
|
-
</View>
|
|
135
|
-
|
|
136
|
-
{/* Data Requests */}
|
|
137
|
-
<ScrollView
|
|
138
|
-
style={styles.content}
|
|
139
|
-
contentContainerStyle={styles.scrollContent}
|
|
140
|
-
showsVerticalScrollIndicator={false}
|
|
141
|
-
>
|
|
142
|
-
{/* Basic Requests (always shown) */}
|
|
143
|
-
<View style={styles.section}>
|
|
144
|
-
<Text style={styles.sectionTitle}>Basic Data</Text>
|
|
145
|
-
{basicRequests.map((request) => renderDataRequest(request, request.key, true))}
|
|
146
|
-
</View>
|
|
147
|
-
|
|
148
|
-
{/* Custom Requests (from developer) */}
|
|
149
|
-
{Object.keys(requestData).length > 0 && (
|
|
150
|
-
<View style={styles.section}>
|
|
151
|
-
<Text style={styles.sectionTitle}>Additional Insights</Text>
|
|
152
|
-
{renderCustomRequests()}
|
|
153
|
-
</View>
|
|
154
|
-
)}
|
|
155
|
-
|
|
156
|
-
{/* Privacy Note */}
|
|
157
|
-
<View style={styles.privacyNote}>
|
|
158
|
-
<Icon name="security" size={20} color="#28a745" />
|
|
159
|
-
<Text style={styles.privacyText}>
|
|
160
|
-
Your data is encrypted and never shared with third parties
|
|
161
|
-
</Text>
|
|
162
|
-
</View>
|
|
163
|
-
</ScrollView>
|
|
164
|
-
|
|
165
|
-
{/* Footer Buttons */}
|
|
166
|
-
<View style={styles.footer}>
|
|
167
|
-
<TouchableOpacity
|
|
168
|
-
style={styles.declineButton}
|
|
169
|
-
onPress={onDecline}
|
|
170
|
-
>
|
|
171
|
-
<Text style={styles.declineButtonText}>Decline</Text>
|
|
172
|
-
</TouchableOpacity>
|
|
173
|
-
|
|
174
|
-
<TouchableOpacity
|
|
175
|
-
style={styles.acceptButton}
|
|
176
|
-
onPress={onAccept}
|
|
177
|
-
>
|
|
178
|
-
<Text style={styles.acceptButtonText}>Accept & Continue</Text>
|
|
179
|
-
</TouchableOpacity>
|
|
180
|
-
</View>
|
|
181
|
-
</View>
|
|
182
|
-
);
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
const styles = StyleSheet.create({
|
|
186
|
-
container: {
|
|
187
|
-
flex: 1,
|
|
188
|
-
backgroundColor: '#fff',
|
|
189
|
-
},
|
|
190
|
-
header: {
|
|
191
|
-
padding: 24,
|
|
192
|
-
paddingTop: 40,
|
|
193
|
-
backgroundColor: '#f8f9fa',
|
|
194
|
-
borderBottomWidth: 1,
|
|
195
|
-
borderBottomColor: '#e9ecef',
|
|
196
|
-
},
|
|
197
|
-
titleContainer: {
|
|
198
|
-
marginBottom: 20,
|
|
199
|
-
},
|
|
200
|
-
title: {
|
|
201
|
-
fontSize: 24,
|
|
202
|
-
fontWeight: '600',
|
|
203
|
-
color: '#000',
|
|
204
|
-
textAlign: 'center',
|
|
205
|
-
marginBottom: 8,
|
|
206
|
-
},
|
|
207
|
-
subtitle: {
|
|
208
|
-
fontSize: 16,
|
|
209
|
-
color: '#666',
|
|
210
|
-
textAlign: 'center',
|
|
211
|
-
},
|
|
212
|
-
iconFlow: {
|
|
213
|
-
flexDirection: 'row',
|
|
214
|
-
alignItems: 'center',
|
|
215
|
-
justifyContent: 'center',
|
|
216
|
-
},
|
|
217
|
-
onairosIcon: {
|
|
218
|
-
width: 32,
|
|
219
|
-
height: 32,
|
|
220
|
-
},
|
|
221
|
-
arrowIcon: {
|
|
222
|
-
marginHorizontal: 12,
|
|
223
|
-
},
|
|
224
|
-
appIcon: {
|
|
225
|
-
width: 32,
|
|
226
|
-
height: 32,
|
|
227
|
-
borderRadius: 8,
|
|
228
|
-
},
|
|
229
|
-
appIconPlaceholder: {
|
|
230
|
-
width: 32,
|
|
231
|
-
height: 32,
|
|
232
|
-
borderRadius: 8,
|
|
233
|
-
backgroundColor: COLORS.primary,
|
|
234
|
-
alignItems: 'center',
|
|
235
|
-
justifyContent: 'center',
|
|
236
|
-
},
|
|
237
|
-
appIconText: {
|
|
238
|
-
color: '#fff',
|
|
239
|
-
fontSize: 16,
|
|
240
|
-
fontWeight: '600',
|
|
241
|
-
},
|
|
242
|
-
content: {
|
|
243
|
-
flex: 1,
|
|
244
|
-
},
|
|
245
|
-
scrollContent: {
|
|
246
|
-
padding: 20,
|
|
247
|
-
},
|
|
248
|
-
section: {
|
|
249
|
-
marginBottom: 24,
|
|
250
|
-
},
|
|
251
|
-
sectionTitle: {
|
|
252
|
-
fontSize: 18,
|
|
253
|
-
fontWeight: '600',
|
|
254
|
-
color: '#000',
|
|
255
|
-
marginBottom: 16,
|
|
256
|
-
},
|
|
257
|
-
dataRequestContainer: {
|
|
258
|
-
marginBottom: 16,
|
|
259
|
-
borderWidth: 1,
|
|
260
|
-
borderColor: '#e9ecef',
|
|
261
|
-
borderRadius: 12,
|
|
262
|
-
padding: 16,
|
|
263
|
-
backgroundColor: '#fff',
|
|
264
|
-
},
|
|
265
|
-
dataRequestHeader: {
|
|
266
|
-
flexDirection: 'row',
|
|
267
|
-
alignItems: 'flex-start',
|
|
268
|
-
},
|
|
269
|
-
iconContainer: {
|
|
270
|
-
width: 40,
|
|
271
|
-
height: 40,
|
|
272
|
-
borderRadius: 20,
|
|
273
|
-
backgroundColor: '#f0f8ff',
|
|
274
|
-
alignItems: 'center',
|
|
275
|
-
justifyContent: 'center',
|
|
276
|
-
marginRight: 12,
|
|
277
|
-
},
|
|
278
|
-
requestContent: {
|
|
279
|
-
flex: 1,
|
|
280
|
-
},
|
|
281
|
-
dataRequestName: {
|
|
282
|
-
fontSize: 16,
|
|
283
|
-
fontWeight: '600',
|
|
284
|
-
color: '#000',
|
|
285
|
-
marginBottom: 4,
|
|
286
|
-
},
|
|
287
|
-
dataRequestDescription: {
|
|
288
|
-
fontSize: 14,
|
|
289
|
-
color: '#666',
|
|
290
|
-
lineHeight: 20,
|
|
291
|
-
marginBottom: 8,
|
|
292
|
-
},
|
|
293
|
-
rewardContainer: {
|
|
294
|
-
flexDirection: 'row',
|
|
295
|
-
alignItems: 'center',
|
|
296
|
-
backgroundColor: '#fff3cd',
|
|
297
|
-
padding: 6,
|
|
298
|
-
borderRadius: 6,
|
|
299
|
-
alignSelf: 'flex-start',
|
|
300
|
-
},
|
|
301
|
-
rewardText: {
|
|
302
|
-
fontSize: 12,
|
|
303
|
-
fontWeight: '500',
|
|
304
|
-
marginLeft: 4,
|
|
305
|
-
color: '#856404',
|
|
306
|
-
},
|
|
307
|
-
privacyNote: {
|
|
308
|
-
flexDirection: 'row',
|
|
309
|
-
alignItems: 'center',
|
|
310
|
-
backgroundColor: '#d4edda',
|
|
311
|
-
padding: 12,
|
|
312
|
-
borderRadius: 8,
|
|
313
|
-
marginTop: 8,
|
|
314
|
-
},
|
|
315
|
-
privacyText: {
|
|
316
|
-
fontSize: 14,
|
|
317
|
-
color: '#155724',
|
|
318
|
-
marginLeft: 8,
|
|
319
|
-
flex: 1,
|
|
320
|
-
},
|
|
321
|
-
footer: {
|
|
322
|
-
flexDirection: 'row',
|
|
323
|
-
padding: 20,
|
|
324
|
-
borderTopWidth: 1,
|
|
325
|
-
borderTopColor: '#e9ecef',
|
|
326
|
-
backgroundColor: '#fff',
|
|
327
|
-
},
|
|
328
|
-
declineButton: {
|
|
329
|
-
flex: 1,
|
|
330
|
-
paddingVertical: 16,
|
|
331
|
-
paddingHorizontal: 24,
|
|
332
|
-
borderRadius: 12,
|
|
333
|
-
borderWidth: 1,
|
|
334
|
-
borderColor: '#dc3545',
|
|
335
|
-
marginRight: 12,
|
|
336
|
-
alignItems: 'center',
|
|
337
|
-
},
|
|
338
|
-
declineButtonText: {
|
|
339
|
-
fontSize: 16,
|
|
340
|
-
fontWeight: '600',
|
|
341
|
-
color: '#dc3545',
|
|
342
|
-
},
|
|
343
|
-
acceptButton: {
|
|
344
|
-
flex: 2,
|
|
345
|
-
paddingVertical: 16,
|
|
346
|
-
paddingHorizontal: 24,
|
|
347
|
-
borderRadius: 12,
|
|
348
|
-
backgroundColor: '#28a745',
|
|
349
|
-
alignItems: 'center',
|
|
350
|
-
},
|
|
351
|
-
acceptButtonText: {
|
|
352
|
-
fontSize: 16,
|
|
353
|
-
fontWeight: '600',
|
|
354
|
-
color: '#fff',
|
|
355
|
-
},
|
|
356
|
-
});
|
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
ActivityIndicator,
|
|
8
|
-
Modal,
|
|
9
|
-
SafeAreaView,
|
|
10
|
-
TouchableWithoutFeedback,
|
|
11
|
-
TextInput,
|
|
12
|
-
Alert,
|
|
13
|
-
} from 'react-native';
|
|
14
|
-
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
15
|
-
import { requestEmailVerification, verifyEmailCode, checkEmailVerificationStatus } from '../services/platformAuthService';
|
|
16
|
-
|
|
17
|
-
export interface EmailVerificationModalProps {
|
|
18
|
-
visible: boolean;
|
|
19
|
-
email: string;
|
|
20
|
-
onClose: () => void;
|
|
21
|
-
onVerificationComplete: (email: string, isExistingUser: boolean) => void;
|
|
22
|
-
onVerificationFailed: (error: string) => void;
|
|
23
|
-
testMode?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const EmailVerificationModal: React.FC<EmailVerificationModalProps> = ({
|
|
27
|
-
visible,
|
|
28
|
-
email,
|
|
29
|
-
onClose,
|
|
30
|
-
onVerificationComplete,
|
|
31
|
-
onVerificationFailed,
|
|
32
|
-
testMode = false,
|
|
33
|
-
}) => {
|
|
34
|
-
const [step, setStep] = useState<'request' | 'verify'>('request');
|
|
35
|
-
const [verificationCode, setVerificationCode] = useState<string>('');
|
|
36
|
-
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
37
|
-
const [codeSent, setCodeSent] = useState<boolean>(false);
|
|
38
|
-
|
|
39
|
-
const handleRequestVerification = useCallback(async () => {
|
|
40
|
-
if (!email) {
|
|
41
|
-
Alert.alert('Error', 'Email address is required');
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
setIsLoading(true);
|
|
46
|
-
try {
|
|
47
|
-
console.log('📧 Requesting email verification for:', email);
|
|
48
|
-
|
|
49
|
-
// First check if there's already a pending verification
|
|
50
|
-
const statusCheck = await checkEmailVerificationStatus(email, testMode);
|
|
51
|
-
if (statusCheck.success && statusCheck.isPending) {
|
|
52
|
-
console.log('✅ Email verification already pending');
|
|
53
|
-
setCodeSent(true);
|
|
54
|
-
setStep('verify');
|
|
55
|
-
setIsLoading(false);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Request new verification code
|
|
60
|
-
const result = await requestEmailVerification(email, testMode);
|
|
61
|
-
|
|
62
|
-
if (result.success) {
|
|
63
|
-
console.log('✅ Email verification code requested successfully');
|
|
64
|
-
setCodeSent(true);
|
|
65
|
-
setStep('verify');
|
|
66
|
-
Alert.alert(
|
|
67
|
-
'Verification Code Sent',
|
|
68
|
-
result.message || 'Please check your email for the verification code.\n\nNote: In development mode, any 6-digit code will work.',
|
|
69
|
-
[{ text: 'OK', style: 'default' }]
|
|
70
|
-
);
|
|
71
|
-
} else {
|
|
72
|
-
console.error('❌ Failed to request verification code:', result.error);
|
|
73
|
-
Alert.alert('Error', result.error || 'Failed to send verification code');
|
|
74
|
-
onVerificationFailed(result.error || 'Failed to send verification code');
|
|
75
|
-
}
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error('❌ Error requesting verification:', error);
|
|
78
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
79
|
-
Alert.alert('Error', errorMessage);
|
|
80
|
-
onVerificationFailed(errorMessage);
|
|
81
|
-
} finally {
|
|
82
|
-
setIsLoading(false);
|
|
83
|
-
}
|
|
84
|
-
}, [email, onVerificationFailed]);
|
|
85
|
-
|
|
86
|
-
const handleVerifyCode = useCallback(async () => {
|
|
87
|
-
if (!verificationCode.trim()) {
|
|
88
|
-
Alert.alert('Error', 'Please enter the verification code');
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
setIsLoading(true);
|
|
93
|
-
try {
|
|
94
|
-
console.log('🔍 Verifying email code for:', email);
|
|
95
|
-
|
|
96
|
-
const result = await verifyEmailCode(email, verificationCode.trim(), testMode);
|
|
97
|
-
|
|
98
|
-
if (result.success) {
|
|
99
|
-
console.log('✅ Email verification successful');
|
|
100
|
-
|
|
101
|
-
// Check if JWT token was received and stored
|
|
102
|
-
if (result.token) {
|
|
103
|
-
console.log('🎫 JWT token received and stored for user authentication');
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Use the existingUser flag from the backend response
|
|
107
|
-
const isExistingUser = result.existingUser || false;
|
|
108
|
-
|
|
109
|
-
Alert.alert(
|
|
110
|
-
'Email Verified',
|
|
111
|
-
result.message || 'Your email has been verified successfully!\n\n' +
|
|
112
|
-
(result.token ? 'You are now authenticated and can access user features.' : 'Authentication complete.'),
|
|
113
|
-
[{
|
|
114
|
-
text: 'Continue',
|
|
115
|
-
onPress: () => {
|
|
116
|
-
onVerificationComplete(email, isExistingUser);
|
|
117
|
-
}
|
|
118
|
-
}]
|
|
119
|
-
);
|
|
120
|
-
} else {
|
|
121
|
-
console.error('❌ Email verification failed:', result.error);
|
|
122
|
-
Alert.alert('Verification Failed', result.error || 'Invalid verification code. Please try again.');
|
|
123
|
-
}
|
|
124
|
-
} catch (error) {
|
|
125
|
-
console.error('❌ Error verifying code:', error);
|
|
126
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
127
|
-
Alert.alert('Error', errorMessage);
|
|
128
|
-
} finally {
|
|
129
|
-
setIsLoading(false);
|
|
130
|
-
}
|
|
131
|
-
}, [email, verificationCode, onVerificationComplete]);
|
|
132
|
-
|
|
133
|
-
const handleResendCode = useCallback(async () => {
|
|
134
|
-
setVerificationCode('');
|
|
135
|
-
await handleRequestVerification();
|
|
136
|
-
}, [handleRequestVerification]);
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<Modal
|
|
140
|
-
visible={visible}
|
|
141
|
-
transparent
|
|
142
|
-
animationType="slide"
|
|
143
|
-
statusBarTranslucent
|
|
144
|
-
onRequestClose={onClose}
|
|
145
|
-
>
|
|
146
|
-
<TouchableWithoutFeedback onPress={onClose}>
|
|
147
|
-
<View style={styles.modalOverlay}>
|
|
148
|
-
<TouchableWithoutFeedback onPress={e => e.stopPropagation()}>
|
|
149
|
-
<View style={styles.modalContent}>
|
|
150
|
-
<SafeAreaView style={styles.container}>
|
|
151
|
-
<View style={styles.header}>
|
|
152
|
-
<TouchableOpacity onPress={onClose} style={styles.closeButton}>
|
|
153
|
-
<Icon name="close" size={24} color="#666" />
|
|
154
|
-
</TouchableOpacity>
|
|
155
|
-
<Text style={styles.headerTitle}>Email Verification</Text>
|
|
156
|
-
<View style={styles.placeholder} />
|
|
157
|
-
</View>
|
|
158
|
-
|
|
159
|
-
<View style={styles.content}>
|
|
160
|
-
{step === 'request' ? (
|
|
161
|
-
<>
|
|
162
|
-
<View style={styles.iconContainer}>
|
|
163
|
-
<Icon name="email" size={48} color="#4CAF50" />
|
|
164
|
-
</View>
|
|
165
|
-
|
|
166
|
-
<Text style={styles.title}>Verify Your Email</Text>
|
|
167
|
-
<Text style={styles.subtitle}>
|
|
168
|
-
We need to verify your email address to continue
|
|
169
|
-
</Text>
|
|
170
|
-
|
|
171
|
-
<View style={styles.emailContainer}>
|
|
172
|
-
<Text style={styles.emailLabel}>Email Address:</Text>
|
|
173
|
-
<Text style={styles.emailText}>{email}</Text>
|
|
174
|
-
</View>
|
|
175
|
-
|
|
176
|
-
<TouchableOpacity
|
|
177
|
-
style={[styles.button, isLoading && styles.buttonDisabled]}
|
|
178
|
-
onPress={handleRequestVerification}
|
|
179
|
-
disabled={isLoading}
|
|
180
|
-
>
|
|
181
|
-
{isLoading ? (
|
|
182
|
-
<ActivityIndicator size="small" color="#fff" />
|
|
183
|
-
) : (
|
|
184
|
-
<Text style={styles.buttonText}>Send Verification Code</Text>
|
|
185
|
-
)}
|
|
186
|
-
</TouchableOpacity>
|
|
187
|
-
</>
|
|
188
|
-
) : (
|
|
189
|
-
<>
|
|
190
|
-
<View style={styles.iconContainer}>
|
|
191
|
-
<Icon name="verified" size={48} color="#4CAF50" />
|
|
192
|
-
</View>
|
|
193
|
-
|
|
194
|
-
<Text style={styles.title}>Enter Verification Code</Text>
|
|
195
|
-
<Text style={styles.subtitle}>
|
|
196
|
-
We've sent a 6-digit code to {email}
|
|
197
|
-
</Text>
|
|
198
|
-
|
|
199
|
-
{testMode && (
|
|
200
|
-
<Text style={styles.testingNote}>
|
|
201
|
-
🔍 Test Mode: Any 6-digit code will work for verification
|
|
202
|
-
</Text>
|
|
203
|
-
)}
|
|
204
|
-
|
|
205
|
-
<TextInput
|
|
206
|
-
style={styles.codeInput}
|
|
207
|
-
value={verificationCode}
|
|
208
|
-
onChangeText={setVerificationCode}
|
|
209
|
-
placeholder="Enter 6-digit code"
|
|
210
|
-
keyboardType="number-pad"
|
|
211
|
-
maxLength={6}
|
|
212
|
-
autoFocus
|
|
213
|
-
textAlign="center"
|
|
214
|
-
/>
|
|
215
|
-
|
|
216
|
-
<TouchableOpacity
|
|
217
|
-
style={[styles.button, isLoading && styles.buttonDisabled]}
|
|
218
|
-
onPress={handleVerifyCode}
|
|
219
|
-
disabled={isLoading || !verificationCode.trim()}
|
|
220
|
-
>
|
|
221
|
-
{isLoading ? (
|
|
222
|
-
<ActivityIndicator size="small" color="#fff" />
|
|
223
|
-
) : (
|
|
224
|
-
<Text style={styles.buttonText}>Verify Code</Text>
|
|
225
|
-
)}
|
|
226
|
-
</TouchableOpacity>
|
|
227
|
-
|
|
228
|
-
<TouchableOpacity
|
|
229
|
-
style={styles.resendButton}
|
|
230
|
-
onPress={handleResendCode}
|
|
231
|
-
disabled={isLoading}
|
|
232
|
-
>
|
|
233
|
-
<Text style={styles.resendButtonText}>
|
|
234
|
-
Didn't receive the code? Resend
|
|
235
|
-
</Text>
|
|
236
|
-
</TouchableOpacity>
|
|
237
|
-
</>
|
|
238
|
-
)}
|
|
239
|
-
</View>
|
|
240
|
-
</SafeAreaView>
|
|
241
|
-
</View>
|
|
242
|
-
</TouchableWithoutFeedback>
|
|
243
|
-
</View>
|
|
244
|
-
</TouchableWithoutFeedback>
|
|
245
|
-
</Modal>
|
|
246
|
-
);
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
const styles = StyleSheet.create({
|
|
250
|
-
modalOverlay: {
|
|
251
|
-
flex: 1,
|
|
252
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
253
|
-
justifyContent: 'center',
|
|
254
|
-
alignItems: 'center',
|
|
255
|
-
},
|
|
256
|
-
modalContent: {
|
|
257
|
-
backgroundColor: '#fff',
|
|
258
|
-
borderRadius: 16,
|
|
259
|
-
width: '90%',
|
|
260
|
-
maxWidth: 400,
|
|
261
|
-
maxHeight: '80%',
|
|
262
|
-
},
|
|
263
|
-
container: {
|
|
264
|
-
padding: 24,
|
|
265
|
-
},
|
|
266
|
-
header: {
|
|
267
|
-
flexDirection: 'row',
|
|
268
|
-
alignItems: 'center',
|
|
269
|
-
justifyContent: 'space-between',
|
|
270
|
-
marginBottom: 24,
|
|
271
|
-
},
|
|
272
|
-
closeButton: {
|
|
273
|
-
padding: 8,
|
|
274
|
-
},
|
|
275
|
-
headerTitle: {
|
|
276
|
-
fontSize: 18,
|
|
277
|
-
fontWeight: '600',
|
|
278
|
-
color: '#000',
|
|
279
|
-
},
|
|
280
|
-
placeholder: {
|
|
281
|
-
width: 40,
|
|
282
|
-
},
|
|
283
|
-
content: {
|
|
284
|
-
alignItems: 'center',
|
|
285
|
-
},
|
|
286
|
-
iconContainer: {
|
|
287
|
-
marginBottom: 16,
|
|
288
|
-
},
|
|
289
|
-
title: {
|
|
290
|
-
fontSize: 24,
|
|
291
|
-
fontWeight: '600',
|
|
292
|
-
color: '#000',
|
|
293
|
-
textAlign: 'center',
|
|
294
|
-
marginBottom: 8,
|
|
295
|
-
},
|
|
296
|
-
subtitle: {
|
|
297
|
-
fontSize: 16,
|
|
298
|
-
color: '#666',
|
|
299
|
-
textAlign: 'center',
|
|
300
|
-
marginBottom: 24,
|
|
301
|
-
},
|
|
302
|
-
emailContainer: {
|
|
303
|
-
backgroundColor: '#f5f5f5',
|
|
304
|
-
padding: 16,
|
|
305
|
-
borderRadius: 8,
|
|
306
|
-
marginBottom: 24,
|
|
307
|
-
width: '100%',
|
|
308
|
-
},
|
|
309
|
-
emailLabel: {
|
|
310
|
-
fontSize: 14,
|
|
311
|
-
color: '#666',
|
|
312
|
-
marginBottom: 4,
|
|
313
|
-
},
|
|
314
|
-
emailText: {
|
|
315
|
-
fontSize: 16,
|
|
316
|
-
fontWeight: '500',
|
|
317
|
-
color: '#000',
|
|
318
|
-
},
|
|
319
|
-
testingNote: {
|
|
320
|
-
fontSize: 14,
|
|
321
|
-
color: '#FF9800',
|
|
322
|
-
textAlign: 'center',
|
|
323
|
-
marginBottom: 16,
|
|
324
|
-
backgroundColor: '#FFF3E0',
|
|
325
|
-
padding: 8,
|
|
326
|
-
borderRadius: 4,
|
|
327
|
-
},
|
|
328
|
-
codeInput: {
|
|
329
|
-
borderWidth: 1,
|
|
330
|
-
borderColor: '#ddd',
|
|
331
|
-
borderRadius: 8,
|
|
332
|
-
padding: 16,
|
|
333
|
-
fontSize: 18,
|
|
334
|
-
fontWeight: '600',
|
|
335
|
-
letterSpacing: 4,
|
|
336
|
-
marginBottom: 24,
|
|
337
|
-
width: '100%',
|
|
338
|
-
},
|
|
339
|
-
button: {
|
|
340
|
-
backgroundColor: '#4CAF50',
|
|
341
|
-
paddingVertical: 16,
|
|
342
|
-
paddingHorizontal: 32,
|
|
343
|
-
borderRadius: 8,
|
|
344
|
-
width: '100%',
|
|
345
|
-
alignItems: 'center',
|
|
346
|
-
marginBottom: 16,
|
|
347
|
-
},
|
|
348
|
-
buttonDisabled: {
|
|
349
|
-
opacity: 0.5,
|
|
350
|
-
},
|
|
351
|
-
buttonText: {
|
|
352
|
-
color: '#fff',
|
|
353
|
-
fontSize: 16,
|
|
354
|
-
fontWeight: '600',
|
|
355
|
-
},
|
|
356
|
-
resendButton: {
|
|
357
|
-
paddingVertical: 8,
|
|
358
|
-
},
|
|
359
|
-
resendButtonText: {
|
|
360
|
-
color: '#4CAF50',
|
|
361
|
-
fontSize: 14,
|
|
362
|
-
textDecorationLine: 'underline',
|
|
363
|
-
},
|
|
364
|
-
});
|