@onairos/react-native 3.4.1 → 3.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -13
- package/lib/commonjs/api/index.js +9 -145
- package/lib/commonjs/assets/animations/loaderani.json +1 -0
- package/lib/commonjs/assets/animations/persona-animation.json +1 -0
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/chatgpt.png +0 -0
- package/lib/commonjs/assets/icons/claude.png +0 -0
- package/lib/commonjs/assets/icons/gemini.png +0 -0
- package/lib/commonjs/assets/icons/grok.png +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/chatgpt.png +0 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/claude.png +0 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- package/lib/commonjs/assets/images/gemini.png +0 -0
- package/lib/commonjs/assets/images/grok.png +0 -0
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +9 -0
- package/lib/commonjs/components/BrandMark.js +10 -0
- package/lib/commonjs/components/CodeInput.js +9 -0
- package/lib/commonjs/components/EmailInput.js +8 -0
- package/lib/commonjs/components/GoogleButton.js +9 -0
- package/lib/commonjs/components/HeadingGroup.js +9 -0
- package/lib/commonjs/components/LLMDataInputModal.js +14 -0
- package/lib/commonjs/components/ModalHeader.js +9 -0
- package/lib/commonjs/components/ModalSheet.js +9 -0
- package/lib/commonjs/components/Onairos.js +14 -374
- package/lib/commonjs/components/OnairosButton.js +13 -309
- package/lib/commonjs/components/OnairosSignInButton.js +12 -0
- package/lib/commonjs/components/Overlay.js +13 -483
- package/lib/commonjs/components/PersonaImage.js +10 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
- package/lib/commonjs/components/PinCreationScreen.js +12 -0
- package/lib/commonjs/components/PinInput.js +9 -302
- package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
- package/lib/commonjs/components/PlatformList.js +10 -137
- package/lib/commonjs/components/PlatformToggle.js +9 -0
- package/lib/commonjs/components/PrimaryButton.js +10 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
- package/lib/commonjs/components/SignInStep.js +12 -0
- package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +21 -0
- package/lib/commonjs/components/icons/Basicproficon.js +8 -0
- package/lib/commonjs/components/icons/Basicprofile.js +8 -0
- package/lib/commonjs/components/icons/Checkbox.js +8 -0
- package/lib/commonjs/components/icons/Checkmark.js +8 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
- package/lib/commonjs/components/icons/Contenticon.js +8 -0
- package/lib/commonjs/components/icons/EnochE.js +8 -0
- package/lib/commonjs/components/icons/Personalityicon.js +8 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
- package/lib/commonjs/components/icons/Userpreferences.js +8 -0
- package/lib/commonjs/components/icons/index.js +17 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
- package/lib/commonjs/components/onboarding/PinInput.js +10 -283
- package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
- package/lib/commonjs/config/api.js +7 -0
- package/lib/commonjs/constants/index.js +7 -83
- package/lib/commonjs/context/AuthContext.js +10 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
- package/lib/commonjs/hooks/useConnections.js +8 -159
- package/lib/commonjs/hooks/useCredentials.js +10 -177
- package/lib/commonjs/hooks/useUserConnections.js +10 -0
- package/lib/commonjs/index.js +35 -106
- package/lib/commonjs/services/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/imageCompressionService.js +7 -0
- package/lib/commonjs/services/jwtStorageService.js +7 -0
- package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
- package/lib/commonjs/services/linkedinProfileService.js +9 -0
- package/lib/commonjs/services/linkedinScrapingService.js +8 -0
- package/lib/commonjs/services/llmDataStorage.js +8 -0
- package/lib/commonjs/services/mobileTrainingService.js +8 -0
- package/lib/commonjs/services/oauthService.js +11 -390
- package/lib/commonjs/services/pinEncryptionService.js +8 -0
- package/lib/commonjs/services/pinStorageUtils.js +7 -0
- package/lib/commonjs/services/platformAuthService.js +12 -1067
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/trainingApiHelpers.js +7 -0
- package/lib/commonjs/services/userConnectionsService.js +10 -0
- package/lib/commonjs/services/youtubeMigrationService.js +10 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/types/ambient.d.js +1 -2
- package/lib/commonjs/types/declarations.d.js +1 -2
- package/lib/commonjs/types/index.js +1 -6
- package/lib/commonjs/types/node-fix.d.js +1 -2
- package/lib/commonjs/types/node-override.d.js +1 -2
- package/lib/commonjs/types/opacity.d.js +1 -2
- package/lib/commonjs/types.js +1 -14
- package/lib/commonjs/utils/Portal.js +8 -98
- package/lib/commonjs/utils/api.js +9 -129
- package/lib/commonjs/utils/assetRegistry.js +33 -0
- package/lib/commonjs/utils/auth.js +9 -111
- package/lib/commonjs/utils/crypto.js +8 -62
- package/lib/commonjs/utils/debugHelper.js +1 -64
- package/lib/commonjs/utils/encryption.js +7 -76
- package/lib/commonjs/utils/eventUtils.js +1 -0
- package/lib/commonjs/utils/haptics.js +9 -0
- package/lib/commonjs/utils/imagePreloader.js +1 -0
- package/lib/commonjs/utils/networkDiagnostics.js +8 -0
- package/lib/commonjs/utils/onairosApi.js +9 -350
- package/lib/commonjs/utils/programmaticFlow.js +9 -117
- package/lib/commonjs/utils/retryHelper.js +1 -220
- package/lib/commonjs/utils/secureStorage.js +10 -349
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +9 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/api/index.js +1 -139
- package/lib/module/assets/animations/loaderani.json +1 -0
- package/lib/module/assets/animations/persona-animation.json +1 -0
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/chatgpt.png +0 -0
- package/lib/module/assets/icons/claude.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/gemini.png +0 -0
- package/lib/module/assets/icons/grok.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/chatgpt.png +0 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/claude.png +0 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- package/lib/module/assets/images/gemini.png +0 -0
- package/lib/module/assets/images/grok.png +0 -0
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +1 -0
- package/lib/module/components/BrandMark.js +1 -0
- package/lib/module/components/CodeInput.js +1 -0
- package/lib/module/components/EmailInput.js +1 -0
- package/lib/module/components/GoogleButton.js +1 -0
- package/lib/module/components/HeadingGroup.js +1 -0
- package/lib/module/components/LLMDataInputModal.js +8 -0
- package/lib/module/components/ModalHeader.js +1 -0
- package/lib/module/components/ModalSheet.js +1 -0
- package/lib/module/components/Onairos.js +1 -367
- package/lib/module/components/OnairosButton.js +1 -302
- package/lib/module/components/OnairosSignInButton.js +1 -0
- package/lib/module/components/Overlay.js +1 -474
- package/lib/module/components/PersonaImage.js +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +1 -0
- package/lib/module/components/PinCreationScreen.js +1 -0
- package/lib/module/components/PinInput.js +1 -293
- package/lib/module/components/PlatformConnectorsStep.js +1 -0
- package/lib/module/components/PlatformList.js +1 -129
- package/lib/module/components/PlatformToggle.js +1 -0
- package/lib/module/components/PrimaryButton.js +1 -0
- package/lib/module/components/SignInMatchAnimation.js +1 -0
- package/lib/module/components/SignInStep.js +1 -0
- package/lib/module/components/UniversalOnboarding.js +1 -1693
- package/lib/module/components/VerificationStep.js +1 -0
- package/lib/module/components/WelcomeScreen.js +1 -0
- package/lib/module/components/icons/Basicproficon.js +1 -0
- package/lib/module/components/icons/Basicprofile.js +1 -0
- package/lib/module/components/icons/Checkbox.js +1 -0
- package/lib/module/components/icons/Checkmark.js +1 -0
- package/lib/module/components/icons/Contentanalysis.js +1 -0
- package/lib/module/components/icons/Contenticon.js +1 -0
- package/lib/module/components/icons/EnochE.js +1 -0
- package/lib/module/components/icons/Personalityicon.js +1 -0
- package/lib/module/components/icons/Personalityprofile.js +1 -0
- package/lib/module/components/icons/Personalitytraits.js +1 -0
- package/lib/module/components/icons/Userpreferences.js +1 -0
- package/lib/module/components/icons/index.js +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +1 -818
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
- package/lib/module/components/onboarding/PinInput.js +1 -274
- package/lib/module/components/onboarding/PlatformConnector.js +1 -240
- package/lib/module/config/api.js +1 -0
- package/lib/module/constants/index.js +1 -77
- package/lib/module/context/AuthContext.js +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +1 -0
- package/lib/module/hooks/useConnections.js +1 -152
- package/lib/module/hooks/useCredentials.js +6 -169
- package/lib/module/hooks/useUserConnections.js +1 -0
- package/lib/module/index.js +1 -32
- package/lib/module/services/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/imageCompressionService.js +1 -0
- package/lib/module/services/jwtStorageService.js +1 -0
- package/lib/module/services/linkedinDOMExtractor.js +1 -0
- package/lib/module/services/linkedinProfileService.js +1 -0
- package/lib/module/services/linkedinScrapingService.js +1 -0
- package/lib/module/services/llmDataStorage.js +1 -0
- package/lib/module/services/mobileTrainingService.js +1 -0
- package/lib/module/services/oauthService.js +1 -380
- package/lib/module/services/pinEncryptionService.js +7 -0
- package/lib/module/services/pinStorageUtils.js +1 -0
- package/lib/module/services/platformAuthService.js +1 -1041
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/trainingApiHelpers.js +1 -0
- package/lib/module/services/userConnectionsService.js +1 -0
- package/lib/module/services/youtubeMigrationService.js +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/types.js +1 -10
- package/lib/module/utils/Portal.js +1 -90
- package/lib/module/utils/api.js +1 -117
- package/lib/module/utils/assetRegistry.js +33 -0
- package/lib/module/utils/auth.js +1 -99
- package/lib/module/utils/crypto.js +1 -54
- package/lib/module/utils/debugHelper.js +1 -54
- package/lib/module/utils/encryption.js +1 -67
- package/lib/module/utils/eventUtils.js +1 -0
- package/lib/module/utils/haptics.js +8 -0
- package/lib/module/utils/imagePreloader.js +1 -0
- package/lib/module/utils/networkDiagnostics.js +1 -0
- package/lib/module/utils/onairosApi.js +1 -333
- package/lib/module/utils/programmaticFlow.js +1 -111
- package/lib/module/utils/retryHelper.js +1 -211
- package/lib/module/utils/secureStorage.js +6 -330
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/module/utils/webviewScripts/claude.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/package.json +62 -39
- package/lib/commonjs/api/index.js.map +0 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js +0 -228
- package/lib/commonjs/components/DataRequestModal.js.map +0 -1
- package/lib/commonjs/components/DataRequestScreen.js +0 -329
- package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
- package/lib/commonjs/components/EmailVerificationModal.js +0 -320
- package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
- package/lib/commonjs/components/Onairos.js.map +0 -1
- package/lib/commonjs/components/OnairosButton.js.map +0 -1
- package/lib/commonjs/components/Overlay.js.map +0 -1
- package/lib/commonjs/components/PinInput.js.map +0 -1
- package/lib/commonjs/components/PlatformList.js.map +0 -1
- package/lib/commonjs/components/TrainingModal.js +0 -717
- package/lib/commonjs/components/TrainingModal.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
- package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/constants/index.js.map +0 -1
- package/lib/commonjs/hooks/useConnections.js.map +0 -1
- package/lib/commonjs/hooks/useCredentials.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/services/apiKeyService.js.map +0 -1
- package/lib/commonjs/services/oauthService.js.map +0 -1
- package/lib/commonjs/services/platformAuthService.js.map +0 -1
- package/lib/commonjs/types/ambient.d.js.map +0 -1
- package/lib/commonjs/types/declarations.d.js.map +0 -1
- package/lib/commonjs/types/index.d.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/types/node-fix.d.js.map +0 -1
- package/lib/commonjs/types/node-override.d.js.map +0 -1
- package/lib/commonjs/types/opacity.d.js.map +0 -1
- package/lib/commonjs/types/types.d.js.map +0 -1
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/Portal.js.map +0 -1
- package/lib/commonjs/utils/api.js.map +0 -1
- package/lib/commonjs/utils/auth.js.map +0 -1
- package/lib/commonjs/utils/crypto.js.map +0 -1
- package/lib/commonjs/utils/debugHelper.js.map +0 -1
- package/lib/commonjs/utils/encryption.js.map +0 -1
- package/lib/commonjs/utils/onairosApi.js.map +0 -1
- package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
- package/lib/commonjs/utils/retryHelper.js.map +0 -1
- package/lib/commonjs/utils/secureStorage.js.map +0 -1
- package/lib/module/api/index.js.map +0 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js +0 -220
- package/lib/module/components/DataRequestModal.js.map +0 -1
- package/lib/module/components/DataRequestScreen.js +0 -321
- package/lib/module/components/DataRequestScreen.js.map +0 -1
- package/lib/module/components/EmailVerificationModal.js +0 -311
- package/lib/module/components/EmailVerificationModal.js.map +0 -1
- package/lib/module/components/Onairos.js.map +0 -1
- package/lib/module/components/OnairosButton.js.map +0 -1
- package/lib/module/components/Overlay.js.map +0 -1
- package/lib/module/components/PinInput.js.map +0 -1
- package/lib/module/components/PlatformList.js.map +0 -1
- package/lib/module/components/TrainingModal.js +0 -708
- package/lib/module/components/TrainingModal.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/module/components/onboarding/PinInput.js.map +0 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/module/components/screens/ConnectorScreen.js +0 -138
- package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/module/components/screens/LoadingScreen.js +0 -83
- package/lib/module/components/screens/LoadingScreen.js.map +0 -1
- package/lib/module/components/screens/PinCreationScreen.js +0 -53
- package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/module/constants/index.js.map +0 -1
- package/lib/module/hooks/useConnections.js.map +0 -1
- package/lib/module/hooks/useCredentials.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/services/apiKeyService.js.map +0 -1
- package/lib/module/services/oauthService.js.map +0 -1
- package/lib/module/services/platformAuthService.js.map +0 -1
- package/lib/module/types/ambient.d.js.map +0 -1
- package/lib/module/types/declarations.d.js.map +0 -1
- package/lib/module/types/index.d.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/types/node-fix.d.js.map +0 -1
- package/lib/module/types/node-override.d.js.map +0 -1
- package/lib/module/types/opacity.d.js.map +0 -1
- package/lib/module/types/types.d.js.map +0 -1
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils/Portal.js.map +0 -1
- package/lib/module/utils/api.js.map +0 -1
- package/lib/module/utils/auth.js.map +0 -1
- package/lib/module/utils/crypto.js.map +0 -1
- package/lib/module/utils/debugHelper.js.map +0 -1
- package/lib/module/utils/encryption.js.map +0 -1
- package/lib/module/utils/onairosApi.js.map +0 -1
- package/lib/module/utils/programmaticFlow.js.map +0 -1
- package/lib/module/utils/retryHelper.js.map +0 -1
- package/lib/module/utils/secureStorage.js.map +0 -1
- package/lib/typescript/api/index.d.ts +0 -8
- package/lib/typescript/api/index.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestModal.d.ts +0 -11
- package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
- package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
- package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
- package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
- package/lib/typescript/components/Onairos.d.ts +0 -4
- package/lib/typescript/components/Onairos.d.ts.map +0 -1
- package/lib/typescript/components/OnairosButton.d.ts +0 -12
- package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
- package/lib/typescript/components/Overlay.d.ts +0 -4
- package/lib/typescript/components/Overlay.d.ts.map +0 -1
- package/lib/typescript/components/PinInput.d.ts +0 -4
- package/lib/typescript/components/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/PlatformList.d.ts +0 -4
- package/lib/typescript/components/PlatformList.d.ts.map +0 -1
- package/lib/typescript/components/TrainingModal.d.ts +0 -4
- package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
- package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
- package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
- package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/constants/index.d.ts +0 -53
- package/lib/typescript/constants/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnections.d.ts +0 -9
- package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
- package/lib/typescript/hooks/useCredentials.d.ts +0 -9
- package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -18
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/services/apiKeyService.d.ts +0 -132
- package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
- package/lib/typescript/services/oauthService.d.ts +0 -50
- package/lib/typescript/services/oauthService.d.ts.map +0 -1
- package/lib/typescript/services/platformAuthService.d.ts +0 -144
- package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts +0 -231
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -270
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils/Portal.d.ts +0 -14
- package/lib/typescript/utils/Portal.d.ts.map +0 -1
- package/lib/typescript/utils/api.d.ts +0 -6
- package/lib/typescript/utils/api.d.ts.map +0 -1
- package/lib/typescript/utils/auth.d.ts +0 -6
- package/lib/typescript/utils/auth.d.ts.map +0 -1
- package/lib/typescript/utils/crypto.d.ts +0 -4
- package/lib/typescript/utils/crypto.d.ts.map +0 -1
- package/lib/typescript/utils/debugHelper.d.ts +0 -29
- package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
- package/lib/typescript/utils/encryption.d.ts +0 -19
- package/lib/typescript/utils/encryption.d.ts.map +0 -1
- package/lib/typescript/utils/onairosApi.d.ts +0 -87
- package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
- package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
- package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
- package/lib/typescript/utils/retryHelper.d.ts +0 -69
- package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
- package/lib/typescript/utils/secureStorage.d.ts +0 -94
- package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
- package/src/api/index.ts +0 -111
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/onairos_logo.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestModal.tsx +0 -227
- package/src/components/DataRequestScreen.tsx +0 -356
- package/src/components/EmailVerificationModal.tsx +0 -364
- package/src/components/Onairos.tsx +0 -425
- package/src/components/OnairosButton.tsx +0 -359
- package/src/components/Overlay.tsx +0 -506
- package/src/components/PinInput.tsx +0 -343
- package/src/components/PlatformList.tsx +0 -145
- package/src/components/TrainingModal.tsx +0 -737
- package/src/components/UniversalOnboarding.tsx +0 -1839
- package/src/components/UniversalOnboarding.tsx.new +0 -455
- package/src/components/onboarding/OAuthWebView.tsx +0 -838
- package/src/components/onboarding/OnboardingHeader.tsx +0 -70
- package/src/components/onboarding/PinInput.tsx +0 -356
- package/src/components/onboarding/PlatformConnector.tsx +0 -302
- package/src/components/screens/ConnectorScreen.tsx +0 -153
- package/src/components/screens/LoadingScreen.tsx +0 -100
- package/src/components/screens/PinCreationScreen.tsx +0 -67
- package/src/constants/index.ts +0 -83
- package/src/hooks/useConnections.ts +0 -163
- package/src/hooks/useCredentials.ts +0 -175
- package/src/index.js +0 -14
- package/src/index.ts +0 -50
- package/src/services/SDK_API_KEY_VALIDATION.md +0 -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,220 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NETWORK_RETRY_OPTIONS = exports.DEFAULT_RETRY_OPTIONS = exports.API_RETRY_OPTIONS = void 0;
|
|
7
|
-
exports.fetchWithRetry = fetchWithRetry;
|
|
8
|
-
exports.healthCheck = healthCheck;
|
|
9
|
-
exports.withRetry = withRetry;
|
|
10
|
-
/**
|
|
11
|
-
* 🔄 Retry Helper Utility
|
|
12
|
-
*
|
|
13
|
-
* Provides robust retry logic with exponential backoff for network operations.
|
|
14
|
-
* Used throughout the Onairos SDK for handling transient failures gracefully.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Default retry options for the Onairos SDK
|
|
19
|
-
*/
|
|
20
|
-
const DEFAULT_RETRY_OPTIONS = exports.DEFAULT_RETRY_OPTIONS = {
|
|
21
|
-
maxRetries: 3,
|
|
22
|
-
baseDelay: 1000,
|
|
23
|
-
maxDelay: 5000,
|
|
24
|
-
exponentialBackoff: true,
|
|
25
|
-
enableLogging: false,
|
|
26
|
-
shouldRetry: (error, attempt) => {
|
|
27
|
-
// Don't retry client errors (4xx) except for 408 (timeout) and 429 (rate limit)
|
|
28
|
-
if (error.status >= 400 && error.status < 500 && error.status !== 408 && error.status !== 429) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Retry network errors, timeouts, and server errors (5xx)
|
|
33
|
-
if (error.name === 'AbortError' || error.message.includes('Network request failed') || error.message.includes('fetch') || error.message.includes('ENOTFOUND') || error.message.includes('timeout') || error.status >= 500) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Retry JSON parse errors (likely server issues)
|
|
38
|
-
if (error.message.includes('JSON Parse error') || error.message.includes('Unexpected character')) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Execute a function with retry logic and exponential backoff
|
|
47
|
-
* @param fn Function to execute (should return a Promise)
|
|
48
|
-
* @param options Retry configuration options
|
|
49
|
-
* @returns Promise with retry result
|
|
50
|
-
*/
|
|
51
|
-
async function withRetry(fn, options = {}) {
|
|
52
|
-
const config = {
|
|
53
|
-
...DEFAULT_RETRY_OPTIONS,
|
|
54
|
-
...options
|
|
55
|
-
};
|
|
56
|
-
const startTime = Date.now();
|
|
57
|
-
let lastError = null;
|
|
58
|
-
for (let attempt = 1; attempt <= config.maxRetries + 1; attempt++) {
|
|
59
|
-
try {
|
|
60
|
-
if (config.enableLogging && attempt > 1) {
|
|
61
|
-
console.log(`🔄 Retry attempt ${attempt}/${config.maxRetries + 1}`);
|
|
62
|
-
}
|
|
63
|
-
const result = await fn();
|
|
64
|
-
return {
|
|
65
|
-
success: true,
|
|
66
|
-
data: result,
|
|
67
|
-
attempts: attempt,
|
|
68
|
-
totalDuration: Date.now() - startTime
|
|
69
|
-
};
|
|
70
|
-
} catch (error) {
|
|
71
|
-
lastError = error;
|
|
72
|
-
|
|
73
|
-
// Check if we should retry this error
|
|
74
|
-
const shouldRetryError = config.shouldRetry ? config.shouldRetry(error, attempt) : true;
|
|
75
|
-
|
|
76
|
-
// If this is the last attempt or we shouldn't retry, throw the error
|
|
77
|
-
if (attempt > config.maxRetries || !shouldRetryError) {
|
|
78
|
-
if (config.enableLogging) {
|
|
79
|
-
console.error(`❌ All retry attempts exhausted or error not retryable: ${error.message}`);
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Calculate delay for next attempt
|
|
85
|
-
let delay = config.baseDelay;
|
|
86
|
-
if (config.exponentialBackoff) {
|
|
87
|
-
delay = Math.min(config.baseDelay * Math.pow(2, attempt - 1), config.maxDelay);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Add some jitter to prevent thundering herd
|
|
91
|
-
const jitter = Math.random() * 0.1 * delay;
|
|
92
|
-
delay = Math.floor(delay + jitter);
|
|
93
|
-
if (config.onRetry) {
|
|
94
|
-
config.onRetry(error, attempt, delay);
|
|
95
|
-
}
|
|
96
|
-
if (config.enableLogging) {
|
|
97
|
-
console.log(`⏳ Waiting ${delay}ms before retry (attempt ${attempt}/${config.maxRetries + 1})`);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Wait before next attempt
|
|
101
|
-
await new Promise(resolve => setTimeout(() => resolve(), delay));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
success: false,
|
|
106
|
-
error: lastError || new Error('Unknown error'),
|
|
107
|
-
attempts: config.maxRetries + 1,
|
|
108
|
-
totalDuration: Date.now() - startTime
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Retry configuration for API calls
|
|
114
|
-
*/
|
|
115
|
-
const API_RETRY_OPTIONS = exports.API_RETRY_OPTIONS = {
|
|
116
|
-
maxRetries: 3,
|
|
117
|
-
baseDelay: 1000,
|
|
118
|
-
maxDelay: 5000,
|
|
119
|
-
exponentialBackoff: true,
|
|
120
|
-
shouldRetry: (error, attempt) => {
|
|
121
|
-
// Enhanced retry logic for API calls
|
|
122
|
-
|
|
123
|
-
// Never retry authentication errors (401) or permission errors (403)
|
|
124
|
-
if (error.status === 401 || error.status === 403) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Never retry bad request errors (400) or not found (404) unless it's a specific case
|
|
129
|
-
if (error.status === 400 || error.status === 404 && !error.message.includes('validation endpoint')) {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Retry rate limiting (429) with longer delays
|
|
134
|
-
if (error.status === 429) {
|
|
135
|
-
return attempt <= 2; // Limit retries for rate limiting
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Retry server errors (5xx)
|
|
139
|
-
if (error.status >= 500) {
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Retry timeout and network errors
|
|
144
|
-
if (error.name === 'AbortError' || error.message.includes('timeout') || error.message.includes('Network request failed') || error.message.includes('fetch') || error.message.includes('ENOTFOUND')) {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Retry JSON parse errors (server returning HTML instead of JSON)
|
|
149
|
-
if (error.message.includes('JSON Parse error') || error.message.includes('Unexpected character') || error.message.includes('HTML page instead of JSON')) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
return false;
|
|
153
|
-
},
|
|
154
|
-
onRetry: (error, attempt, delay) => {
|
|
155
|
-
console.warn(`⚠️ API call failed (attempt ${attempt}), retrying in ${delay}ms: ${error.message}`);
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Specialized retry for network/connectivity issues
|
|
161
|
-
*/
|
|
162
|
-
const NETWORK_RETRY_OPTIONS = exports.NETWORK_RETRY_OPTIONS = {
|
|
163
|
-
maxRetries: 2,
|
|
164
|
-
baseDelay: 2000,
|
|
165
|
-
maxDelay: 8000,
|
|
166
|
-
exponentialBackoff: true,
|
|
167
|
-
shouldRetry: (error, attempt) => {
|
|
168
|
-
// Only retry actual network/connectivity issues
|
|
169
|
-
return error.message.includes('Network request failed') || error.message.includes('ENOTFOUND') || error.message.includes('DNS') || error.name === 'AbortError';
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Create a retry wrapper for fetch requests
|
|
175
|
-
* @param url Request URL
|
|
176
|
-
* @param options Fetch options
|
|
177
|
-
* @param retryOptions Retry configuration
|
|
178
|
-
* @returns Promise with fetch response
|
|
179
|
-
*/
|
|
180
|
-
async function fetchWithRetry(url, options = {}, retryOptions = API_RETRY_OPTIONS) {
|
|
181
|
-
const result = await withRetry(() => fetch(url, options), retryOptions);
|
|
182
|
-
if (!result.success) {
|
|
183
|
-
throw result.error;
|
|
184
|
-
}
|
|
185
|
-
return result.data;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Health check function with retry for testing connectivity
|
|
190
|
-
* @param url URL to check
|
|
191
|
-
* @param timeout Timeout in milliseconds
|
|
192
|
-
* @returns Promise indicating if the service is reachable
|
|
193
|
-
*/
|
|
194
|
-
async function healthCheck(url, timeout = 5000) {
|
|
195
|
-
const startTime = Date.now();
|
|
196
|
-
try {
|
|
197
|
-
const controller = new AbortController();
|
|
198
|
-
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
199
|
-
const response = await fetch(url, {
|
|
200
|
-
method: 'GET',
|
|
201
|
-
signal: controller.signal,
|
|
202
|
-
headers: {
|
|
203
|
-
'User-Agent': 'OnairosReactNative/HealthCheck'
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
clearTimeout(timeoutId);
|
|
207
|
-
return {
|
|
208
|
-
reachable: true,
|
|
209
|
-
status: response.status,
|
|
210
|
-
duration: Date.now() - startTime
|
|
211
|
-
};
|
|
212
|
-
} catch (error) {
|
|
213
|
-
return {
|
|
214
|
-
reachable: false,
|
|
215
|
-
error: error.message,
|
|
216
|
-
duration: Date.now() - startTime
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=retryHelper.js.map
|
|
1
|
+
'use strict';Object[_0x43f1(0x0)](exports,_0x43f1(0x1),{'value':!![]}),exports[_0x43f1(0x2)]=exports[_0x43f1(0x3)]=exports[_0x43f1(0x4)]=void 0x0,exports[_0x43f1(0x5)]=fetchWithRetry,exports[_0x43f1(0x6)]=healthCheck,exports['withRetry']=withRetry;const DEFAULT_RETRY_OPTIONS=exports[_0x43f1(0x3)]={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1388,'exponentialBackoff':!![],'enableLogging':![],'shouldRetry':(_0x3339c0,_0x1df038)=>{const _0x423712={'itDiX':function(_0xceed6c,_0x30d3e4){return _0xceed6c>=_0x30d3e4;},'kQsGP':function(_0x45aa18,_0x51bb31){return _0x45aa18<_0x51bb31;},'zLLoR':function(_0xa66a0a,_0x14659c){return _0xa66a0a!==_0x14659c;},'GpSjU':function(_0x37562c,_0x345580){return _0x37562c===_0x345580;},'OeErm':'AbortError','CWAHS':_0x43f1(0x7),'VBMLf':_0x43f1(0x8),'knVIj':'timeout','NmZYW':function(_0x32e84c,_0x4363e0){return _0x32e84c>=_0x4363e0;},'caJkR':_0x43f1(0x9),'NCFIK':_0x43f1(0xa),'MFjXq':_0x43f1(0xb),'PIjuS':'Unexpected\x20character'};if(_0x423712[_0x43f1(0xc)](_0x3339c0[_0x43f1(0xd)],0x190)&&_0x423712['kQsGP'](_0x3339c0[_0x43f1(0xd)],0x1f4)&&_0x3339c0[_0x43f1(0xd)]!==0x198&&_0x423712[_0x43f1(0xe)](_0x3339c0['status'],0x1ad))return![];if(_0x423712[_0x43f1(0xf)](_0x3339c0[_0x43f1(0x10)],_0x423712[_0x43f1(0x11)])||_0x3339c0['message'][_0x43f1(0x12)](_0x423712['CWAHS'])||_0x3339c0['message'][_0x43f1(0x12)](_0x43f1(0x13))||_0x3339c0[_0x43f1(0x14)][_0x43f1(0x12)](_0x423712['VBMLf'])||_0x3339c0[_0x43f1(0x14)][_0x43f1(0x12)](_0x423712[_0x43f1(0x15)])||_0x423712[_0x43f1(0x16)](_0x3339c0[_0x43f1(0xd)],0x1f4)){if(_0x423712[_0x43f1(0x17)]!==_0x423712[_0x43f1(0x18)])return!![];else _0x21fb1a[_0x43f1(0x19)]('⏳\x20Waiting\x20'+_0x1c9955+_0x43f1(0x1a)+_0x342807+'/'+(_0x1b3130[_0x43f1(0x1b)]+0x1)+')');}if(_0x3339c0[_0x43f1(0x14)][_0x43f1(0x12)](_0x423712['MFjXq'])||_0x3339c0[_0x43f1(0x14)][_0x43f1(0x12)](_0x423712[_0x43f1(0x1c)]))return!![];return![];}};async function withRetry(_0x25cb98,_0x10ca36={}){const _0x317bca={'nWRSu':function(_0x29af67,_0x27f1e1){return _0x29af67<=_0x27f1e1;},'nGAXe':function(_0x42d637,_0x416aab){return _0x42d637<=_0x416aab;},'lnjSu':_0x43f1(0x1d),'oBwVG':function(_0xb3faec,_0x4c0bb4){return _0xb3faec===_0x4c0bb4;},'uVSRD':function(_0x551586,_0x1bcf5b){return _0x551586>_0x1bcf5b;},'xcXju':function(_0x54369e,_0x153c24){return _0x54369e+_0x153c24;},'svzfR':function(_0x5e3f6d,_0x4f2057){return _0x5e3f6d===_0x4f2057;},'CJIoK':_0x43f1(0x1e),'JADrs':_0x43f1(0x1f),'vDFut':function(_0x4f8ff3,_0x4e7b88){return _0x4f8ff3>_0x4e7b88;},'kXMCy':_0x43f1(0x20),'DkISW':function(_0x320361,_0x1b753e){return _0x320361*_0x1b753e;},'QMoKG':function(_0x37e884,_0x2f390c){return _0x37e884+_0x2f390c;},'BcJdZ':_0x43f1(0x21),'zSdyX':function(_0x3accbd,_0x285c4c){return _0x3accbd-_0x285c4c;}},_0x3e914c={...DEFAULT_RETRY_OPTIONS,..._0x10ca36},_0x4fbed4=Date[_0x43f1(0x22)]();let _0xbde473=null;for(let _0x205383=0x1;_0x317bca[_0x43f1(0x23)](_0x205383,_0x3e914c[_0x43f1(0x1b)]+0x1);_0x205383++){if(_0x43f1(0x24)!==_0x317bca['lnjSu'])try{if(_0x317bca['oBwVG'](_0x43f1(0x25),'HtPyJ'))return!![];else{_0x3e914c['enableLogging']&&_0x317bca[_0x43f1(0x26)](_0x205383,0x1)&&console[_0x43f1(0x19)](_0x43f1(0x27)+_0x205383+'/'+_0x317bca['xcXju'](_0x3e914c['maxRetries'],0x1));const _0x57cbd0=await _0x25cb98();return{'success':!![],'data':_0x57cbd0,'attempts':_0x205383,'totalDuration':Date[_0x43f1(0x22)]()-_0x4fbed4};}}catch(_0x2e0af9){if(_0x317bca['svzfR'](_0x317bca[_0x43f1(0x28)],_0x317bca[_0x43f1(0x29)]))throw _0x2a277c[_0x43f1(0x2a)];else{_0xbde473=_0x2e0af9;const _0x49959f=_0x3e914c[_0x43f1(0x2b)]?_0x3e914c[_0x43f1(0x2b)](_0x2e0af9,_0x205383):!![];if(_0x317bca[_0x43f1(0x2c)](_0x205383,_0x3e914c['maxRetries'])||!_0x49959f){if('AiVPx'===_0x317bca[_0x43f1(0x2d)]){_0x3e914c['enableLogging']&&console[_0x43f1(0x2a)]('❌\x20All\x20retry\x20attempts\x20exhausted\x20or\x20error\x20not\x20retryable:\x20'+_0x2e0af9[_0x43f1(0x14)]);break;}else return!![];}let _0x346c15=_0x3e914c[_0x43f1(0x2e)];if(_0x3e914c[_0x43f1(0x2f)]){if(_0x43f1(0x30)!==_0x43f1(0x30))return _0x317bca[_0x43f1(0x31)](_0x189a6f,0x2);else _0x346c15=Math[_0x43f1(0x32)](_0x317bca[_0x43f1(0x33)](_0x3e914c[_0x43f1(0x2e)],Math[_0x43f1(0x34)](0x2,_0x205383-0x1)),_0x3e914c[_0x43f1(0x35)]);}const _0x4365ba=_0x317bca['DkISW'](_0x317bca[_0x43f1(0x33)](Math[_0x43f1(0x36)](),0.1),_0x346c15);_0x346c15=Math[_0x43f1(0x37)](_0x317bca[_0x43f1(0x38)](_0x346c15,_0x4365ba)),_0x3e914c[_0x43f1(0x39)]&&_0x3e914c[_0x43f1(0x39)](_0x2e0af9,_0x205383,_0x346c15),_0x3e914c['enableLogging']&&console[_0x43f1(0x19)](_0x43f1(0x3a)+_0x346c15+_0x43f1(0x1a)+_0x205383+'/'+_0x317bca[_0x43f1(0x3b)](_0x3e914c[_0x43f1(0x1b)],0x1)+')'),await new Promise(_0x33af10=>setTimeout(()=>_0x33af10(),_0x346c15));}}else return!![];}return{'success':![],'error':_0xbde473||new Error(_0x317bca[_0x43f1(0x3c)]),'attempts':_0x317bca[_0x43f1(0x38)](_0x3e914c[_0x43f1(0x1b)],0x1),'totalDuration':_0x317bca[_0x43f1(0x3d)](Date[_0x43f1(0x22)](),_0x4fbed4)};}const API_RETRY_OPTIONS=exports[_0x43f1(0x4)]={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1388,'exponentialBackoff':!![],'shouldRetry':(_0x43d652,_0xaceeed)=>{const _0x24fed2={'CKjSr':function(_0x20a834,_0x3d0edf){return _0x20a834<_0x3d0edf;},'sUfpk':function(_0x172689,_0x27b817){return _0x172689!==_0x27b817;},'FsAsW':function(_0x4281d2,_0x5d9569){return _0x4281d2===_0x5d9569;},'TjvCz':_0x43f1(0x3e),'QkAZU':_0x43f1(0x7),'OspMl':_0x43f1(0x13),'aaBPq':_0x43f1(0x8),'PCWEq':_0x43f1(0x3f),'QDSNn':_0x43f1(0x40),'BiNLU':function(_0x1dfb49,_0x19b08e){return _0x1dfb49*_0x19b08e;},'byRdF':function(_0x50e3d0,_0x540dbf){return _0x50e3d0-_0x540dbf;},'kOFOM':function(_0x3abbaa,_0x42bd24){return _0x3abbaa===_0x42bd24;},'snuwL':_0x43f1(0x41),'ZCICs':function(_0x23aad8,_0x28771f){return _0x23aad8===_0x28771f;},'WiFrG':function(_0x57db5c,_0x14acee){return _0x57db5c===_0x14acee;},'FVZOA':_0x43f1(0x42),'cfeGG':function(_0x5031f8,_0x285863){return _0x5031f8<=_0x285863;},'AqmIt':function(_0x252491,_0x13b37b){return _0x252491>=_0x13b37b;},'qPzYF':function(_0x5b15eb,_0x381697){return _0x5b15eb===_0x381697;},'HkLeY':_0x43f1(0xb)};if(_0x24fed2[_0x43f1(0x43)](_0x43d652[_0x43f1(0xd)],0x191)||_0x24fed2[_0x43f1(0x43)](_0x43d652[_0x43f1(0xd)],0x193)){if(_0x24fed2['FsAsW'](_0x24fed2['snuwL'],_0x24fed2[_0x43f1(0x44)]))return![];else _0x4b531e[_0x43f1(0x39)](_0x596121,_0x4758b5,_0x22680c);}if(_0x24fed2[_0x43f1(0x45)](_0x43d652[_0x43f1(0xd)],0x190)||_0x24fed2[_0x43f1(0x46)](_0x43d652[_0x43f1(0xd)],0x194)&&!_0x43d652[_0x43f1(0x14)]['includes'](_0x43f1(0x47)))return![];if(_0x24fed2[_0x43f1(0x48)](_0x43d652['status'],0x1ad)){if(_0x24fed2[_0x43f1(0x49)](_0x24fed2[_0x43f1(0x4a)],'OvlIs'))return _0x24fed2[_0x43f1(0x4b)](_0xaceeed,0x2);else{if(_0x475b68[_0x43f1(0xd)]>=0x190&&_0x24fed2[_0x43f1(0x4c)](_0x4d7115[_0x43f1(0xd)],0x1f4)&&_0x24fed2[_0x43f1(0x49)](_0x4f631d['status'],0x198)&&_0x5acdae[_0x43f1(0xd)]!==0x1ad)return![];if(_0x24fed2[_0x43f1(0x48)](_0x15e3e0['name'],_0x24fed2[_0x43f1(0x4d)])||_0x14e021[_0x43f1(0x14)][_0x43f1(0x12)](_0x24fed2['QkAZU'])||_0x41d903[_0x43f1(0x14)][_0x43f1(0x12)](_0x24fed2[_0x43f1(0x4e)])||_0x553a91[_0x43f1(0x14)][_0x43f1(0x12)](_0x24fed2[_0x43f1(0x4f)])||_0x120a1a[_0x43f1(0x14)]['includes'](_0x24fed2[_0x43f1(0x50)])||_0x5d52cb['status']>=0x1f4)return!![];if(_0x7b722b[_0x43f1(0x14)][_0x43f1(0x12)]('JSON\x20Parse\x20error')||_0x349a8b[_0x43f1(0x14)][_0x43f1(0x12)](_0x24fed2[_0x43f1(0x51)]))return!![];return![];}}if(_0x24fed2[_0x43f1(0x52)](_0x43d652[_0x43f1(0xd)],0x1f4))return'KNfzQ'==='KNfzQ'?!![]:![];if(_0x43d652[_0x43f1(0x10)]==='AbortError'||_0x43d652[_0x43f1(0x14)][_0x43f1(0x12)](_0x24fed2['PCWEq'])||_0x43d652['message'][_0x43f1(0x12)](_0x24fed2[_0x43f1(0x53)])||_0x43d652[_0x43f1(0x14)]['includes'](_0x24fed2[_0x43f1(0x4e)])||_0x43d652[_0x43f1(0x14)][_0x43f1(0x12)](_0x43f1(0x8))){if(_0x24fed2[_0x43f1(0x54)](_0x43f1(0x55),_0x43f1(0x56)))_0x3dc9e0=_0x3c9dd4[_0x43f1(0x32)](_0x24fed2['BiNLU'](_0x36d874[_0x43f1(0x2e)],_0x1be74c['pow'](0x2,_0x24fed2[_0x43f1(0x57)](_0x414efd,0x1))),_0x46bb5f['maxDelay']);else return!![];}if(_0x43d652[_0x43f1(0x14)][_0x43f1(0x12)](_0x24fed2['HkLeY'])||_0x43d652['message']['includes'](_0x43f1(0x40))||_0x43d652['message'][_0x43f1(0x12)](_0x43f1(0x58)))return!![];return![];},'onRetry':(_0x582b3f,_0xf719f0,_0x20b437)=>{console[_0x43f1(0x59)](_0x43f1(0x5a)+_0xf719f0+_0x43f1(0x5b)+_0x20b437+'ms:\x20'+_0x582b3f[_0x43f1(0x14)]);}},NETWORK_RETRY_OPTIONS=exports[_0x43f1(0x2)]={'maxRetries':0x2,'baseDelay':0x7d0,'maxDelay':0x1f40,'exponentialBackoff':!![],'shouldRetry':(_0x2de10d,_0x43a7c8)=>{const _0x521ace={'lOfbR':_0x43f1(0x7),'iGAUV':_0x43f1(0x8),'UPjSh':'DNS','PDyxP':function(_0x5adff3,_0x5433fd){return _0x5adff3===_0x5433fd;}};return _0x2de10d[_0x43f1(0x14)][_0x43f1(0x12)](_0x521ace[_0x43f1(0x5c)])||_0x2de10d[_0x43f1(0x14)][_0x43f1(0x12)](_0x521ace['iGAUV'])||_0x2de10d[_0x43f1(0x14)][_0x43f1(0x12)](_0x521ace[_0x43f1(0x5d)])||_0x521ace[_0x43f1(0x5e)](_0x2de10d[_0x43f1(0x10)],'AbortError');}};async function fetchWithRetry(_0x24cd6a,_0x3a69d8={},_0x14c754=API_RETRY_OPTIONS){const _0x340750={'mDyos':function(_0x39b2d9,_0x46ec62,_0x9e4090){return _0x39b2d9(_0x46ec62,_0x9e4090);}},_0x102473=await _0x340750[_0x43f1(0x5f)](withRetry,()=>fetch(_0x24cd6a,_0x3a69d8),_0x14c754);if(!_0x102473[_0x43f1(0x60)])throw _0x102473[_0x43f1(0x2a)];return _0x102473[_0x43f1(0x61)];}async function healthCheck(_0x4236de,_0x30e544=0x1388){const _0x662204={'tiLhk':function(_0x1349e0,_0x3a1c60){return _0x1349e0===_0x3a1c60;},'zYgWO':'sXTtB','NUdvA':function(_0xe4859e,_0x183241,_0x4f8b14){return _0xe4859e(_0x183241,_0x4f8b14);},'KwGaD':'OnairosReactNative/HealthCheck','VXRtS':function(_0x4d2f6a,_0x5ba08c){return _0x4d2f6a(_0x5ba08c);},'KtdEL':function(_0x13c30b,_0x3fc3c9){return _0x13c30b!==_0x3fc3c9;},'IkUrO':_0x43f1(0x62),'yMecj':function(_0x1faee5,_0x45863a){return _0x1faee5-_0x45863a;}},_0x593699=Date['now']();try{if(_0x662204['tiLhk'](_0x662204[_0x43f1(0x63)],_0x43f1(0x64)))return!![];else{const _0x4c152f=new AbortController(),_0x76dda8=setTimeout(()=>_0x4c152f['abort'](),_0x30e544),_0xa1ad2a=await _0x662204[_0x43f1(0x65)](fetch,_0x4236de,{'method':'GET','signal':_0x4c152f[_0x43f1(0x66)],'headers':{'User-Agent':_0x662204[_0x43f1(0x67)]}});return _0x662204['VXRtS'](clearTimeout,_0x76dda8),{'reachable':!![],'status':_0xa1ad2a['status'],'duration':Date[_0x43f1(0x22)]()-_0x593699};}}catch(_0x2b8996){if(_0x662204[_0x43f1(0x68)](_0x662204[_0x43f1(0x69)],_0x43f1(0x6a)))return{'reachable':![],'error':_0x2b8996[_0x43f1(0x14)],'duration':_0x662204[_0x43f1(0x6b)](Date[_0x43f1(0x22)](),_0x593699)};else _0x15e6ce['warn'](_0x43f1(0x5a)+_0x568cfb+_0x43f1(0x5b)+_0x44b4dd+_0x43f1(0x6c)+_0xe558bd['message']);}}function _0x43f1(_0x3e6623,_0x43f1e7){_0x3e6623=_0x3e6623-0x0;const _0x487677=_0x3e66();let _0x109037=_0x487677[_0x3e6623];return _0x109037;}function _0x3e66(){const _0x4e72d7=['defineProperty','__esModule','NETWORK_RETRY_OPTIONS','DEFAULT_RETRY_OPTIONS','API_RETRY_OPTIONS','fetchWithRetry','healthCheck','Network\x20request\x20failed','ENOTFOUND','SHAoa','xtvpr','JSON\x20Parse\x20error','itDiX','status','zLLoR','GpSjU','name','OeErm','includes','fetch','message','knVIj','NmZYW','caJkR','NCFIK','log','ms\x20before\x20retry\x20(attempt\x20','maxRetries','PIjuS','RYNIQ','UQvGi','agdtA','AiVPx','Unknown\x20error','now','nGAXe','WaggI','peZbE','uVSRD','🔄\x20Retry\x20attempt\x20','CJIoK','JADrs','error','shouldRetry','vDFut','kXMCy','baseDelay','exponentialBackoff','GLXHt','nWRSu','min','DkISW','pow','maxDelay','random','floor','xcXju','onRetry','⏳\x20Waiting\x20','QMoKG','BcJdZ','zSdyX','AbortError','timeout','Unexpected\x20character','UAIkl','rfzLi','kOFOM','snuwL','ZCICs','WiFrG','validation\x20endpoint','FsAsW','sUfpk','FVZOA','cfeGG','CKjSr','TjvCz','OspMl','aaBPq','PCWEq','QDSNn','AqmIt','QkAZU','qPzYF','yAndZ','aRNZk','byRdF','HTML\x20page\x20instead\x20of\x20JSON','warn','⚠️\x20API\x20call\x20failed\x20(attempt\x20','),\x20retrying\x20in\x20','lOfbR','UPjSh','PDyxP','mDyos','success','data','CxrUJ','zYgWO','jRIQt','NUdvA','signal','KwGaD','KtdEL','IkUrO','GeOHa','yMecj','ms:\x20'];_0x3e66=function(){return _0x4e72d7;};return _0x3e66();}
|
|
@@ -1,349 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
// JWT token storage key
|
|
12
|
-
const JWT_TOKEN_KEY = 'onairos_jwt_token';
|
|
13
|
-
|
|
14
|
-
// Define OnairosCredentials interface locally to avoid circular dependencies
|
|
15
|
-
|
|
16
|
-
// Create a mock storage for environments without Keychain access (like Expo Go)
|
|
17
|
-
const mockStorage = {};
|
|
18
|
-
|
|
19
|
-
// Try to import Keychain, but provide fallbacks if not available
|
|
20
|
-
let Keychain = null;
|
|
21
|
-
try {
|
|
22
|
-
// This import might fail in Expo Go or environments without native modules
|
|
23
|
-
Keychain = require('react-native-keychain');
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.warn('react-native-keychain module not available, using mock storage');
|
|
26
|
-
// Create minimal mock implementation
|
|
27
|
-
Keychain = {
|
|
28
|
-
ACCESS_CONTROL: {
|
|
29
|
-
BIOMETRY_ANY_OR_DEVICE_PASSCODE: 'mock'
|
|
30
|
-
},
|
|
31
|
-
ACCESSIBLE: {
|
|
32
|
-
WHEN_UNLOCKED: 'mock'
|
|
33
|
-
},
|
|
34
|
-
getGenericPassword: async () => null,
|
|
35
|
-
setGenericPassword: async () => true,
|
|
36
|
-
resetGenericPassword: async () => true
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Check if Keychain is properly initialized and available
|
|
41
|
-
const isKeychainAvailable = () => {
|
|
42
|
-
try {
|
|
43
|
-
return Keychain && typeof Keychain.getGenericPassword === 'function';
|
|
44
|
-
} catch (e) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// Wrapper for getGenericPassword that falls back to mock storage
|
|
50
|
-
const safeGetGenericPassword = async options => {
|
|
51
|
-
try {
|
|
52
|
-
if (isKeychainAvailable()) {
|
|
53
|
-
return await Keychain.getGenericPassword(options);
|
|
54
|
-
} else {
|
|
55
|
-
// Fall back to mock storage in memory
|
|
56
|
-
const key = (options === null || options === void 0 ? void 0 : options.service) || 'default';
|
|
57
|
-
return mockStorage[key] || null;
|
|
58
|
-
}
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.warn('Keychain access failed, using mock storage', error);
|
|
61
|
-
// Fall back to mock storage on error
|
|
62
|
-
const key = (options === null || options === void 0 ? void 0 : options.service) || 'default';
|
|
63
|
-
return mockStorage[key] || null;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Wrapper for setGenericPassword that falls back to mock storage
|
|
68
|
-
const safeSetGenericPassword = async (username, password, options) => {
|
|
69
|
-
try {
|
|
70
|
-
if (isKeychainAvailable()) {
|
|
71
|
-
return await Keychain.setGenericPassword(username, password, options);
|
|
72
|
-
} else {
|
|
73
|
-
// Fall back to mock storage in memory
|
|
74
|
-
const key = (options === null || options === void 0 ? void 0 : options.service) || 'default';
|
|
75
|
-
mockStorage[key] = {
|
|
76
|
-
username,
|
|
77
|
-
password
|
|
78
|
-
};
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.warn('Keychain access failed, using mock storage', error);
|
|
83
|
-
// Fall back to mock storage on error
|
|
84
|
-
const key = (options === null || options === void 0 ? void 0 : options.service) || 'default';
|
|
85
|
-
mockStorage[key] = {
|
|
86
|
-
username,
|
|
87
|
-
password
|
|
88
|
-
};
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// Wrapper for resetGenericPassword that falls back to mock storage
|
|
94
|
-
const safeResetGenericPassword = async options => {
|
|
95
|
-
try {
|
|
96
|
-
if (isKeychainAvailable()) {
|
|
97
|
-
return await Keychain.resetGenericPassword(options);
|
|
98
|
-
} else {
|
|
99
|
-
// Fall back to mock storage in memory
|
|
100
|
-
const key = (options === null || options === void 0 ? void 0 : options.service) || 'default';
|
|
101
|
-
delete mockStorage[key];
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
} catch (error) {
|
|
105
|
-
console.warn('Keychain access failed, using mock storage', error);
|
|
106
|
-
// Fall back to mock storage on error
|
|
107
|
-
const key = (options === null || options === void 0 ? void 0 : options.service) || 'default';
|
|
108
|
-
delete mockStorage[key];
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Store credentials in memory (temporary solution)
|
|
115
|
-
*/
|
|
116
|
-
const storeCredentials = async credentials => {
|
|
117
|
-
try {
|
|
118
|
-
const existingCredentials = await getCredentials();
|
|
119
|
-
const updatedCredentials = {
|
|
120
|
-
...existingCredentials,
|
|
121
|
-
...credentials,
|
|
122
|
-
createdAt: (existingCredentials === null || existingCredentials === void 0 ? void 0 : existingCredentials.createdAt) || Date.now()
|
|
123
|
-
};
|
|
124
|
-
const username = updatedCredentials.username;
|
|
125
|
-
if (!username) {
|
|
126
|
-
throw new Error('Username is required for storing credentials');
|
|
127
|
-
}
|
|
128
|
-
const options = {
|
|
129
|
-
service: _constants.STORAGE_KEYS.credentials
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// Only use secure storage options on real devices
|
|
133
|
-
if (_reactNative.Platform.OS !== 'web' && isKeychainAvailable()) {
|
|
134
|
-
options.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE;
|
|
135
|
-
options.accessible = Keychain.ACCESSIBLE.WHEN_UNLOCKED;
|
|
136
|
-
}
|
|
137
|
-
await safeSetGenericPassword(username, JSON.stringify(updatedCredentials), options);
|
|
138
|
-
return true;
|
|
139
|
-
} catch (error) {
|
|
140
|
-
console.error('Error storing credentials:', error);
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Retrieve credentials from memory (temporary solution)
|
|
147
|
-
*/
|
|
148
|
-
exports.storeCredentials = storeCredentials;
|
|
149
|
-
const getCredentials = async () => {
|
|
150
|
-
try {
|
|
151
|
-
const credentials = await safeGetGenericPassword({
|
|
152
|
-
service: _constants.STORAGE_KEYS.credentials
|
|
153
|
-
});
|
|
154
|
-
if (credentials) {
|
|
155
|
-
return JSON.parse(credentials.password);
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
158
|
-
} catch (error) {
|
|
159
|
-
console.error('Error getting credentials:', error);
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Check if the user has stored credentials
|
|
166
|
-
*/
|
|
167
|
-
exports.getCredentials = getCredentials;
|
|
168
|
-
const hasCredentials = async () => {
|
|
169
|
-
try {
|
|
170
|
-
const credentials = await safeGetGenericPassword({
|
|
171
|
-
service: _constants.STORAGE_KEYS.credentials
|
|
172
|
-
});
|
|
173
|
-
return !!credentials;
|
|
174
|
-
} catch (error) {
|
|
175
|
-
console.error('Error checking credentials:', error);
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Delete stored credentials
|
|
182
|
-
*/
|
|
183
|
-
exports.hasCredentials = hasCredentials;
|
|
184
|
-
const deleteCredentials = async () => {
|
|
185
|
-
try {
|
|
186
|
-
await safeResetGenericPassword({
|
|
187
|
-
service: _constants.STORAGE_KEYS.credentials
|
|
188
|
-
});
|
|
189
|
-
return true;
|
|
190
|
-
} catch (error) {
|
|
191
|
-
console.error('Error deleting credentials:', error);
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Update specific fields in the stored credentials
|
|
198
|
-
*/
|
|
199
|
-
exports.deleteCredentials = deleteCredentials;
|
|
200
|
-
const updateCredentials = async credentials => {
|
|
201
|
-
return storeCredentials(credentials);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Generate a device-specific unique username
|
|
206
|
-
*/
|
|
207
|
-
exports.updateCredentials = updateCredentials;
|
|
208
|
-
const generateDeviceUsername = () => {
|
|
209
|
-
const randomId = Math.random().toString(36).substring(2, 10);
|
|
210
|
-
return `dev_${randomId}`;
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Verify credentials (temporary mock implementation)
|
|
215
|
-
*/
|
|
216
|
-
exports.generateDeviceUsername = generateDeviceUsername;
|
|
217
|
-
const verifyCredentials = async username => {
|
|
218
|
-
try {
|
|
219
|
-
// For Expo Go or development, always return true
|
|
220
|
-
if (!isKeychainAvailable()) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// TODO: Implement actual verification with API
|
|
225
|
-
return true;
|
|
226
|
-
} catch (error) {
|
|
227
|
-
console.error('Error verifying credentials:', error);
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* JWT Token Storage Functions
|
|
234
|
-
* These functions handle JWT tokens from email verification
|
|
235
|
-
*
|
|
236
|
-
* Note: Main JWT token management is handled in apiKeyService.ts
|
|
237
|
-
* These are utility functions for backwards compatibility
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Retrieve JWT token
|
|
242
|
-
* @returns JWT token or null if not found
|
|
243
|
-
*/
|
|
244
|
-
exports.verifyCredentials = verifyCredentials;
|
|
245
|
-
const getJWT = async () => {
|
|
246
|
-
try {
|
|
247
|
-
const token = await _asyncStorage.default.getItem(JWT_TOKEN_KEY);
|
|
248
|
-
return token;
|
|
249
|
-
} catch (error) {
|
|
250
|
-
console.error('❌ Failed to retrieve JWT token:', error);
|
|
251
|
-
return null;
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Check if JWT token exists
|
|
257
|
-
* @returns True if JWT token exists
|
|
258
|
-
*/
|
|
259
|
-
exports.getJWT = getJWT;
|
|
260
|
-
const hasJWT = async () => {
|
|
261
|
-
try {
|
|
262
|
-
const token = await _asyncStorage.default.getItem(JWT_TOKEN_KEY);
|
|
263
|
-
return !!token;
|
|
264
|
-
} catch (error) {
|
|
265
|
-
console.error('❌ Failed to check JWT token:', error);
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Clear JWT token
|
|
272
|
-
*/
|
|
273
|
-
exports.hasJWT = hasJWT;
|
|
274
|
-
const clearJWT = async () => {
|
|
275
|
-
try {
|
|
276
|
-
await _asyncStorage.default.removeItem(JWT_TOKEN_KEY);
|
|
277
|
-
console.log('🗑️ JWT token cleared');
|
|
278
|
-
return true;
|
|
279
|
-
} catch (error) {
|
|
280
|
-
console.error('❌ Failed to clear JWT token:', error);
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Simple base64 decoder for React Native
|
|
287
|
-
*/
|
|
288
|
-
exports.clearJWT = clearJWT;
|
|
289
|
-
const base64Decode = str => {
|
|
290
|
-
// Add padding if needed
|
|
291
|
-
while (str.length % 4) {
|
|
292
|
-
str += '=';
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Simple base64 decoding
|
|
296
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
297
|
-
let result = '';
|
|
298
|
-
for (let i = 0; i < str.length; i += 4) {
|
|
299
|
-
const a = chars.indexOf(str.charAt(i));
|
|
300
|
-
const b = chars.indexOf(str.charAt(i + 1));
|
|
301
|
-
const c = chars.indexOf(str.charAt(i + 2));
|
|
302
|
-
const d = chars.indexOf(str.charAt(i + 3));
|
|
303
|
-
const bitmap = a << 18 | b << 12 | c << 6 | d;
|
|
304
|
-
result += String.fromCharCode(bitmap >> 16 & 255);
|
|
305
|
-
if (c !== 64) result += String.fromCharCode(bitmap >> 8 & 255);
|
|
306
|
-
if (d !== 64) result += String.fromCharCode(bitmap & 255);
|
|
307
|
-
}
|
|
308
|
-
return result;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Get JWT token payload (decoded)
|
|
313
|
-
* @returns Decoded JWT payload or null if invalid
|
|
314
|
-
*/
|
|
315
|
-
const getJWTPayload = async () => {
|
|
316
|
-
try {
|
|
317
|
-
const token = await getJWT();
|
|
318
|
-
if (!token) return null;
|
|
319
|
-
|
|
320
|
-
// Decode JWT payload (middle part of token)
|
|
321
|
-
const parts = token.split('.');
|
|
322
|
-
if (parts.length !== 3) return null;
|
|
323
|
-
const decodedPayload = base64Decode(parts[1]);
|
|
324
|
-
const payload = JSON.parse(decodedPayload);
|
|
325
|
-
return payload;
|
|
326
|
-
} catch (error) {
|
|
327
|
-
console.error('❌ Failed to decode JWT payload:', error);
|
|
328
|
-
return null;
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Check if JWT token is expired
|
|
334
|
-
* @returns True if token is expired or invalid
|
|
335
|
-
*/
|
|
336
|
-
exports.getJWTPayload = getJWTPayload;
|
|
337
|
-
const isJWTExpired = async () => {
|
|
338
|
-
try {
|
|
339
|
-
const payload = await getJWTPayload();
|
|
340
|
-
if (!payload || !payload.exp) return true;
|
|
341
|
-
const currentTime = Math.floor(Date.now() / 1000);
|
|
342
|
-
return payload.exp < currentTime;
|
|
343
|
-
} catch (error) {
|
|
344
|
-
console.error('❌ Failed to check JWT expiration:', error);
|
|
345
|
-
return true;
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
exports.isJWTExpired = isJWTExpired;
|
|
349
|
-
//# sourceMappingURL=secureStorage.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
// Onairos SDK - Asset Registry (auto-generated)
|
|
3
|
+
var __ONAIROS_REQ_REGISTRY__ = [
|
|
4
|
+
require("react-native"),
|
|
5
|
+
require("../constants"),
|
|
6
|
+
require("@react-native-async-storage/async-storage"),
|
|
7
|
+
require('react-native-keychain')
|
|
8
|
+
];
|
|
9
|
+
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
10
|
+
Object[_0x4fb5(0x0)](exports,_0x4fb5(0x1),{'value':!![]}),exports[_0x4fb5(0x2)]=exports[_0x4fb5(0x3)]=exports[_0x4fb5(0x4)]=exports['isJWTExpired']=exports[_0x4fb5(0x5)]=exports['hasCredentials']=exports[_0x4fb5(0x6)]=exports['getJWT']=exports[_0x4fb5(0x7)]=exports[_0x4fb5(0x8)]=exports[_0x4fb5(0x9)]=exports[_0x4fb5(0xa)]=void 0x0;var _reactNative=__ONAIROS_REQ_FUNC__(0x0),_constants=__ONAIROS_REQ_FUNC__(0x1),_asyncStorage=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x2));function _interopRequireDefault(_0x24b4ac){return _0x24b4ac&&_0x24b4ac[_0x4fb5(0x1)]?_0x24b4ac:{'default':_0x24b4ac};}const JWT_TOKEN_KEY=_0x4fb5(0xb),mockStorage={};let Keychain=null;try{Keychain=__ONAIROS_REQ_FUNC__(0x3);}catch(_0x471ded){console[_0x4fb5(0xc)]('react-native-keychain module not available, using mock storage'),Keychain={'ACCESS_CONTROL':{'BIOMETRY_ANY_OR_DEVICE_PASSCODE':'mock'},'ACCESSIBLE':{'WHEN_UNLOCKED':_0x4fb5(0xd)},'getGenericPassword':async()=>null,'setGenericPassword':async()=>!![],'resetGenericPassword':async()=>!![]};}const isKeychainAvailable=()=>{try{return Keychain&&typeof Keychain['getGenericPassword']==='function';}catch(_0x4653b0){return![];}},safeGetGenericPassword=async _0x5e3794=>{const _0x5e764c={'JDxLK':_0x4fb5(0xe),'xxXGn':function(_0x2971bd,_0x5f1ae2){return _0x2971bd<_0x5f1ae2;},'pNMFr':function(_0xef33f8,_0x589516){return _0xef33f8+_0x589516;},'JbkHO':function(_0xad4374,_0x54923d){return _0xad4374|_0x54923d;},'JUnCY':function(_0x1c3dc0,_0x50caf7){return _0x1c3dc0|_0x50caf7;},'HNwRZ':function(_0x2577de,_0x1338c0){return _0x2577de<<_0x1338c0;},'YOjYs':function(_0x4ebe32,_0x1e78a3){return _0x4ebe32&_0x1e78a3;},'BWQwN':function(_0x2308f6,_0x331bc7){return _0x2308f6>>_0x331bc7;},'Tfjox':function(_0x409644,_0x46e5c0){return _0x409644!==_0x46e5c0;},'FIKCh':function(_0x4ff86f,_0x2d9a07){return _0x4ff86f&_0x2d9a07;},'ceyFG':function(_0x1baec0,_0x2a8c2b){return _0x1baec0>>_0x2a8c2b;},'PsuDK':function(_0x3c22b5,_0x4759f6){return _0x3c22b5!==_0x4759f6;},'fMNgx':function(_0x69c5c9,_0x54d831){return _0x69c5c9&_0x54d831;},'dnxxT':function(_0x599a35,_0x2b470f){return _0x599a35===_0x2b470f;},'BjGfM':'function','wCPra':function(_0x176e2c){return _0x176e2c();},'bQTeM':function(_0x3db607,_0x413a80){return _0x3db607===_0x413a80;},'iMurP':_0x4fb5(0xf),'Sphcs':function(_0x183f9c,_0x235ee1){return _0x183f9c===_0x235ee1;},'NjpAO':'default','BPvZY':function(_0x3386c4,_0x3c37c7){return _0x3386c4!==_0x3c37c7;},'NLqWw':_0x4fb5(0x10),'RpjZs':_0x4fb5(0x11)};try{if(_0x5e764c[_0x4fb5(0x12)](isKeychainAvailable))return await Keychain['getGenericPassword'](_0x5e3794);else{if(_0x5e764c[_0x4fb5(0x13)](_0x5e764c[_0x4fb5(0x14)],_0x4fb5(0xf))){const _0x4fd990=(_0x5e764c[_0x4fb5(0x15)](_0x5e3794,null)||_0x5e764c[_0x4fb5(0x13)](_0x5e3794,void 0x0)?void 0x0:_0x5e3794['service'])||_0x5e764c[_0x4fb5(0x16)];return mockStorage[_0x4fd990]||null;}else{while(_0x2f913f[_0x4fb5(0x17)]%0x4){_0x5e7949+='=';}const _0x2059d9=_0x5e764c[_0x4fb5(0x18)];let _0x4e495c='';for(let _0x39a650=0x0;_0x5e764c[_0x4fb5(0x19)](_0x39a650,_0x29e523[_0x4fb5(0x17)]);_0x39a650+=0x4){const _0x44a1d2=_0x2059d9[_0x4fb5(0x1a)](_0x217282[_0x4fb5(0x1b)](_0x39a650)),_0x2cd53d=_0x2059d9['indexOf'](_0x4ec37a['charAt'](_0x39a650+0x1)),_0x4b2416=_0x2059d9['indexOf'](_0x8ccdc7[_0x4fb5(0x1b)](_0x5e764c['pNMFr'](_0x39a650,0x2))),_0x20c242=_0x2059d9[_0x4fb5(0x1a)](_0x5184fb[_0x4fb5(0x1b)](_0x39a650+0x3)),_0x1baea0=_0x5e764c['JbkHO'](_0x5e764c['JUnCY'](_0x44a1d2<<0x12,_0x5e764c[_0x4fb5(0x1c)](_0x2cd53d,0xc)),_0x5e764c[_0x4fb5(0x1c)](_0x4b2416,0x6))|_0x20c242;_0x4e495c+=_0x1fc409[_0x4fb5(0x1d)](_0x5e764c['YOjYs'](_0x5e764c[_0x4fb5(0x1e)](_0x1baea0,0x10),0xff));if(_0x5e764c[_0x4fb5(0x1f)](_0x4b2416,0x40))_0x4e495c+=_0x5d884e[_0x4fb5(0x1d)](_0x5e764c[_0x4fb5(0x20)](_0x5e764c[_0x4fb5(0x21)](_0x1baea0,0x8),0xff));if(_0x5e764c[_0x4fb5(0x22)](_0x20c242,0x40))_0x4e495c+=_0x165b40['fromCharCode'](_0x5e764c[_0x4fb5(0x23)](_0x1baea0,0xff));}return _0x4e495c;}}}catch(_0x30f003){if(_0x5e764c[_0x4fb5(0x24)](_0x5e764c[_0x4fb5(0x25)],_0x4fb5(0x26))){console['warn'](_0x5e764c[_0x4fb5(0x27)],_0x30f003);const _0x30af8e=(_0x5e3794===null||_0x5e3794===void 0x0?void 0x0:_0x5e3794[_0x4fb5(0x28)])||_0x5e764c[_0x4fb5(0x16)];return mockStorage[_0x30af8e]||null;}else return Keychain&&_0x5e764c['dnxxT'](typeof Keychain[_0x4fb5(0x29)],_0x5e764c['BjGfM']);}},safeSetGenericPassword=async(_0x266ada,_0x2ba083,_0x15fd8e)=>{const _0x1de988={'VHTIS':function(_0x2adba7){return _0x2adba7();},'XRNqy':function(_0x4ed460,_0x5de80e){return _0x4ed460===_0x5de80e;},'PtUUC':'default','EwZcf':_0x4fb5(0x11),'HiKfH':function(_0x3fa842,_0x53c80a){return _0x3fa842===_0x53c80a;},'MDKvL':function(_0x204941,_0x38a2ee){return _0x204941===_0x38a2ee;}};try{if(_0x1de988[_0x4fb5(0x2a)](isKeychainAvailable))return await Keychain[_0x4fb5(0x2b)](_0x266ada,_0x2ba083,_0x15fd8e);else{const _0x55f1fe=(_0x1de988[_0x4fb5(0x2c)](_0x15fd8e,null)||_0x1de988[_0x4fb5(0x2c)](_0x15fd8e,void 0x0)?void 0x0:_0x15fd8e[_0x4fb5(0x28)])||_0x1de988[_0x4fb5(0x2d)];return mockStorage[_0x55f1fe]={'username':_0x266ada,'password':_0x2ba083},!![];}}catch(_0x29dad6){console[_0x4fb5(0xc)](_0x1de988['EwZcf'],_0x29dad6);const _0x30badd=(_0x1de988[_0x4fb5(0x2e)](_0x15fd8e,null)||_0x1de988[_0x4fb5(0x2f)](_0x15fd8e,void 0x0)?void 0x0:_0x15fd8e['service'])||_0x1de988[_0x4fb5(0x2d)];return mockStorage[_0x30badd]={'username':_0x266ada,'password':_0x2ba083},!![];}},safeResetGenericPassword=async _0x294500=>{const _0x3aac8d={'CpVAW':function(_0x28c4f8,_0x31feaf){return _0x28c4f8===_0x31feaf;},'UbMjL':_0x4fb5(0x30),'jCaUz':_0x4fb5(0x31),'MDdwv':_0x4fb5(0x32),'LyrZL':_0x4fb5(0x11)};try{if(isKeychainAvailable())return await Keychain[_0x4fb5(0x33)](_0x294500);else{if(_0x3aac8d[_0x4fb5(0x34)](_0x3aac8d[_0x4fb5(0x35)],_0x3aac8d[_0x4fb5(0x36)]))return _0x2749ed&&_0x1c7245[_0x4fb5(0x1)]?_0x37a26a:{'default':_0x561ccf};else{const _0x57f321=(_0x294500===null||_0x294500===void 0x0?void 0x0:_0x294500[_0x4fb5(0x28)])||_0x3aac8d[_0x4fb5(0x37)];return delete mockStorage[_0x57f321],!![];}}}catch(_0x4aa8e5){console[_0x4fb5(0xc)](_0x3aac8d[_0x4fb5(0x38)],_0x4aa8e5);const _0x12b1ec=(_0x3aac8d[_0x4fb5(0x34)](_0x294500,null)||_0x3aac8d['CpVAW'](_0x294500,void 0x0)?void 0x0:_0x294500[_0x4fb5(0x28)])||_0x4fb5(0x32);return delete mockStorage[_0x12b1ec],!![];}},storeCredentials=async _0xb289a9=>{const _0x1a19c8={'ucAiX':function(_0x5c7a7e,_0x35d607){return _0x5c7a7e===_0x35d607;},'gTLmY':function(_0x3d9ab7){return _0x3d9ab7();},'QpODd':function(_0x23374c,_0x2e662e){return _0x23374c===_0x2e662e;},'trfJB':function(_0xfbef8f,_0x168124){return _0xfbef8f===_0x168124;},'bPIlb':_0x4fb5(0x39),'AIApk':function(_0x9eca59,_0x414601){return _0x9eca59!==_0x414601;},'QDDcy':_0x4fb5(0x3a),'qbdbg':function(_0x43cf6b){return _0x43cf6b();},'vhoCq':function(_0x219af2,_0x6d8a73,_0x38e055,_0x45f42e){return _0x219af2(_0x6d8a73,_0x38e055,_0x45f42e);},'NiYjL':_0x4fb5(0x3b)};try{const _0x70ba55=await _0x1a19c8['gTLmY'](getCredentials),_0x1003b2={..._0x70ba55,..._0xb289a9,'createdAt':(_0x1a19c8['QpODd'](_0x70ba55,null)||_0x1a19c8[_0x4fb5(0x3c)](_0x70ba55,void 0x0)?void 0x0:_0x70ba55['createdAt'])||Date[_0x4fb5(0x3d)]()},_0x98008e=_0x1003b2[_0x4fb5(0x3e)];if(!_0x98008e){if(_0x1a19c8[_0x4fb5(0x3f)](_0x1a19c8[_0x4fb5(0x40)],'DIlfs'))throw new Error('Username\x20is\x20required\x20for\x20storing\x20credentials');else try{return Keychain&&_0x1a19c8[_0x4fb5(0x41)](typeof Keychain['getGenericPassword'],_0x4fb5(0x42));}catch(_0x68dfdb){return![];}}const _0x565d74={'service':_constants[_0x4fb5(0x43)][_0x4fb5(0x44)]};return _0x1a19c8[_0x4fb5(0x45)](_reactNative[_0x4fb5(0x46)]['OS'],_0x1a19c8[_0x4fb5(0x47)])&&_0x1a19c8[_0x4fb5(0x48)](isKeychainAvailable)&&(_0x565d74[_0x4fb5(0x49)]=Keychain['ACCESS_CONTROL'][_0x4fb5(0x4a)],_0x565d74[_0x4fb5(0x4b)]=Keychain[_0x4fb5(0x4c)][_0x4fb5(0x4d)]),await _0x1a19c8[_0x4fb5(0x4e)](safeSetGenericPassword,_0x98008e,JSON[_0x4fb5(0x4f)](_0x1003b2),_0x565d74),!![];}catch(_0x1a1b7d){return console[_0x4fb5(0x50)](_0x1a19c8[_0x4fb5(0x51)],_0x1a1b7d),![];}};exports['storeCredentials']=storeCredentials;const getCredentials=async()=>{const _0x1a3afe={'GLyVU':_0x4fb5(0x52),'RoyDy':function(_0x7fd61c,_0x1e5c16){return _0x7fd61c===_0x1e5c16;},'WhGSk':'pfbwx','ecxTG':'ZnGvk','lIeed':function(_0x10f7c4,_0x250193){return _0x10f7c4(_0x250193);},'wQTyM':_0x4fb5(0x53)};try{if(_0x1a3afe['RoyDy'](_0x1a3afe['WhGSk'],_0x1a3afe[_0x4fb5(0x54)]))return _0xe7cf0a[_0x4fb5(0x50)](_0x1a3afe['GLyVU'],_0x2b296d),null;else{const _0x494561=await _0x1a3afe[_0x4fb5(0x55)](safeGetGenericPassword,{'service':_constants['STORAGE_KEYS'][_0x4fb5(0x44)]});if(_0x494561)return JSON[_0x4fb5(0x56)](_0x494561['password']);return null;}}catch(_0x48a856){return console['error'](_0x1a3afe['wQTyM'],_0x48a856),null;}};exports[_0x4fb5(0x7)]=getCredentials;const hasCredentials=async()=>{const _0x4f2860={'PabiN':function(_0x3d8547,_0xc99050){return _0x3d8547(_0xc99050);},'LhSLw':_0x4fb5(0x3b),'xoDcv':function(_0x555341,_0x314146){return _0x555341!==_0x314146;},'WyXPl':_0x4fb5(0x57),'qYtgq':_0x4fb5(0x58),'YtRCk':_0x4fb5(0x59)};try{if(_0x4f2860[_0x4fb5(0x5a)](_0x4fb5(0x5b),_0x4f2860[_0x4fb5(0x5c)])){const _0x11dbfc=await _0x4f2860[_0x4fb5(0x5d)](safeGetGenericPassword,{'service':_constants[_0x4fb5(0x43)][_0x4fb5(0x44)]});return!!_0x11dbfc;}else return _0x4f2860[_0x4fb5(0x5d)](_0x36d31b,_0x47121d);}catch(_0x192579){return _0x4f2860[_0x4fb5(0x5a)](_0x4f2860['qYtgq'],_0x4f2860[_0x4fb5(0x5e)])?(_0xb85848['error'](_0x4f2860[_0x4fb5(0x5f)],_0x298b4f),![]):(console[_0x4fb5(0x50)](_0x4f2860[_0x4fb5(0x60)],_0x192579),![]);}};exports['hasCredentials']=hasCredentials;function _0x4fb5(_0x3cf120,_0x4fb59b){_0x3cf120=_0x3cf120-0x0;const _0x452eaf=_0x3cf1();let _0x1e46f5=_0x452eaf[_0x3cf120];return _0x1e46f5;}const deleteCredentials=async()=>{const _0x481820={'eIInm':function(_0x36ea39){return _0x36ea39();},'PQPFG':_0x4fb5(0x61),'QOOnm':function(_0x1e401b,_0x17a8ac){return _0x1e401b(_0x17a8ac);},'chNgA':_0x4fb5(0x62)};try{if(_0x4fb5(0x63)!==_0x481820[_0x4fb5(0x64)])return await _0x481820[_0x4fb5(0x65)](safeResetGenericPassword,{'service':_constants[_0x4fb5(0x43)]['credentials']}),!![];else{if(!_0x481820[_0x4fb5(0x66)](_0x4b8c91))return!![];return!![];}}catch(_0x6f45cd){return console[_0x4fb5(0x50)](_0x481820[_0x4fb5(0x67)],_0x6f45cd),![];}};exports[_0x4fb5(0x9)]=deleteCredentials;const updateCredentials=async _0x3f55b2=>{const _0x25db50={'MCfAi':function(_0x2a9249,_0x791c40){return _0x2a9249(_0x791c40);}};return _0x25db50['MCfAi'](storeCredentials,_0x3f55b2);};exports[_0x4fb5(0x3)]=updateCredentials;const generateDeviceUsername=()=>{const _0x4af485=Math['random']()[_0x4fb5(0x68)](0x24)[_0x4fb5(0x69)](0x2,0xa);return _0x4fb5(0x6a)+_0x4af485;};exports[_0x4fb5(0x8)]=generateDeviceUsername;const verifyCredentials=async _0x1cd465=>{const _0x3766cd={'gXMJZ':_0x4fb5(0x6b)};try{if(!isKeychainAvailable())return!![];return!![];}catch(_0x581499){return console[_0x4fb5(0x50)](_0x3766cd[_0x4fb5(0x6c)],_0x581499),![];}};exports[_0x4fb5(0x2)]=verifyCredentials;const getJWT=async()=>{const _0x421ee0={'axnMW':_0x4fb5(0x53),'NYgYl':function(_0x21f700,_0x2bb48d){return _0x21f700!==_0x2bb48d;},'TjNZW':_0x4fb5(0x6d),'Hiwbj':_0x4fb5(0x6e),'tTeBk':'❌\x20Failed\x20to\x20retrieve\x20JWT\x20token:'};try{if(_0x421ee0[_0x4fb5(0x6f)](_0x421ee0[_0x4fb5(0x70)],_0x421ee0['Hiwbj'])){const _0x4aa6a1=await _asyncStorage[_0x4fb5(0x32)][_0x4fb5(0x71)](JWT_TOKEN_KEY);return _0x4aa6a1;}else return _0x13f02f[_0x4fb5(0x50)](_0x421ee0[_0x4fb5(0x72)],_0x4f5e0a),null;}catch(_0x53c607){return console[_0x4fb5(0x50)](_0x421ee0[_0x4fb5(0x73)],_0x53c607),null;}};exports[_0x4fb5(0x74)]=getJWT;const hasJWT=async()=>{const _0x5a3d55={'vVBPM':function(_0x25f30e,_0xe45210){return _0x25f30e===_0xe45210;},'dLaTd':'default','cPhNm':function(_0x58656f,_0x3f97c1){return _0x58656f!==_0x3f97c1;},'PrjOS':'qilYo','mUYPI':_0x4fb5(0x75),'sqIQg':_0x4fb5(0x76)};try{const _0xde4f22=await _asyncStorage[_0x4fb5(0x32)][_0x4fb5(0x71)](JWT_TOKEN_KEY);return!!_0xde4f22;}catch(_0x5f0b8e){if(_0x5a3d55[_0x4fb5(0x77)](_0x5a3d55[_0x4fb5(0x78)],_0x5a3d55[_0x4fb5(0x79)]))return console[_0x4fb5(0x50)](_0x5a3d55[_0x4fb5(0x7a)],_0x5f0b8e),![];else{const _0x1ef422=(_0x5a3d55[_0x4fb5(0x7b)](_0x574325,null)||_0x5a3d55[_0x4fb5(0x7b)](_0x1637f1,void 0x0)?void 0x0:_0x22f28d[_0x4fb5(0x28)])||_0x5a3d55[_0x4fb5(0x7c)];return _0x4d50bc[_0x1ef422]={'username':_0x4fc14b,'password':_0xca4eee},!![];}}};exports[_0x4fb5(0x5)]=hasJWT;const clearJWT=async()=>{const _0x4a71b2={'XoOmU':function(_0x5e17dc,_0x202903){return _0x5e17dc===_0x202903;},'yQwbE':_0x4fb5(0x7d),'twwEI':'MOMkO','Ouqbb':_0x4fb5(0x7e)};try{return await _asyncStorage[_0x4fb5(0x32)][_0x4fb5(0x7f)](JWT_TOKEN_KEY),console['log'](_0x4fb5(0x80)),!![];}catch(_0x5d6e7e){if(_0x4a71b2[_0x4fb5(0x81)](_0x4a71b2[_0x4fb5(0x82)],_0x4a71b2[_0x4fb5(0x83)]))_0x53fcaa+='=';else return console[_0x4fb5(0x50)](_0x4a71b2['Ouqbb'],_0x5d6e7e),![];}};exports[_0x4fb5(0xa)]=clearJWT;const base64Decode=_0x2003ed=>{const _0x282e55={'FuWaO':function(_0x4ae7df,_0x462344){return _0x4ae7df%_0x462344;},'iCqxV':_0x4fb5(0xe),'guRPJ':function(_0x7c5f4b,_0x4b5306){return _0x7c5f4b<_0x4b5306;},'Kxyen':function(_0x42e970,_0x4dea35){return _0x42e970===_0x4dea35;},'vlyiA':_0x4fb5(0x84),'XsuGJ':_0x4fb5(0x85),'lxjXU':function(_0x517f71,_0x21fa90){return _0x517f71+_0x21fa90;},'HaTSh':function(_0x4a30a3,_0x31d19c){return _0x4a30a3+_0x31d19c;},'Rduwr':function(_0x888a3c,_0xa4925d){return _0x888a3c+_0xa4925d;},'RaEeb':function(_0x1f71b4,_0x10fa14){return _0x1f71b4|_0x10fa14;},'HwPrB':function(_0x583516,_0x489f5b){return _0x583516|_0x489f5b;},'QKcZJ':function(_0x2975b0,_0x1be6f3){return _0x2975b0<<_0x1be6f3;},'NTDtq':function(_0x346f19,_0x55f657){return _0x346f19&_0x55f657;},'RpPIY':function(_0x2391f6,_0x9c5858){return _0x2391f6!==_0x9c5858;},'sxjYd':function(_0x577d36,_0x15960b){return _0x577d36&_0x15960b;}};while(_0x282e55[_0x4fb5(0x86)](_0x2003ed[_0x4fb5(0x17)],0x4)){_0x2003ed+='=';}const _0x3a631a=_0x282e55['iCqxV'];let _0xd04d42='';for(let _0x170637=0x0;_0x282e55[_0x4fb5(0x87)](_0x170637,_0x2003ed[_0x4fb5(0x17)]);_0x170637+=0x4){if(_0x282e55[_0x4fb5(0x88)](_0x282e55['vlyiA'],_0x282e55[_0x4fb5(0x89)]))return!![];else{const _0x2cc984=_0x3a631a[_0x4fb5(0x1a)](_0x2003ed[_0x4fb5(0x1b)](_0x170637)),_0x3ef535=_0x3a631a[_0x4fb5(0x1a)](_0x2003ed['charAt'](_0x282e55[_0x4fb5(0x8a)](_0x170637,0x1))),_0x45bf8f=_0x3a631a[_0x4fb5(0x1a)](_0x2003ed[_0x4fb5(0x1b)](_0x282e55[_0x4fb5(0x8b)](_0x170637,0x2))),_0x310bc8=_0x3a631a[_0x4fb5(0x1a)](_0x2003ed[_0x4fb5(0x1b)](_0x282e55[_0x4fb5(0x8c)](_0x170637,0x3))),_0x1cba06=_0x282e55[_0x4fb5(0x8d)](_0x282e55['HwPrB'](_0x282e55[_0x4fb5(0x8e)](_0x2cc984,0x12)|_0x282e55[_0x4fb5(0x8e)](_0x3ef535,0xc),_0x282e55['QKcZJ'](_0x45bf8f,0x6)),_0x310bc8);_0xd04d42+=String[_0x4fb5(0x1d)](_0x282e55['NTDtq'](_0x1cba06>>0x10,0xff));if(_0x45bf8f!==0x40)_0xd04d42+=String[_0x4fb5(0x1d)](_0x1cba06>>0x8&0xff);if(_0x282e55['RpPIY'](_0x310bc8,0x40))_0xd04d42+=String[_0x4fb5(0x1d)](_0x282e55[_0x4fb5(0x8f)](_0x1cba06,0xff));}}return _0xd04d42;},getJWTPayload=async()=>{const _0x28ab56={'yutKv':'❌\x20Failed\x20to\x20retrieve\x20JWT\x20token:','VODFv':function(_0x7df155){return _0x7df155();},'aLHiQ':function(_0xe7e2e8,_0x30e996){return _0xe7e2e8!==_0x30e996;},'UpNaB':function(_0xf3c314,_0x257898){return _0xf3c314!==_0x257898;},'UfgAd':_0x4fb5(0x90),'WeDTN':_0x4fb5(0x91),'biACB':'❌\x20Failed\x20to\x20decode\x20JWT\x20payload:'};try{const _0x7d1f4b=await _0x28ab56[_0x4fb5(0x92)](getJWT);if(!_0x7d1f4b)return null;const _0x312073=_0x7d1f4b[_0x4fb5(0x93)]('.');if(_0x28ab56[_0x4fb5(0x94)](_0x312073[_0x4fb5(0x17)],0x3))return null;const _0x13c684=base64Decode(_0x312073[0x1]),_0x232c92=JSON['parse'](_0x13c684);return _0x232c92;}catch(_0x4ee574){return _0x28ab56[_0x4fb5(0x95)](_0x28ab56[_0x4fb5(0x96)],_0x28ab56[_0x4fb5(0x97)])?(console[_0x4fb5(0x50)](_0x28ab56['biACB'],_0x4ee574),null):(_0x2aa776[_0x4fb5(0x50)](_0x28ab56[_0x4fb5(0x98)],_0x56bd1d),null);}};function _0x3cf1(){const _0x356315=['defineProperty','__esModule','verifyCredentials','updateCredentials','storeCredentials','hasJWT','getJWTPayload','getCredentials','generateDeviceUsername','deleteCredentials','clearJWT','onairos_jwt_token','warn','mock','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/','JsnDa','QTCab','Keychain\x20access\x20failed,\x20using\x20mock\x20storage','wCPra','bQTeM','iMurP','Sphcs','NjpAO','length','JDxLK','xxXGn','indexOf','charAt','HNwRZ','fromCharCode','BWQwN','Tfjox','FIKCh','ceyFG','PsuDK','fMNgx','BPvZY','NLqWw','PYKWC','RpjZs','service','getGenericPassword','VHTIS','setGenericPassword','XRNqy','PtUUC','HiKfH','MDKvL','qVuni','pGIxe','default','resetGenericPassword','CpVAW','UbMjL','jCaUz','MDdwv','LyrZL','DIlfs','web','Error\x20storing\x20credentials:','QpODd','now','username','trfJB','bPIlb','ucAiX','function','STORAGE_KEYS','credentials','AIApk','Platform','QDDcy','qbdbg','accessControl','BIOMETRY_ANY_OR_DEVICE_PASSCODE','accessible','ACCESSIBLE','WHEN_UNLOCKED','vhoCq','stringify','error','NiYjL','❌\x20Failed\x20to\x20decode\x20JWT\x20payload:','Error\x20getting\x20credentials:','ecxTG','lIeed','parse','NmCRm','QpMXi','Error\x20checking\x20credentials:','xoDcv','rSjmX','WyXPl','PabiN','qYtgq','LhSLw','YtRCk','ayUbE','Error\x20deleting\x20credentials:','Nchgy','PQPFG','QOOnm','eIInm','chNgA','toString','substring','dev_','Error\x20verifying\x20credentials:','gXMJZ','BCNKY','QTVTO','NYgYl','TjNZW','getItem','axnMW','tTeBk','getJWT','eXHyH','❌\x20Failed\x20to\x20check\x20JWT\x20token:','cPhNm','PrjOS','mUYPI','sqIQg','vVBPM','dLaTd','pVfHo','❌\x20Failed\x20to\x20clear\x20JWT\x20token:','removeItem','🗑️\x20JWT\x20token\x20cleared','XoOmU','yQwbE','twwEI','FNuNl','cabRc','FuWaO','guRPJ','Kxyen','XsuGJ','lxjXU','HaTSh','Rduwr','RaEeb','QKcZJ','sxjYd','PoaYU','JewkR','VODFv','split','aLHiQ','UpNaB','UfgAd','WeDTN','yutKv','jWrDI','tlBlj','exp','floor','WPRGA','uNgXW','LezDp','fneiy','❌\x20Failed\x20to\x20check\x20JWT\x20expiration:','isJWTExpired'];_0x3cf1=function(){return _0x356315;};return _0x3cf1();}exports[_0x4fb5(0x6)]=getJWTPayload;const isJWTExpired=async()=>{const _0x3ad09c={'uNgXW':'Keychain\x20access\x20failed,\x20using\x20mock\x20storage','LezDp':function(_0x3e8a93,_0x1663c4){return _0x3e8a93===_0x1663c4;},'fneiy':function(_0x693118,_0x5d3c3e){return _0x693118===_0x5d3c3e;},'tlBlj':_0x4fb5(0x99),'WPRGA':function(_0x1fbf98,_0x3773bf){return _0x1fbf98/_0x3773bf;},'txlsw':function(_0x294c59,_0x395674){return _0x294c59<_0x395674;}};try{if(_0x3ad09c[_0x4fb5(0x9a)]==='jWrDI'){const _0x217f89=await getJWTPayload();if(!_0x217f89||!_0x217f89[_0x4fb5(0x9b)])return!![];const _0x48a867=Math[_0x4fb5(0x9c)](_0x3ad09c[_0x4fb5(0x9d)](Date['now'](),0x3e8));return _0x3ad09c['txlsw'](_0x217f89[_0x4fb5(0x9b)],_0x48a867);}else{_0xe0d6ac['warn'](_0x3ad09c[_0x4fb5(0x9e)],_0x57c3dc);const _0x2d2f89=(_0x3ad09c[_0x4fb5(0x9f)](_0x534871,null)||_0x3ad09c[_0x4fb5(0xa0)](_0x292dbe,void 0x0)?void 0x0:_0x40609a[_0x4fb5(0x28)])||_0x4fb5(0x32);return _0x381d54[_0x2d2f89]={'username':_0x449c27,'password':_0x9f5c27},!![];}}catch(_0x4a15ed){return console[_0x4fb5(0x50)](_0x4fb5(0xa1),_0x4a15ed),!![];}};exports[_0x4fb5(0xa2)]=isJWTExpired;
|