@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
package/src/types.ts
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
export interface DataTier {
|
|
2
|
-
type: string;
|
|
3
|
-
descriptions: string;
|
|
4
|
-
reward: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface DataRequest {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
reward: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface TestModeOptions {
|
|
14
|
-
// Simple 2-flow system
|
|
15
|
-
existingUser?: boolean; // Flow 1: Email → Code → Data Request → Close (return API URL)
|
|
16
|
-
newUser?: boolean; // Flow 2: Email → Code → Platform Connect → PIN → Training → Complete
|
|
17
|
-
|
|
18
|
-
// Optional tweaks
|
|
19
|
-
fastTraining?: boolean; // Speed up training simulation
|
|
20
|
-
skipRealConnections?: boolean; // Allow mock platform connections
|
|
21
|
-
skipApiCalls?: boolean; // Skip API calls entirely (for pure UI testing)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ApiKeyConfig {
|
|
25
|
-
apiKey: string;
|
|
26
|
-
environment?: 'production' | 'staging' | 'development';
|
|
27
|
-
enableLogging?: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// API key types
|
|
31
|
-
export enum ApiKeyType {
|
|
32
|
-
DEVELOPER = 'developer',
|
|
33
|
-
ADMIN = 'admin',
|
|
34
|
-
INVALID = 'invalid'
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface ApiKeyValidationResult {
|
|
38
|
-
isValid: boolean;
|
|
39
|
-
error?: string;
|
|
40
|
-
permissions?: string[];
|
|
41
|
-
rateLimits?: {
|
|
42
|
-
remaining: number;
|
|
43
|
-
resetTime: number;
|
|
44
|
-
};
|
|
45
|
-
keyType?: ApiKeyType;
|
|
46
|
-
isNetworkError?: boolean; // Flag to indicate if the error is due to network connectivity issues
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface OnairosConfig {
|
|
50
|
-
apiKey: string;
|
|
51
|
-
environment?: 'production' | 'staging' | 'development';
|
|
52
|
-
enableLogging?: boolean;
|
|
53
|
-
timeout?: number;
|
|
54
|
-
retryAttempts?: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface OnairosProps {
|
|
58
|
-
/** Return link after authentication (used for web-based flows) */
|
|
59
|
-
returnLink?: string;
|
|
60
|
-
/** Prefill URL for the authentication process */
|
|
61
|
-
prefillUrl?: string;
|
|
62
|
-
/** Application name to display in dialogs */
|
|
63
|
-
AppName: string;
|
|
64
|
-
/** Button type - 'normal' or 'pill' */
|
|
65
|
-
buttonType?: 'normal' | 'pill';
|
|
66
|
-
/** Data requests for user consent */
|
|
67
|
-
requestData?: {
|
|
68
|
-
[key: string]: DataTier;
|
|
69
|
-
};
|
|
70
|
-
/** Button width in pixels */
|
|
71
|
-
buttonWidth?: number;
|
|
72
|
-
/** Button height in pixels */
|
|
73
|
-
buttonHeight?: number;
|
|
74
|
-
/** Whether to show stroke/border around button */
|
|
75
|
-
hasStroke?: boolean;
|
|
76
|
-
/** Whether the button is enabled */
|
|
77
|
-
enabled?: boolean;
|
|
78
|
-
/** Button form/shape style */
|
|
79
|
-
buttonForm?: 'default' | 'connect';
|
|
80
|
-
/** Callback when user rejects or cancels */
|
|
81
|
-
onRejection?: (error?: string) => void;
|
|
82
|
-
/** Callback when authentication is resolved */
|
|
83
|
-
onResolved?: (apiUrl: string, token: string, userData: any) => void;
|
|
84
|
-
/** Function to check before starting authentication */
|
|
85
|
-
preCheck?: () => Promise<boolean>;
|
|
86
|
-
/** Button background color */
|
|
87
|
-
color?: string;
|
|
88
|
-
/** Enable debug mode */
|
|
89
|
-
debug?: boolean;
|
|
90
|
-
/** Enable dark mode */
|
|
91
|
-
darkMode?: boolean;
|
|
92
|
-
/** Preferred platform(s) for authentication - can specify 1-2 platforms to prioritize first */
|
|
93
|
-
preferredPlatform?: string | string[];
|
|
94
|
-
/** Enable test mode */
|
|
95
|
-
testMode?: boolean;
|
|
96
|
-
/** API Key Configuration (REQUIRED) */
|
|
97
|
-
apiKey: string;
|
|
98
|
-
/** Environment setting for API calls */
|
|
99
|
-
environment?: 'production' | 'staging' | 'development';
|
|
100
|
-
/** Enable logging for debugging */
|
|
101
|
-
enableLogging?: boolean;
|
|
102
|
-
/** Request timeout in milliseconds */
|
|
103
|
-
timeout?: number;
|
|
104
|
-
/** Number of retry attempts for failed requests */
|
|
105
|
-
retryAttempts?: number;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface UniversalOnboardingProps {
|
|
109
|
-
visible: boolean;
|
|
110
|
-
onClose: (result?: any) => void;
|
|
111
|
-
AppName: string;
|
|
112
|
-
appIcon?: any; // Optional app icon (React Native ImageSourcePropType)
|
|
113
|
-
requestData: {
|
|
114
|
-
// Support both old format (for backward compatibility)
|
|
115
|
-
Small?: DataTier;
|
|
116
|
-
Medium?: DataTier;
|
|
117
|
-
Large?: DataTier;
|
|
118
|
-
// And new format
|
|
119
|
-
personality_traits?: DataRequest;
|
|
120
|
-
sentiment_analysis?: DataRequest;
|
|
121
|
-
[key: string]: DataTier | DataRequest | undefined;
|
|
122
|
-
};
|
|
123
|
-
returnLink?: string;
|
|
124
|
-
prefillUrl?: string;
|
|
125
|
-
onComplete: (apiUrl: string, token: string, data: any) => void;
|
|
126
|
-
embedd?: boolean;
|
|
127
|
-
debug?: boolean;
|
|
128
|
-
testMode?: TestModeOptions | boolean;
|
|
129
|
-
buttonType?: 'default' | 'pill';
|
|
130
|
-
buttonForm?: 'signup' | 'login';
|
|
131
|
-
/** Preferred platform(s) for authentication - can specify 1-2 platforms to prioritize first */
|
|
132
|
-
preferredPlatform?: string | string[];
|
|
133
|
-
inferenceData?: any; // Data used for AI inference API requests
|
|
134
|
-
auto?: boolean; // If true, use inferenceData for automatic API requests
|
|
135
|
-
partner?: string; // Partner identifier (e.g., "couplebible")
|
|
136
|
-
config?: OnairosConfig; // Add API configuration
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export interface ConnectionStatus {
|
|
140
|
-
[key: string]: {
|
|
141
|
-
userName: string;
|
|
142
|
-
connected: boolean;
|
|
143
|
-
profileData?: any; // Additional profile data (e.g., from Opacity SDK for Instagram)
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface OnairosButtonProps {
|
|
148
|
-
returnLink?: string;
|
|
149
|
-
prefillUrl?: string;
|
|
150
|
-
AppName: string;
|
|
151
|
-
appIcon?: any; // Optional app icon (React Native ImageSourcePropType)
|
|
152
|
-
buttonType?: 'normal' | 'pill';
|
|
153
|
-
requestData?: {
|
|
154
|
-
// Support both old format (for backward compatibility)
|
|
155
|
-
Small?: DataTier;
|
|
156
|
-
Medium?: DataTier;
|
|
157
|
-
Large?: DataTier;
|
|
158
|
-
// And new format
|
|
159
|
-
personality_traits?: DataRequest;
|
|
160
|
-
sentiment_analysis?: DataRequest;
|
|
161
|
-
[key: string]: DataTier | DataRequest | undefined;
|
|
162
|
-
};
|
|
163
|
-
buttonWidth?: number;
|
|
164
|
-
buttonHeight?: number;
|
|
165
|
-
hasStroke?: boolean;
|
|
166
|
-
enabled?: boolean;
|
|
167
|
-
buttonForm?: 'default' | 'login' | 'signup' | 'connect';
|
|
168
|
-
onRejection?: (error?: string) => void;
|
|
169
|
-
onResolved?: (apiUrl: string, token: string, userData: any) => void;
|
|
170
|
-
preCheck?: () => Promise<boolean>;
|
|
171
|
-
color?: string;
|
|
172
|
-
swerv?: boolean;
|
|
173
|
-
debug?: boolean;
|
|
174
|
-
darkMode?: boolean;
|
|
175
|
-
/** Preferred platform(s) for authentication - can specify 1-2 platforms to prioritize first */
|
|
176
|
-
preferredPlatform?: string | string[];
|
|
177
|
-
testMode?: boolean;
|
|
178
|
-
autoFetch?: boolean;
|
|
179
|
-
inferenceData?: any; // Data used for AI inference API requests
|
|
180
|
-
auto?: boolean; // If true, use inferenceData for automatic API requests
|
|
181
|
-
partner?: string; // Partner identifier (e.g., "couplebible")
|
|
182
|
-
textLayout?: 'left' | 'right' | 'center';
|
|
183
|
-
textColor?: string;
|
|
184
|
-
proofMode?: boolean;
|
|
185
|
-
webpageName?: string;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export interface PlatformListProps {
|
|
189
|
-
platforms?: string[];
|
|
190
|
-
onSelect?: (platform: string) => void;
|
|
191
|
-
selectedPlatform?: string;
|
|
192
|
-
connections?: ConnectionStatus;
|
|
193
|
-
onToggle?: (platform: string, connect: boolean) => void;
|
|
194
|
-
isLoading?: boolean;
|
|
195
|
-
canProceed?: boolean;
|
|
196
|
-
onProceed?: () => void;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface PinInputProps {
|
|
200
|
-
onComplete?: (pin: string) => void;
|
|
201
|
-
length?: number;
|
|
202
|
-
secure?: boolean;
|
|
203
|
-
title?: string;
|
|
204
|
-
subtitle?: string;
|
|
205
|
-
verification?: boolean;
|
|
206
|
-
initialPin?: string;
|
|
207
|
-
onSubmit: (pin: string) => void;
|
|
208
|
-
minLength?: number;
|
|
209
|
-
requireSpecialChar?: boolean;
|
|
210
|
-
requireNumber?: boolean;
|
|
211
|
-
onBack?: () => void;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export interface TrainingModalProps {
|
|
215
|
-
visible: boolean;
|
|
216
|
-
progress: number;
|
|
217
|
-
eta: string;
|
|
218
|
-
onCancel: () => void;
|
|
219
|
-
onComplete?: () => void;
|
|
220
|
-
modelKey?: string;
|
|
221
|
-
username?: string;
|
|
222
|
-
test?: boolean; // Enable test mode for simulated training
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export interface OAuthWebViewProps {
|
|
226
|
-
url: string;
|
|
227
|
-
onClose: () => void;
|
|
228
|
-
onSuccess: (code: string) => void;
|
|
229
|
-
platform?: string;
|
|
230
|
-
onComplete?: () => void;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export interface PlatformConfig {
|
|
234
|
-
name: string;
|
|
235
|
-
icon: string;
|
|
236
|
-
color: string;
|
|
237
|
-
description?: string;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export interface PlatformAuthConfig {
|
|
241
|
-
hasNativeSDK: boolean;
|
|
242
|
-
nativeSDKPackage?: string;
|
|
243
|
-
authEndpoint: string;
|
|
244
|
-
color: string;
|
|
245
|
-
clientId?: string;
|
|
246
|
-
iosClientId?: string;
|
|
247
|
-
redirectUri?: string;
|
|
248
|
-
scope?: string;
|
|
249
|
-
responseType?: string;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export interface ApiResponse<T> {
|
|
253
|
-
success: boolean;
|
|
254
|
-
data?: T;
|
|
255
|
-
error?: string;
|
|
256
|
-
publicKey?: string;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export interface CredentialsResult {
|
|
260
|
-
success: boolean;
|
|
261
|
-
credentials?: any;
|
|
262
|
-
error?: string;
|
|
263
|
-
isValid?: boolean;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export interface OverlayProps {
|
|
267
|
-
data: {
|
|
268
|
-
// Support both old format (for backward compatibility)
|
|
269
|
-
Small?: DataTier;
|
|
270
|
-
Medium?: DataTier;
|
|
271
|
-
Large?: DataTier;
|
|
272
|
-
// And new format
|
|
273
|
-
personality_traits?: DataRequest;
|
|
274
|
-
sentiment_analysis?: DataRequest;
|
|
275
|
-
[key: string]: DataTier | DataRequest | undefined;
|
|
276
|
-
};
|
|
277
|
-
username: string;
|
|
278
|
-
modelKey: string;
|
|
279
|
-
onResolved: (apiUrl: string, accessToken: string, loginDetails: any) => void;
|
|
280
|
-
appName?: string;
|
|
281
|
-
darkMode?: boolean;
|
|
282
|
-
platforms?: Array<{id: string, name: string, icon: any}>;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export interface BiometricOptions {
|
|
286
|
-
enableBiometrics?: boolean;
|
|
287
|
-
biometricPrompt?: string;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export interface PinRequirements {
|
|
291
|
-
minLength: number;
|
|
292
|
-
requireUppercase: boolean;
|
|
293
|
-
requireLowercase: boolean;
|
|
294
|
-
requireNumber: boolean;
|
|
295
|
-
requireSpecialChar: boolean;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// ... rest of the existing types ...
|
package/src/utils/Portal.tsx
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
// Store for portal instances
|
|
5
|
-
const portalRefs: {[key: string]: React.ReactNode} = {};
|
|
6
|
-
let portalId = 0;
|
|
7
|
-
|
|
8
|
-
// Context to pass portal host state
|
|
9
|
-
const PortalContext = React.createContext<{
|
|
10
|
-
mount: (children: React.ReactNode) => number;
|
|
11
|
-
update: (key: number, children: React.ReactNode) => void;
|
|
12
|
-
unmount: (key: number) => void;
|
|
13
|
-
}>({
|
|
14
|
-
mount: () => 0,
|
|
15
|
-
update: () => {},
|
|
16
|
-
unmount: () => {},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Portal Host component - place this at the root of your app
|
|
21
|
-
*/
|
|
22
|
-
export const PortalHost: React.FC<{children?: React.ReactNode}> = ({ children }) => {
|
|
23
|
-
const [portals, setPortals] = useState<{[key: number]: React.ReactNode}>({});
|
|
24
|
-
|
|
25
|
-
const mount = (children: React.ReactNode) => {
|
|
26
|
-
const key = ++portalId;
|
|
27
|
-
setPortals(state => ({
|
|
28
|
-
...state,
|
|
29
|
-
[key]: children,
|
|
30
|
-
}));
|
|
31
|
-
return key;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const update = (key: number, children: React.ReactNode) => {
|
|
35
|
-
setPortals(state => ({
|
|
36
|
-
...state,
|
|
37
|
-
[key]: children,
|
|
38
|
-
}));
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const unmount = (key: number) => {
|
|
42
|
-
setPortals(state => {
|
|
43
|
-
const newState = { ...state };
|
|
44
|
-
delete newState[key];
|
|
45
|
-
return newState;
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<PortalContext.Provider value={{ mount, update, unmount }}>
|
|
51
|
-
{children}
|
|
52
|
-
{Object.keys(portals).map(key => (
|
|
53
|
-
<View key={key} style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, zIndex: 9999 }}>
|
|
54
|
-
{portals[Number(key)]}
|
|
55
|
-
</View>
|
|
56
|
-
))}
|
|
57
|
-
</PortalContext.Provider>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Portal component - renders children into the PortalHost
|
|
63
|
-
*/
|
|
64
|
-
export const Portal: React.FC<{children: React.ReactNode}> = ({ children }) => {
|
|
65
|
-
const { mount, update, unmount } = React.useContext(PortalContext);
|
|
66
|
-
const [portalId, setPortalId] = useState<number | null>(null);
|
|
67
|
-
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
const id = mount(children);
|
|
70
|
-
setPortalId(id);
|
|
71
|
-
return () => {
|
|
72
|
-
if (portalId) unmount(portalId);
|
|
73
|
-
};
|
|
74
|
-
}, []);
|
|
75
|
-
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
if (portalId !== null) {
|
|
78
|
-
update(portalId, children);
|
|
79
|
-
}
|
|
80
|
-
}, [children, portalId]);
|
|
81
|
-
|
|
82
|
-
return null;
|
|
83
|
-
};
|
package/src/utils/api.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
3
|
-
|
|
4
|
-
const API_URL = 'https://api2.onairos.uk';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Create an API instance with authorization headers
|
|
8
|
-
* @returns {Promise<Object>} - The axios instance
|
|
9
|
-
*/
|
|
10
|
-
export const createApiInstance = async () => {
|
|
11
|
-
const token = await AsyncStorage.getItem('onairosToken');
|
|
12
|
-
|
|
13
|
-
return axios.create({
|
|
14
|
-
baseURL: API_URL,
|
|
15
|
-
headers: {
|
|
16
|
-
'Content-Type': 'application/json',
|
|
17
|
-
...(token ? { 'Authorization': `Bearer ${token}` } : {})
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Validate the domain with the Onairos API
|
|
24
|
-
* @returns {Promise<Object>} - The validation response
|
|
25
|
-
*/
|
|
26
|
-
export const validateDomain = async () => {
|
|
27
|
-
try {
|
|
28
|
-
const api = await createApiInstance();
|
|
29
|
-
const response = await api.post('/valid/validate-domain');
|
|
30
|
-
return response.data;
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error('Error validating domain:', error);
|
|
33
|
-
return { status: false };
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Fetch account information
|
|
39
|
-
* @param {string} identifier - The username or email
|
|
40
|
-
* @param {boolean} isEmail - Whether the identifier is an email
|
|
41
|
-
* @returns {Promise<Object>} - The account information
|
|
42
|
-
*/
|
|
43
|
-
export const fetchAccountInfo = async (identifier, isEmail = false) => {
|
|
44
|
-
try {
|
|
45
|
-
const api = await createApiInstance();
|
|
46
|
-
const jsonData = isEmail
|
|
47
|
-
? { Info: { identifier } }
|
|
48
|
-
: { Info: { userName: identifier } };
|
|
49
|
-
|
|
50
|
-
const endpoint = isEmail ? '/getAccountInfo/email' : '/getAccountInfo';
|
|
51
|
-
const response = await api.post(endpoint, jsonData);
|
|
52
|
-
|
|
53
|
-
return response.data;
|
|
54
|
-
} catch (error) {
|
|
55
|
-
console.error('Error fetching account info:', error);
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Get API URL for data requests
|
|
62
|
-
* @param {Array} approvedRequests - The approved data requests
|
|
63
|
-
* @param {string} pin - The encrypted PIN
|
|
64
|
-
* @param {string} othentSub - The hashed Othent sub
|
|
65
|
-
* @returns {Promise<Object>} - The API URL response
|
|
66
|
-
*/
|
|
67
|
-
export const getApiUrl = async (approvedRequests, pin, othentSub) => {
|
|
68
|
-
try {
|
|
69
|
-
const api = await createApiInstance();
|
|
70
|
-
const jsonData = {
|
|
71
|
-
Info: {
|
|
72
|
-
EncryptedUserPin: pin,
|
|
73
|
-
confirmations: approvedRequests,
|
|
74
|
-
web3Type: 'othent',
|
|
75
|
-
Domain: Platform.OS,
|
|
76
|
-
proofMode: false,
|
|
77
|
-
OthentSub: othentSub,
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const response = await api.post('/getAPIurl', jsonData);
|
|
82
|
-
return response.data;
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.error('Error getting API URL:', error);
|
|
85
|
-
throw error;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Create a new user account
|
|
91
|
-
* @param {string} othentSub - The hashed Othent sub
|
|
92
|
-
* @param {string} pin - The PIN
|
|
93
|
-
* @param {Array} socialAccounts - The selected social accounts
|
|
94
|
-
* @param {string} email - The user's email
|
|
95
|
-
* @returns {Promise<Object>} - The account creation response
|
|
96
|
-
*/
|
|
97
|
-
export const createAccount = async (othentSub, pin, socialAccounts, email) => {
|
|
98
|
-
try {
|
|
99
|
-
const api = await createApiInstance();
|
|
100
|
-
const response = await api.post('/createAccount', {
|
|
101
|
-
othentSub,
|
|
102
|
-
pin,
|
|
103
|
-
socialAccounts,
|
|
104
|
-
email
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return response.data;
|
|
108
|
-
} catch (error) {
|
|
109
|
-
console.error('Error creating account:', error);
|
|
110
|
-
throw error;
|
|
111
|
-
}
|
|
112
|
-
};
|
package/src/utils/auth.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
3
|
-
|
|
4
|
-
const API_URL = 'https://api2.onairos.uk';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Get the encrypted PIN for a user
|
|
8
|
-
* @param {string} hashedOthentSub - The hashed Othent sub
|
|
9
|
-
* @returns {Promise<Object>} - The response containing the encrypted PIN
|
|
10
|
-
*/
|
|
11
|
-
export const getPin = async (hashedOthentSub) => {
|
|
12
|
-
try {
|
|
13
|
-
const response = await axios.post(`${API_URL}/getPin`, {
|
|
14
|
-
hashedOthentSub
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return response.data;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
console.error('Error getting PIN:', error);
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Verify a token with the Onairos API
|
|
26
|
-
* @param {string} token - The token to verify
|
|
27
|
-
* @returns {Promise<boolean>} - Whether the token is valid
|
|
28
|
-
*/
|
|
29
|
-
export const verifyToken = async (token) => {
|
|
30
|
-
try {
|
|
31
|
-
const response = await axios.post(`${API_URL}/verifyToken`, {}, {
|
|
32
|
-
headers: {
|
|
33
|
-
'Authorization': `Bearer ${token}`
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return response.data.valid;
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error('Error verifying token:', error);
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Store authentication data
|
|
46
|
-
* @param {string} token - The authentication token
|
|
47
|
-
* @param {string} username - The username
|
|
48
|
-
* @param {Object} othentData - The Othent user data
|
|
49
|
-
*/
|
|
50
|
-
export const storeAuthData = async (token, username = null, othentData = null) => {
|
|
51
|
-
try {
|
|
52
|
-
await AsyncStorage.setItem('onairosToken', token);
|
|
53
|
-
|
|
54
|
-
if (username) {
|
|
55
|
-
await AsyncStorage.setItem('username', username);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (othentData) {
|
|
59
|
-
await AsyncStorage.setItem('othentToken', JSON.stringify(othentData));
|
|
60
|
-
}
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.error('Error storing auth data:', error);
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Clear authentication data
|
|
69
|
-
*/
|
|
70
|
-
export const clearAuthData = async () => {
|
|
71
|
-
try {
|
|
72
|
-
await AsyncStorage.removeItem('onairosToken');
|
|
73
|
-
await AsyncStorage.removeItem('username');
|
|
74
|
-
await AsyncStorage.removeItem('othentToken');
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error('Error clearing auth data:', error);
|
|
77
|
-
throw error;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get stored authentication data
|
|
83
|
-
* @returns {Promise<Object>} - The stored authentication data
|
|
84
|
-
*/
|
|
85
|
-
export const getStoredAuthData = async () => {
|
|
86
|
-
try {
|
|
87
|
-
const token = await AsyncStorage.getItem('onairosToken');
|
|
88
|
-
const username = await AsyncStorage.getItem('username');
|
|
89
|
-
const othentToken = await AsyncStorage.getItem('othentToken');
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
token,
|
|
93
|
-
username,
|
|
94
|
-
othentToken: othentToken ? JSON.parse(othentToken) : null
|
|
95
|
-
};
|
|
96
|
-
} catch (error) {
|
|
97
|
-
console.error('Error getting stored auth data:', error);
|
|
98
|
-
return {
|
|
99
|
-
token: null,
|
|
100
|
-
username: null,
|
|
101
|
-
othentToken: null
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
};
|
package/src/utils/crypto.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { RSA } from 'react-native-rsa-native';
|
|
2
|
-
import { sha256 as cryptoSha256 } from 'react-native-crypto-js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Encrypt data using RSA
|
|
6
|
-
* @param {string} publicKey - The RSA public key
|
|
7
|
-
* @param {string} data - The data to encrypt
|
|
8
|
-
* @returns {Promise<string>} - The encrypted data
|
|
9
|
-
*/
|
|
10
|
-
export const rsaEncrypt = async (publicKey, data) => {
|
|
11
|
-
try {
|
|
12
|
-
// Clean the public key format
|
|
13
|
-
const cleanedKey = publicKey
|
|
14
|
-
.replace(/\\n/g, '')
|
|
15
|
-
.replace(/^\s+|\s+$/g, '')
|
|
16
|
-
.replace('-----BEGIN PUBLIC KEY-----', '')
|
|
17
|
-
.replace('-----END PUBLIC KEY-----', '')
|
|
18
|
-
.trim();
|
|
19
|
-
|
|
20
|
-
// Format the key properly for the library
|
|
21
|
-
const formattedKey = `-----BEGIN PUBLIC KEY-----\n${cleanedKey}\n-----END PUBLIC KEY-----`;
|
|
22
|
-
|
|
23
|
-
// Encrypt the data
|
|
24
|
-
const encrypted = await RSA.encrypt(data, formattedKey);
|
|
25
|
-
return encrypted;
|
|
26
|
-
} catch (error) {
|
|
27
|
-
console.error('RSA encryption failed:', error);
|
|
28
|
-
throw error;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Hash data using SHA-256
|
|
34
|
-
* @param {string} data - The data to hash
|
|
35
|
-
* @returns {string} - The hashed data
|
|
36
|
-
*/
|
|
37
|
-
export const sha256 = (data) => {
|
|
38
|
-
return cryptoSha256(data).toString();
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Convert a base64 string to a buffer
|
|
43
|
-
* @param {string} base64String - The base64 string to convert
|
|
44
|
-
* @returns {ArrayBuffer} - The converted buffer
|
|
45
|
-
*/
|
|
46
|
-
export const base64ToBuffer = (base64String) => {
|
|
47
|
-
try {
|
|
48
|
-
const binaryString = Buffer.from(base64String, 'base64').toString('binary');
|
|
49
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
50
|
-
|
|
51
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
52
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return bytes.buffer;
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error('Error converting base64 to buffer:', error);
|
|
58
|
-
throw error;
|
|
59
|
-
}
|
|
60
|
-
};
|
package/src/utils/debugHelper.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug utility functions for Onairos React Native SDK
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Determine if we're in dev mode
|
|
6
|
-
const __DEV__ = process.env.NODE_ENV !== 'production';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Log debug message to console when in development mode
|
|
10
|
-
* @param label Label for the debug message
|
|
11
|
-
* @param data Data to log
|
|
12
|
-
*/
|
|
13
|
-
export const logDebug = (label: string, data?: any): void => {
|
|
14
|
-
if (__DEV__) {
|
|
15
|
-
console.log(`[Onairos Debug] ${label}:`, data || '');
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Log error message to console
|
|
21
|
-
* @param label Label for the error message
|
|
22
|
-
* @param error Error object or message
|
|
23
|
-
*/
|
|
24
|
-
export const logError = (label: string, error: any): void => {
|
|
25
|
-
if (__DEV__) {
|
|
26
|
-
console.error(`[Onairos Error] ${label}:`, error);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Check if debug mode is enabled
|
|
32
|
-
* @param debug Debug flag passed to component
|
|
33
|
-
* @returns Whether debug mode is enabled
|
|
34
|
-
*/
|
|
35
|
-
export const isDebugMode = (debug?: boolean): boolean => {
|
|
36
|
-
return debug === true || __DEV__;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Format and log API request details
|
|
41
|
-
* @param method HTTP method
|
|
42
|
-
* @param url API URL
|
|
43
|
-
* @param data Request data
|
|
44
|
-
*/
|
|
45
|
-
export const logApiRequest = (method: string, url: string, data?: any): void => {
|
|
46
|
-
if (__DEV__) {
|
|
47
|
-
logDebug('API Request', {
|
|
48
|
-
method,
|
|
49
|
-
url,
|
|
50
|
-
data: data || {},
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
};
|