@onairos/react-native 3.4.1 → 3.6.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 +423 -374
- 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/OnairosNewLogo.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 +23 -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 +30 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +22 -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 +18 -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 +34 -106
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +421 -421
- package/lib/commonjs/services/apiClient.js +8 -0
- package/lib/commonjs/services/apiKeyService.js +9 -952
- 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/hingeDataExtractor.js +8 -0
- package/lib/commonjs/services/hingeDataService.js +9 -0
- package/lib/commonjs/services/imageCompressionService.js +7 -0
- package/lib/commonjs/services/instagramDataExtractor.js +8 -0
- package/lib/commonjs/services/instagramDataService.js +9 -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/sephoraDataExtractor.js +8 -0
- package/lib/commonjs/services/sephoraDataService.js +9 -0
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/telegramDataExtractor.js +8 -0
- package/lib/commonjs/services/telegramDataService.js +11 -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/connectorTests.js +29 -0
- 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/hinge.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +13 -0
- package/lib/commonjs/utils/webviewScripts/instagram.js +1 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/commonjs/utils/webviewScripts/sephora.js +1 -0
- package/lib/commonjs/utils/webviewScripts/telegram.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/OnairosNewLogo.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 +7 -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 +421 -421
- package/lib/module/services/apiClient.js +1 -0
- package/lib/module/services/apiKeyService.js +1 -925
- 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/hingeDataExtractor.js +1 -0
- package/lib/module/services/hingeDataService.js +1 -0
- package/lib/module/services/imageCompressionService.js +1 -0
- package/lib/module/services/instagramDataExtractor.js +1 -0
- package/lib/module/services/instagramDataService.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/sephoraDataExtractor.js +1 -0
- package/lib/module/services/sephoraDataService.js +1 -0
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/telegramDataExtractor.js +1 -0
- package/lib/module/services/telegramDataService.js +8 -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/connectorTests.js +28 -0
- 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/hinge.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/instagram.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/utils/webviewScripts/sephora.js +1 -0
- package/lib/module/utils/webviewScripts/telegram.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 -421
- package/src/services/apiKeyService.ts +0 -984
- 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,302 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
ActivityIndicator,
|
|
8
|
-
ScrollView,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
11
|
-
import { COLORS } from '../../constants';
|
|
12
|
-
import { OAuthWebView } from './OAuthWebView';
|
|
13
|
-
import type { ConnectionStatus, PlatformConfig } from '../../types';
|
|
14
|
-
|
|
15
|
-
interface PlatformConnectorProps {
|
|
16
|
-
connections: ConnectionStatus;
|
|
17
|
-
onConnect: (platform: string) => Promise<void>;
|
|
18
|
-
onDisconnect: (platform: string) => Promise<void>;
|
|
19
|
-
isLoading: boolean;
|
|
20
|
-
canProceed: boolean;
|
|
21
|
-
onProceed: () => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Platform definitions
|
|
25
|
-
const PLATFORMS: Record<string, PlatformConfig> = {
|
|
26
|
-
instagram: {
|
|
27
|
-
name: 'Instagram',
|
|
28
|
-
icon: 'photo-camera',
|
|
29
|
-
color: '#E1306C',
|
|
30
|
-
description: 'Connect to share and analyze your Instagram content',
|
|
31
|
-
},
|
|
32
|
-
youtube: {
|
|
33
|
-
name: 'YouTube',
|
|
34
|
-
icon: 'smart-display',
|
|
35
|
-
color: '#FF0000',
|
|
36
|
-
description: 'Connect for YouTube video recommendations and analysis',
|
|
37
|
-
},
|
|
38
|
-
pinterest: {
|
|
39
|
-
name: 'Pinterest',
|
|
40
|
-
icon: 'push-pin',
|
|
41
|
-
color: '#E60023',
|
|
42
|
-
description: 'Connect to enhance Pinterest board recommendations',
|
|
43
|
-
},
|
|
44
|
-
reddit: {
|
|
45
|
-
name: 'Reddit',
|
|
46
|
-
icon: 'forum',
|
|
47
|
-
color: '#FF4500',
|
|
48
|
-
description: 'Connect to personalize Reddit content insights',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const PlatformConnector: React.FC<PlatformConnectorProps> = ({
|
|
53
|
-
connections,
|
|
54
|
-
onConnect,
|
|
55
|
-
onDisconnect,
|
|
56
|
-
isLoading,
|
|
57
|
-
canProceed,
|
|
58
|
-
onProceed,
|
|
59
|
-
}) => {
|
|
60
|
-
const [activeWebview, setActiveWebview] = useState<string | null>(null);
|
|
61
|
-
|
|
62
|
-
const handleConnectPress = async (platform: string) => {
|
|
63
|
-
setActiveWebview(platform);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const handleWebViewComplete = () => {
|
|
67
|
-
setActiveWebview(null);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const handleWebViewClose = () => {
|
|
71
|
-
setActiveWebview(null);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const handleDisconnectPress = async (platform: string) => {
|
|
75
|
-
await onDisconnect(platform);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const getPlatformStatus = (platform: string) => {
|
|
79
|
-
const platformKey = platform as keyof ConnectionStatus;
|
|
80
|
-
return connections[platformKey] ? true : false;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const getConnectedCount = () => {
|
|
84
|
-
return Object.values(connections).filter(Boolean).length;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<View style={styles.container}>
|
|
89
|
-
<Text style={styles.title}>Connect Your Platforms</Text>
|
|
90
|
-
<Text style={styles.subtitle}>
|
|
91
|
-
Connect at least 2 platforms to create your Onairos account
|
|
92
|
-
</Text>
|
|
93
|
-
|
|
94
|
-
<ScrollView style={styles.platformList}>
|
|
95
|
-
{Object.keys(PLATFORMS).map((platform) => {
|
|
96
|
-
const platformInfo = PLATFORMS[platform];
|
|
97
|
-
const isConnected = getPlatformStatus(platform);
|
|
98
|
-
const userName = isConnected
|
|
99
|
-
? connections[platform as keyof ConnectionStatus]?.userName
|
|
100
|
-
: null;
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<View key={platform} style={styles.platformItem}>
|
|
104
|
-
<View style={styles.platformInfo}>
|
|
105
|
-
<View
|
|
106
|
-
style={[
|
|
107
|
-
styles.platformIcon,
|
|
108
|
-
{ backgroundColor: platformInfo.color },
|
|
109
|
-
]}
|
|
110
|
-
>
|
|
111
|
-
<Icon name={platformInfo.icon} size={24} color="#fff" />
|
|
112
|
-
</View>
|
|
113
|
-
<View style={styles.platformText}>
|
|
114
|
-
<Text style={styles.platformName}>{platformInfo.name}</Text>
|
|
115
|
-
<Text style={styles.platformDescription}>
|
|
116
|
-
{isConnected
|
|
117
|
-
? `Connected as ${userName}`
|
|
118
|
-
: platformInfo.description}
|
|
119
|
-
</Text>
|
|
120
|
-
</View>
|
|
121
|
-
</View>
|
|
122
|
-
|
|
123
|
-
<TouchableOpacity
|
|
124
|
-
style={[
|
|
125
|
-
styles.platformButton,
|
|
126
|
-
isConnected ? styles.disconnectButton : styles.connectButton,
|
|
127
|
-
]}
|
|
128
|
-
onPress={() =>
|
|
129
|
-
isConnected
|
|
130
|
-
? handleDisconnectPress(platform)
|
|
131
|
-
: handleConnectPress(platform)
|
|
132
|
-
}
|
|
133
|
-
disabled={isLoading}
|
|
134
|
-
>
|
|
135
|
-
{isLoading ? (
|
|
136
|
-
<ActivityIndicator size="small" color="#fff" />
|
|
137
|
-
) : (
|
|
138
|
-
<Text style={styles.buttonText}>
|
|
139
|
-
{isConnected ? 'Disconnect' : 'Connect'}
|
|
140
|
-
</Text>
|
|
141
|
-
)}
|
|
142
|
-
</TouchableOpacity>
|
|
143
|
-
</View>
|
|
144
|
-
);
|
|
145
|
-
})}
|
|
146
|
-
</ScrollView>
|
|
147
|
-
|
|
148
|
-
<View style={styles.footer}>
|
|
149
|
-
<Text style={styles.connectionStatus}>
|
|
150
|
-
{getConnectedCount()} of {Object.keys(PLATFORMS).length} platforms connected
|
|
151
|
-
</Text>
|
|
152
|
-
<TouchableOpacity
|
|
153
|
-
style={[
|
|
154
|
-
styles.proceedButton,
|
|
155
|
-
canProceed ? styles.proceedActive : styles.proceedInactive,
|
|
156
|
-
]}
|
|
157
|
-
onPress={onProceed}
|
|
158
|
-
disabled={!canProceed}
|
|
159
|
-
>
|
|
160
|
-
<Text
|
|
161
|
-
style={[
|
|
162
|
-
styles.proceedText,
|
|
163
|
-
canProceed ? styles.proceedTextActive : styles.proceedTextInactive,
|
|
164
|
-
]}
|
|
165
|
-
>
|
|
166
|
-
Continue
|
|
167
|
-
</Text>
|
|
168
|
-
<Icon
|
|
169
|
-
name="arrow-forward"
|
|
170
|
-
size={20}
|
|
171
|
-
color={canProceed ? '#fff' : '#999'}
|
|
172
|
-
/>
|
|
173
|
-
</TouchableOpacity>
|
|
174
|
-
</View>
|
|
175
|
-
|
|
176
|
-
{activeWebview && (
|
|
177
|
-
<OAuthWebView
|
|
178
|
-
url={`https://oauth.example.com/${activeWebview}`} // This would be replaced with actual OAuth URL
|
|
179
|
-
platform={activeWebview}
|
|
180
|
-
onComplete={handleWebViewComplete}
|
|
181
|
-
onClose={handleWebViewClose}
|
|
182
|
-
onSuccess={(code) => {
|
|
183
|
-
console.log(`Received authorization code for ${activeWebview}: ${code}`);
|
|
184
|
-
// In a real implementation, we'd pass this code to our API service
|
|
185
|
-
handleWebViewComplete();
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
|
-
)}
|
|
189
|
-
</View>
|
|
190
|
-
);
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
const styles = StyleSheet.create({
|
|
194
|
-
container: {
|
|
195
|
-
flex: 1,
|
|
196
|
-
padding: 16,
|
|
197
|
-
},
|
|
198
|
-
title: {
|
|
199
|
-
fontSize: 24,
|
|
200
|
-
fontWeight: 'bold',
|
|
201
|
-
marginBottom: 8,
|
|
202
|
-
color: '#000',
|
|
203
|
-
},
|
|
204
|
-
subtitle: {
|
|
205
|
-
fontSize: 16,
|
|
206
|
-
color: '#666',
|
|
207
|
-
marginBottom: 24,
|
|
208
|
-
},
|
|
209
|
-
platformList: {
|
|
210
|
-
flex: 1,
|
|
211
|
-
},
|
|
212
|
-
platformItem: {
|
|
213
|
-
flexDirection: 'row',
|
|
214
|
-
alignItems: 'center',
|
|
215
|
-
marginBottom: 16,
|
|
216
|
-
padding: 12,
|
|
217
|
-
backgroundColor: '#f8f8f8',
|
|
218
|
-
borderRadius: 12,
|
|
219
|
-
borderWidth: 1,
|
|
220
|
-
borderColor: '#eee',
|
|
221
|
-
},
|
|
222
|
-
platformInfo: {
|
|
223
|
-
flex: 1,
|
|
224
|
-
flexDirection: 'row',
|
|
225
|
-
alignItems: 'center',
|
|
226
|
-
},
|
|
227
|
-
platformIcon: {
|
|
228
|
-
width: 40,
|
|
229
|
-
height: 40,
|
|
230
|
-
borderRadius: 20,
|
|
231
|
-
justifyContent: 'center',
|
|
232
|
-
alignItems: 'center',
|
|
233
|
-
marginRight: 12,
|
|
234
|
-
},
|
|
235
|
-
platformText: {
|
|
236
|
-
flex: 1,
|
|
237
|
-
},
|
|
238
|
-
platformName: {
|
|
239
|
-
fontSize: 16,
|
|
240
|
-
fontWeight: '600',
|
|
241
|
-
marginBottom: 4,
|
|
242
|
-
color: '#000',
|
|
243
|
-
},
|
|
244
|
-
platformDescription: {
|
|
245
|
-
fontSize: 14,
|
|
246
|
-
color: '#666',
|
|
247
|
-
},
|
|
248
|
-
platformButton: {
|
|
249
|
-
paddingHorizontal: 16,
|
|
250
|
-
paddingVertical: 8,
|
|
251
|
-
borderRadius: 20,
|
|
252
|
-
justifyContent: 'center',
|
|
253
|
-
alignItems: 'center',
|
|
254
|
-
minWidth: 100,
|
|
255
|
-
},
|
|
256
|
-
connectButton: {
|
|
257
|
-
backgroundColor: COLORS.primary,
|
|
258
|
-
},
|
|
259
|
-
disconnectButton: {
|
|
260
|
-
backgroundColor: '#f44336',
|
|
261
|
-
},
|
|
262
|
-
buttonText: {
|
|
263
|
-
color: '#fff',
|
|
264
|
-
fontWeight: '600',
|
|
265
|
-
},
|
|
266
|
-
footer: {
|
|
267
|
-
flexDirection: 'row',
|
|
268
|
-
alignItems: 'center',
|
|
269
|
-
justifyContent: 'space-between',
|
|
270
|
-
paddingTop: 16,
|
|
271
|
-
borderTopWidth: 1,
|
|
272
|
-
borderTopColor: '#eee',
|
|
273
|
-
marginTop: 16,
|
|
274
|
-
},
|
|
275
|
-
connectionStatus: {
|
|
276
|
-
fontSize: 14,
|
|
277
|
-
color: '#666',
|
|
278
|
-
},
|
|
279
|
-
proceedButton: {
|
|
280
|
-
flexDirection: 'row',
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
paddingHorizontal: 16,
|
|
283
|
-
paddingVertical: 10,
|
|
284
|
-
borderRadius: 24,
|
|
285
|
-
},
|
|
286
|
-
proceedActive: {
|
|
287
|
-
backgroundColor: COLORS.primary,
|
|
288
|
-
},
|
|
289
|
-
proceedInactive: {
|
|
290
|
-
backgroundColor: '#eee',
|
|
291
|
-
},
|
|
292
|
-
proceedText: {
|
|
293
|
-
fontWeight: '600',
|
|
294
|
-
marginRight: 8,
|
|
295
|
-
},
|
|
296
|
-
proceedTextActive: {
|
|
297
|
-
color: '#fff',
|
|
298
|
-
},
|
|
299
|
-
proceedTextInactive: {
|
|
300
|
-
color: '#999',
|
|
301
|
-
},
|
|
302
|
-
});
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet, SafeAreaView } from 'react-native';
|
|
3
|
-
import { OnboardingHeader } from '../onboarding/OnboardingHeader';
|
|
4
|
-
import { PlatformConnector } from '../onboarding/PlatformConnector';
|
|
5
|
-
import { connectPlatform, disconnectPlatform } from '../../services/oauthService';
|
|
6
|
-
import { getCredentials, updateCredentials } from '../../utils/secureStorage';
|
|
7
|
-
import type { ConnectionStatus } from '../../types';
|
|
8
|
-
|
|
9
|
-
interface ConnectorScreenProps {
|
|
10
|
-
onComplete: () => void;
|
|
11
|
-
onClose: () => void;
|
|
12
|
-
AppName: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const ConnectorScreen: React.FC<ConnectorScreenProps> = ({
|
|
16
|
-
onComplete,
|
|
17
|
-
onClose,
|
|
18
|
-
AppName,
|
|
19
|
-
}) => {
|
|
20
|
-
const [connections, setConnections] = useState<ConnectionStatus>({});
|
|
21
|
-
const [isConnecting, setIsConnecting] = useState(false);
|
|
22
|
-
|
|
23
|
-
// Load initial connection status
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
loadConnectionStatus();
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
// Load connection status from secure storage
|
|
29
|
-
const loadConnectionStatus = useCallback(async () => {
|
|
30
|
-
try {
|
|
31
|
-
const credentials = await getCredentials();
|
|
32
|
-
|
|
33
|
-
if (credentials?.platforms) {
|
|
34
|
-
const connectionStatus: ConnectionStatus = {};
|
|
35
|
-
|
|
36
|
-
// Transform platforms data to connection status format
|
|
37
|
-
Object.entries(credentials.platforms).forEach(([platform, data]) => {
|
|
38
|
-
if (data && 'username' in data) {
|
|
39
|
-
connectionStatus[platform] = {
|
|
40
|
-
userName: data.username,
|
|
41
|
-
connected: true
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
setConnections(connectionStatus);
|
|
47
|
-
}
|
|
48
|
-
} catch (error) {
|
|
49
|
-
console.error('Error loading connection status:', error);
|
|
50
|
-
}
|
|
51
|
-
}, []);
|
|
52
|
-
|
|
53
|
-
// Handle platform connection
|
|
54
|
-
const handleConnect = useCallback(async (platform: string) => {
|
|
55
|
-
try {
|
|
56
|
-
setIsConnecting(true);
|
|
57
|
-
|
|
58
|
-
// Start OAuth flow
|
|
59
|
-
const connectionData = await connectPlatform(platform);
|
|
60
|
-
|
|
61
|
-
// Get current credentials
|
|
62
|
-
const credentials = await getCredentials();
|
|
63
|
-
|
|
64
|
-
if (!credentials) {
|
|
65
|
-
throw new Error('No credentials found');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Update platforms in credentials
|
|
69
|
-
const updatedPlatforms = {
|
|
70
|
-
...credentials.platforms,
|
|
71
|
-
[platform]: {
|
|
72
|
-
token: connectionData.token,
|
|
73
|
-
username: connectionData.username,
|
|
74
|
-
userId: connectionData.userId,
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// Update stored credentials
|
|
79
|
-
await updateCredentials({
|
|
80
|
-
platforms: updatedPlatforms,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// Refresh connection status
|
|
84
|
-
await loadConnectionStatus();
|
|
85
|
-
} catch (error) {
|
|
86
|
-
console.error(`Error connecting to ${platform}:`, error);
|
|
87
|
-
} finally {
|
|
88
|
-
setIsConnecting(false);
|
|
89
|
-
}
|
|
90
|
-
}, [loadConnectionStatus]);
|
|
91
|
-
|
|
92
|
-
// Handle platform disconnection
|
|
93
|
-
const handleDisconnect = useCallback(async (platform: string) => {
|
|
94
|
-
try {
|
|
95
|
-
setIsConnecting(true);
|
|
96
|
-
|
|
97
|
-
// Get current credentials
|
|
98
|
-
const credentials = await getCredentials();
|
|
99
|
-
|
|
100
|
-
if (!credentials || !credentials.platforms) {
|
|
101
|
-
throw new Error('No credentials or platforms found');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Create updated platforms object without the disconnected platform
|
|
105
|
-
const updatedPlatforms = { ...credentials.platforms };
|
|
106
|
-
delete updatedPlatforms[platform as keyof typeof updatedPlatforms];
|
|
107
|
-
|
|
108
|
-
// Update stored credentials
|
|
109
|
-
await updateCredentials({
|
|
110
|
-
platforms: updatedPlatforms,
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// Refresh connection status
|
|
114
|
-
await loadConnectionStatus();
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error(`Error disconnecting from ${platform}:`, error);
|
|
117
|
-
} finally {
|
|
118
|
-
setIsConnecting(false);
|
|
119
|
-
}
|
|
120
|
-
}, [loadConnectionStatus]);
|
|
121
|
-
|
|
122
|
-
// Check if user can proceed to next step
|
|
123
|
-
const canProceed = useCallback(() => {
|
|
124
|
-
const connectedPlatforms = Object.values(connections).filter(conn => conn.connected).length;
|
|
125
|
-
return connectedPlatforms >= 2;
|
|
126
|
-
}, [connections]);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<SafeAreaView style={styles.container}>
|
|
130
|
-
<OnboardingHeader
|
|
131
|
-
title="Connect Your Platforms"
|
|
132
|
-
subtitle={`Connecting to ${AppName}`}
|
|
133
|
-
onClose={onClose}
|
|
134
|
-
/>
|
|
135
|
-
|
|
136
|
-
<PlatformConnector
|
|
137
|
-
connections={connections}
|
|
138
|
-
onConnect={handleConnect}
|
|
139
|
-
onDisconnect={handleDisconnect}
|
|
140
|
-
isLoading={isConnecting}
|
|
141
|
-
canProceed={canProceed()}
|
|
142
|
-
onProceed={onComplete}
|
|
143
|
-
/>
|
|
144
|
-
</SafeAreaView>
|
|
145
|
-
);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const styles = StyleSheet.create({
|
|
149
|
-
container: {
|
|
150
|
-
flex: 1,
|
|
151
|
-
backgroundColor: '#fff',
|
|
152
|
-
},
|
|
153
|
-
});
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
ActivityIndicator,
|
|
7
|
-
SafeAreaView,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import { COLORS } from '../../constants';
|
|
10
|
-
|
|
11
|
-
interface LoadingScreenProps {
|
|
12
|
-
message: string;
|
|
13
|
-
progress?: number;
|
|
14
|
-
eta?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const LoadingScreen: React.FC<LoadingScreenProps> = ({
|
|
18
|
-
message,
|
|
19
|
-
progress,
|
|
20
|
-
eta,
|
|
21
|
-
}) => {
|
|
22
|
-
// Calculate progress percentage for display
|
|
23
|
-
const progressPercent = progress ? Math.round(progress * 100) : undefined;
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<SafeAreaView style={styles.container}>
|
|
27
|
-
<View style={styles.content}>
|
|
28
|
-
<ActivityIndicator size="large" color={COLORS.primary} style={styles.spinner} />
|
|
29
|
-
|
|
30
|
-
<Text style={styles.message}>{message}</Text>
|
|
31
|
-
|
|
32
|
-
{progressPercent !== undefined && (
|
|
33
|
-
<View style={styles.progressContainer}>
|
|
34
|
-
<View style={styles.progressBarBackground}>
|
|
35
|
-
<View
|
|
36
|
-
style={[
|
|
37
|
-
styles.progressBar,
|
|
38
|
-
{ width: `${progressPercent}%` }
|
|
39
|
-
]}
|
|
40
|
-
/>
|
|
41
|
-
</View>
|
|
42
|
-
|
|
43
|
-
<Text style={styles.progressText}>{progressPercent}%</Text>
|
|
44
|
-
</View>
|
|
45
|
-
)}
|
|
46
|
-
|
|
47
|
-
{eta && <Text style={styles.etaText}>{eta}</Text>}
|
|
48
|
-
</View>
|
|
49
|
-
</SafeAreaView>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const styles = StyleSheet.create({
|
|
54
|
-
container: {
|
|
55
|
-
flex: 1,
|
|
56
|
-
backgroundColor: '#fff',
|
|
57
|
-
justifyContent: 'center',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
},
|
|
60
|
-
content: {
|
|
61
|
-
width: '80%',
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
padding: 24,
|
|
64
|
-
},
|
|
65
|
-
spinner: {
|
|
66
|
-
marginBottom: 24,
|
|
67
|
-
},
|
|
68
|
-
message: {
|
|
69
|
-
fontSize: 18,
|
|
70
|
-
fontWeight: '600',
|
|
71
|
-
color: '#000',
|
|
72
|
-
textAlign: 'center',
|
|
73
|
-
marginBottom: 24,
|
|
74
|
-
},
|
|
75
|
-
progressContainer: {
|
|
76
|
-
width: '100%',
|
|
77
|
-
marginBottom: 8,
|
|
78
|
-
},
|
|
79
|
-
progressBarBackground: {
|
|
80
|
-
height: 8,
|
|
81
|
-
backgroundColor: '#eee',
|
|
82
|
-
borderRadius: 4,
|
|
83
|
-
overflow: 'hidden',
|
|
84
|
-
marginBottom: 8,
|
|
85
|
-
},
|
|
86
|
-
progressBar: {
|
|
87
|
-
height: '100%',
|
|
88
|
-
backgroundColor: COLORS.primary,
|
|
89
|
-
},
|
|
90
|
-
progressText: {
|
|
91
|
-
fontSize: 14,
|
|
92
|
-
color: '#666',
|
|
93
|
-
textAlign: 'right',
|
|
94
|
-
},
|
|
95
|
-
etaText: {
|
|
96
|
-
fontSize: 14,
|
|
97
|
-
color: '#666',
|
|
98
|
-
marginTop: 8,
|
|
99
|
-
},
|
|
100
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import { View, StyleSheet, SafeAreaView } from 'react-native';
|
|
3
|
-
import { OnboardingHeader } from '../onboarding/OnboardingHeader';
|
|
4
|
-
import { PinInput } from '../onboarding/PinInput';
|
|
5
|
-
import { updateCredentials, getCredentials } from '../../utils/secureStorage';
|
|
6
|
-
|
|
7
|
-
interface PinCreationScreenProps {
|
|
8
|
-
onComplete: () => void;
|
|
9
|
-
onBack: () => void;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
AppName: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const PinCreationScreen: React.FC<PinCreationScreenProps> = ({
|
|
15
|
-
onComplete,
|
|
16
|
-
onBack,
|
|
17
|
-
onClose,
|
|
18
|
-
AppName,
|
|
19
|
-
}) => {
|
|
20
|
-
// Handle PIN submission
|
|
21
|
-
const handlePinSubmit = useCallback(async (pin: string) => {
|
|
22
|
-
try {
|
|
23
|
-
// Get current credentials
|
|
24
|
-
const credentials = await getCredentials();
|
|
25
|
-
|
|
26
|
-
if (!credentials) {
|
|
27
|
-
throw new Error('No credentials found');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Update credentials with PIN
|
|
31
|
-
await updateCredentials({
|
|
32
|
-
userPin: pin,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Move to next step
|
|
36
|
-
onComplete();
|
|
37
|
-
} catch (error) {
|
|
38
|
-
console.error('Error saving PIN:', error);
|
|
39
|
-
}
|
|
40
|
-
}, [onComplete]);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<SafeAreaView style={styles.container}>
|
|
44
|
-
<OnboardingHeader
|
|
45
|
-
title="Create a PIN"
|
|
46
|
-
subtitle={`Secure your ${AppName} account`}
|
|
47
|
-
showBackButton
|
|
48
|
-
onBack={onBack}
|
|
49
|
-
onClose={onClose}
|
|
50
|
-
/>
|
|
51
|
-
|
|
52
|
-
<PinInput
|
|
53
|
-
onSubmit={handlePinSubmit}
|
|
54
|
-
minLength={8}
|
|
55
|
-
requireSpecialChar
|
|
56
|
-
requireNumber
|
|
57
|
-
/>
|
|
58
|
-
</SafeAreaView>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const styles = StyleSheet.create({
|
|
63
|
-
container: {
|
|
64
|
-
flex: 1,
|
|
65
|
-
backgroundColor: '#fff',
|
|
66
|
-
},
|
|
67
|
-
});
|
package/src/constants/index.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { PlatformConfig } from '../types';
|
|
2
|
-
|
|
3
|
-
export const COLORS = {
|
|
4
|
-
primary: '#1BA9D4',
|
|
5
|
-
headerBg: '#F8F9FA',
|
|
6
|
-
text: {
|
|
7
|
-
primary: '#000000',
|
|
8
|
-
secondary: '#666666',
|
|
9
|
-
},
|
|
10
|
-
border: '#E5E5E5',
|
|
11
|
-
success: '#34C759',
|
|
12
|
-
error: '#FF3B30',
|
|
13
|
-
instagram: '#E1306C',
|
|
14
|
-
pinterest: '#E60023',
|
|
15
|
-
reddit: '#FF4500',
|
|
16
|
-
youtube: '#FF0000',
|
|
17
|
-
white: '#FFFFFF',
|
|
18
|
-
black: '#000000',
|
|
19
|
-
gray: '#666666',
|
|
20
|
-
lightGray: '#E5E5E5',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const PLATFORMS: Record<string, PlatformConfig> = {
|
|
24
|
-
instagram: {
|
|
25
|
-
name: 'Instagram',
|
|
26
|
-
icon: 'instagram',
|
|
27
|
-
color: COLORS.instagram,
|
|
28
|
-
description: 'Connect your Instagram account to train your AI model',
|
|
29
|
-
},
|
|
30
|
-
pinterest: {
|
|
31
|
-
name: 'Pinterest',
|
|
32
|
-
icon: 'pinterest',
|
|
33
|
-
color: COLORS.pinterest,
|
|
34
|
-
description: 'Use your Pinterest boards for AI training',
|
|
35
|
-
},
|
|
36
|
-
reddit: {
|
|
37
|
-
name: 'Reddit',
|
|
38
|
-
icon: 'reddit',
|
|
39
|
-
color: COLORS.reddit,
|
|
40
|
-
description: 'Connect Reddit to enhance your AI model',
|
|
41
|
-
},
|
|
42
|
-
youtube: {
|
|
43
|
-
name: 'YouTube',
|
|
44
|
-
icon: 'youtube',
|
|
45
|
-
color: COLORS.youtube,
|
|
46
|
-
description: 'Use YouTube data to improve AI recommendations',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const API_ENDPOINTS = {
|
|
51
|
-
base: 'https://api2.onairos.uk',
|
|
52
|
-
oauth: {
|
|
53
|
-
instagram: '/instagram/auth',
|
|
54
|
-
pinterest: '/pinterest/auth',
|
|
55
|
-
reddit: '/reddit/auth',
|
|
56
|
-
youtube: '/youtube/auth',
|
|
57
|
-
},
|
|
58
|
-
callback: {
|
|
59
|
-
instagram: '/instagram/callback',
|
|
60
|
-
pinterest: '/pinterest/callback',
|
|
61
|
-
reddit: '/reddit/callback',
|
|
62
|
-
youtube: '/youtube/callback',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const STORAGE_KEYS = {
|
|
67
|
-
credentials: 'onairos_credentials',
|
|
68
|
-
connections: 'onairos_connections',
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const PIN_REQUIREMENTS = {
|
|
72
|
-
minLength: 8,
|
|
73
|
-
requireUppercase: true,
|
|
74
|
-
requireLowercase: true,
|
|
75
|
-
requireNumber: true,
|
|
76
|
-
requireSpecialChar: true,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const DEEP_LINK_CONFIG = {
|
|
80
|
-
scheme: 'onairosanime',
|
|
81
|
-
host: 'authenticate',
|
|
82
|
-
redirectUri: 'onairosanime://auth/',
|
|
83
|
-
};
|