@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,390 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// Define OAuth configuration types
|
|
12
|
-
|
|
13
|
-
// Platform-specific OAuth configurations
|
|
14
|
-
const OAUTH_CONFIGS = {
|
|
15
|
-
instagram: {
|
|
16
|
-
clientId: 'YOUR_INSTAGRAM_CLIENT_ID',
|
|
17
|
-
// Replace with actual client ID
|
|
18
|
-
redirectUri: 'onairosanime://auth/instagram',
|
|
19
|
-
scope: 'user_profile,user_media',
|
|
20
|
-
authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
|
|
21
|
-
tokenEndpoint: 'https://api.instagram.com/oauth/access_token',
|
|
22
|
-
responseType: 'code'
|
|
23
|
-
},
|
|
24
|
-
youtube: {
|
|
25
|
-
clientId: 'YOUR_YOUTUBE_CLIENT_ID',
|
|
26
|
-
// Replace with actual client ID
|
|
27
|
-
redirectUri: 'onairosanime://auth/youtube',
|
|
28
|
-
scope: 'https://www.googleapis.com/auth/youtube.readonly',
|
|
29
|
-
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
|
|
30
|
-
tokenEndpoint: 'https://oauth2.googleapis.com/token',
|
|
31
|
-
responseType: 'code'
|
|
32
|
-
},
|
|
33
|
-
pinterest: {
|
|
34
|
-
clientId: 'YOUR_PINTEREST_CLIENT_ID',
|
|
35
|
-
// Replace with actual client ID
|
|
36
|
-
redirectUri: 'onairosanime://auth/pinterest',
|
|
37
|
-
scope: 'boards:read,pins:read',
|
|
38
|
-
authorizationEndpoint: 'https://www.pinterest.com/oauth/',
|
|
39
|
-
tokenEndpoint: 'https://api.pinterest.com/v5/oauth/token',
|
|
40
|
-
responseType: 'code'
|
|
41
|
-
},
|
|
42
|
-
reddit: {
|
|
43
|
-
clientId: 'YOUR_REDDIT_CLIENT_ID',
|
|
44
|
-
// Replace with actual client ID
|
|
45
|
-
redirectUri: 'onairosanime://auth/reddit',
|
|
46
|
-
scope: 'identity,read',
|
|
47
|
-
authorizationEndpoint: 'https://www.reddit.com/api/v1/authorize',
|
|
48
|
-
tokenEndpoint: 'https://www.reddit.com/api/v1/access_token',
|
|
49
|
-
responseType: 'code'
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Generate a state value for OAuth to prevent CSRF attacks
|
|
55
|
-
*/
|
|
56
|
-
const generateState = () => {
|
|
57
|
-
const randomValue = Math.random().toString(36).substring(2, 15);
|
|
58
|
-
return (0, _crypto.sha256)(randomValue).substring(0, 10);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Initialize OAuth service handlers and listeners
|
|
63
|
-
*/
|
|
64
|
-
const initializeOAuthService = () => {
|
|
65
|
-
// Set up deep linking handlers for OAuth redirects
|
|
66
|
-
_reactNative.Linking.addEventListener('url', handleDeepLink);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Clean up OAuth service handlers and listeners
|
|
71
|
-
*/
|
|
72
|
-
exports.initializeOAuthService = initializeOAuthService;
|
|
73
|
-
const cleanupOAuthService = () => {
|
|
74
|
-
// Use the modern React Native Linking API
|
|
75
|
-
if (typeof _reactNative.Linking.removeAllListeners === 'function') {
|
|
76
|
-
_reactNative.Linking.removeAllListeners('url');
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// Keep track of current OAuth state and callbacks
|
|
81
|
-
exports.cleanupOAuthService = cleanupOAuthService;
|
|
82
|
-
let currentOAuthState = null;
|
|
83
|
-
let currentOAuthPlatform = null;
|
|
84
|
-
let currentOAuthResolve = null;
|
|
85
|
-
let currentOAuthReject = null;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Handle deep link callbacks from OAuth providers
|
|
89
|
-
*/
|
|
90
|
-
const handleDeepLink = async event => {
|
|
91
|
-
try {
|
|
92
|
-
const {
|
|
93
|
-
url
|
|
94
|
-
} = event;
|
|
95
|
-
|
|
96
|
-
// Check if this is an OAuth callback URL
|
|
97
|
-
if (!url.startsWith('onairosanime://auth/')) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Extract platform from URL path
|
|
102
|
-
const platform = url.split('onairosanime://auth/')[1].split('?')[0];
|
|
103
|
-
|
|
104
|
-
// Only handle if it matches current OAuth flow
|
|
105
|
-
if (platform !== currentOAuthPlatform) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Parse URL parameters
|
|
110
|
-
const params = new URL(url).searchParams;
|
|
111
|
-
const code = params.get('code');
|
|
112
|
-
const state = params.get('state');
|
|
113
|
-
const error = params.get('error');
|
|
114
|
-
|
|
115
|
-
// Validate state to prevent CSRF attacks
|
|
116
|
-
if (state !== currentOAuthState) {
|
|
117
|
-
if (currentOAuthReject) {
|
|
118
|
-
currentOAuthReject(new Error('OAuth state mismatch - possible CSRF attack'));
|
|
119
|
-
}
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Handle errors
|
|
124
|
-
if (error) {
|
|
125
|
-
if (currentOAuthReject) {
|
|
126
|
-
currentOAuthReject(new Error(`OAuth error: ${error}`));
|
|
127
|
-
}
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Proceed with token exchange if code is present
|
|
132
|
-
if (code) {
|
|
133
|
-
const tokenResult = await exchangeCodeForToken(platform, code);
|
|
134
|
-
if (currentOAuthResolve) {
|
|
135
|
-
currentOAuthResolve(tokenResult);
|
|
136
|
-
}
|
|
137
|
-
} else {
|
|
138
|
-
if (currentOAuthReject) {
|
|
139
|
-
currentOAuthReject(new Error('No authorization code received'));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.error('Error handling OAuth deep link:', error);
|
|
144
|
-
if (currentOAuthReject) {
|
|
145
|
-
currentOAuthReject(error);
|
|
146
|
-
}
|
|
147
|
-
} finally {
|
|
148
|
-
// Reset state
|
|
149
|
-
currentOAuthState = null;
|
|
150
|
-
currentOAuthPlatform = null;
|
|
151
|
-
currentOAuthResolve = null;
|
|
152
|
-
currentOAuthReject = null;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Exchange OAuth authorization code for access token
|
|
158
|
-
*/
|
|
159
|
-
const exchangeCodeForToken = async (platform, code) => {
|
|
160
|
-
try {
|
|
161
|
-
const config = OAUTH_CONFIGS[platform];
|
|
162
|
-
if (!config) {
|
|
163
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Prepare token request parameters
|
|
167
|
-
const params = new URLSearchParams({
|
|
168
|
-
grant_type: 'authorization_code',
|
|
169
|
-
code,
|
|
170
|
-
redirect_uri: config.redirectUri,
|
|
171
|
-
client_id: config.clientId
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Exchange code for token
|
|
175
|
-
const response = await fetch(config.tokenEndpoint, {
|
|
176
|
-
method: 'POST',
|
|
177
|
-
headers: {
|
|
178
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
179
|
-
},
|
|
180
|
-
body: params.toString()
|
|
181
|
-
});
|
|
182
|
-
const data = await response.json();
|
|
183
|
-
if (!response.ok) {
|
|
184
|
-
throw new Error(data.error || 'Failed to exchange code for token');
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Fetch user information based on the platform
|
|
188
|
-
const userInfo = await fetchUserInfo(platform, data.access_token);
|
|
189
|
-
return {
|
|
190
|
-
token: data.access_token,
|
|
191
|
-
refreshToken: data.refresh_token,
|
|
192
|
-
expiresIn: data.expires_in,
|
|
193
|
-
username: userInfo.username,
|
|
194
|
-
userId: userInfo.id
|
|
195
|
-
};
|
|
196
|
-
} catch (error) {
|
|
197
|
-
console.error(`Error exchanging code for token (${platform}):`, error);
|
|
198
|
-
throw error;
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Fetch user information from the connected platform
|
|
204
|
-
*/
|
|
205
|
-
const fetchUserInfo = async (platform, accessToken) => {
|
|
206
|
-
try {
|
|
207
|
-
let endpoint;
|
|
208
|
-
let headers = {
|
|
209
|
-
Authorization: `Bearer ${accessToken}`
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
// Platform-specific API endpoints for user info
|
|
213
|
-
switch (platform) {
|
|
214
|
-
case 'instagram':
|
|
215
|
-
endpoint = 'https://graph.instagram.com/me?fields=id,username';
|
|
216
|
-
break;
|
|
217
|
-
case 'youtube':
|
|
218
|
-
endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true';
|
|
219
|
-
break;
|
|
220
|
-
case 'pinterest':
|
|
221
|
-
endpoint = 'https://api.pinterest.com/v5/user_account';
|
|
222
|
-
break;
|
|
223
|
-
case 'reddit':
|
|
224
|
-
endpoint = 'https://oauth.reddit.com/api/v1/me';
|
|
225
|
-
break;
|
|
226
|
-
default:
|
|
227
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
228
|
-
}
|
|
229
|
-
const response = await fetch(endpoint, {
|
|
230
|
-
headers
|
|
231
|
-
});
|
|
232
|
-
const data = await response.json();
|
|
233
|
-
if (!response.ok) {
|
|
234
|
-
throw new Error(data.error || 'Failed to fetch user info');
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Extract user information based on platform-specific response format
|
|
238
|
-
switch (platform) {
|
|
239
|
-
case 'instagram':
|
|
240
|
-
return {
|
|
241
|
-
id: data.id,
|
|
242
|
-
username: data.username
|
|
243
|
-
};
|
|
244
|
-
case 'youtube':
|
|
245
|
-
return {
|
|
246
|
-
id: data.items[0].id,
|
|
247
|
-
username: data.items[0].snippet.title
|
|
248
|
-
};
|
|
249
|
-
case 'pinterest':
|
|
250
|
-
return {
|
|
251
|
-
id: data.id,
|
|
252
|
-
username: data.username || data.full_name
|
|
253
|
-
};
|
|
254
|
-
case 'reddit':
|
|
255
|
-
return {
|
|
256
|
-
id: data.id,
|
|
257
|
-
username: data.name
|
|
258
|
-
};
|
|
259
|
-
default:
|
|
260
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
261
|
-
}
|
|
262
|
-
} catch (error) {
|
|
263
|
-
console.error(`Error fetching user info (${platform}):`, error);
|
|
264
|
-
throw error;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Connect to a platform using OAuth
|
|
270
|
-
*/
|
|
271
|
-
const connectPlatform = platform => {
|
|
272
|
-
return new Promise((resolve, reject) => {
|
|
273
|
-
try {
|
|
274
|
-
const config = OAUTH_CONFIGS[platform];
|
|
275
|
-
if (!config) {
|
|
276
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// Generate state for CSRF protection
|
|
280
|
-
const state = generateState();
|
|
281
|
-
|
|
282
|
-
// Build authorization URL
|
|
283
|
-
const authUrl = new URL(config.authorizationEndpoint);
|
|
284
|
-
authUrl.searchParams.append('client_id', config.clientId);
|
|
285
|
-
authUrl.searchParams.append('redirect_uri', config.redirectUri);
|
|
286
|
-
authUrl.searchParams.append('response_type', config.responseType);
|
|
287
|
-
authUrl.searchParams.append('scope', config.scope);
|
|
288
|
-
authUrl.searchParams.append('state', state);
|
|
289
|
-
|
|
290
|
-
// Set up current OAuth state for callback handling
|
|
291
|
-
currentOAuthState = state;
|
|
292
|
-
currentOAuthPlatform = platform;
|
|
293
|
-
currentOAuthResolve = resolve;
|
|
294
|
-
currentOAuthReject = reject;
|
|
295
|
-
|
|
296
|
-
// Open browser or WebView to the authorization URL
|
|
297
|
-
_reactNative.Linking.openURL(authUrl.toString());
|
|
298
|
-
} catch (error) {
|
|
299
|
-
reject(error);
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Disconnect from a platform
|
|
306
|
-
*/
|
|
307
|
-
exports.connectPlatform = connectPlatform;
|
|
308
|
-
const disconnectPlatform = async (platform, credentials) => {
|
|
309
|
-
try {
|
|
310
|
-
// Call Onairos API to disconnect platform
|
|
311
|
-
await _api.onairosApi.post('/users/disconnect-platform', {
|
|
312
|
-
platform,
|
|
313
|
-
username: credentials.username
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
// Update local credentials to remove platform
|
|
317
|
-
const updatedPlatforms = {
|
|
318
|
-
...credentials.platforms
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
// Type-safe platform removal using keyof operator
|
|
322
|
-
if (updatedPlatforms && platform in updatedPlatforms) {
|
|
323
|
-
delete updatedPlatforms[platform];
|
|
324
|
-
}
|
|
325
|
-
await (0, _secureStorage.updateCredentials)({
|
|
326
|
-
...credentials,
|
|
327
|
-
platforms: updatedPlatforms
|
|
328
|
-
});
|
|
329
|
-
return true;
|
|
330
|
-
} catch (error) {
|
|
331
|
-
console.error(`Error disconnecting platform (${platform}):`, error);
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Store platform connection data in user credentials
|
|
338
|
-
*/
|
|
339
|
-
exports.disconnectPlatform = disconnectPlatform;
|
|
340
|
-
const storePlatformConnection = async (platform, connectionData, credentials) => {
|
|
341
|
-
try {
|
|
342
|
-
// Only accept valid platform types
|
|
343
|
-
const validPlatform = platform === 'instagram' || platform === 'youtube' || platform === 'pinterest' || platform === 'reddit';
|
|
344
|
-
if (!validPlatform) {
|
|
345
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
// Update platforms in credentials with type safety
|
|
349
|
-
const updatedPlatforms = {
|
|
350
|
-
...credentials.platforms
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// Type-safe assignment
|
|
354
|
-
const platformData = {
|
|
355
|
-
username: connectionData.username,
|
|
356
|
-
userId: connectionData.userId,
|
|
357
|
-
token: connectionData.token,
|
|
358
|
-
refreshToken: connectionData.refreshToken,
|
|
359
|
-
expiresAt: connectionData.expiresIn ? Date.now() + connectionData.expiresIn * 1000 : null,
|
|
360
|
-
connectedAt: Date.now()
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
// Assign platform data based on platform type
|
|
364
|
-
if (platform === 'instagram') updatedPlatforms.instagram = platformData;else if (platform === 'youtube') updatedPlatforms.youtube = platformData;else if (platform === 'pinterest') updatedPlatforms.pinterest = platformData;else if (platform === 'reddit') updatedPlatforms.reddit = platformData;
|
|
365
|
-
|
|
366
|
-
// Update stored credentials
|
|
367
|
-
await (0, _secureStorage.updateCredentials)({
|
|
368
|
-
...credentials,
|
|
369
|
-
platforms: updatedPlatforms
|
|
370
|
-
});
|
|
371
|
-
return true;
|
|
372
|
-
} catch (error) {
|
|
373
|
-
console.error(`Error storing platform connection (${platform}):`, error);
|
|
374
|
-
return false;
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
exports.storePlatformConnection = storePlatformConnection;
|
|
378
|
-
/**
|
|
379
|
-
* Service for handling OAuth connections to various platforms
|
|
380
|
-
*/
|
|
381
|
-
const OAuthService = exports.OAuthService = {
|
|
382
|
-
initializeOAuthService,
|
|
383
|
-
cleanupOAuthService,
|
|
384
|
-
connectPlatform,
|
|
385
|
-
disconnectPlatform,
|
|
386
|
-
storePlatformConnection,
|
|
387
|
-
// Base API URL
|
|
388
|
-
_apiBaseUrl: 'https://api2.onairos.uk'
|
|
389
|
-
};
|
|
390
|
-
//# sourceMappingURL=oauthService.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
// Onairos SDK - Asset Registry (auto-generated)
|
|
3
|
+
var __ONAIROS_REQ_REGISTRY__ = [
|
|
4
|
+
require("react-native"),
|
|
5
|
+
require("../utils/secureStorage"),
|
|
6
|
+
require("../utils/crypto"),
|
|
7
|
+
require("../api"),
|
|
8
|
+
require("../config/api")
|
|
9
|
+
];
|
|
10
|
+
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
11
|
+
Object[_0x4e5c(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x4e5c(0x1)]=exports[_0x4e5c(0x2)]=exports[_0x4e5c(0x3)]=exports['connectPlatform']=exports['cleanupOAuthService']=exports[_0x4e5c(0x4)]=void 0x0;var _reactNative=__ONAIROS_REQ_FUNC__(0x0),_secureStorage=__ONAIROS_REQ_FUNC__(0x1),_crypto=__ONAIROS_REQ_FUNC__(0x2),_api=__ONAIROS_REQ_FUNC__(0x3),_api2=__ONAIROS_REQ_FUNC__(0x4);function _0x4e5c(_0x5cdf70,_0x4e5cde){_0x5cdf70=_0x5cdf70-0x0;const _0x5dd139=_0x5cdf();let _0x258ae7=_0x5dd139[_0x5cdf70];return _0x258ae7;}const OAUTH_CONFIGS={'instagram':{'clientId':'YOUR_INSTAGRAM_CLIENT_ID','redirectUri':_0x4e5c(0x5),'scope':_0x4e5c(0x6),'authorizationEndpoint':'https://api.instagram.com/oauth/authorize','tokenEndpoint':'https://api.instagram.com/oauth/access_token','responseType':_0x4e5c(0x7)},'youtube':{'clientId':_0x4e5c(0x8),'redirectUri':_0x4e5c(0x9),'scope':_0x4e5c(0xa),'authorizationEndpoint':_0x4e5c(0xb),'tokenEndpoint':_0x4e5c(0xc),'responseType':_0x4e5c(0x7)},'pinterest':{'clientId':_0x4e5c(0xd),'redirectUri':_0x4e5c(0xe),'scope':_0x4e5c(0xf),'authorizationEndpoint':_0x4e5c(0x10),'tokenEndpoint':_0x4e5c(0x11),'responseType':_0x4e5c(0x7)},'reddit':{'clientId':_0x4e5c(0x12),'redirectUri':_0x4e5c(0x13),'scope':_0x4e5c(0x14),'authorizationEndpoint':_0x4e5c(0x15),'tokenEndpoint':_0x4e5c(0x16),'responseType':_0x4e5c(0x7)}},generateState=()=>{const _0x2d1e5c=Math[_0x4e5c(0x17)]()['toString'](0x24)['substring'](0x2,0xf);return(0x0,_crypto[_0x4e5c(0x18)])(_0x2d1e5c)['substring'](0x0,0xa);},initializeOAuthService=()=>{_reactNative[_0x4e5c(0x19)][_0x4e5c(0x1a)](_0x4e5c(0x1b),handleDeepLink);};exports[_0x4e5c(0x2)]=initializeOAuthService;const cleanupOAuthService=()=>{const _0x19596a={'OKTbE':function(_0x5f061e,_0x37ae72){return _0x5f061e(_0x37ae72);},'QJUsh':function(_0x48f404,_0x46cedd){return _0x48f404===_0x46cedd;},'RanqH':_0x4e5c(0x1c),'VDGyf':_0x4e5c(0x1d),'TNFfQ':_0x4e5c(0x1e)};_0x19596a[_0x4e5c(0x1f)](typeof _reactNative[_0x4e5c(0x19)]['removeAllListeners'],_0x19596a[_0x4e5c(0x20)])&&(_0x19596a[_0x4e5c(0x1f)](_0x19596a[_0x4e5c(0x21)],_0x19596a[_0x4e5c(0x22)])?(_0x279581['error'](_0x4e5c(0x23),_0x4201a8),_0x126e55&&_0x19596a[_0x4e5c(0x24)](_0x3eec20,_0x441115)):_reactNative[_0x4e5c(0x19)][_0x4e5c(0x25)](_0x4e5c(0x1b)));};exports[_0x4e5c(0x26)]=cleanupOAuthService;let currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;const handleDeepLink=async _0x197ea1=>{const _0x3fb549={'EpUco':function(_0x4e1e56,_0x254472){return _0x4e1e56(_0x254472);},'jQegg':_0x4e5c(0x27),'KfTsK':_0x4e5c(0x28),'rMgIq':function(_0x2c3953,_0x5c3aa2){return _0x2c3953!==_0x5c3aa2;},'WiBfS':_0x4e5c(0x7),'fBREZ':'state','mNykb':_0x4e5c(0x29),'iEEWS':_0x4e5c(0x2a),'iplDV':function(_0x2335c3,_0x531072){return _0x2335c3!==_0x531072;},'jvPdP':_0x4e5c(0x2b),'iqeLJ':'pTGNJ','iwGhp':function(_0x2223d0,_0x22d1f9){return _0x2223d0!==_0x22d1f9;},'MxiWF':_0x4e5c(0x2c),'IDPjT':function(_0x21192d,_0x4d3f6b){return _0x21192d===_0x4d3f6b;},'WvWTi':_0x4e5c(0x2d),'VjvLI':'eHEra','XOHxp':_0x4e5c(0x2e),'upiiO':_0x4e5c(0x23)};try{const {url:_0x25f8e6}=_0x197ea1;if(!_0x25f8e6[_0x4e5c(0x2f)](_0x3fb549[_0x4e5c(0x30)]))return;const _0x31a798=_0x25f8e6[_0x4e5c(0x31)](_0x3fb549['KfTsK'])[0x1][_0x4e5c(0x31)]('?')[0x0];if(_0x3fb549[_0x4e5c(0x32)](_0x31a798,currentOAuthPlatform))return;const _0x5c9f93=new URL(_0x25f8e6)[_0x4e5c(0x33)],_0x491749=_0x5c9f93[_0x4e5c(0x34)](_0x3fb549[_0x4e5c(0x35)]),_0x2415e3=_0x5c9f93[_0x4e5c(0x34)](_0x3fb549['fBREZ']),_0x3b6923=_0x5c9f93['get'](_0x4e5c(0x36));if(_0x3fb549[_0x4e5c(0x32)](_0x2415e3,currentOAuthState)){if(currentOAuthReject){if(_0x3fb549['rMgIq'](_0x3fb549[_0x4e5c(0x37)],_0x3fb549[_0x4e5c(0x38)]))_0x3fb549['EpUco'](currentOAuthReject,new Error(_0x3fb549[_0x4e5c(0x39)]));else{_0x3c2a97[_0x4e5c(0x36)](_0x4e5c(0x3a)+_0x3d94c6+'):',_0x173332);throw _0x4cdd5f;}}return;}if(_0x3b6923){currentOAuthReject&&(_0x3fb549[_0x4e5c(0x3b)](_0x3fb549['jvPdP'],_0x3fb549[_0x4e5c(0x3c)])?_0x3fb549[_0x4e5c(0x3d)](currentOAuthReject,new Error(_0x4e5c(0x3e)+_0x3b6923)):_0x3fb549[_0x4e5c(0x3d)](_0x3783f1,new _0x4b1d67(_0x4e5c(0x3e)+_0x4e7b67)));return;}if(_0x491749){if(_0x3fb549[_0x4e5c(0x3f)](_0x3fb549[_0x4e5c(0x40)],_0x4e5c(0x2c)))_0x3b2a88[_0x4e5c(0x19)][_0x4e5c(0x1a)](_0x4e5c(0x1b),_0x5dd01d);else{const _0x12bcca=await exchangeCodeForToken(_0x31a798,_0x491749);currentOAuthResolve&&(_0x3fb549[_0x4e5c(0x41)](_0x3fb549[_0x4e5c(0x42)],_0x3fb549[_0x4e5c(0x43)])?_0x22b0c9(new _0x1b41a9(_0x3fb549[_0x4e5c(0x39)])):currentOAuthResolve(_0x12bcca));}}else currentOAuthReject&¤tOAuthReject(new Error(_0x3fb549[_0x4e5c(0x44)]));}catch(_0xaf283a){console[_0x4e5c(0x36)](_0x3fb549[_0x4e5c(0x45)],_0xaf283a),currentOAuthReject&&_0x3fb549[_0x4e5c(0x3d)](currentOAuthReject,_0xaf283a);}finally{currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;}},exchangeCodeForToken=async(_0x98fb18,_0x28fe40)=>{const _0x3ab8cc={'UeqLg':function(_0x310aa6,_0x157144){return _0x310aa6(_0x157144);},'MRUtm':_0x4e5c(0x2e),'jhuVD':function(_0x62b1cf,_0x3cdeeb,_0x56fa){return _0x62b1cf(_0x3cdeeb,_0x56fa);},'yzKWj':_0x4e5c(0x46),'WjUCm':function(_0x42e0d5,_0x4687a4){return _0x42e0d5===_0x4687a4;},'VbYxJ':_0x4e5c(0x47),'kFKwu':'Failed\x20to\x20exchange\x20code\x20for\x20token','tkXSF':function(_0x2a4244,_0x229f30,_0x4ffa15){return _0x2a4244(_0x229f30,_0x4ffa15);},'enSEw':function(_0xf7c4fe,_0x457e02){return _0xf7c4fe===_0x457e02;},'aeiuD':'sOCEP'};try{const _0x70cdeb=OAUTH_CONFIGS[_0x98fb18];if(!_0x70cdeb)throw new Error(_0x4e5c(0x48)+_0x98fb18);const _0x5ef5f7=new URLSearchParams({'grant_type':_0x4e5c(0x49),'code':_0x28fe40,'redirect_uri':_0x70cdeb[_0x4e5c(0x4a)],'client_id':_0x70cdeb['clientId']}),_0x2a7c46=await _0x3ab8cc['jhuVD'](fetch,_0x70cdeb['tokenEndpoint'],{'method':'POST','headers':{'Content-Type':_0x3ab8cc[_0x4e5c(0x4b)]},'body':_0x5ef5f7[_0x4e5c(0x4c)]()}),_0x44b4fb=await _0x2a7c46['json']();if(!_0x2a7c46['ok']){if(_0x3ab8cc[_0x4e5c(0x4d)](_0x3ab8cc[_0x4e5c(0x4e)],_0x4e5c(0x47)))throw new Error(_0x44b4fb[_0x4e5c(0x36)]||_0x3ab8cc[_0x4e5c(0x4f)]);else _0x383be2&&_0x3ab8cc[_0x4e5c(0x50)](_0x517de6,new _0x2b681c(_0x3ab8cc[_0x4e5c(0x51)]));}const _0x4a44ea=await _0x3ab8cc[_0x4e5c(0x52)](fetchUserInfo,_0x98fb18,_0x44b4fb[_0x4e5c(0x53)]);return{'token':_0x44b4fb[_0x4e5c(0x53)],'refreshToken':_0x44b4fb[_0x4e5c(0x54)],'expiresIn':_0x44b4fb['expires_in'],'username':_0x4a44ea[_0x4e5c(0x55)],'userId':_0x4a44ea['id']};}catch(_0x1f9b32){if(_0x3ab8cc[_0x4e5c(0x56)](_0x3ab8cc[_0x4e5c(0x57)],_0x3ab8cc['aeiuD'])){console[_0x4e5c(0x36)](_0x4e5c(0x3a)+_0x98fb18+'):',_0x1f9b32);throw _0x1f9b32;}else{_0x1d7763[_0x4e5c(0x36)](_0x4e5c(0x58)+_0x7672a7+'):',_0x5e579f);throw _0x2f992e;}}},fetchUserInfo=async(_0x427d45,_0x555c12)=>{const _0x455103={'XylCR':_0x4e5c(0x59),'PBblB':_0x4e5c(0x5a),'LhOdm':_0x4e5c(0x5b),'wbJkI':'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true','wMicZ':'pinterest','mhcuY':'https://api.pinterest.com/v5/user_account','dkjpD':_0x4e5c(0x5c),'mIKSz':function(_0x417061,_0x5d1291,_0x218a31){return _0x417061(_0x5d1291,_0x218a31);},'NqpkP':_0x4e5c(0x5d)};try{let _0x49c157,_0x17458d={'Authorization':_0x4e5c(0x5e)+_0x555c12};switch(_0x427d45){case _0x455103[_0x4e5c(0x5f)]:_0x49c157=_0x455103[_0x4e5c(0x60)];break;case _0x455103[_0x4e5c(0x61)]:_0x49c157=_0x455103[_0x4e5c(0x62)];break;case _0x455103[_0x4e5c(0x63)]:_0x49c157=_0x455103[_0x4e5c(0x64)];break;case'reddit':_0x49c157=_0x455103['dkjpD'];break;default:throw new Error('Unsupported\x20platform:\x20'+_0x427d45);}const _0x78d7da=await _0x455103['mIKSz'](fetch,_0x49c157,{'headers':_0x17458d}),_0x2b282d=await _0x78d7da['json']();if(!_0x78d7da['ok'])throw new Error(_0x2b282d[_0x4e5c(0x36)]||_0x455103['NqpkP']);switch(_0x427d45){case _0x455103[_0x4e5c(0x5f)]:return{'id':_0x2b282d['id'],'username':_0x2b282d['username']};case _0x455103[_0x4e5c(0x61)]:return{'id':_0x2b282d['items'][0x0]['id'],'username':_0x2b282d[_0x4e5c(0x65)][0x0]['snippet']['title']};case _0x455103['wMicZ']:return{'id':_0x2b282d['id'],'username':_0x2b282d[_0x4e5c(0x55)]||_0x2b282d[_0x4e5c(0x66)]};case _0x4e5c(0x67):return{'id':_0x2b282d['id'],'username':_0x2b282d[_0x4e5c(0x68)]};default:throw new Error(_0x4e5c(0x48)+_0x427d45);}}catch(_0x435838){console['error']('Error\x20fetching\x20user\x20info\x20('+_0x427d45+'):',_0x435838);throw _0x435838;}},connectPlatform=_0x34b8bb=>{const _0x454dd5={'cyGbB':'Failed\x20to\x20exchange\x20code\x20for\x20token','mppLI':_0x4e5c(0x69),'wWgUX':_0x4e5c(0x6a),'IgOkV':_0x4e5c(0x6b),'yybHh':_0x4e5c(0x6c),'aSFDC':_0x4e5c(0x6d),'wMkxk':_0x4e5c(0x6e),'OJCTW':_0x4e5c(0x6f),'sdoEr':_0x4e5c(0x70),'gAABX':'eyfpr','vxotP':function(_0x230332,_0x4fa60b){return _0x230332(_0x4fa60b);}};return new Promise((_0x571754,_0x200bc0)=>{if(_0x454dd5[_0x4e5c(0x71)]!==_0x454dd5[_0x4e5c(0x72)])try{const _0x1b69ec=OAUTH_CONFIGS[_0x34b8bb];if(!_0x1b69ec){if(_0x454dd5[_0x4e5c(0x73)]===_0x454dd5[_0x4e5c(0x73)])throw new Error(_0x4e5c(0x48)+_0x34b8bb);else return;}const _0x43162a=generateState(),_0x209541=new URL(_0x1b69ec[_0x4e5c(0x74)]);_0x209541[_0x4e5c(0x33)][_0x4e5c(0x75)](_0x454dd5[_0x4e5c(0x76)],_0x1b69ec[_0x4e5c(0x77)]),_0x209541[_0x4e5c(0x33)]['append'](_0x4e5c(0x78),_0x1b69ec['redirectUri']),_0x209541[_0x4e5c(0x33)][_0x4e5c(0x75)](_0x454dd5[_0x4e5c(0x79)],_0x1b69ec[_0x4e5c(0x7a)]),_0x209541[_0x4e5c(0x33)]['append'](_0x454dd5[_0x4e5c(0x7b)],_0x1b69ec[_0x4e5c(0x6e)]),_0x209541[_0x4e5c(0x33)][_0x4e5c(0x75)](_0x454dd5['OJCTW'],_0x43162a),currentOAuthState=_0x43162a,currentOAuthPlatform=_0x34b8bb,currentOAuthResolve=_0x571754,currentOAuthReject=_0x200bc0,_reactNative[_0x4e5c(0x19)][_0x4e5c(0x7c)](_0x209541[_0x4e5c(0x4c)]());}catch(_0x58808d){if(_0x454dd5[_0x4e5c(0x7d)]!==_0x454dd5['gAABX'])_0x454dd5[_0x4e5c(0x7e)](_0x200bc0,_0x58808d);else throw new _0x145111(_0x25e11e[_0x4e5c(0x36)]||_0x454dd5[_0x4e5c(0x7f)]);}else _0x142a78(_0x1e72cd);});};exports[_0x4e5c(0x80)]=connectPlatform;const disconnectPlatform=async(_0x31231d,_0x17f1d3)=>{const _0x7d7e54={'tSCJz':_0x4e5c(0x81),'lyKlC':function(_0x199471,_0x45041a){return _0x199471 in _0x45041a;},'rmUdl':_0x4e5c(0x82),'SBDjt':'aHCqr'};try{await _api[_0x4e5c(0x83)][_0x4e5c(0x84)](_0x7d7e54[_0x4e5c(0x85)],{'platform':_0x31231d,'username':_0x17f1d3[_0x4e5c(0x55)]});const _0x5c7f4b={..._0x17f1d3['platforms']};if(_0x5c7f4b&&_0x7d7e54[_0x4e5c(0x86)](_0x31231d,_0x5c7f4b)){if(_0x7d7e54['rmUdl']===_0x7d7e54[_0x4e5c(0x87)])delete _0x5c7f4b[_0x31231d];else throw new _0x4293d4(_0x4e5c(0x48)+_0x46857d);}return await(0x0,_secureStorage[_0x4e5c(0x88)])({..._0x17f1d3,'platforms':_0x5c7f4b}),!![];}catch(_0x4dcfef){if(_0x7d7e54[_0x4e5c(0x89)]!==_0x7d7e54[_0x4e5c(0x89)])_0x4e5b95=null,_0x59a737=null,_0x32e357=null,_0x428653=null;else return console[_0x4e5c(0x36)](_0x4e5c(0x8a)+_0x31231d+'):',_0x4dcfef),![];}};exports[_0x4e5c(0x3)]=disconnectPlatform;const storePlatformConnection=async(_0x50d1bb,_0x44af17,_0x41d428)=>{const _0x335fb9={'xSviE':function(_0x43bedc,_0x4b906c){return _0x43bedc(_0x4b906c);},'ldpcQ':_0x4e5c(0x2e),'sadmm':function(_0x50b208,_0x1cc383){return _0x50b208!==_0x1cc383;},'OHSYR':_0x4e5c(0x8b),'zcaSj':function(_0x15723d,_0x5d82cb){return _0x15723d===_0x5d82cb;},'QtkZt':'instagram','Ghyou':function(_0x37b2f5,_0x4e138b){return _0x37b2f5===_0x4e138b;},'gwFcD':_0x4e5c(0x5b),'mbgNw':_0x4e5c(0x8c),'vMGyA':function(_0x59ef1e,_0x2e4883){return _0x59ef1e===_0x2e4883;},'McPYd':function(_0x357307,_0x51f322){return _0x357307===_0x51f322;},'YVYRG':_0x4e5c(0x8d),'PHMuS':_0x4e5c(0x8e),'pRHmD':function(_0x5a5e65,_0x2b8f2d){return _0x5a5e65+_0x2b8f2d;},'bcYYp':function(_0x5bb2d3,_0x237c44){return _0x5bb2d3*_0x237c44;},'QJgKK':function(_0x18d55f,_0x57c41a){return _0x18d55f===_0x57c41a;},'Yqzlw':'reddit'};try{if(_0x335fb9[_0x4e5c(0x8f)](_0x4e5c(0x90),_0x335fb9[_0x4e5c(0x91)])){const _0x26551c=_0x335fb9[_0x4e5c(0x92)](_0x50d1bb,_0x335fb9[_0x4e5c(0x93)])||_0x335fb9[_0x4e5c(0x94)](_0x50d1bb,_0x335fb9['gwFcD'])||_0x335fb9['zcaSj'](_0x50d1bb,_0x335fb9[_0x4e5c(0x95)])||_0x335fb9[_0x4e5c(0x96)](_0x50d1bb,_0x4e5c(0x67));if(!_0x26551c){if(_0x335fb9[_0x4e5c(0x97)](_0x335fb9[_0x4e5c(0x98)],_0x335fb9['PHMuS']))_0x335fb9[_0x4e5c(0x99)](_0x321ac7,new _0x1b3cd(_0x335fb9[_0x4e5c(0x9a)]));else throw new Error(_0x4e5c(0x48)+_0x50d1bb);}const _0xca8006={..._0x41d428[_0x4e5c(0x9b)]},_0x1216ed={'username':_0x44af17[_0x4e5c(0x55)],'userId':_0x44af17['userId'],'token':_0x44af17[_0x4e5c(0x9c)],'refreshToken':_0x44af17[_0x4e5c(0x9d)],'expiresAt':_0x44af17[_0x4e5c(0x9e)]?_0x335fb9[_0x4e5c(0x9f)](Date[_0x4e5c(0xa0)](),_0x335fb9[_0x4e5c(0xa1)](_0x44af17['expiresIn'],0x3e8)):null,'connectedAt':Date[_0x4e5c(0xa0)]()};if(_0x335fb9[_0x4e5c(0x94)](_0x50d1bb,_0x335fb9['QtkZt']))_0xca8006[_0x4e5c(0x59)]=_0x1216ed;else{if(_0x335fb9[_0x4e5c(0xa2)](_0x50d1bb,_0x4e5c(0x5b)))_0xca8006['youtube']=_0x1216ed;else{if(_0x335fb9[_0x4e5c(0x92)](_0x50d1bb,_0x335fb9['mbgNw']))_0xca8006[_0x4e5c(0x8c)]=_0x1216ed;else{if(_0x335fb9[_0x4e5c(0x97)](_0x50d1bb,_0x335fb9[_0x4e5c(0xa3)]))_0xca8006[_0x4e5c(0x67)]=_0x1216ed;}}}return await(0x0,_secureStorage['updateCredentials'])({..._0x41d428,'platforms':_0xca8006}),!![];}else delete _0x3b3cc4[_0x46dd71];}catch(_0x37c4d1){return console[_0x4e5c(0x36)](_0x4e5c(0xa4)+_0x50d1bb+'):',_0x37c4d1),![];}};function _0x5cdf(){const _0x256a6e=['defineProperty','storePlatformConnection','initializeOAuthService','disconnectPlatform','OAuthService','onairosanime://auth/instagram','user_profile,user_media','code','YOUR_YOUTUBE_CLIENT_ID','onairosanime://auth/youtube','https://www.googleapis.com/auth/youtube.readonly','https://accounts.google.com/o/oauth2/auth','https://oauth2.googleapis.com/token','YOUR_PINTEREST_CLIENT_ID','onairosanime://auth/pinterest','boards:read,pins:read','https://www.pinterest.com/oauth/','https://api.pinterest.com/v5/oauth/token','YOUR_REDDIT_CLIENT_ID','onairosanime://auth/reddit','identity,read','https://www.reddit.com/api/v1/authorize','https://www.reddit.com/api/v1/access_token','random','sha256','Linking','addEventListener','url','function','aViUQ','eWzMC','QJUsh','RanqH','VDGyf','TNFfQ','Error\x20handling\x20OAuth\x20deep\x20link:','OKTbE','removeAllListeners','cleanupOAuthService','OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','onairosanime://auth/','rLvPg','pKNPE','eGhKS','HwUFo','hjsDc','No\x20authorization\x20code\x20received','startsWith','KfTsK','split','rMgIq','searchParams','get','WiBfS','error','mNykb','iEEWS','jQegg','Error\x20exchanging\x20code\x20for\x20token\x20(','iplDV','iqeLJ','EpUco','OAuth\x20error:\x20','iwGhp','MxiWF','IDPjT','WvWTi','VjvLI','XOHxp','upiiO','application/x-www-form-urlencoded','jedcP','Unsupported\x20platform:\x20','authorization_code','redirectUri','yzKWj','toString','WjUCm','VbYxJ','kFKwu','UeqLg','MRUtm','tkXSF','access_token','refresh_token','username','enSEw','aeiuD','Error\x20fetching\x20user\x20info\x20(','instagram','https://graph.instagram.com/me?fields=id,username','youtube','https://oauth.reddit.com/api/v1/me','Failed\x20to\x20fetch\x20user\x20info','Bearer\x20','XylCR','PBblB','LhOdm','wbJkI','wMicZ','mhcuY','items','full_name','reddit','name','DyLjK','ohJlV','GcItO','client_id','response_type','scope','state','pGWQa','mppLI','wWgUX','IgOkV','authorizationEndpoint','append','yybHh','clientId','redirect_uri','aSFDC','responseType','wMkxk','openURL','sdoEr','vxotP','cyGbB','connectPlatform','/users/disconnect-platform','AzpnZ','onairosApi','post','tSCJz','lyKlC','rmUdl','updateCredentials','SBDjt','Error\x20disconnecting\x20platform\x20(','opASt','pinterest','nPnvT','RRpmL','sadmm','gDWqn','OHSYR','zcaSj','QtkZt','Ghyou','mbgNw','vMGyA','McPYd','YVYRG','xSviE','ldpcQ','platforms','token','refreshToken','expiresIn','pRHmD','now','bcYYp','QJgKK','Yqzlw','Error\x20storing\x20platform\x20connection\x20(','API_CONFIG'];_0x5cdf=function(){return _0x256a6e;};return _0x5cdf();}exports[_0x4e5c(0x1)]=storePlatformConnection;const OAuthService=exports[_0x4e5c(0x4)]={'initializeOAuthService':initializeOAuthService,'cleanupOAuthService':cleanupOAuthService,'connectPlatform':connectPlatform,'disconnectPlatform':disconnectPlatform,'storePlatformConnection':storePlatformConnection,'_apiBaseUrl':''+_api2[_0x4e5c(0xa5)]['BASE_URL']};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Onairos SDK - Asset Registry (auto-generated)
|
|
3
|
+
var __ONAIROS_REQ_REGISTRY__ = [
|
|
4
|
+
require("./pinStorageUtils"),
|
|
5
|
+
require('react-native-crypto-js')
|
|
6
|
+
];
|
|
7
|
+
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
8
|
+
Object['defineProperty'](exports,_0x4569(0x0),{'value':!![]}),exports[_0x4569(0x1)]=exports[_0x4569(0x2)]=exports[_0x4569(0x3)]=exports[_0x4569(0x4)]=void 0x0;var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);function _0x2a37(){const _0x16c878=['__esModule','hashPin','getEncryptedPinForAPI','encryptPin','decryptPin','onairos-pin-encryption-key-2024','❌\x20Error\x20encrypting\x20PIN:','AES','encrypt','toString','log','VJzRi','error','❌\x20Error\x20hashing\x20PIN:','wfIMh','🔓\x20PIN\x20decrypted\x20successfully','❌\x20Error\x20decrypting\x20PIN:','keLaT','kSdhe','decrypt','Utf8','vORxE','fsLkv','gGmdK','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','dYHGB','ZJFqg','CiihO','🔒\x20PIN\x20hashed\x20successfully','ADLOF','SHA256','HAxlQ','zFBaF','Mbqnx','Hvczo','enc','RQDlS','IlycO'];_0x2a37=function(){return _0x16c878;};return _0x2a37();}const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY=_0x4569(0x5),encryptPin=_0xf50575=>{const _0x21461e={'VJzRi':'🔐\x20PIN\x20encrypted\x20successfully','pzuuD':_0x4569(0x6)};try{const _0x3ad00d=CryptoJS[_0x4569(0x7)][_0x4569(0x8)](_0xf50575,ENCRYPTION_KEY)[_0x4569(0x9)]();return console[_0x4569(0xa)](_0x21461e[_0x4569(0xb)]),_0x3ad00d;}catch(_0x485693){console[_0x4569(0xc)](_0x21461e['pzuuD'],_0x485693);throw _0x485693;}};exports[_0x4569(0x3)]=encryptPin;const decryptPin=_0x330861=>{const _0x122a73={'KPWhV':_0x4569(0xd),'CWLWl':function(_0xc87ae3,_0x4fb907){return _0xc87ae3===_0x4fb907;},'keLaT':_0x4569(0xe),'vORxE':_0x4569(0xf),'fsLkv':_0x4569(0x10)};try{if(_0x122a73['CWLWl'](_0x122a73[_0x4569(0x11)],_0x4569(0x12))){_0x40982a['error'](_0x122a73['KPWhV'],_0x50c80f);throw _0x225242;}else{const _0x3c79f4=CryptoJS['AES'][_0x4569(0x13)](_0x330861,ENCRYPTION_KEY),_0x28989a=_0x3c79f4[_0x4569(0x9)](CryptoJS['enc'][_0x4569(0x14)]);return console[_0x4569(0xa)](_0x122a73[_0x4569(0x15)]),_0x28989a;}}catch(_0x30ba86){console[_0x4569(0xc)](_0x122a73[_0x4569(0x16)],_0x30ba86);throw _0x30ba86;}};function _0x4569(_0x2a37c2,_0x456938){_0x2a37c2=_0x2a37c2-0x0;const _0x31af0e=_0x2a37();let _0x4404d3=_0x31af0e[_0x2a37c2];return _0x4404d3;}exports[_0x4569(0x4)]=decryptPin;const getEncryptedPinForAPI=async()=>{const _0x35a2c8={'ZJFqg':'❌\x20Error\x20encrypting\x20PIN:','dYHGB':_0x4569(0x17),'ugMWf':function(_0x424c94,_0x3851a7){return _0x424c94(_0x3851a7);},'mgKUC':'✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','CiihO':_0x4569(0x18)};try{const _0x58be4e=(0x0,_pinStorageUtils['getTemporaryPin'])();if(!_0x58be4e){if(_0x35a2c8['dYHGB']===_0x35a2c8[_0x4569(0x19)])return console[_0x4569(0xa)]('⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption'),null;else{_0x9fc69c[_0x4569(0xc)](_0x35a2c8[_0x4569(0x1a)],_0x256283);throw _0x3c9de6;}}const _0x10b6e2=_0x35a2c8['ugMWf'](encryptPin,_0x58be4e);return console[_0x4569(0xa)](_0x35a2c8['mgKUC']),_0x10b6e2;}catch(_0x4ecb12){return console[_0x4569(0xc)](_0x35a2c8[_0x4569(0x1b)],_0x4ecb12),null;}};exports[_0x4569(0x2)]=getEncryptedPinForAPI;const hashPin=_0x176f50=>{const _0x373f24={'GLyxg':'🔓\x20PIN\x20decrypted\x20successfully','RQDlS':_0x4569(0x10),'HAxlQ':function(_0x7241f8,_0x372625){return _0x7241f8+_0x372625;},'zFBaF':_0x4569(0x1c),'Mbqnx':function(_0x279394,_0x3cae92){return _0x279394!==_0x3cae92;},'Hvczo':_0x4569(0x1d),'IlycO':_0x4569(0xd)};try{const _0x416495=CryptoJS[_0x4569(0x1e)](_0x373f24[_0x4569(0x1f)](_0x176f50,ENCRYPTION_KEY))[_0x4569(0x9)]();return console[_0x4569(0xa)](_0x373f24[_0x4569(0x20)]),_0x416495;}catch(_0x3c5297){if(_0x373f24[_0x4569(0x21)](_0x373f24[_0x4569(0x22)],_0x373f24[_0x4569(0x22)]))try{const _0x1099af=_0x596dca[_0x4569(0x7)][_0x4569(0x13)](_0x52f0ac,_0x14d93b),_0x44157c=_0x1099af[_0x4569(0x9)](_0x4013b2[_0x4569(0x23)][_0x4569(0x14)]);return _0x56928c[_0x4569(0xa)](_0x373f24['GLyxg']),_0x44157c;}catch(_0x3d446d){_0x191af9[_0x4569(0xc)](_0x373f24[_0x4569(0x24)],_0x3d446d);throw _0x3d446d;}else{console[_0x4569(0xc)](_0x373f24[_0x4569(0x25)],_0x3c5297);throw _0x3c5297;}}};exports['hashPin']=hashPin;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Onairos SDK - Asset Registry (auto-generated)
|
|
3
|
+
var __ONAIROS_REQ_REGISTRY__ = [
|
|
4
|
+
require("./biometricPinService")
|
|
5
|
+
];
|
|
6
|
+
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
7
|
+
Object[_0x4795(0x0)](exports,'__esModule',{'value':!![]}),exports['setTemporaryPin']=exports[_0x4795(0x1)]=exports[_0x4795(0x2)]=exports['getStoredPinForTraining']=exports[_0x4795(0x3)]=exports[_0x4795(0x4)]=exports['clearStoredPin']=void 0x0;var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x163548={'DqgxQ':_0x4795(0x5),'yJriN':_0x4795(0x6),'cgEyO':function(_0x399df9,_0x24d41d){return _0x399df9!==_0x24d41d;},'mUbXH':_0x4795(0x7),'LBthb':_0x4795(0x8),'QnsfY':'✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','yQJot':_0x4795(0x9)};try{console['log'](_0x163548['yJriN']);const _0x47f5dc=await _biometricPinService[_0x4795(0xa)]['isPinStored']();if(!_0x47f5dc)return _0x163548['cgEyO'](_0x4795(0x7),_0x163548[_0x4795(0xb)])?(_0x41fdca[_0x4795(0xc)](_0x163548[_0x4795(0xd)],_0x31f42e),null):(console[_0x4795(0xe)](_0x163548[_0x4795(0xf)]),null);const _0x208401=await _biometricPinService[_0x4795(0xa)][_0x4795(0x10)]();return _0x208401?(console['log'](_0x163548[_0x4795(0x11)]),_0x208401):(console['log'](_0x163548['yQJot']),null);}catch(_0x3c0af3){return console[_0x4795(0xc)](_0x163548[_0x4795(0xd)],_0x3c0af3),null;}};exports[_0x4795(0x12)]=getStoredPinForTraining;function _0x3398(){const _0x59453a=['defineProperty','hasStoredPin','getTemporaryPin','getPinForTraining','clearTemporaryPin','❌\x20Error\x20retrieving\x20stored\x20PIN:','🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...','iLORy','⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','biometricPinService','mUbXH','error','DqgxQ','log','LBthb','retrievePinWithBiometric','QnsfY','getStoredPinForTraining','❌\x20Error\x20checking\x20PIN\x20storage:','isPinStored','❌\x20Error\x20clearing\x20stored\x20PIN:','MrdHD','removePinFromStorage','ymxal','WQyfZ','OeqIz','NtxuV','clearStoredPin','fhlwS','📝\x20Using\x20temporary\x20PIN\x20for\x20training','QyYoH','IzEIf','LWEUW','📝\x20Temporary\x20PIN\x20set\x20for\x20training','ipjap','setTemporaryPin','🗑️\x20Temporary\x20PIN\x20cleared','VUuNv'];_0x3398=function(){return _0x59453a;};return _0x3398();}const hasStoredPin=async()=>{const _0x10ff4b={'WuJfa':_0x4795(0x13)};try{return await _biometricPinService['biometricPinService'][_0x4795(0x14)]();}catch(_0x202747){return console[_0x4795(0xc)](_0x10ff4b['WuJfa'],_0x202747),![];}};exports[_0x4795(0x1)]=hasStoredPin;const clearStoredPin=async()=>{const _0x43fcdd={'NtxuV':_0x4795(0x15),'MrdHD':'🗑️\x20Clearing\x20stored\x20PIN...','ymxal':function(_0x3b6fd3,_0x3aea2d){return _0x3b6fd3!==_0x3aea2d;},'WQyfZ':'DcTVC','OeqIz':'fTuOZ'};try{return console[_0x4795(0xe)](_0x43fcdd[_0x4795(0x16)]),await _biometricPinService['biometricPinService'][_0x4795(0x17)]();}catch(_0x551018){return _0x43fcdd[_0x4795(0x18)](_0x43fcdd[_0x4795(0x19)],_0x43fcdd[_0x4795(0x1a)])?(console[_0x4795(0xc)](_0x43fcdd[_0x4795(0x1b)],_0x551018),![]):(_0x14237a[_0x4795(0xc)](_0x43fcdd[_0x4795(0x1b)],_0x64234e),![]);}};exports[_0x4795(0x1c)]=clearStoredPin;const getPinForTraining=async _0x36fe6b=>{const _0x28283e={'HCTAm':function(_0x2ab80b,_0x174f9c){return _0x2ab80b===_0x174f9c;},'QyYoH':_0x4795(0x1d),'IzEIf':_0x4795(0x1e),'LWEUW':function(_0x1324c7){return _0x1324c7();}};if(_0x36fe6b){if(_0x28283e['HCTAm'](_0x28283e[_0x4795(0x1f)],_0x28283e[_0x4795(0x1f)]))return console[_0x4795(0xe)](_0x28283e[_0x4795(0x20)]),_0x36fe6b;else _0x24200d=_0x72703b,_0x1b1402[_0x4795(0xe)]('📝\x20Temporary\x20PIN\x20set\x20for\x20training');}return await _0x28283e[_0x4795(0x21)](getStoredPinForTraining);};exports['getPinForTraining']=getPinForTraining;let temporaryPin=null;function _0x4795(_0x3398a6,_0x47950f){_0x3398a6=_0x3398a6-0x0;const _0x470796=_0x3398();let _0x59e7e8=_0x470796[_0x3398a6];return _0x59e7e8;}const setTemporaryPin=_0x2d81de=>{const _0x3bded5={'ipjap':_0x4795(0x22)};temporaryPin=_0x2d81de,console[_0x4795(0xe)](_0x3bded5[_0x4795(0x23)]);};exports[_0x4795(0x24)]=setTemporaryPin;const getTemporaryPin=()=>{return temporaryPin;};exports['getTemporaryPin']=getTemporaryPin;const clearTemporaryPin=()=>{const _0x29844a={'VUuNv':_0x4795(0x25)};temporaryPin=null,console[_0x4795(0xe)](_0x29844a[_0x4795(0x26)]);};exports['clearTemporaryPin']=clearTemporaryPin;
|