@onairos/react-native 3.4.0 → 3.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -13
- package/lib/commonjs/api/index.js +9 -145
- package/lib/commonjs/assets/animations/loaderani.json +1 -0
- package/lib/commonjs/assets/animations/persona-animation.json +1 -0
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/chatgpt.png +0 -0
- package/lib/commonjs/assets/icons/claude.png +0 -0
- package/lib/commonjs/assets/icons/gemini.png +0 -0
- package/lib/commonjs/assets/icons/grok.png +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/chatgpt.png +0 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/claude.png +0 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- package/lib/commonjs/assets/images/gemini.png +0 -0
- package/lib/commonjs/assets/images/grok.png +0 -0
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +9 -0
- package/lib/commonjs/components/BrandMark.js +10 -0
- package/lib/commonjs/components/CodeInput.js +9 -0
- package/lib/commonjs/components/EmailInput.js +8 -0
- package/lib/commonjs/components/GoogleButton.js +9 -0
- package/lib/commonjs/components/HeadingGroup.js +9 -0
- package/lib/commonjs/components/LLMDataInputModal.js +14 -0
- package/lib/commonjs/components/ModalHeader.js +9 -0
- package/lib/commonjs/components/ModalSheet.js +9 -0
- package/lib/commonjs/components/Onairos.js +14 -374
- package/lib/commonjs/components/OnairosButton.js +13 -309
- package/lib/commonjs/components/OnairosSignInButton.js +12 -0
- package/lib/commonjs/components/Overlay.js +13 -483
- package/lib/commonjs/components/PersonaImage.js +10 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
- package/lib/commonjs/components/PinCreationScreen.js +12 -0
- package/lib/commonjs/components/PinInput.js +9 -302
- package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
- package/lib/commonjs/components/PlatformList.js +10 -137
- package/lib/commonjs/components/PlatformToggle.js +9 -0
- package/lib/commonjs/components/PrimaryButton.js +10 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
- package/lib/commonjs/components/SignInStep.js +12 -0
- package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +21 -0
- package/lib/commonjs/components/icons/Basicproficon.js +8 -0
- package/lib/commonjs/components/icons/Basicprofile.js +8 -0
- package/lib/commonjs/components/icons/Checkbox.js +8 -0
- package/lib/commonjs/components/icons/Checkmark.js +8 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
- package/lib/commonjs/components/icons/Contenticon.js +8 -0
- package/lib/commonjs/components/icons/EnochE.js +8 -0
- package/lib/commonjs/components/icons/Personalityicon.js +8 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
- package/lib/commonjs/components/icons/Userpreferences.js +8 -0
- package/lib/commonjs/components/icons/index.js +17 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
- package/lib/commonjs/components/onboarding/PinInput.js +10 -283
- package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
- package/lib/commonjs/config/api.js +7 -0
- package/lib/commonjs/constants/index.js +7 -83
- package/lib/commonjs/context/AuthContext.js +10 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
- package/lib/commonjs/hooks/useConnections.js +8 -159
- package/lib/commonjs/hooks/useCredentials.js +10 -177
- package/lib/commonjs/hooks/useUserConnections.js +10 -0
- package/lib/commonjs/index.js +35 -106
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +31 -38
- package/lib/commonjs/services/apiClient.js +8 -0
- package/lib/commonjs/services/apiKeyService.js +9 -946
- package/lib/commonjs/services/authService.js +10 -0
- package/lib/commonjs/services/biometricPinService.js +8 -0
- package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
- package/lib/commonjs/services/chatGPTConversationService.js +9 -0
- package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
- package/lib/commonjs/services/claudeConversationService.js +9 -0
- package/lib/commonjs/services/connectedAccountsService.js +10 -0
- package/lib/commonjs/services/googleAuthService.js +11 -0
- package/lib/commonjs/services/imageCompressionService.js +7 -0
- package/lib/commonjs/services/jwtStorageService.js +7 -0
- package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
- package/lib/commonjs/services/linkedinProfileService.js +9 -0
- package/lib/commonjs/services/linkedinScrapingService.js +8 -0
- package/lib/commonjs/services/llmDataStorage.js +8 -0
- package/lib/commonjs/services/mobileTrainingService.js +8 -0
- package/lib/commonjs/services/oauthService.js +11 -390
- package/lib/commonjs/services/pinEncryptionService.js +8 -0
- package/lib/commonjs/services/pinStorageUtils.js +7 -0
- package/lib/commonjs/services/platformAuthService.js +12 -1067
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/trainingApiHelpers.js +7 -0
- package/lib/commonjs/services/userConnectionsService.js +10 -0
- package/lib/commonjs/services/youtubeMigrationService.js +10 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/types/ambient.d.js +1 -2
- package/lib/commonjs/types/declarations.d.js +1 -2
- package/lib/commonjs/types/index.js +1 -6
- package/lib/commonjs/types/node-fix.d.js +1 -2
- package/lib/commonjs/types/node-override.d.js +1 -2
- package/lib/commonjs/types/opacity.d.js +1 -2
- package/lib/commonjs/types.js +1 -14
- package/lib/commonjs/utils/Portal.js +8 -98
- package/lib/commonjs/utils/api.js +9 -129
- package/lib/commonjs/utils/assetRegistry.js +33 -0
- package/lib/commonjs/utils/auth.js +9 -111
- package/lib/commonjs/utils/crypto.js +8 -62
- package/lib/commonjs/utils/debugHelper.js +1 -64
- package/lib/commonjs/utils/encryption.js +7 -76
- package/lib/commonjs/utils/eventUtils.js +1 -0
- package/lib/commonjs/utils/haptics.js +9 -0
- package/lib/commonjs/utils/imagePreloader.js +1 -0
- package/lib/commonjs/utils/networkDiagnostics.js +8 -0
- package/lib/commonjs/utils/onairosApi.js +9 -350
- package/lib/commonjs/utils/programmaticFlow.js +9 -117
- package/lib/commonjs/utils/retryHelper.js +1 -220
- package/lib/commonjs/utils/secureStorage.js +10 -349
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +9 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/api/index.js +1 -139
- package/lib/module/assets/animations/loaderani.json +1 -0
- package/lib/module/assets/animations/persona-animation.json +1 -0
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/chatgpt.png +0 -0
- package/lib/module/assets/icons/claude.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/gemini.png +0 -0
- package/lib/module/assets/icons/grok.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/chatgpt.png +0 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/claude.png +0 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- package/lib/module/assets/images/gemini.png +0 -0
- package/lib/module/assets/images/grok.png +0 -0
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +1 -0
- package/lib/module/components/BrandMark.js +1 -0
- package/lib/module/components/CodeInput.js +1 -0
- package/lib/module/components/EmailInput.js +1 -0
- package/lib/module/components/GoogleButton.js +1 -0
- package/lib/module/components/HeadingGroup.js +1 -0
- package/lib/module/components/LLMDataInputModal.js +8 -0
- package/lib/module/components/ModalHeader.js +1 -0
- package/lib/module/components/ModalSheet.js +1 -0
- package/lib/module/components/Onairos.js +1 -367
- package/lib/module/components/OnairosButton.js +1 -302
- package/lib/module/components/OnairosSignInButton.js +1 -0
- package/lib/module/components/Overlay.js +1 -474
- package/lib/module/components/PersonaImage.js +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +1 -0
- package/lib/module/components/PinCreationScreen.js +1 -0
- package/lib/module/components/PinInput.js +1 -293
- package/lib/module/components/PlatformConnectorsStep.js +1 -0
- package/lib/module/components/PlatformList.js +1 -129
- package/lib/module/components/PlatformToggle.js +1 -0
- package/lib/module/components/PrimaryButton.js +1 -0
- package/lib/module/components/SignInMatchAnimation.js +1 -0
- package/lib/module/components/SignInStep.js +1 -0
- package/lib/module/components/UniversalOnboarding.js +1 -1693
- package/lib/module/components/VerificationStep.js +1 -0
- package/lib/module/components/WelcomeScreen.js +1 -0
- package/lib/module/components/icons/Basicproficon.js +1 -0
- package/lib/module/components/icons/Basicprofile.js +1 -0
- package/lib/module/components/icons/Checkbox.js +1 -0
- package/lib/module/components/icons/Checkmark.js +1 -0
- package/lib/module/components/icons/Contentanalysis.js +1 -0
- package/lib/module/components/icons/Contenticon.js +1 -0
- package/lib/module/components/icons/EnochE.js +1 -0
- package/lib/module/components/icons/Personalityicon.js +1 -0
- package/lib/module/components/icons/Personalityprofile.js +1 -0
- package/lib/module/components/icons/Personalitytraits.js +1 -0
- package/lib/module/components/icons/Userpreferences.js +1 -0
- package/lib/module/components/icons/index.js +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +1 -818
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
- package/lib/module/components/onboarding/PinInput.js +1 -274
- package/lib/module/components/onboarding/PlatformConnector.js +1 -240
- package/lib/module/config/api.js +1 -0
- package/lib/module/constants/index.js +1 -77
- package/lib/module/context/AuthContext.js +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +1 -0
- package/lib/module/hooks/useConnections.js +1 -152
- package/lib/module/hooks/useCredentials.js +6 -169
- package/lib/module/hooks/useUserConnections.js +1 -0
- package/lib/module/index.js +1 -32
- package/lib/module/services/SDK_API_KEY_VALIDATION.md +31 -38
- package/lib/module/services/apiClient.js +1 -0
- package/lib/module/services/apiKeyService.js +1 -919
- package/lib/module/services/authService.js +1 -0
- package/lib/module/services/biometricPinService.js +1 -0
- package/lib/module/services/chatGPTConversationExtractor.js +1 -0
- package/lib/module/services/chatGPTConversationService.js +1 -0
- package/lib/module/services/claudeConversationExtractor.js +1 -0
- package/lib/module/services/claudeConversationService.js +1 -0
- package/lib/module/services/connectedAccountsService.js +1 -0
- package/lib/module/services/googleAuthService.js +1 -0
- package/lib/module/services/imageCompressionService.js +1 -0
- package/lib/module/services/jwtStorageService.js +1 -0
- package/lib/module/services/linkedinDOMExtractor.js +1 -0
- package/lib/module/services/linkedinProfileService.js +1 -0
- package/lib/module/services/linkedinScrapingService.js +1 -0
- package/lib/module/services/llmDataStorage.js +1 -0
- package/lib/module/services/mobileTrainingService.js +1 -0
- package/lib/module/services/oauthService.js +1 -380
- package/lib/module/services/pinEncryptionService.js +7 -0
- package/lib/module/services/pinStorageUtils.js +1 -0
- package/lib/module/services/platformAuthService.js +1 -1041
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/trainingApiHelpers.js +1 -0
- package/lib/module/services/userConnectionsService.js +1 -0
- package/lib/module/services/youtubeMigrationService.js +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/types.js +1 -10
- package/lib/module/utils/Portal.js +1 -90
- package/lib/module/utils/api.js +1 -117
- package/lib/module/utils/assetRegistry.js +33 -0
- package/lib/module/utils/auth.js +1 -99
- package/lib/module/utils/crypto.js +1 -54
- package/lib/module/utils/debugHelper.js +1 -54
- package/lib/module/utils/encryption.js +1 -67
- package/lib/module/utils/eventUtils.js +1 -0
- package/lib/module/utils/haptics.js +8 -0
- package/lib/module/utils/imagePreloader.js +1 -0
- package/lib/module/utils/networkDiagnostics.js +1 -0
- package/lib/module/utils/onairosApi.js +1 -333
- package/lib/module/utils/programmaticFlow.js +1 -111
- package/lib/module/utils/retryHelper.js +1 -211
- package/lib/module/utils/secureStorage.js +6 -330
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/module/utils/webviewScripts/claude.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/package.json +62 -39
- package/lib/commonjs/api/index.js.map +0 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js +0 -228
- package/lib/commonjs/components/DataRequestModal.js.map +0 -1
- package/lib/commonjs/components/DataRequestScreen.js +0 -329
- package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
- package/lib/commonjs/components/EmailVerificationModal.js +0 -320
- package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
- package/lib/commonjs/components/Onairos.js.map +0 -1
- package/lib/commonjs/components/OnairosButton.js.map +0 -1
- package/lib/commonjs/components/Overlay.js.map +0 -1
- package/lib/commonjs/components/PinInput.js.map +0 -1
- package/lib/commonjs/components/PlatformList.js.map +0 -1
- package/lib/commonjs/components/TrainingModal.js +0 -717
- package/lib/commonjs/components/TrainingModal.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
- package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/constants/index.js.map +0 -1
- package/lib/commonjs/hooks/useConnections.js.map +0 -1
- package/lib/commonjs/hooks/useCredentials.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/services/apiKeyService.js.map +0 -1
- package/lib/commonjs/services/oauthService.js.map +0 -1
- package/lib/commonjs/services/platformAuthService.js.map +0 -1
- package/lib/commonjs/types/ambient.d.js.map +0 -1
- package/lib/commonjs/types/declarations.d.js.map +0 -1
- package/lib/commonjs/types/index.d.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/types/node-fix.d.js.map +0 -1
- package/lib/commonjs/types/node-override.d.js.map +0 -1
- package/lib/commonjs/types/opacity.d.js.map +0 -1
- package/lib/commonjs/types/types.d.js.map +0 -1
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/Portal.js.map +0 -1
- package/lib/commonjs/utils/api.js.map +0 -1
- package/lib/commonjs/utils/auth.js.map +0 -1
- package/lib/commonjs/utils/crypto.js.map +0 -1
- package/lib/commonjs/utils/debugHelper.js.map +0 -1
- package/lib/commonjs/utils/encryption.js.map +0 -1
- package/lib/commonjs/utils/onairosApi.js.map +0 -1
- package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
- package/lib/commonjs/utils/retryHelper.js.map +0 -1
- package/lib/commonjs/utils/secureStorage.js.map +0 -1
- package/lib/module/api/index.js.map +0 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js +0 -220
- package/lib/module/components/DataRequestModal.js.map +0 -1
- package/lib/module/components/DataRequestScreen.js +0 -321
- package/lib/module/components/DataRequestScreen.js.map +0 -1
- package/lib/module/components/EmailVerificationModal.js +0 -311
- package/lib/module/components/EmailVerificationModal.js.map +0 -1
- package/lib/module/components/Onairos.js.map +0 -1
- package/lib/module/components/OnairosButton.js.map +0 -1
- package/lib/module/components/Overlay.js.map +0 -1
- package/lib/module/components/PinInput.js.map +0 -1
- package/lib/module/components/PlatformList.js.map +0 -1
- package/lib/module/components/TrainingModal.js +0 -708
- package/lib/module/components/TrainingModal.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/module/components/onboarding/PinInput.js.map +0 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/module/components/screens/ConnectorScreen.js +0 -138
- package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/module/components/screens/LoadingScreen.js +0 -83
- package/lib/module/components/screens/LoadingScreen.js.map +0 -1
- package/lib/module/components/screens/PinCreationScreen.js +0 -53
- package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/module/constants/index.js.map +0 -1
- package/lib/module/hooks/useConnections.js.map +0 -1
- package/lib/module/hooks/useCredentials.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/services/apiKeyService.js.map +0 -1
- package/lib/module/services/oauthService.js.map +0 -1
- package/lib/module/services/platformAuthService.js.map +0 -1
- package/lib/module/types/ambient.d.js.map +0 -1
- package/lib/module/types/declarations.d.js.map +0 -1
- package/lib/module/types/index.d.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/types/node-fix.d.js.map +0 -1
- package/lib/module/types/node-override.d.js.map +0 -1
- package/lib/module/types/opacity.d.js.map +0 -1
- package/lib/module/types/types.d.js.map +0 -1
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils/Portal.js.map +0 -1
- package/lib/module/utils/api.js.map +0 -1
- package/lib/module/utils/auth.js.map +0 -1
- package/lib/module/utils/crypto.js.map +0 -1
- package/lib/module/utils/debugHelper.js.map +0 -1
- package/lib/module/utils/encryption.js.map +0 -1
- package/lib/module/utils/onairosApi.js.map +0 -1
- package/lib/module/utils/programmaticFlow.js.map +0 -1
- package/lib/module/utils/retryHelper.js.map +0 -1
- package/lib/module/utils/secureStorage.js.map +0 -1
- package/lib/typescript/api/index.d.ts +0 -8
- package/lib/typescript/api/index.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestModal.d.ts +0 -11
- package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
- package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
- package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
- package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
- package/lib/typescript/components/Onairos.d.ts +0 -4
- package/lib/typescript/components/Onairos.d.ts.map +0 -1
- package/lib/typescript/components/OnairosButton.d.ts +0 -12
- package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
- package/lib/typescript/components/Overlay.d.ts +0 -4
- package/lib/typescript/components/Overlay.d.ts.map +0 -1
- package/lib/typescript/components/PinInput.d.ts +0 -4
- package/lib/typescript/components/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/PlatformList.d.ts +0 -4
- package/lib/typescript/components/PlatformList.d.ts.map +0 -1
- package/lib/typescript/components/TrainingModal.d.ts +0 -4
- package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
- package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
- package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
- package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/constants/index.d.ts +0 -53
- package/lib/typescript/constants/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnections.d.ts +0 -9
- package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
- package/lib/typescript/hooks/useCredentials.d.ts +0 -9
- package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -18
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/services/apiKeyService.d.ts +0 -132
- package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
- package/lib/typescript/services/oauthService.d.ts +0 -50
- package/lib/typescript/services/oauthService.d.ts.map +0 -1
- package/lib/typescript/services/platformAuthService.d.ts +0 -144
- package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts +0 -231
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -270
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils/Portal.d.ts +0 -14
- package/lib/typescript/utils/Portal.d.ts.map +0 -1
- package/lib/typescript/utils/api.d.ts +0 -6
- package/lib/typescript/utils/api.d.ts.map +0 -1
- package/lib/typescript/utils/auth.d.ts +0 -6
- package/lib/typescript/utils/auth.d.ts.map +0 -1
- package/lib/typescript/utils/crypto.d.ts +0 -4
- package/lib/typescript/utils/crypto.d.ts.map +0 -1
- package/lib/typescript/utils/debugHelper.d.ts +0 -29
- package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
- package/lib/typescript/utils/encryption.d.ts +0 -19
- package/lib/typescript/utils/encryption.d.ts.map +0 -1
- package/lib/typescript/utils/onairosApi.d.ts +0 -87
- package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
- package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
- package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
- package/lib/typescript/utils/retryHelper.d.ts +0 -69
- package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
- package/lib/typescript/utils/secureStorage.d.ts +0 -94
- package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
- package/src/api/index.ts +0 -111
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/onairos_logo.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestModal.tsx +0 -227
- package/src/components/DataRequestScreen.tsx +0 -356
- package/src/components/EmailVerificationModal.tsx +0 -364
- package/src/components/Onairos.tsx +0 -425
- package/src/components/OnairosButton.tsx +0 -359
- package/src/components/Overlay.tsx +0 -506
- package/src/components/PinInput.tsx +0 -343
- package/src/components/PlatformList.tsx +0 -145
- package/src/components/TrainingModal.tsx +0 -737
- package/src/components/UniversalOnboarding.tsx +0 -1839
- package/src/components/UniversalOnboarding.tsx.new +0 -455
- package/src/components/onboarding/OAuthWebView.tsx +0 -838
- package/src/components/onboarding/OnboardingHeader.tsx +0 -70
- package/src/components/onboarding/PinInput.tsx +0 -356
- package/src/components/onboarding/PlatformConnector.tsx +0 -302
- package/src/components/screens/ConnectorScreen.tsx +0 -153
- package/src/components/screens/LoadingScreen.tsx +0 -100
- package/src/components/screens/PinCreationScreen.tsx +0 -67
- package/src/constants/index.ts +0 -83
- package/src/hooks/useConnections.ts +0 -163
- package/src/hooks/useCredentials.ts +0 -175
- package/src/index.js +0 -14
- package/src/index.ts +0 -50
- package/src/services/SDK_API_KEY_VALIDATION.md +0 -428
- package/src/services/apiKeyService.ts +0 -979
- package/src/services/oauthService.ts +0 -412
- package/src/services/platformAuthService.ts +0 -1113
- package/src/types/ambient.d.ts +0 -29
- package/src/types/declarations.d.ts +0 -26
- package/src/types/index.d.ts +0 -274
- package/src/types/index.ts +0 -244
- package/src/types/node-fix.d.ts +0 -19
- package/src/types/node-override.d.ts +0 -24
- package/src/types/opacity.d.ts +0 -16
- package/src/types/types.d.ts +0 -18
- package/src/types.ts +0 -298
- package/src/utils/Portal.tsx +0 -83
- package/src/utils/api.js +0 -112
- package/src/utils/auth.js +0 -104
- package/src/utils/crypto.js +0 -60
- package/src/utils/debugHelper.ts +0 -53
- package/src/utils/encryption.ts +0 -69
- package/src/utils/onairosApi.ts +0 -391
- package/src/utils/programmaticFlow.ts +0 -113
- package/src/utils/retryHelper.ts +0 -275
- package/src/utils/secureStorage.ts +0 -361
- package/types/index.d.ts +0 -218
- package/types/node-env.d.ts +0 -15
- /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
|
@@ -1,54 +1 @@
|
|
|
1
|
-
import
|
|
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.replace(/\\n/g, '').replace(/^\s+|\s+$/g, '').replace('-----BEGIN PUBLIC KEY-----', '').replace('-----END PUBLIC KEY-----', '').trim();
|
|
14
|
-
|
|
15
|
-
// Format the key properly for the library
|
|
16
|
-
const formattedKey = `-----BEGIN PUBLIC KEY-----\n${cleanedKey}\n-----END PUBLIC KEY-----`;
|
|
17
|
-
|
|
18
|
-
// Encrypt the data
|
|
19
|
-
const encrypted = await RSA.encrypt(data, formattedKey);
|
|
20
|
-
return encrypted;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error('RSA encryption failed:', error);
|
|
23
|
-
throw error;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Hash data using SHA-256
|
|
29
|
-
* @param {string} data - The data to hash
|
|
30
|
-
* @returns {string} - The hashed data
|
|
31
|
-
*/
|
|
32
|
-
export const sha256 = data => {
|
|
33
|
-
return cryptoSha256(data).toString();
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Convert a base64 string to a buffer
|
|
38
|
-
* @param {string} base64String - The base64 string to convert
|
|
39
|
-
* @returns {ArrayBuffer} - The converted buffer
|
|
40
|
-
*/
|
|
41
|
-
export const base64ToBuffer = base64String => {
|
|
42
|
-
try {
|
|
43
|
-
const binaryString = Buffer.from(base64String, 'base64').toString('binary');
|
|
44
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
45
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
46
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
47
|
-
}
|
|
48
|
-
return bytes.buffer;
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error('Error converting base64 to buffer:', error);
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=crypto.js.map
|
|
1
|
+
import{RSA}from'react-native-rsa-native';import{sha256 as _0x50d9b9}from'react-native-crypto-js';function _0x57cc(_0x52a775,_0x57cc28){_0x52a775=_0x52a775-0x0;const _0x730eb=_0x52a7();let _0x14d211=_0x730eb[_0x52a775];return _0x14d211;}export const rsaEncrypt=async(_0x58b182,_0x2d95d4)=>{const _0x5da2cf={'Jbjoc':_0x57cc(0x0),'SzMUV':function(_0x41a201,_0x41d820){return _0x41a201===_0x41d820;},'MhNyv':_0x57cc(0x1),'awefo':_0x57cc(0x2),'WmceQ':'-----END\x20PUBLIC\x20KEY-----','jXvxA':'gWMsE','suLWG':_0x57cc(0x3),'UMNdh':'RSA\x20encryption\x20failed:'};try{if(_0x5da2cf['SzMUV'](_0x5da2cf['MhNyv'],'qcVIB')){_0x5da115[_0x57cc(0x4)](_0x5da2cf[_0x57cc(0x5)],_0x3c8b8a);throw _0x4eaa44;}else{const _0x2374df=_0x58b182[_0x57cc(0x6)](/\\n/g,'')[_0x57cc(0x6)](/^\s+|\s+$/g,'')[_0x57cc(0x6)](_0x5da2cf[_0x57cc(0x7)],'')[_0x57cc(0x6)](_0x5da2cf[_0x57cc(0x8)],'')[_0x57cc(0x9)](),_0x110686=_0x57cc(0xa)+_0x2374df+_0x57cc(0xb),_0x4bafe1=await RSA[_0x57cc(0xc)](_0x2d95d4,_0x110686);return _0x4bafe1;}}catch(_0x2f87b5){if(_0x5da2cf[_0x57cc(0xd)](_0x5da2cf[_0x57cc(0xe)],_0x5da2cf[_0x57cc(0xf)])){_0x12c6f3[_0x57cc(0x4)]('RSA\x20encryption\x20failed:',_0x40670f);throw _0x369bb5;}else{console[_0x57cc(0x4)](_0x5da2cf['UMNdh'],_0x2f87b5);throw _0x2f87b5;}}};export const sha256=_0xd1c342=>{const _0xa4a2af={'gCGYK':function(_0xcfb877,_0x32eb11){return _0xcfb877(_0x32eb11);}};return _0xa4a2af[_0x57cc(0x10)](_0x50d9b9,_0xd1c342)['toString']();};export const base64ToBuffer=_0xfa08b0=>{const _0x937c58={'jlRFR':function(_0x4fb67b,_0x249730){return _0x4fb67b(_0x249730);},'ERusA':function(_0x549465,_0x4e1d06){return _0x549465===_0x4e1d06;},'UJtsU':_0x57cc(0x11),'mFhOb':'JWkMA','WBiEz':_0x57cc(0x12),'DhYqm':_0x57cc(0x13),'nGzna':function(_0x260838,_0x3b1870){return _0x260838<_0x3b1870;}};try{if(_0x937c58[_0x57cc(0x14)](_0x937c58[_0x57cc(0x15)],_0x937c58[_0x57cc(0x16)]))return _0x937c58[_0x57cc(0x17)](_0x3f3355,_0x13d781)[_0x57cc(0x18)]();else{const _0x537773=Buffer[_0x57cc(0x19)](_0xfa08b0,_0x937c58[_0x57cc(0x1a)])[_0x57cc(0x18)](_0x937c58[_0x57cc(0x1b)]),_0x5b147d=new Uint8Array(_0x537773[_0x57cc(0x1c)]);for(let _0x3a7aa0=0x0;_0x937c58[_0x57cc(0x1d)](_0x3a7aa0,_0x537773[_0x57cc(0x1c)]);_0x3a7aa0++){_0x5b147d[_0x3a7aa0]=_0x537773[_0x57cc(0x1e)](_0x3a7aa0);}return _0x5b147d['buffer'];}}catch(_0x1efc8d){console[_0x57cc(0x4)](_0x57cc(0x0),_0x1efc8d);throw _0x1efc8d;}};function _0x52a7(){const _0x308996=['Error\x20converting\x20base64\x20to\x20buffer:','wnQZc','-----BEGIN\x20PUBLIC\x20KEY-----','newUl','error','Jbjoc','replace','awefo','WmceQ','trim','-----BEGIN\x20PUBLIC\x20KEY-----\x0a','\x0a-----END\x20PUBLIC\x20KEY-----','encrypt','SzMUV','jXvxA','suLWG','gCGYK','WzHqi','base64','binary','ERusA','UJtsU','mFhOb','jlRFR','toString','from','WBiEz','DhYqm','length','nGzna','charCodeAt'];_0x52a7=function(){return _0x308996;};return _0x52a7();}
|
|
@@ -1,54 +1 @@
|
|
|
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, data) => {
|
|
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, error) => {
|
|
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 => {
|
|
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, url, data) => {
|
|
46
|
-
if (__DEV__) {
|
|
47
|
-
logDebug('API Request', {
|
|
48
|
-
method,
|
|
49
|
-
url,
|
|
50
|
-
data: data || {}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=debugHelper.js.map
|
|
1
|
+
function _0x2cfa(){const _0x47d736=['env','production','log','oUNFe','[Onairos\x20Error]\x20','jCZhl'];_0x2cfa=function(){return _0x47d736;};return _0x2cfa();}const __DEV__=process[_0x29f2(0x0)]['NODE_ENV']!==_0x29f2(0x1);export const logDebug=(_0x379b47,_0x1e123c)=>{const _0x320e75={'oUNFe':function(_0x5b8d64,_0x353606){return _0x5b8d64||_0x353606;}};__DEV__&&console[_0x29f2(0x2)]('[Onairos\x20Debug]\x20'+_0x379b47+':',_0x320e75[_0x29f2(0x3)](_0x1e123c,''));};function _0x29f2(_0x2cfa7d,_0x29f20d){_0x2cfa7d=_0x2cfa7d-0x0;const _0x2d84a5=_0x2cfa();let _0x74ce28=_0x2d84a5[_0x2cfa7d];return _0x74ce28;}export const logError=(_0x4f4b66,_0xb4041c)=>{__DEV__&&console['error'](_0x29f2(0x4)+_0x4f4b66+':',_0xb4041c);};export const isDebugMode=_0x43e6a5=>{const _0x4fcb78={'jCZhl':function(_0x2960c8,_0x39587c){return _0x2960c8===_0x39587c;}};return _0x4fcb78[_0x29f2(0x5)](_0x43e6a5,!![])||__DEV__;};export const logApiRequest=(_0x1929e0,_0x54201c,_0x20e92e)=>{const _0x45ee31={'uEtOp':'API\x20Request'};__DEV__&&logDebug(_0x45ee31['uEtOp'],{'method':_0x1929e0,'url':_0x54201c,'data':_0x20e92e||{}});};
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
import { onairosApi }
|
|
2
|
-
/**
|
|
3
|
-
* Encrypt a model key using RSA with a public key
|
|
4
|
-
* @param publicKey The public key to encrypt with
|
|
5
|
-
* @param modelKey The model key to encrypt
|
|
6
|
-
* @returns The encrypted model key
|
|
7
|
-
*/
|
|
8
|
-
export const encryptModelKey = (publicKey, modelKey) => {
|
|
9
|
-
try {
|
|
10
|
-
console.log('Encrypting model key');
|
|
11
|
-
if (!publicKey || !modelKey) {
|
|
12
|
-
throw new Error('Public key or model key is missing');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// In a production environment, this would use RSA encryption
|
|
16
|
-
// For now, we'll use a mock implementation
|
|
17
|
-
// return RSA.encrypt(modelKey, publicKey);
|
|
18
|
-
|
|
19
|
-
// Return a fake encrypted value
|
|
20
|
-
return `encrypted_${modelKey}_${Date.now()}`;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error('Error encrypting model key:', error);
|
|
23
|
-
throw error;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get the server's public key
|
|
29
|
-
* @returns The server's public key
|
|
30
|
-
*/
|
|
31
|
-
export const getServerPublicKey = async () => {
|
|
32
|
-
try {
|
|
33
|
-
var _response$data, _response$data2;
|
|
34
|
-
// Use the API without generics to prevent TypeScript errors
|
|
35
|
-
const response = await onairosApi.get('public/getPublicKey');
|
|
36
|
-
|
|
37
|
-
// Check for the public key in the response data
|
|
38
|
-
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data = _response$data.data) !== null && _response$data !== void 0 && _response$data.publicKey) {
|
|
39
|
-
return response.data.data.publicKey;
|
|
40
|
-
} else if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.publicKey) {
|
|
41
|
-
return response.data.publicKey;
|
|
42
|
-
} else {
|
|
43
|
-
throw new Error('No public key found in response');
|
|
44
|
-
}
|
|
45
|
-
} catch (error) {
|
|
46
|
-
console.error('Error getting server public key:', error);
|
|
47
|
-
// For testing, return a mock public key
|
|
48
|
-
return 'mock_public_key_for_testing';
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Hash a string using SHA-256
|
|
54
|
-
* @param input The string to hash
|
|
55
|
-
* @returns The hashed string
|
|
56
|
-
*/
|
|
57
|
-
export const hashString = async input => {
|
|
58
|
-
try {
|
|
59
|
-
// In a production environment, this would use a proper hashing function
|
|
60
|
-
// For now, we'll return a mock hash
|
|
61
|
-
return `hash_${input.replace(/\s+/g, '_')}_${Date.now()}`;
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.error('Error hashing string:', error);
|
|
64
|
-
return `fallback_hash_${Date.now()}`;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=encryption.js.map
|
|
1
|
+
import{onairosApi}from'../api';export const encryptModelKey=(_0xd862d5,_0x1de50c)=>{const _0x55362b={'QEMBb':_0x5a5c(0x0),'RpiQh':_0x5a5c(0x1),'aZKPN':function(_0x583442,_0x6529c5){return _0x583442||_0x6529c5;},'LwfAl':function(_0x1c1d86,_0x216ec9){return _0x1c1d86!==_0x216ec9;},'LjCGf':'ySXKx'};try{console[_0x5a5c(0x2)](_0x55362b['RpiQh']);if(_0x55362b[_0x5a5c(0x3)](!_0xd862d5,!_0x1de50c)){if(_0x55362b[_0x5a5c(0x4)](_0x55362b[_0x5a5c(0x5)],_0x5a5c(0x6)))throw new Error(_0x5a5c(0x7));else{_0x5e241f[_0x5a5c(0x8)](_0x55362b[_0x5a5c(0x9)],_0x35d623);throw _0x597f23;}}return _0x5a5c(0xa)+_0x1de50c+'_'+Date[_0x5a5c(0xb)]();}catch(_0x59e093){console['error'](_0x55362b['QEMBb'],_0x59e093);throw _0x59e093;}};function _0x5a5c(_0x92d9f4,_0x5a5cf9){_0x92d9f4=_0x92d9f4-0x0;const _0x8bb412=_0x92d9();let _0x1d648b=_0x8bb412[_0x92d9f4];return _0x1d648b;}export const getServerPublicKey=async()=>{const _0x40564d={'qEIXG':_0x5a5c(0x1),'JKeHR':function(_0x4f003e,_0x1a3b67){return _0x4f003e||_0x1a3b67;},'kplCj':_0x5a5c(0x7),'TWMnK':_0x5a5c(0x0),'xQcyg':function(_0x348a0e,_0x20a65d){return _0x348a0e!==_0x20a65d;},'MbaBI':_0x5a5c(0xc),'SHpgX':_0x5a5c(0xd),'ynHSJ':function(_0x5646b2,_0x11fb2e){return _0x5646b2!==_0x11fb2e;},'aZaKt':function(_0x332ce2,_0x57b412){return _0x332ce2!==_0x57b412;},'EPDYL':function(_0x47f1b8,_0x58734d){return _0x47f1b8!==_0x58734d;},'vUjau':function(_0x460f92,_0x28baab){return _0x460f92===_0x28baab;},'ERjyi':function(_0x36fc58,_0x54e4f2){return _0x36fc58!==_0x54e4f2;},'fvuLK':_0x5a5c(0xe),'aHTYO':_0x5a5c(0xf),'EGfEe':_0x5a5c(0x10),'HGnta':_0x5a5c(0x11),'FWxDJ':'mock_public_key_for_testing'};try{if(_0x40564d['xQcyg'](_0x40564d[_0x5a5c(0x12)],_0x40564d[_0x5a5c(0x12)]))try{_0x42121e['log'](_0x40564d[_0x5a5c(0x13)]);if(_0x40564d['JKeHR'](!_0x54e536,!_0x97cf61))throw new _0x5367f7(_0x40564d[_0x5a5c(0x14)]);return _0x5a5c(0xa)+_0x8e488a+'_'+_0x3ede3d[_0x5a5c(0xb)]();}catch(_0x37f683){_0x68992c['error'](_0x40564d['TWMnK'],_0x37f683);throw _0x37f683;}else{var _0x4d1aeb,_0x568347;const _0x2cd30e=await onairosApi[_0x5a5c(0x15)](_0x40564d[_0x5a5c(0x16)]);if(_0x2cd30e!==null&&_0x40564d[_0x5a5c(0x17)](_0x2cd30e,void 0x0)&&_0x40564d[_0x5a5c(0x17)](_0x4d1aeb=_0x2cd30e['data'],null)&&_0x40564d['ynHSJ'](_0x4d1aeb,void 0x0)&&_0x40564d[_0x5a5c(0x18)](_0x4d1aeb=_0x4d1aeb[_0x5a5c(0x19)],null)&&_0x40564d[_0x5a5c(0x1a)](_0x4d1aeb,void 0x0)&&_0x4d1aeb[_0x5a5c(0x1b)])return _0x40564d[_0x5a5c(0x1c)](_0x5a5c(0x1d),'wiMBE')?_0x2cd30e[_0x5a5c(0x19)][_0x5a5c(0x19)][_0x5a5c(0x1b)]:_0x191f92[_0x5a5c(0x19)][_0x5a5c(0x1b)];else{if(_0x40564d['ERjyi'](_0x2cd30e,null)&&_0x2cd30e!==void 0x0&&_0x40564d[_0x5a5c(0x18)](_0x568347=_0x2cd30e[_0x5a5c(0x19)],null)&&_0x40564d['ynHSJ'](_0x568347,void 0x0)&&_0x568347[_0x5a5c(0x1b)])return _0x40564d[_0x5a5c(0x1e)](_0x40564d[_0x5a5c(0x1f)],_0x40564d[_0x5a5c(0x20)])?_0x2cd30e[_0x5a5c(0x19)]['publicKey']:_0x5a5c(0x21)+_0x3f4305[_0x5a5c(0x22)](/\s+/g,'_')+'_'+_0xfcd1ad['now']();else throw new Error(_0x40564d['EGfEe']);}}}catch(_0x29c637){return console[_0x5a5c(0x8)](_0x40564d[_0x5a5c(0x23)],_0x29c637),_0x40564d[_0x5a5c(0x24)];}};export const hashString=async _0x10c204=>{const _0x2e4f62={'MWVgw':function(_0x525740,_0x511fa5){return _0x525740===_0x511fa5;},'dOcVZ':_0x5a5c(0x25),'YPCBV':_0x5a5c(0x26),'CYflR':_0x5a5c(0x27)};try{return _0x5a5c(0x21)+_0x10c204[_0x5a5c(0x22)](/\s+/g,'_')+'_'+Date[_0x5a5c(0xb)]();}catch(_0x361f7b){return _0x2e4f62[_0x5a5c(0x28)](_0x2e4f62[_0x5a5c(0x29)],_0x2e4f62['YPCBV'])?_0x24fcbe[_0x5a5c(0x19)][_0x5a5c(0x19)][_0x5a5c(0x1b)]:(console[_0x5a5c(0x8)](_0x2e4f62[_0x5a5c(0x2a)],_0x361f7b),'fallback_hash_'+Date[_0x5a5c(0xb)]());}};function _0x92d9(){const _0x347c1a=['Error\x20encrypting\x20model\x20key:','Encrypting\x20model\x20key','log','aZKPN','LwfAl','LjCGf','FtMkq','Public\x20key\x20or\x20model\x20key\x20is\x20missing','error','QEMBb','encrypted_','now','RsXSk','public/getPublicKey','koKvc','qjQhu','No\x20public\x20key\x20found\x20in\x20response','Error\x20getting\x20server\x20public\x20key:','MbaBI','qEIXG','kplCj','get','SHpgX','xQcyg','aZaKt','data','EPDYL','publicKey','vUjau','wiMBE','ERjyi','fvuLK','aHTYO','hash_','replace','HGnta','FWxDJ','PWPNA','spsDs','Error\x20hashing\x20string:','MWVgw','dOcVZ','CYflR'];_0x92d9=function(){return _0x347c1a;};return _0x92d9();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const generateEventCode=(_0x140545=0x6)=>{const _0x23f657={'FtroE':_0x248f(0x0),'MTcPk':function(_0x369a0b,_0x122d9c){return _0x369a0b<_0x122d9c;},'klqMt':function(_0x20b516,_0xdc70df){return _0x20b516!==_0xdc70df;},'JwOXv':_0x248f(0x1),'tWnPf':_0x248f(0x2)},_0x440ec1=_0x23f657[_0x248f(0x3)];let _0x14debd='';for(let _0xde02de=0x0;_0x23f657['MTcPk'](_0xde02de,_0x140545);_0xde02de++){if(_0x23f657[_0x248f(0x4)](_0x23f657[_0x248f(0x5)],_0x23f657[_0x248f(0x6)]))_0x14debd+=_0x440ec1[_0x248f(0x7)](Math[_0x248f(0x8)](Math[_0x248f(0x9)]()*_0x440ec1[_0x248f(0xa)]));else return _0x226b9e;}return _0x14debd;};function _0x248f(_0x107384,_0x248f2b){_0x107384=_0x107384-0x0;const _0x5cb084=_0x1073();let _0x55dabe=_0x5cb084[_0x107384];return _0x55dabe;}export const generateSmartEventCode=_0x2f5b83=>{const _0x2fc307={'IsjIt':function(_0x151b9f,_0x3be537){return _0x151b9f<_0x3be537;},'DVdfF':_0x248f(0xb),'tbwXI':'Today','zLvpU':_0x248f(0xc),'gsjwE':function(_0x31d310){return _0x31d310();},'CsBUL':function(_0x483896,_0x4d7235){return _0x483896===_0x4d7235;},'REcqG':function(_0x3e3eb8,_0x1cb980){return _0x3e3eb8!==_0x1cb980;},'yskgP':_0x248f(0xd),'JQmqg':function(_0x4df863){return _0x4df863();},'ENuOb':function(_0x134b55,_0x38ea06){return _0x134b55<_0x38ea06;},'DnUsA':function(_0x44cba9,_0x5a6522){return _0x44cba9!==_0x5a6522;},'iHxpl':_0x248f(0xe),'pfHQw':function(_0x3b5ed2,_0x683fd4){return _0x3b5ed2(_0x683fd4);},'WLPDO':function(_0xa94b7f,_0x66213e){return _0xa94b7f-_0x66213e;},'uIhcE':function(_0x4dfab8,_0xac371a){return _0x4dfab8>_0xac371a;},'hGfBy':function(_0x244254,_0xfcd5e9){return _0x244254===_0xfcd5e9;},'MoSXo':_0x248f(0xf)};if(!_0x2f5b83[_0x248f(0x10)]()){if(_0x248f(0x11)===_0x2fc307[_0x248f(0x12)]){const _0x48dd5c=new _0x109f1b(),_0x32d923=new _0x4ef937(_0x25d196);return _0x48dd5c['setHours'](0x0,0x0,0x0,0x0),_0x32d923[_0x248f(0x13)](0x0,0x0,0x0,0x0),_0x2fc307[_0x248f(0x14)](_0x32d923,_0x48dd5c);}else return _0x2fc307[_0x248f(0x15)](generateEventCode);}const _0x476410=_0x2f5b83[_0x248f(0x10)]()['toUpperCase']()[_0x248f(0x16)](/[^A-Z0-9\s]/g,'')[_0x248f(0x17)](/\s+/)[_0x248f(0x18)](_0x7cafec=>_0x7cafec[_0x248f(0xa)]>0x0);if(_0x2fc307[_0x248f(0x19)](_0x476410[_0x248f(0xa)],0x0))return _0x2fc307['REcqG'](_0x248f(0xd),_0x2fc307['yskgP'])?{'isValid':![],'error':_0x2fc307[_0x248f(0x1a)]}:_0x2fc307[_0x248f(0x1b)](generateEventCode);let _0x3ecac6='';if(_0x476410[_0x248f(0xa)]>=0x2){const _0x44f7fe=_0x476410[_0x248f(0x1c)](0x0,0x3);_0x3ecac6=_0x44f7fe[_0x248f(0x1d)](_0x1961ff=>_0x1961ff[_0x248f(0x1e)](0x0,0x2))[_0x248f(0x1f)]('');}else _0x3ecac6=_0x476410[0x0][_0x248f(0x1e)](0x0,0x4);const _0x1ef084=new Date()[_0x248f(0x20)]()[_0x248f(0x21)]()[_0x248f(0x1c)](-0x2);_0x3ecac6+=_0x1ef084;if(_0x2fc307[_0x248f(0x22)](_0x3ecac6[_0x248f(0xa)],0x4)){if(_0x2fc307[_0x248f(0x23)](_0x2fc307[_0x248f(0x24)],_0x2fc307[_0x248f(0x24)]))return _0x2fc307[_0x248f(0x25)];else _0x3ecac6+=_0x2fc307[_0x248f(0x26)](generateEventCode,_0x2fc307['WLPDO'](0x4,_0x3ecac6['length']));}else{if(_0x2fc307[_0x248f(0x27)](_0x3ecac6[_0x248f(0xa)],0x8)){if(_0x2fc307[_0x248f(0x28)](_0x2fc307['MoSXo'],'yZwdC'))return{'isValid':![],'error':_0x248f(0x29)};else _0x3ecac6=_0x3ecac6[_0x248f(0x1e)](0x0,0x8);}}return _0x3ecac6;};export const validateEventCode=_0x200477=>{const _0x3d080b={'hLdiq':_0x248f(0x2a),'AgeDF':'numeric','Vnpbh':_0x248f(0x2b),'fxBNr':function(_0x41bebe,_0x2d8522){return _0x41bebe<_0x2d8522;},'clTde':_0x248f(0x2c),'YbKpJ':_0x248f(0xb),'WPOJc':function(_0x4dd1ce,_0x4e1d6f){return _0x4dd1ce!==_0x4e1d6f;},'TcsJW':'lbUfj','cpjjc':_0x248f(0x29)};if(!_0x200477||!_0x200477['trim']()){if(_0x248f(0x2d)!==_0x248f(0x2e))return{'isValid':![],'error':_0x3d080b['Vnpbh']};else _0x5a6587+=_0x40d6c0[_0x248f(0x7)](_0x26d5e2[_0x248f(0x8)](_0x2885cb[_0x248f(0x9)]()*_0x382105[_0x248f(0xa)]));}const _0x2c0865=_0x200477[_0x248f(0x10)]()[_0x248f(0x2f)]();if(_0x3d080b[_0x248f(0x30)](_0x2c0865[_0x248f(0xa)],0x3))return{'isValid':![],'error':_0x3d080b[_0x248f(0x31)]};if(_0x2c0865[_0x248f(0xa)]>0xa)return{'isValid':![],'error':_0x3d080b['YbKpJ']};if(!/^[A-Z0-9]+$/['test'](_0x2c0865)){if(_0x3d080b[_0x248f(0x32)](_0x248f(0x33),_0x3d080b[_0x248f(0x34)]))return{'isValid':![],'error':_0x3d080b[_0x248f(0x35)]};else{const _0x3d7697=new _0x1e9256(_0x9e4379);return _0x3d7697[_0x248f(0x36)](_0x3d080b[_0x248f(0x37)],{'weekday':_0x248f(0x38),'year':'numeric','month':_0x248f(0x38),'day':_0x3d080b['AgeDF']});}}return{'isValid':!![]};};export const formatEventDate=_0x3745c4=>{const _0x19a57c={'VcVPQ':function(_0x48dbf8){return _0x48dbf8();},'ctdgZ':function(_0x55bfd6,_0x50553a){return _0x55bfd6===_0x50553a;},'CigkD':_0x248f(0x39),'MotaM':_0x248f(0x3a),'TVbcN':_0x248f(0x2a),'AmOrO':_0x248f(0x3b),'rQWeh':_0x248f(0x38)};try{if(_0x19a57c[_0x248f(0x3c)](_0x19a57c[_0x248f(0x3d)],_0x19a57c[_0x248f(0x3e)]))return _0x19a57c[_0x248f(0x3f)](_0x280924);else{const _0x346281=new Date(_0x3745c4);return _0x346281[_0x248f(0x36)](_0x19a57c[_0x248f(0x40)],{'weekday':'long','year':_0x19a57c[_0x248f(0x41)],'month':_0x19a57c[_0x248f(0x42)],'day':_0x19a57c['AmOrO']});}}catch(_0x5be10f){return _0x3745c4;}};export const isEventToday=_0x3443af=>{const _0x5cd36d={'GHkBg':function(_0x47e54d,_0x221ffa){return _0x47e54d===_0x221ffa;},'BOIyk':function(_0xcf348d,_0x2c159a){return _0xcf348d===_0x2c159a;},'BMhMY':function(_0x1390bc,_0x1f7773){return _0x1390bc===_0x1f7773;},'HoMoh':_0x248f(0x43)};try{const _0x3a0fee=new Date(),_0x30b7eb=new Date(_0x3443af);return _0x5cd36d[_0x248f(0x44)](_0x3a0fee[_0x248f(0x20)](),_0x30b7eb[_0x248f(0x20)]())&&_0x3a0fee[_0x248f(0x45)]()===_0x30b7eb[_0x248f(0x45)]()&&_0x5cd36d[_0x248f(0x46)](_0x3a0fee[_0x248f(0x47)](),_0x30b7eb[_0x248f(0x47)]());}catch(_0x4b375a){if(_0x5cd36d[_0x248f(0x48)](_0x5cd36d['HoMoh'],_0x5cd36d[_0x248f(0x49)]))return![];else{const _0x4a3fa0=_0x30ad95[_0x248f(0x4a)](_0x5d2dc8=>_0x5d2dc8[_0x248f(0x4b)]||[]);return _0xbc43b1[_0x248f(0x4c)](new _0x32427d(_0x4a3fa0))[_0x248f(0x4d)]();}}};export const isEventPast=_0x19ca9f=>{const _0x551417={'REdqx':function(_0x516537,_0x1680c9){return _0x516537<_0x1680c9;}};try{const _0x4fc5d4=new Date(),_0x33ee93=new Date(_0x19ca9f);return _0x4fc5d4[_0x248f(0x13)](0x0,0x0,0x0,0x0),_0x33ee93[_0x248f(0x13)](0x0,0x0,0x0,0x0),_0x551417['REdqx'](_0x33ee93,_0x4fc5d4);}catch(_0x3e7ff9){return![];}};export const getEventStatus=(_0x7ca448,_0x463529)=>{const _0xdd277c={'mimsZ':_0x248f(0x4e),'nRpHT':function(_0x37db5a,_0x2119d9){return _0x37db5a(_0x2119d9);},'zAqRm':_0x248f(0x4f),'IUBYB':_0x248f(0x50),'HSxCL':'Past','fYpRA':'Today','QQwRn':_0x248f(0x51)};if(!_0x463529)return _0xdd277c['mimsZ'];if(_0xdd277c[_0x248f(0x52)](isEventPast,_0x7ca448))return _0xdd277c[_0x248f(0x53)]!==_0xdd277c[_0x248f(0x54)]?_0xdd277c[_0x248f(0x55)]:_0x1fe4ac;if(_0xdd277c[_0x248f(0x52)](isEventToday,_0x7ca448))return _0xdd277c[_0x248f(0x56)];return _0xdd277c[_0x248f(0x57)];};export const getDaysUntilEvent=_0x52b455=>{const _0x33c2b3={'WVBEA':function(_0x348ca9,_0x42acaf){return _0x348ca9-_0x42acaf;},'irlFi':function(_0x2cd566,_0x1275c3){return _0x2cd566/_0x1275c3;},'aMaZg':function(_0xf00df6,_0x37dd38){return _0xf00df6*_0x37dd38;},'dcCIV':function(_0x25e313,_0x280b93){return _0x25e313*_0x280b93;}};try{const _0x3acc36=new Date(),_0xce9a8d=new Date(_0x52b455);_0x3acc36[_0x248f(0x13)](0x0,0x0,0x0,0x0),_0xce9a8d[_0x248f(0x13)](0x0,0x0,0x0,0x0);const _0x562427=_0x33c2b3[_0x248f(0x58)](_0xce9a8d[_0x248f(0x59)](),_0x3acc36[_0x248f(0x59)]()),_0x2a9add=Math[_0x248f(0x5a)](_0x33c2b3[_0x248f(0x5b)](_0x562427,_0x33c2b3['aMaZg'](_0x33c2b3[_0x248f(0x5c)](_0x33c2b3[_0x248f(0x5c)](0x3e8,0x3c),0x3c),0x18)));return _0x2a9add;}catch(_0x1bd209){return 0x0;}};export const sortEventsByDate=_0x86f7d8=>{const _0x359527={'GQMYY':function(_0x361a3a,_0x4e32e5){return _0x361a3a<_0x4e32e5;},'rYIBC':function(_0x256d77,_0x3adcfc){return _0x256d77<_0x3adcfc;},'yJrri':function(_0x31a3aa,_0x4d2165){return _0x31a3aa&&_0x4d2165;},'dIICf':function(_0x356178,_0x4f9daa){return _0x356178!==_0x4f9daa;},'gOtCl':function(_0x4aaf5f,_0xf6fde8){return _0x4aaf5f-_0xf6fde8;}};return _0x86f7d8['sort']((_0x17b340,_0x275712)=>{if(_0x17b340['isActive']&&!_0x275712[_0x248f(0x5d)])return-0x1;if(!_0x17b340[_0x248f(0x5d)]&&_0x275712[_0x248f(0x5d)])return 0x1;const _0x28e535=new Date(_0x17b340[_0x248f(0x5e)]),_0xbae798=new Date(_0x275712[_0x248f(0x5e)]),_0x28a4dc=new Date(),_0x3f2ad2=_0x359527[_0x248f(0x5f)](_0x28e535,_0x28a4dc),_0x546b23=_0x359527['rYIBC'](_0xbae798,_0x28a4dc);if(_0x359527[_0x248f(0x60)](_0x3f2ad2,!_0x546b23))return 0x1;if(!_0x3f2ad2&&_0x546b23)return-0x1;return _0x3f2ad2&&_0x546b23?_0x359527[_0x248f(0x61)](_0x248f(0x62),_0x248f(0x62))?_0x5c783f['getTime']()-_0x3f025c[_0x248f(0x59)]():_0xbae798[_0x248f(0x59)]()-_0x28e535[_0x248f(0x59)]():_0x359527['gOtCl'](_0x28e535[_0x248f(0x59)](),_0xbae798[_0x248f(0x59)]());});};export const filterEventsBySearch=(_0x323fe7,_0x207c34)=>{const _0x436848={'TIhRO':function(_0x4d7fea,_0x49282c){return _0x4d7fea===_0x49282c;},'ALaOF':function(_0x44a43b,_0x1f0945){return _0x44a43b===_0x1f0945;},'SLgkc':function(_0x3e9fe9,_0x27873c){return _0x3e9fe9===_0x27873c;}};if(!_0x207c34[_0x248f(0x10)]()){if(_0x436848[_0x248f(0x63)](_0x248f(0x64),_0x248f(0x64)))return _0x323fe7;else{const _0x5320cc=_0x3ce640[_0x248f(0x1c)](0x0,0x3);_0x58fb6d=_0x5320cc[_0x248f(0x1d)](_0x1ceb7f=>_0x1ceb7f[_0x248f(0x1e)](0x0,0x2))[_0x248f(0x1f)]('');}}const _0x365120=_0x207c34['toLowerCase']()[_0x248f(0x10)]();return _0x323fe7[_0x248f(0x18)](_0x4b97e9=>{var _0x1a4204,_0x56ce88,_0x493e01;return _0x4b97e9[_0x248f(0x65)]['toLowerCase']()['includes'](_0x365120)||_0x4b97e9['description'][_0x248f(0x66)]()[_0x248f(0x67)](_0x365120)||_0x4b97e9[_0x248f(0x68)]['toLowerCase']()[_0x248f(0x67)](_0x365120)||((_0x1a4204=_0x4b97e9[_0x248f(0x69)])===null||_0x436848[_0x248f(0x6a)](_0x1a4204,void 0x0)?void 0x0:_0x1a4204[_0x248f(0x66)]()[_0x248f(0x67)](_0x365120))||((_0x56ce88=_0x4b97e9[_0x248f(0x6b)])===null||_0x56ce88===void 0x0?void 0x0:_0x56ce88[_0x248f(0x66)]()[_0x248f(0x67)](_0x365120))||(_0x436848['ALaOF'](_0x493e01=_0x4b97e9['tags'],null)||_0x493e01===void 0x0?void 0x0:_0x493e01[_0x248f(0x6c)](_0x39d563=>_0x39d563[_0x248f(0x66)]()[_0x248f(0x67)](_0x365120)));});};export const getUniqueEventTags=_0x421116=>{const _0x3ce6e7=_0x421116[_0x248f(0x4a)](_0x5b3bd2=>_0x5b3bd2[_0x248f(0x4b)]||[]);return Array[_0x248f(0x4c)](new Set(_0x3ce6e7))['sort']();};export const calculateEventStats=_0xa19cc3=>{const _0x3ea48d={'gkRsd':function(_0x4a7a04,_0x3d0c48){return _0x4a7a04-_0x3d0c48;},'tXUGT':function(_0xb4eda,_0x2cf315){return _0xb4eda>_0x2cf315;},'FVeOD':function(_0x209adf,_0x46b158){return _0x209adf*_0x46b158;},'yFrIf':function(_0x6d7864,_0xb69b5a){return _0x6d7864/_0xb69b5a;}},_0x676b23=_0xa19cc3[_0x248f(0xa)],_0x5d4aa1=_0xa19cc3[_0x248f(0x18)](_0x499fa3=>_0x499fa3[_0x248f(0x5d)])[_0x248f(0xa)],_0x3db72a=_0x3ea48d[_0x248f(0x6d)](_0x676b23,_0x5d4aa1),_0x48f79d=_0xa19cc3[_0x248f(0x6e)]((_0x8997b5,_0x59f9b7)=>_0x8997b5+_0x59f9b7[_0x248f(0x6f)],0x0),_0x4754bb=_0xa19cc3[_0x248f(0x6e)]((_0x75ed7b,_0x95e73c)=>_0x75ed7b+_0x95e73c[_0x248f(0x70)],0x0),_0xfad2bf=_0xa19cc3[_0x248f(0x18)](_0x102f30=>_0x102f30['isActive']&&!isEventPast(_0x102f30[_0x248f(0x5e)]))[_0x248f(0xa)],_0x365ab6=_0xa19cc3[_0x248f(0x18)](_0x1b1b58=>isEventPast(_0x1b1b58[_0x248f(0x5e)]))['length'],_0x401d4f=_0xa19cc3['filter'](_0x4df60e=>_0x4df60e[_0x248f(0x5d)]&&isEventToday(_0x4df60e[_0x248f(0x5e)]))[_0x248f(0xa)];return{'total':_0x676b23,'active':_0x5d4aa1,'inactive':_0x3db72a,'upcoming':_0xfad2bf,'past':_0x365ab6,'today':_0x401d4f,'totalAttendees':_0x48f79d,'totalCapacity':_0x4754bb,'averageAttendance':_0x3ea48d['tXUGT'](_0x4754bb,0x0)?Math['round'](_0x3ea48d[_0x248f(0x71)](_0x3ea48d[_0x248f(0x72)](_0x48f79d,_0x4754bb),0x64)):0x0};};function _0x1073(){const _0x26c1fd=['ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','uytsX','yFTlS','FtroE','klqMt','JwOXv','tWnPf','charAt','floor','random','length','Event\x20code\x20must\x20be\x2010\x20characters\x20or\x20less','rBOjT','jbJMr','EaCRU','wQTGg','trim','WmJEX','zLvpU','setHours','IsjIt','gsjwE','replace','split','filter','CsBUL','DVdfF','JQmqg','slice','map','substring','join','getFullYear','toString','ENuOb','DnUsA','iHxpl','tbwXI','pfHQw','uIhcE','hGfBy','Event\x20code\x20must\x20contain\x20only\x20letters\x20and\x20numbers','en-US','Event\x20code\x20is\x20required','Event\x20code\x20must\x20be\x20at\x20least\x203\x20characters','IMdYu','Fqnlr','toUpperCase','fxBNr','clTde','WPOJc','LYMGZ','TcsJW','cpjjc','toLocaleDateString','hLdiq','long','leOru','BngPT','numeric','ctdgZ','CigkD','MotaM','VcVPQ','TVbcN','AmOrO','rQWeh','sVEoh','GHkBg','getMonth','BOIyk','getDate','BMhMY','HoMoh','flatMap','tags','from','sort','Inactive','SHlKM','oQhqs','Upcoming','nRpHT','zAqRm','IUBYB','HSxCL','fYpRA','QQwRn','WVBEA','getTime','ceil','irlFi','dcCIV','isActive','eventDate','GQMYY','yJrri','dIICf','yNvQM','SLgkc','gKNmT','title','toLowerCase','includes','code','location','TIhRO','organizer','some','gkRsd','reduce','attendeeCount','maxAttendees','FVeOD','yFrIf'];_0x1073=function(){return _0x26c1fd;};return _0x1073();}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
// Onairos SDK - Asset Registry (auto-generated)
|
|
3
|
+
var __ONAIROS_REQ_REGISTRY__ = [
|
|
4
|
+
require('react-native-haptic-feedback'),
|
|
5
|
+
require('react-native')
|
|
6
|
+
];
|
|
7
|
+
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
8
|
+
import{Platform}from'react-native';export let HapticType=function(_0x816f79){const _0x3fe8da={'RLAQJ':_0x1e3a(0x0),'uWadH':_0x1e3a(0x1),'NBCsM':'error','LlEMk':_0x1e3a(0x2),'HaCyZ':_0x1e3a(0x3),'pbPiQ':_0x1e3a(0x4),'UxSaF':_0x1e3a(0x5),'iPwhS':_0x1e3a(0x6),'ONlKg':'SUCCESS','Zubte':'success'},_0x4ca956=_0x3fe8da[_0x1e3a(0x7)][_0x1e3a(0x8)]('|');let _0x590c59=0x0;while(!![]){switch(_0x4ca956[_0x590c59++]){case'0':_0x816f79[_0x3fe8da[_0x1e3a(0x9)]]=_0x3fe8da[_0x1e3a(0xa)];continue;case'1':_0x816f79[_0x3fe8da[_0x1e3a(0xb)]]=_0x1e3a(0xc);continue;case'2':_0x816f79[_0x3fe8da['HaCyZ']]=_0x3fe8da[_0x1e3a(0xd)];continue;case'3':_0x816f79[_0x1e3a(0xe)]=_0x1e3a(0xf);continue;case'4':return _0x816f79;case'5':_0x816f79[_0x3fe8da[_0x1e3a(0x10)]]=_0x1e3a(0x4);continue;case'6':_0x816f79['HEAVY']=_0x3fe8da[_0x1e3a(0x11)];continue;case'7':_0x816f79[_0x3fe8da[_0x1e3a(0x12)]]=_0x3fe8da[_0x1e3a(0x13)];continue;}break;}}({});function _0x1e3a(_0x351042,_0x1e3a10){_0x351042=_0x351042-0x0;const _0x16b318=_0x3510();let _0x58a2bc=_0x16b318[_0x351042];return _0x58a2bc;}export const triggerHaptic=(_0x1b7069=HapticType[_0x1e3a(0x5)])=>{const _0x53f61d={'vvtjL':_0x1e3a(0x14),'dttjw':function(_0x13d989,_0xdd9d97){return _0x13d989===_0xdd9d97;},'ronoh':_0x1e3a(0x15),'oELUL':_0x1e3a(0x16),'WFVBp':function(_0x421001,_0x45a886){return _0x421001!==_0x45a886;},'wWMrS':_0x1e3a(0x17),'XxMad':_0x1e3a(0x18),'lFNdx':function(_0x53b7cd,_0x433c8b){return _0x53b7cd===_0x433c8b;},'mIlrr':_0x1e3a(0x19),'wDdfG':_0x1e3a(0x1a)};if(_0x53f61d[_0x1e3a(0x1b)](Platform['OS'],_0x1e3a(0x1c)))try{const _0xdcf8db=__ONAIROS_REQ_FUNC__(0x0),_0x170a6c={'enableVibrateFallback':!![],'ignoreAndroidSystemSettings':![]};switch(_0x1b7069){case HapticType[_0x1e3a(0x5)]:_0xdcf8db[_0x1e3a(0x1d)](_0x1e3a(0x1e),_0x170a6c);break;case HapticType[_0x1e3a(0x2)]:_0xdcf8db['trigger'](_0x53f61d[_0x1e3a(0x1f)],_0x170a6c);break;case HapticType[_0x1e3a(0x20)]:_0xdcf8db[_0x1e3a(0x1d)](_0x53f61d[_0x1e3a(0x21)],_0x170a6c);break;case HapticType[_0x1e3a(0x22)]:_0xdcf8db[_0x1e3a(0x1d)](_0x1e3a(0x23),_0x170a6c);break;case HapticType[_0x1e3a(0xe)]:_0xdcf8db[_0x1e3a(0x1d)](_0x1e3a(0x24),_0x170a6c);break;case HapticType[_0x1e3a(0x1)]:_0xdcf8db[_0x1e3a(0x1d)](_0x1e3a(0x25),_0x170a6c);break;default:_0xdcf8db[_0x1e3a(0x1d)]('impactLight',_0x170a6c);}}catch(_0xd23ca1){_0x53f61d[_0x1e3a(0x26)](_0x53f61d['wWMrS'],_0x53f61d['XxMad'])?console[_0x1e3a(0x27)](_0x53f61d[_0x1e3a(0x28)],_0xd23ca1):_0x3bacda[_0x1e3a(0x27)](_0x53f61d[_0x1e3a(0x28)],_0x47c0ae);}else{if(_0x53f61d['lFNdx'](Platform['OS'],_0x53f61d[_0x1e3a(0x29)]))try{const {Vibration:_0x20140a}=__ONAIROS_REQ_FUNC__(0x1);_0x20140a['vibrate'](0x32);}catch(_0x11316c){console['warn'](_0x53f61d[_0x1e3a(0x2a)],_0x11316c);}}};function _0x3510(){const _0x348c8e=['5|1|6|7|3|0|2|4','ERROR','MEDIUM','BUTTON_PRESS','light','LIGHT','heavy','RLAQJ','split','uWadH','NBCsM','LlEMk','medium','pbPiQ','WARNING','warning','UxSaF','iPwhS','ONlKg','Zubte','Haptic\x20feedback\x20not\x20available:','impactMedium','impactHeavy','OwtkL','moTxI','android','Vibration\x20not\x20available:','dttjw','ios','trigger','impactLight','ronoh','HEAVY','oELUL','SUCCESS','notificationSuccess','notificationWarning','notificationError','WFVBp','warn','vvtjL','mIlrr','wDdfG'];_0x3510=function(){return _0x348c8e;};return _0x3510();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x1635(_0x1646cf,_0x163526){_0x1646cf=_0x1646cf-0x0;const _0x278358=_0x1646();let _0xca3a2a=_0x278358[_0x1646cf];return _0xca3a2a;}import{Platform}from'react-native';import{API_CONFIG}from'../config/api';function _0x1646(){const _0x22c144=['2|0|3|4|1','iOS:\x20Add\x20NSAppTransportSecurity\x20to\x20Info.plist','iOS:\x20Try\x20on\x20physical\x20device\x20instead\x20of\x20simulator','online','═══════════════════════════════════════════','🔍\x20ONAIROS\x20SDK\x20NETWORK\x20DIAGNOSTICS','───────────────────────────────────────────','HEAD','4|2|3|0|1','Internet\x20works\x20but\x20API\x20blocked.\x20Check:\x20VPN,\x20Firewall,\x20iOS\x20ATS\x20settings','fIhvI','diagnostic_test','1|2|0|3|4','\x0a───────────────────────────────────────────','📋\x20SUMMARY','MWUTJ','\x0a⚠️\x20SOME\x20TESTS\x20FAILED\x20-\x20See\x20recommendations\x20below:','ios','\x0a═══════════════════════════════════════════','Full\x20results\x20object\x20logged\x20below\x20for\x20debugging:','log','gXLFl','MyFzr','toISOString','📱\x20Platform:\x20','Version','\x0a🧪\x20Test\x201:\x20Internet\x20Connectivity\x20(google.com)','now','QUWMF','kqDoa','ZFhIq','tests','googleReachable','rawResults','google','status','\x20\x20\x20✅\x20PASS\x20-\x20Google\x20reachable\x20(','ms)','split','errors','push','Google\x20unreachable:\x20','message','recommendations','Check\x20internet\x20connection\x20on\x20device','qmYLK','BASE_URL','/health','catch','Unable\x20to\x20read','apiReachable','apiHealth','\x20\x20\x20✅\x20PASS\x20-\x20API\x20reachable\x20(','API\x20returned\x20status\x20','kpKeG','\x20\x20\x20❌\x20FAIL\x20-\x20','ZReZb','API\x20unreachable:\x20','VEbfe','youtube','text','substring','youtubeURL','youtubeOAuthWorks','\x20\x20\x20✅\x20BONUS\x20-\x20Got\x20YouTube\x20OAuth\x20URL!','uBWiy','BkxRb','AizzT','apiPost','POST\x20request\x20failed:\x20','yMMFV','Cwxhx','pbUEE','values','filter','length','keys','\x0a✅\x20ALL\x20TESTS\x20PASSED\x20-\x20SDK\x20should\x20work\x20correctly','TxWCY','VBHxL','NPbde','AHgPg','LVMhC','NqasO','UvAmN','uxbhM','kNLPJ','XfjHK','JpjLd','forEach','\x20\x20\x20','JlEXJ','stringify','KgNYG','stLoi','HrwUU','VrpqK','JhNao','offline','Gmnoe','https://www.google.com','api_unreachable','aYTcT','zoftf','HdMlt','CWJOs','eurxH','DkZTt'];_0x1646=function(){return _0x22c144;};return _0x1646();}export const runFullDiagnostics=async()=>{const _0x4a668a={'uBWiy':_0x1635(0x0),'kNLPJ':_0x1635(0x1),'NPbde':_0x1635(0x2),'uxbhM':_0x1635(0x3),'gXLFl':_0x1635(0x4),'MyFzr':_0x1635(0x5),'pbUEE':_0x1635(0x6),'QUWMF':'https://www.google.com','kqDoa':_0x1635(0x7),'ZFhIq':function(_0x227625,_0x253ef0){return _0x227625-_0x253ef0;},'StzPV':'0|1|3|2|4','qmYLK':'\x0a🧪\x20Test\x202:\x20API\x20Reachability\x20(API\x20server/health)','kpKeG':_0x1635(0x8),'ZReZb':_0x1635(0x9),'BkxRb':function(_0x112041,_0x40bc7f){return _0x112041===_0x40bc7f;},'fFWuw':_0x1635(0xa),'VEbfe':_0x1635(0xb),'UTNhQ':function(_0x59ad33,_0x475d2f){return _0x59ad33-_0x475d2f;},'AizzT':'KFqUh','ClkZd':_0x1635(0xc),'yMMFV':_0x1635(0xd),'Cwxhx':_0x1635(0xe),'TxWCY':_0x1635(0xf),'AHgPg':_0x1635(0x10),'LVMhC':function(_0x56e12c,_0x4abd5f){return _0x56e12c===_0x4abd5f;},'AUrxa':_0x1635(0x11),'UvAmN':'YfYjO','XfjHK':'Device\x20has\x20no\x20internet\x20-\x20check\x20WiFi/cellular','JpjLd':'\x0a📌\x20RECOMMENDATIONS:','hMmva':_0x1635(0x12),'JlEXJ':_0x1635(0x13)};console[_0x1635(0x14)](_0x4a668a[_0x1635(0x15)]),console[_0x1635(0x14)](_0x4a668a[_0x1635(0x16)]),console['log'](_0x4a668a[_0x1635(0x15)]);const _0xdd8cd7={'timestamp':new Date()[_0x1635(0x17)](),'platform':Platform['OS'],'platformVersion':Platform['Version'],'tests':{'googleReachable':![],'apiReachable':![],'apiPostWorks':![],'youtubeOAuthWorks':![]},'errors':[],'recommendations':[],'rawResults':{}};console[_0x1635(0x14)](_0x1635(0x18)+Platform['OS']+'\x20'+Platform[_0x1635(0x19)]),console['log'](_0x4a668a['pbUEE']),console[_0x1635(0x14)](_0x1635(0x1a));try{const _0x1f2e08=Date[_0x1635(0x1b)](),_0x51ee9d=await fetch(_0x4a668a[_0x1635(0x1c)],{'method':_0x4a668a[_0x1635(0x1d)]}),_0x48a488=_0x4a668a[_0x1635(0x1e)](Date['now'](),_0x1f2e08);_0xdd8cd7[_0x1635(0x1f)][_0x1635(0x20)]=!![],_0xdd8cd7[_0x1635(0x21)][_0x1635(0x22)]={'status':_0x51ee9d[_0x1635(0x23)],'time':_0x48a488},console[_0x1635(0x14)](_0x1635(0x24)+_0x48a488+_0x1635(0x25));}catch(_0x370519){const _0x204bb3=_0x4a668a['StzPV'][_0x1635(0x26)]('|');let _0x22ef42=0x0;while(!![]){switch(_0x204bb3[_0x22ef42++]){case'0':_0xdd8cd7[_0x1635(0x1f)][_0x1635(0x20)]=![];continue;case'1':_0xdd8cd7[_0x1635(0x27)][_0x1635(0x28)](_0x1635(0x29)+_0x370519['message']);continue;case'2':console[_0x1635(0x14)]('\x20\x20\x20❌\x20FAIL\x20-\x20'+_0x370519[_0x1635(0x2a)]);continue;case'3':_0xdd8cd7[_0x1635(0x21)][_0x1635(0x22)]={'error':_0x370519[_0x1635(0x2a)]};continue;case'4':_0xdd8cd7[_0x1635(0x2b)][_0x1635(0x28)](_0x1635(0x2c));continue;}break;}}console[_0x1635(0x14)](_0x4a668a[_0x1635(0x2d)]);try{const _0x4582c5=Date[_0x1635(0x1b)](),_0x573b84=await fetch(API_CONFIG[_0x1635(0x2e)]+_0x1635(0x2f),{'method':'GET','headers':{'Accept':'application/json'}}),_0x53a944=_0x4a668a[_0x1635(0x1e)](Date[_0x1635(0x1b)](),_0x4582c5),_0x2bbb10=await _0x573b84['text']()[_0x1635(0x30)](()=>_0x1635(0x31));_0xdd8cd7[_0x1635(0x1f)][_0x1635(0x32)]=_0x573b84['ok'],_0xdd8cd7['rawResults'][_0x1635(0x33)]={'status':_0x573b84[_0x1635(0x23)],'time':_0x53a944,'body':_0x2bbb10['substring'](0x0,0xc8)},_0x573b84['ok']?console[_0x1635(0x14)](_0x1635(0x34)+_0x53a944+'ms)'):(console[_0x1635(0x14)]('\x20\x20\x20⚠️\x20PARTIAL\x20-\x20API\x20responded\x20with\x20'+_0x573b84[_0x1635(0x23)]),_0xdd8cd7[_0x1635(0x27)]['push'](_0x1635(0x35)+_0x573b84['status']));}catch(_0x2cfe12){const _0xf19540=_0x4a668a[_0x1635(0x36)][_0x1635(0x26)]('|');let _0x2f2cf0=0x0;while(!![]){switch(_0xf19540[_0x2f2cf0++]){case'0':console[_0x1635(0x14)](_0x1635(0x37)+_0x2cfe12[_0x1635(0x2a)]);continue;case'1':_0xdd8cd7[_0x1635(0x1f)][_0x1635(0x20)]&&_0xdd8cd7[_0x1635(0x2b)][_0x1635(0x28)](_0x4a668a[_0x1635(0x38)]);continue;case'2':_0xdd8cd7[_0x1635(0x27)][_0x1635(0x28)](_0x1635(0x39)+_0x2cfe12[_0x1635(0x2a)]);continue;case'3':_0xdd8cd7[_0x1635(0x21)][_0x1635(0x33)]={'error':_0x2cfe12[_0x1635(0x2a)]};continue;case'4':_0xdd8cd7['tests'][_0x1635(0x32)]=![];continue;}break;}}console[_0x1635(0x14)]('\n\uD83E\uDDEA Test 3: POST Request (OAuth simulation)');try{if(_0x4a668a['BkxRb'](_0x1635(0xa),_0x4a668a['fFWuw'])){const _0x51c5ec=Date[_0x1635(0x1b)](),_0x77e280=await fetch(API_CONFIG['BASE_URL']+'/youtube/authorize',{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json'},'body':JSON['stringify']({'session':{'username':_0x4a668a[_0x1635(0x3a)],'platform':_0x1635(0x3b),'timestamp':new Date()[_0x1635(0x17)]()}})}),_0x5cce70=_0x4a668a['UTNhQ'](Date[_0x1635(0x1b)](),_0x51c5ec),_0x1b8fe2=await _0x77e280[_0x1635(0x3c)]()[_0x1635(0x30)](()=>_0x1635(0x31));_0xdd8cd7['rawResults']['apiPost']={'status':_0x77e280[_0x1635(0x23)],'time':_0x5cce70,'body':_0x1b8fe2[_0x1635(0x3d)](0x0,0x1f4)},_0xdd8cd7[_0x1635(0x1f)]['apiPostWorks']=!![],console[_0x1635(0x14)]('\x20\x20\x20✅\x20PASS\x20-\x20POST\x20request\x20succeeded,\x20status:\x20'+_0x77e280['status']+'\x20('+_0x5cce70+'ms)');try{const _0x2015d8=JSON['parse'](_0x1b8fe2);_0x2015d8[_0x1635(0x3e)]&&(_0xdd8cd7['tests'][_0x1635(0x3f)]=!![],console[_0x1635(0x14)](_0x1635(0x40)));}catch{}}else{const _0x4ce12c=_0x4a668a[_0x1635(0x41)][_0x1635(0x26)]('|');let _0x29c09b=0x0;while(!![]){switch(_0x4ce12c[_0x29c09b++]){case'0':_0x1320cd[_0x1635(0x27)][_0x1635(0x28)](_0x1635(0x29)+_0x5d72ed[_0x1635(0x2a)]);continue;case'1':_0x1f10cb[_0x1635(0x2b)]['push'](_0x1635(0x2c));continue;case'2':_0x48a66c['tests'][_0x1635(0x20)]=![];continue;case'3':_0x1b09a7[_0x1635(0x21)]['google']={'error':_0x3404e6['message']};continue;case'4':_0x2cbd86[_0x1635(0x14)]('\x20\x20\x20❌\x20FAIL\x20-\x20'+_0x3b2db4['message']);continue;}break;}}}catch(_0xd68856){if(_0x4a668a[_0x1635(0x42)](_0x4a668a[_0x1635(0x43)],_0x4a668a['AizzT'])){const _0x2f1f21=_0x4a668a['ClkZd'][_0x1635(0x26)]('|');let _0x595baf=0x0;while(!![]){switch(_0x2f1f21[_0x595baf++]){case'0':_0xdd8cd7[_0x1635(0x21)][_0x1635(0x44)]={'error':_0xd68856['message']};continue;case'1':_0xdd8cd7[_0x1635(0x1f)]['apiPostWorks']=![];continue;case'2':_0xdd8cd7['errors'][_0x1635(0x28)](_0x1635(0x45)+_0xd68856[_0x1635(0x2a)]);continue;case'3':console[_0x1635(0x14)](_0x1635(0x37)+_0xd68856[_0x1635(0x2a)]);continue;case'4':_0xdd8cd7[_0x1635(0x2b)][_0x1635(0x28)]('POST requests failing. This is the exact issue affecting OAuth.');continue;}break;}}else _0x2c703e[_0x1635(0x1f)][_0x1635(0x3f)]=!![],_0xc4c208[_0x1635(0x14)](_0x1635(0x40));}console[_0x1635(0x14)](_0x4a668a[_0x1635(0x46)]),console[_0x1635(0x14)](_0x4a668a[_0x1635(0x47)]),console[_0x1635(0x14)](_0x4a668a[_0x1635(0x48)]);const _0x3855f4=Object[_0x1635(0x49)](_0xdd8cd7[_0x1635(0x1f)])[_0x1635(0x4a)](Boolean)[_0x1635(0x4b)],_0x40b93c=Object[_0x1635(0x4c)](_0xdd8cd7['tests'])[_0x1635(0x4b)];console[_0x1635(0x14)]('\x0aTests\x20Passed:\x20'+_0x3855f4+'/'+_0x40b93c);if(_0x3855f4===_0x40b93c)console[_0x1635(0x14)](_0x1635(0x4d));else{if(_0x4a668a[_0x1635(0x42)](_0x4a668a[_0x1635(0x4e)],_0x1635(0x4f)))_0x156d12[_0x1635(0x2b)][_0x1635(0x28)](_0x4a668a['kNLPJ'],_0x4a668a[_0x1635(0x50)]);else{console['log'](_0x4a668a[_0x1635(0x51)]);if(_0x4a668a[_0x1635(0x52)](Platform['OS'],_0x4a668a['AUrxa'])&&!_0xdd8cd7[_0x1635(0x1f)][_0x1635(0x32)]){if(_0x4a668a[_0x1635(0x52)](_0x1635(0x53),_0x4a668a[_0x1635(0x54)]))return _0x4a668a[_0x1635(0x55)];else _0xdd8cd7[_0x1635(0x2b)][_0x1635(0x28)](_0x4a668a[_0x1635(0x56)],_0x1635(0x2));}!_0xdd8cd7['tests']['googleReachable']&&_0xdd8cd7[_0x1635(0x2b)][_0x1635(0x28)](_0x4a668a[_0x1635(0x57)]),console[_0x1635(0x14)](_0x4a668a[_0x1635(0x58)]),_0xdd8cd7[_0x1635(0x2b)][_0x1635(0x59)]((_0x3ede21,_0x374989)=>{console[_0x1635(0x14)](_0x1635(0x5a)+(_0x374989+0x1)+'.\x20'+_0x3ede21);});}}return console[_0x1635(0x14)](_0x4a668a['hMmva']),console[_0x1635(0x14)](_0x4a668a[_0x1635(0x5b)]),console[_0x1635(0x14)](JSON[_0x1635(0x5c)](_0xdd8cd7,null,0x2)),_0xdd8cd7;};export const isApiReachable=async()=>{const _0x383520={'JhNao':_0x1635(0x4d),'stLoi':function(_0x58e980,_0x3a8457,_0x516519){return _0x58e980(_0x3a8457,_0x516519);},'HrwUU':'KNmqn','VrpqK':_0x1635(0x5d)};try{const _0x15627c=await _0x383520[_0x1635(0x5e)](fetch,API_CONFIG['BASE_URL']+_0x1635(0x2f),{'method':'GET'});return _0x15627c['ok'];}catch{if(_0x383520[_0x1635(0x5f)]!==_0x383520[_0x1635(0x60)])return![];else _0x500d85[_0x1635(0x14)](_0x383520[_0x1635(0x61)]);}};export const getNetworkStatus=async()=>{const _0x239fe5={'DkZTt':_0x1635(0x62),'TrNgw':function(_0x3dbf97,_0x5c660f){return _0x3dbf97===_0x5c660f;},'aYTcT':_0x1635(0x63),'zLIEQ':function(_0x10845f,_0x19d108,_0x551fb1){return _0x10845f(_0x19d108,_0x551fb1);},'zoftf':_0x1635(0x64),'HdMlt':'HEAD','CWJOs':function(_0x1ae5e4,_0x15f51d){return _0x1ae5e4!==_0x15f51d;},'MmiVW':'kmODN','zuTBs':_0x1635(0x65)};try{if(_0x239fe5['TrNgw'](_0x239fe5['aYTcT'],_0x239fe5[_0x1635(0x66)])){await _0x239fe5['zLIEQ'](fetch,_0x239fe5[_0x1635(0x67)],{'method':_0x239fe5[_0x1635(0x68)]});const _0x573d82=await fetch(API_CONFIG['BASE_URL']+_0x1635(0x2f));return _0x573d82['ok']?_0x239fe5[_0x1635(0x69)](_0x1635(0x6a),_0x239fe5['MmiVW'])?_0x1635(0x3):_0x239fe5[_0x1635(0x6b)]:_0x239fe5['zuTBs'];}else{const _0x1635c4=_0x251713['parse'](_0x36995);_0x1635c4['youtubeURL']&&(_0x5b7c91['tests']['youtubeOAuthWorks']=!![],_0xb0507d['log']('\x20\x20\x20✅\x20BONUS\x20-\x20Got\x20YouTube\x20OAuth\x20URL!'));}}catch{return _0x239fe5['DkZTt'];}};
|
|
@@ -1,333 +1 @@
|
|
|
1
|
-
import NetInfo from '@react-native-community/netinfo';
|
|
2
|
-
import { logDebug } from './debugHelper';
|
|
3
|
-
import { getJWT, makeUserRequest, makeDeveloperRequest, isUserAuthenticated, extractUsernameFromJWT } from '../services/apiKeyService';
|
|
4
|
-
|
|
5
|
-
// API response types
|
|
6
|
-
|
|
7
|
-
// Error types
|
|
8
|
-
|
|
9
|
-
// API error structure
|
|
10
|
-
export class ApiError extends Error {
|
|
11
|
-
constructor(message, type, code, details) {
|
|
12
|
-
super(message);
|
|
13
|
-
this.type = type;
|
|
14
|
-
this.code = code;
|
|
15
|
-
this.details = details;
|
|
16
|
-
this.name = 'ApiError';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Check if the device has an active network connection
|
|
22
|
-
*/
|
|
23
|
-
const checkNetworkConnection = async () => {
|
|
24
|
-
const networkState = await NetInfo.fetch();
|
|
25
|
-
return networkState.isConnected === true;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Make user-authenticated API request using JWT token
|
|
30
|
-
*/
|
|
31
|
-
const makeUserApiRequest = async (endpoint, method, options = {}) => {
|
|
32
|
-
const {
|
|
33
|
-
data,
|
|
34
|
-
headers = {},
|
|
35
|
-
debug = false
|
|
36
|
-
} = options;
|
|
37
|
-
try {
|
|
38
|
-
// Check for network connectivity
|
|
39
|
-
const isConnected = await checkNetworkConnection();
|
|
40
|
-
if (!isConnected) {
|
|
41
|
-
throw new ApiError('No network connection available', 'network_error');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Check if user is authenticated
|
|
45
|
-
if (!isUserAuthenticated()) {
|
|
46
|
-
throw new ApiError('User not authenticated. Please verify email first.', 'auth_error');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Log request information if debug mode is enabled
|
|
50
|
-
if (debug) {
|
|
51
|
-
logDebug('User API Request', {
|
|
52
|
-
endpoint,
|
|
53
|
-
method,
|
|
54
|
-
headers: {
|
|
55
|
-
...headers,
|
|
56
|
-
Authorization: '[REDACTED]'
|
|
57
|
-
},
|
|
58
|
-
data: data || null
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Make authenticated request using JWT token
|
|
63
|
-
const response = await makeUserRequest(endpoint, {
|
|
64
|
-
method,
|
|
65
|
-
headers,
|
|
66
|
-
...(data ? {
|
|
67
|
-
body: JSON.stringify(data)
|
|
68
|
-
} : {})
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// Parse response as JSON
|
|
72
|
-
const responseData = await response.json();
|
|
73
|
-
|
|
74
|
-
// Log response if debug mode is enabled
|
|
75
|
-
if (debug) {
|
|
76
|
-
logDebug('User API Response', {
|
|
77
|
-
status: response.status,
|
|
78
|
-
data: responseData
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Handle API error responses
|
|
83
|
-
if (!response.ok) {
|
|
84
|
-
var _responseData$error, _responseData$error2, _responseData$error3;
|
|
85
|
-
const errorType = response.status === 401 || response.status === 403 ? 'auth_error' : response.status === 400 ? 'validation_error' : response.status >= 500 ? 'server_error' : 'unknown_error';
|
|
86
|
-
throw new ApiError(((_responseData$error = responseData.error) === null || _responseData$error === void 0 ? void 0 : _responseData$error.message) || 'API request failed', errorType, (_responseData$error2 = responseData.error) === null || _responseData$error2 === void 0 ? void 0 : _responseData$error2.code, (_responseData$error3 = responseData.error) === null || _responseData$error3 === void 0 ? void 0 : _responseData$error3.details);
|
|
87
|
-
}
|
|
88
|
-
return responseData;
|
|
89
|
-
} catch (error) {
|
|
90
|
-
// Handle specific error types
|
|
91
|
-
if (error instanceof ApiError) {
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
if (error.name === 'AbortError') {
|
|
95
|
-
throw new ApiError('Request timed out', 'timeout_error');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Log error if debug mode is enabled
|
|
99
|
-
if (debug) {
|
|
100
|
-
logDebug('User API Error', {
|
|
101
|
-
endpoint,
|
|
102
|
-
method,
|
|
103
|
-
error: error.message || 'Unknown error'
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Return a generic error for all other cases
|
|
108
|
-
throw new ApiError(error.message || 'An unexpected error occurred', 'unknown_error');
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Make developer-authenticated API request using API key
|
|
114
|
-
*/
|
|
115
|
-
const makeDeveloperApiRequest = async (endpoint, method, options = {}) => {
|
|
116
|
-
const {
|
|
117
|
-
data,
|
|
118
|
-
headers = {},
|
|
119
|
-
debug = false
|
|
120
|
-
} = options;
|
|
121
|
-
try {
|
|
122
|
-
// Check for network connectivity
|
|
123
|
-
const isConnected = await checkNetworkConnection();
|
|
124
|
-
if (!isConnected) {
|
|
125
|
-
throw new ApiError('No network connection available', 'network_error');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Log request information if debug mode is enabled
|
|
129
|
-
if (debug) {
|
|
130
|
-
logDebug('Developer API Request', {
|
|
131
|
-
endpoint,
|
|
132
|
-
method,
|
|
133
|
-
headers: {
|
|
134
|
-
...headers,
|
|
135
|
-
Authorization: '[REDACTED]'
|
|
136
|
-
},
|
|
137
|
-
data: data || null
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Make authenticated request using developer API key
|
|
142
|
-
const response = await makeDeveloperRequest(endpoint, {
|
|
143
|
-
method,
|
|
144
|
-
headers,
|
|
145
|
-
...(data ? {
|
|
146
|
-
body: JSON.stringify(data)
|
|
147
|
-
} : {})
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// Parse response as JSON
|
|
151
|
-
const responseData = await response.json();
|
|
152
|
-
|
|
153
|
-
// Log response if debug mode is enabled
|
|
154
|
-
if (debug) {
|
|
155
|
-
logDebug('Developer API Response', {
|
|
156
|
-
status: response.status,
|
|
157
|
-
data: responseData
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Handle API error responses
|
|
162
|
-
if (!response.ok) {
|
|
163
|
-
var _responseData$error4, _responseData$error5, _responseData$error6;
|
|
164
|
-
const errorType = response.status === 401 || response.status === 403 ? 'auth_error' : response.status === 400 ? 'validation_error' : response.status >= 500 ? 'server_error' : 'unknown_error';
|
|
165
|
-
throw new ApiError(((_responseData$error4 = responseData.error) === null || _responseData$error4 === void 0 ? void 0 : _responseData$error4.message) || 'API request failed', errorType, (_responseData$error5 = responseData.error) === null || _responseData$error5 === void 0 ? void 0 : _responseData$error5.code, (_responseData$error6 = responseData.error) === null || _responseData$error6 === void 0 ? void 0 : _responseData$error6.details);
|
|
166
|
-
}
|
|
167
|
-
return responseData;
|
|
168
|
-
} catch (error) {
|
|
169
|
-
// Handle specific error types
|
|
170
|
-
if (error instanceof ApiError) {
|
|
171
|
-
throw error;
|
|
172
|
-
}
|
|
173
|
-
if (error.name === 'AbortError') {
|
|
174
|
-
throw new ApiError('Request timed out', 'timeout_error');
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Log error if debug mode is enabled
|
|
178
|
-
if (debug) {
|
|
179
|
-
logDebug('Developer API Error', {
|
|
180
|
-
endpoint,
|
|
181
|
-
method,
|
|
182
|
-
error: error.message || 'Unknown error'
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Return a generic error for all other cases
|
|
187
|
-
throw new ApiError(error.message || 'An unexpected error occurred', 'unknown_error');
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Validate user credentials with the API (uses JWT)
|
|
193
|
-
*/
|
|
194
|
-
export const validateCredentials = async (username, options = {
|
|
195
|
-
debug: false
|
|
196
|
-
}) => {
|
|
197
|
-
try {
|
|
198
|
-
var _response$data, _response$error;
|
|
199
|
-
const response = await makeUserApiRequest('auth/validate', 'POST', {
|
|
200
|
-
data: {
|
|
201
|
-
username
|
|
202
|
-
},
|
|
203
|
-
debug: options.debug
|
|
204
|
-
});
|
|
205
|
-
return {
|
|
206
|
-
isValid: response.success && ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.isValid) === true,
|
|
207
|
-
message: (_response$error = response.error) === null || _response$error === void 0 ? void 0 : _response$error.message
|
|
208
|
-
};
|
|
209
|
-
} catch (error) {
|
|
210
|
-
return {
|
|
211
|
-
isValid: false,
|
|
212
|
-
message: error.message
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Create a new user account (uses developer API key)
|
|
219
|
-
*/
|
|
220
|
-
export const createAccount = async (credentials, options = {
|
|
221
|
-
debug: false
|
|
222
|
-
}) => {
|
|
223
|
-
return makeDeveloperApiRequest('auth/register', 'POST', {
|
|
224
|
-
data: {
|
|
225
|
-
username: credentials.username,
|
|
226
|
-
platforms: credentials.platforms
|
|
227
|
-
},
|
|
228
|
-
debug: options.debug
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Authenticate with the API using credentials (uses JWT)
|
|
234
|
-
*/
|
|
235
|
-
export const authenticate = async (credentials, options = {
|
|
236
|
-
debug: false
|
|
237
|
-
}) => {
|
|
238
|
-
return makeUserApiRequest('auth/login', 'POST', {
|
|
239
|
-
data: {
|
|
240
|
-
username: credentials.username,
|
|
241
|
-
pin: credentials.userPin
|
|
242
|
-
},
|
|
243
|
-
debug: options.debug
|
|
244
|
-
});
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Refresh authentication token (uses JWT)
|
|
249
|
-
*/
|
|
250
|
-
export const refreshToken = async (refreshToken, options = {
|
|
251
|
-
debug: false
|
|
252
|
-
}) => {
|
|
253
|
-
return makeUserApiRequest('auth/refresh', 'POST', {
|
|
254
|
-
data: {
|
|
255
|
-
refreshToken
|
|
256
|
-
},
|
|
257
|
-
debug: options.debug
|
|
258
|
-
});
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Get user's connected platform data (uses JWT)
|
|
263
|
-
*/
|
|
264
|
-
export const getPlatformData = async (platform, options = {
|
|
265
|
-
debug: false
|
|
266
|
-
}) => {
|
|
267
|
-
return makeUserApiRequest(`platforms/${platform}/data`, 'GET', {
|
|
268
|
-
debug: options.debug
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Get user profile information (uses JWT)
|
|
274
|
-
*/
|
|
275
|
-
export const getUserProfile = async (options = {
|
|
276
|
-
debug: false
|
|
277
|
-
}) => {
|
|
278
|
-
return makeUserApiRequest('user/profile', 'GET', {
|
|
279
|
-
debug: options.debug
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Update user platform connections (uses JWT)
|
|
285
|
-
*/
|
|
286
|
-
export const updatePlatformConnections = async (platforms, options = {
|
|
287
|
-
debug: false
|
|
288
|
-
}) => {
|
|
289
|
-
return makeUserApiRequest('user/platforms', 'PUT', {
|
|
290
|
-
data: {
|
|
291
|
-
platforms
|
|
292
|
-
},
|
|
293
|
-
debug: options.debug
|
|
294
|
-
});
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Store user PIN (uses JWT and extracts username from JWT)
|
|
299
|
-
*/
|
|
300
|
-
export const storePIN = async (pin, options = {}) => {
|
|
301
|
-
const {
|
|
302
|
-
debug = false,
|
|
303
|
-
username
|
|
304
|
-
} = options;
|
|
305
|
-
|
|
306
|
-
// Extract username from JWT if not provided
|
|
307
|
-
const userToStore = username || extractUsernameFromJWT();
|
|
308
|
-
if (!userToStore) {
|
|
309
|
-
throw new ApiError('No username available - either provide username or ensure JWT token is valid', 'auth_error');
|
|
310
|
-
}
|
|
311
|
-
return makeUserApiRequest('store-pin/mobile', 'POST', {
|
|
312
|
-
data: {
|
|
313
|
-
username: userToStore,
|
|
314
|
-
pin
|
|
315
|
-
},
|
|
316
|
-
debug
|
|
317
|
-
});
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Get current JWT token
|
|
322
|
-
*/
|
|
323
|
-
export const getCurrentUserToken = async () => {
|
|
324
|
-
return await getJWT();
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Check if user is authenticated with JWT
|
|
329
|
-
*/
|
|
330
|
-
export const isCurrentUserAuthenticated = () => {
|
|
331
|
-
return isUserAuthenticated();
|
|
332
|
-
};
|
|
333
|
-
//# sourceMappingURL=onairosApi.js.map
|
|
1
|
+
import NetInfo from'@react-native-community/netinfo';import{logDebug}from'./debugHelper';import{getJWT,makeUserRequest,makeDeveloperRequest,isUserAuthenticated,extractUsernameFromJWT}from'../services/apiKeyService';export class ApiError extends Error{constructor(_0x5ea7e4,_0x3fcbe3,_0x10a920,_0x2ecf5d){const _0x3d1187={'zvTYX':'3|2|0|1|4','wxflU':_0x138c(0x0)},_0x408110=_0x3d1187['zvTYX'][_0x138c(0x1)]('|');let _0x3f230c=0x0;while(!![]){switch(_0x408110[_0x3f230c++]){case'0':this[_0x138c(0x2)]=_0x10a920;continue;case'1':this[_0x138c(0x3)]=_0x2ecf5d;continue;case'2':this[_0x138c(0x4)]=_0x3fcbe3;continue;case'3':super(_0x5ea7e4);continue;case'4':this['name']=_0x3d1187[_0x138c(0x5)];continue;}break;}}}const checkNetworkConnection=async()=>{const _0x16f326={'faZss':function(_0x3ee73a,_0x5ad466){return _0x3ee73a===_0x5ad466;}},_0x4e5b04=await NetInfo[_0x138c(0x6)]();return _0x16f326[_0x138c(0x7)](_0x4e5b04['isConnected'],!![]);},makeUserApiRequest=async(_0x1eace6,_0x2ff246,_0x4d1ebb={})=>{const _0x454f86={'MQZUu':function(_0x3b9f94,_0x16bd56,_0x154fc0,_0x5b9926){return _0x3b9f94(_0x16bd56,_0x154fc0,_0x5b9926);},'KlrWR':function(_0x955de6,_0x2573a6){return _0x955de6===_0x2573a6;},'QDjCB':_0x138c(0x8),'gpEkY':_0x138c(0x9),'lmCeI':function(_0x255f88,_0x41401c){return _0x255f88>=_0x41401c;},'NukmG':_0x138c(0xa),'Zflmr':_0x138c(0xb),'ERBOD':function(_0x5d9385,_0x1c1a07){return _0x5d9385===_0x1c1a07;},'uLWeS':function(_0x1283db){return _0x1283db();},'QnOyk':_0x138c(0xc),'iCEYx':_0x138c(0xd),'cfeSI':_0x138c(0xe),'Anqtt':'User\x20API\x20Request','VJElx':_0x138c(0xf),'CHwdD':function(_0x28b7ae,_0x57d49d){return _0x28b7ae||_0x57d49d;},'BkHpX':function(_0x3ee272,_0xa1c6cb,_0x5c3702){return _0x3ee272(_0xa1c6cb,_0x5c3702);},'ebGyw':_0x138c(0x10),'mlmqt':_0x138c(0x11),'vSnAn':_0x138c(0x12),'pWYQT':function(_0x582f1f,_0x2fbdc4){return _0x582f1f===_0x2fbdc4;},'NHGHJ':_0x138c(0x13),'ANMzc':function(_0x16824a,_0x3add3d){return _0x16824a===_0x3add3d;},'jzJkD':function(_0x3d3a14,_0x2fc5f9){return _0x3d3a14===_0x2fc5f9;},'iIUvf':function(_0x423e41,_0x576d9a){return _0x423e41===_0x576d9a;},'kZDKE':_0x138c(0x14),'ZmNQq':function(_0x1c5fb8,_0x3b1673){return _0x1c5fb8 instanceof _0x3b1673;},'nJgSl':function(_0x4b7c59,_0x5ebd13){return _0x4b7c59===_0x5ebd13;},'EXPGM':_0x138c(0x15),'rWPHg':_0x138c(0x16),'OWnGQ':_0x138c(0x17),'tRfte':function(_0x16a915,_0x5b12c1,_0x3c65c2){return _0x16a915(_0x5b12c1,_0x3c65c2);},'PSsAl':'User\x20API\x20Error','FhZsz':_0x138c(0x18),'qMaVQ':_0x138c(0x19)},{data:_0x18c8e8,headers:headers={},debug:debug=![]}=_0x4d1ebb;try{const _0x185299=await _0x454f86[_0x138c(0x1a)](checkNetworkConnection);if(!_0x185299)throw new ApiError(_0x454f86[_0x138c(0x1b)],_0x454f86[_0x138c(0x1c)]);if(!_0x454f86[_0x138c(0x1a)](isUserAuthenticated))throw new ApiError(_0x454f86[_0x138c(0x1d)],_0x454f86[_0x138c(0x1e)]);debug&&logDebug(_0x454f86[_0x138c(0x1f)],{'endpoint':_0x1eace6,'method':_0x2ff246,'headers':{...headers,'Authorization':_0x454f86[_0x138c(0x20)]},'data':_0x454f86[_0x138c(0x21)](_0x18c8e8,null)});const _0x4fd65d=await _0x454f86[_0x138c(0x22)](makeUserRequest,_0x1eace6,{'method':_0x2ff246,'headers':headers,..._0x18c8e8?{'body':JSON[_0x138c(0x23)](_0x18c8e8)}:{}}),_0x584af5=await _0x4fd65d[_0x138c(0x24)]();if(debug){if(_0x454f86[_0x138c(0x25)](_0x454f86['ebGyw'],_0x454f86['mlmqt']))return _0x454f86['MQZUu'](_0x45e054,_0x138c(0x26)+_0x8a5840+_0x138c(0x27),'GET',{'debug':_0x12d159[_0x138c(0x28)]});else _0x454f86[_0x138c(0x22)](logDebug,_0x454f86[_0x138c(0x29)],{'status':_0x4fd65d['status'],'data':_0x584af5});}if(!_0x4fd65d['ok']){if(_0x454f86['pWYQT'](_0x454f86['NHGHJ'],_0x454f86['NHGHJ'])){var _0x3dde6a,_0x4d6658,_0x53473f;const _0xb8a14a=_0x454f86[_0x138c(0x2a)](_0x4fd65d[_0x138c(0x2b)],0x191)||_0x454f86['jzJkD'](_0x4fd65d[_0x138c(0x2b)],0x193)?_0x454f86[_0x138c(0x1e)]:_0x454f86['iIUvf'](_0x4fd65d[_0x138c(0x2b)],0x190)?_0x454f86[_0x138c(0x2c)]:_0x454f86[_0x138c(0x2d)](_0x4fd65d[_0x138c(0x2b)],0x1f4)?_0x454f86['kZDKE']:_0x138c(0xa);throw new ApiError(((_0x3dde6a=_0x584af5[_0x138c(0x2e)])===null||_0x454f86['ANMzc'](_0x3dde6a,void 0x0)?void 0x0:_0x3dde6a[_0x138c(0x2f)])||_0x138c(0xb),_0xb8a14a,_0x454f86[_0x138c(0x2a)](_0x4d6658=_0x584af5['error'],null)||_0x454f86[_0x138c(0x30)](_0x4d6658,void 0x0)?void 0x0:_0x4d6658['code'],_0x454f86['ANMzc'](_0x53473f=_0x584af5[_0x138c(0x2e)],null)||_0x454f86[_0x138c(0x2a)](_0x53473f,void 0x0)?void 0x0:_0x53473f[_0x138c(0x3)]);}else{var _0x2d0f8e,_0x2e4a9f,_0x32e0de;const _0x59306d=_0x233143['status']===0x191||_0x454f86['KlrWR'](_0x3128ed[_0x138c(0x2b)],0x193)?_0x454f86['QDjCB']:_0x38100e[_0x138c(0x2b)]===0x190?_0x454f86[_0x138c(0x2c)]:_0x454f86[_0x138c(0x2d)](_0x2eb262['status'],0x1f4)?_0x138c(0x14):_0x454f86[_0x138c(0x31)];throw new _0x3e80ec(((_0x2d0f8e=_0x41f240[_0x138c(0x2e)])===null||_0x454f86['KlrWR'](_0x2d0f8e,void 0x0)?void 0x0:_0x2d0f8e[_0x138c(0x2f)])||_0x454f86[_0x138c(0x32)],_0x59306d,_0x454f86[_0x138c(0x30)](_0x2e4a9f=_0x19693d[_0x138c(0x2e)],null)||_0x2e4a9f===void 0x0?void 0x0:_0x2e4a9f[_0x138c(0x2)],_0x454f86[_0x138c(0x25)](_0x32e0de=_0x177e74[_0x138c(0x2e)],null)||_0x454f86[_0x138c(0x25)](_0x32e0de,void 0x0)?void 0x0:_0x32e0de['details']);}}return _0x584af5;}catch(_0x532bfc){if(_0x454f86['ZmNQq'](_0x532bfc,ApiError))throw _0x532bfc;if(_0x454f86[_0x138c(0x33)](_0x532bfc[_0x138c(0x34)],_0x454f86[_0x138c(0x35)]))throw new ApiError(_0x454f86['rWPHg'],_0x454f86[_0x138c(0x36)]);debug&&_0x454f86[_0x138c(0x37)](logDebug,_0x454f86[_0x138c(0x38)],{'endpoint':_0x1eace6,'method':_0x2ff246,'error':_0x532bfc[_0x138c(0x2f)]||_0x454f86[_0x138c(0x39)]});throw new ApiError(_0x532bfc[_0x138c(0x2f)]||_0x454f86['qMaVQ'],_0x454f86[_0x138c(0x31)]);}},makeDeveloperApiRequest=async(_0x1e837f,_0x26bd8f,_0x2d81ea={})=>{const _0x4452c8={'qrGOr':_0x138c(0xc),'Wcrma':_0x138c(0xd),'giSRP':function(_0x2ae637,_0xf09c4c,_0x5f0ea4){return _0x2ae637(_0xf09c4c,_0x5f0ea4);},'ktcYc':_0x138c(0x3a),'OzeWg':'[REDACTED]','cFqQn':function(_0x55aa31,_0x3f2a77){return _0x55aa31||_0x3f2a77;},'xeNCY':_0x138c(0x3b),'ETbUG':function(_0x521ccf,_0x50b8be,_0x2a6045,_0x373517){return _0x521ccf(_0x50b8be,_0x2a6045,_0x373517);},'FmDiR':function(_0x57ffb3){return _0x57ffb3();},'CBWWf':function(_0x46b97c,_0x1c5021){return _0x46b97c||_0x1c5021;},'eGZCp':function(_0x445ff5,_0x572a4a,_0x59f8a5){return _0x445ff5(_0x572a4a,_0x59f8a5);},'zCiiF':function(_0x246872,_0x2e222b){return _0x246872!==_0x2e222b;},'lnYCM':_0x138c(0x3c),'cUFBY':'fyQYe','JmNzM':_0x138c(0x8),'OTYzA':_0x138c(0x9),'Vbrud':function(_0x461427,_0x46066d){return _0x461427>=_0x46066d;},'PHxgN':_0x138c(0xa),'PBUbj':function(_0x34d644,_0x24ed14){return _0x34d644===_0x24ed14;},'ruLuJ':function(_0x1e9537,_0x437b4b){return _0x1e9537===_0x437b4b;},'xZkRe':function(_0x16412a,_0x2f621c){return _0x16412a!==_0x2f621c;},'riGiD':'jbavF','fVQdQ':_0x138c(0x15),'eauLJ':_0x138c(0x16),'eLlgi':'timeout_error','tbIJc':_0x138c(0x3d),'HfNzz':_0x138c(0x3e),'llDvM':_0x138c(0x18),'PQEgR':'An\x20unexpected\x20error\x20occurred'},{data:_0x252548,headers:headers={},debug:debug=![]}=_0x2d81ea;try{const _0x1c192f=await _0x4452c8[_0x138c(0x3f)](checkNetworkConnection);if(!_0x1c192f)throw new ApiError(_0x4452c8[_0x138c(0x40)],_0x4452c8[_0x138c(0x41)]);debug&&logDebug(_0x4452c8[_0x138c(0x42)],{'endpoint':_0x1e837f,'method':_0x26bd8f,'headers':{...headers,'Authorization':_0x4452c8[_0x138c(0x43)]},'data':_0x4452c8[_0x138c(0x44)](_0x252548,null)});const _0x3467bc=await _0x4452c8['eGZCp'](makeDeveloperRequest,_0x1e837f,{'method':_0x26bd8f,'headers':headers,..._0x252548?{'body':JSON[_0x138c(0x23)](_0x252548)}:{}}),_0x39e9ad=await _0x3467bc[_0x138c(0x24)]();if(debug){if(_0x4452c8[_0x138c(0x45)]('ASRuG',_0x138c(0x46)))throw new _0x54dd8a(_0x4452c8[_0x138c(0x40)],_0x4452c8[_0x138c(0x41)]);else logDebug(_0x4452c8['lnYCM'],{'status':_0x3467bc[_0x138c(0x2b)],'data':_0x39e9ad});}if(!_0x3467bc['ok']){if(_0x4452c8[_0x138c(0x47)]===_0x4452c8[_0x138c(0x47)]){var _0xda0b2a,_0x377206,_0x4381e4;const _0xf8b06=_0x3467bc['status']===0x191||_0x3467bc[_0x138c(0x2b)]===0x193?_0x4452c8[_0x138c(0x48)]:_0x3467bc[_0x138c(0x2b)]===0x190?_0x4452c8[_0x138c(0x49)]:_0x4452c8[_0x138c(0x4a)](_0x3467bc['status'],0x1f4)?_0x138c(0x14):_0x4452c8[_0x138c(0x4b)];throw new ApiError((_0x4452c8[_0x138c(0x4c)](_0xda0b2a=_0x39e9ad[_0x138c(0x2e)],null)||_0x4452c8[_0x138c(0x4c)](_0xda0b2a,void 0x0)?void 0x0:_0xda0b2a[_0x138c(0x2f)])||_0x138c(0xb),_0xf8b06,_0x4452c8['PBUbj'](_0x377206=_0x39e9ad[_0x138c(0x2e)],null)||_0x4452c8[_0x138c(0x4d)](_0x377206,void 0x0)?void 0x0:_0x377206[_0x138c(0x2)],(_0x4381e4=_0x39e9ad[_0x138c(0x2e)])===null||_0x4381e4===void 0x0?void 0x0:_0x4381e4[_0x138c(0x3)]);}else _0x4452c8['giSRP'](_0x473a49,_0x4452c8['ktcYc'],{'endpoint':_0x1cbc12,'method':_0x36e9fe,'headers':{..._0x1a9d47,'Authorization':_0x4452c8[_0x138c(0x43)]},'data':_0x4452c8[_0x138c(0x4e)](_0x3a1910,null)});}return _0x39e9ad;}catch(_0x15b983){if(_0x4452c8[_0x138c(0x4f)](_0x4452c8[_0x138c(0x50)],_0x4452c8['riGiD']))_0x4452c8['giSRP'](_0x53e18d,_0x4452c8[_0x138c(0x42)],{'endpoint':_0x4d4c48,'method':_0x40d713,'headers':{..._0x48775d,'Authorization':_0x4452c8[_0x138c(0x43)]},'data':_0x4452c8[_0x138c(0x4e)](_0x7a967d,null)});else{if(_0x15b983 instanceof ApiError)throw _0x15b983;if(_0x4452c8['ruLuJ'](_0x15b983[_0x138c(0x34)],_0x4452c8[_0x138c(0x51)]))throw new ApiError(_0x4452c8[_0x138c(0x52)],_0x4452c8[_0x138c(0x53)]);if(debug){if(_0x4452c8[_0x138c(0x45)](_0x4452c8[_0x138c(0x54)],'eeXTI'))return _0x4452c8[_0x138c(0x55)](_0x27f91b,_0x138c(0x56),'POST',{'data':{'username':_0x12abf4[_0x138c(0x57)],'pin':_0x9c6234[_0x138c(0x58)]},'debug':_0x4ac92a[_0x138c(0x28)]});else logDebug(_0x4452c8[_0x138c(0x59)],{'endpoint':_0x1e837f,'method':_0x26bd8f,'error':_0x15b983[_0x138c(0x2f)]||_0x4452c8[_0x138c(0x5a)]});}throw new ApiError(_0x15b983[_0x138c(0x2f)]||_0x4452c8[_0x138c(0x5b)],_0x4452c8[_0x138c(0x4b)]);}}};export const validateCredentials=async(_0x31f9bd,_0x4938ce={'debug':![]})=>{const _0x34cd06={'FufvK':function(_0x1c50ec,_0x25f504,_0xee6fbc,_0xeb9404){return _0x1c50ec(_0x25f504,_0xee6fbc,_0xeb9404);},'JqnRF':_0x138c(0x5c),'UUHZt':function(_0x1f2255,_0x3dfa90){return _0x1f2255===_0x3dfa90;},'Soaxx':function(_0x233e52,_0x513f70){return _0x233e52===_0x513f70;}};try{var _0x113c00,_0x3552e9;const _0x1ca5d3=await _0x34cd06['FufvK'](makeUserApiRequest,_0x34cd06[_0x138c(0x5d)],'POST',{'data':{'username':_0x31f9bd},'debug':_0x4938ce[_0x138c(0x28)]});return{'isValid':_0x1ca5d3[_0x138c(0x5e)]&&_0x34cd06[_0x138c(0x5f)]((_0x113c00=_0x1ca5d3['data'])===null||_0x113c00===void 0x0?void 0x0:_0x113c00[_0x138c(0x60)],!![]),'message':_0x34cd06['Soaxx'](_0x3552e9=_0x1ca5d3[_0x138c(0x2e)],null)||_0x3552e9===void 0x0?void 0x0:_0x3552e9['message']};}catch(_0x62cb87){return{'isValid':![],'message':_0x62cb87[_0x138c(0x2f)]};}};export const createAccount=async(_0x1d621e,_0x21a132={'debug':![]})=>{const _0x3969c6={'bPfYM':function(_0x2015b1,_0x19c3c1,_0x1d8668,_0x2286af){return _0x2015b1(_0x19c3c1,_0x1d8668,_0x2286af);},'uLvif':_0x138c(0x61)};return _0x3969c6[_0x138c(0x62)](makeDeveloperApiRequest,_0x3969c6['uLvif'],'POST',{'data':{'username':_0x1d621e[_0x138c(0x57)],'platforms':_0x1d621e['platforms']},'debug':_0x21a132[_0x138c(0x28)]});};export const authenticate=async(_0x3a6fa8,_0x69e075={'debug':![]})=>{const _0x536218={'eziXI':function(_0x3fd02e,_0x4a6584,_0xf48d4a,_0x4767c5){return _0x3fd02e(_0x4a6584,_0xf48d4a,_0x4767c5);},'VLxkA':_0x138c(0x56)};return _0x536218[_0x138c(0x63)](makeUserApiRequest,_0x536218[_0x138c(0x64)],'POST',{'data':{'username':_0x3a6fa8[_0x138c(0x57)],'pin':_0x3a6fa8[_0x138c(0x58)]},'debug':_0x69e075[_0x138c(0x28)]});};export const refreshToken=async(_0x3f4cbe,_0xa2f413={'debug':![]})=>{const _0x17bf98={'euiyy':_0x138c(0x65)};return makeUserApiRequest(_0x17bf98[_0x138c(0x66)],'POST',{'data':{'refreshToken':_0x3f4cbe},'debug':_0xa2f413[_0x138c(0x28)]});};export const getPlatformData=async(_0x53538e,_0x1b7b89={'debug':![]})=>{const _0x144069={'EMoXS':function(_0x2722c9,_0x545a25,_0x1d3d49,_0xefb5d5){return _0x2722c9(_0x545a25,_0x1d3d49,_0xefb5d5);}};return _0x144069[_0x138c(0x67)](makeUserApiRequest,_0x138c(0x26)+_0x53538e+'/data','GET',{'debug':_0x1b7b89['debug']});};export const getUserProfile=async(_0x5edb67={'debug':![]})=>{const _0x410631={'mJbFx':_0x138c(0x68)};return makeUserApiRequest(_0x410631[_0x138c(0x69)],'GET',{'debug':_0x5edb67['debug']});};function _0x50a8(){const _0x5ac197=['ApiError','split','code','details','type','wxflU','fetch','faZss','auth_error','validation_error','unknown_error','API\x20request\x20failed','No\x20network\x20connection\x20available','network_error','User\x20not\x20authenticated.\x20Please\x20verify\x20email\x20first.','[REDACTED]','MywCF','ezeOK','User\x20API\x20Response','paEuQ','server_error','AbortError','Request\x20timed\x20out','timeout_error','Unknown\x20error','An\x20unexpected\x20error\x20occurred','uLWeS','QnOyk','iCEYx','cfeSI','QDjCB','Anqtt','VJElx','CHwdD','BkHpX','stringify','json','KlrWR','platforms/','/data','debug','vSnAn','ANMzc','status','gpEkY','lmCeI','error','message','ERBOD','NukmG','Zflmr','nJgSl','name','EXPGM','OWnGQ','tRfte','PSsAl','FhZsz','User\x20API\x20Request','Developer\x20API\x20Request','Developer\x20API\x20Response','eeXTI','Developer\x20API\x20Error','FmDiR','qrGOr','Wcrma','xeNCY','OzeWg','CBWWf','zCiiF','ASRuG','cUFBY','JmNzM','OTYzA','Vbrud','PHxgN','PBUbj','ruLuJ','cFqQn','xZkRe','riGiD','fVQdQ','eauLJ','eLlgi','tbIJc','ETbUG','auth/login','username','userPin','HfNzz','llDvM','PQEgR','auth/validate','JqnRF','success','UUHZt','isValid','auth/register','bPfYM','eziXI','VLxkA','auth/refresh','euiyy','EMoXS','user/profile','mJbFx','user/platforms','store-pin/mobile','sGlZJ','eOFdS','eICVM','platforms','zkvUD','onJQC','NUOOr','WXvml','KTuWP'];_0x50a8=function(){return _0x5ac197;};return _0x50a8();}export const updatePlatformConnections=async(_0x183711,_0x434e68={'debug':![]})=>{const _0x498d42={'MdZsF':function(_0x118f7f,_0x4b646b,_0x4b8fd7,_0xc085ef){return _0x118f7f(_0x4b646b,_0x4b8fd7,_0xc085ef);},'Nobqk':_0x138c(0x6a)};return _0x498d42['MdZsF'](makeUserApiRequest,_0x498d42['Nobqk'],'PUT',{'data':{'platforms':_0x183711},'debug':_0x434e68[_0x138c(0x28)]});};export const storePIN=async(_0x217f72,_0x51885d={})=>{const _0x8151ea={'eICVM':function(_0x585eb4,_0x41beef,_0x380cd2,_0x3bb81e){return _0x585eb4(_0x41beef,_0x380cd2,_0x3bb81e);},'WaHzd':_0x138c(0x61),'sGlZJ':function(_0x2f73ea,_0x557187){return _0x2f73ea!==_0x557187;},'eOFdS':'EYkqV','zkvUD':'No\x20username\x20available\x20-\x20either\x20provide\x20username\x20or\x20ensure\x20JWT\x20token\x20is\x20valid','onJQC':'auth_error','NUOOr':_0x138c(0x6b)},{debug:debug=![],username:_0xb6ac4f}=_0x51885d,_0x541406=_0xb6ac4f||extractUsernameFromJWT();if(!_0x541406){if(_0x8151ea[_0x138c(0x6c)](_0x8151ea[_0x138c(0x6d)],_0x8151ea[_0x138c(0x6d)]))return _0x8151ea[_0x138c(0x6e)](_0x3309a1,_0x8151ea['WaHzd'],'POST',{'data':{'username':_0x4d2f9c['username'],'platforms':_0x285f31[_0x138c(0x6f)]},'debug':_0x2a8dfd['debug']});else throw new ApiError(_0x8151ea[_0x138c(0x70)],_0x8151ea[_0x138c(0x71)]);}return _0x8151ea[_0x138c(0x6e)](makeUserApiRequest,_0x8151ea[_0x138c(0x72)],'POST',{'data':{'username':_0x541406,'pin':_0x217f72},'debug':debug});};function _0x138c(_0x50a824,_0x138c54){_0x50a824=_0x50a824-0x0;const _0x1a0aa4=_0x50a8();let _0x24816c=_0x1a0aa4[_0x50a824];return _0x24816c;}export const getCurrentUserToken=async()=>{const _0x244812={'WXvml':function(_0x328cd5){return _0x328cd5();}};return await _0x244812[_0x138c(0x73)](getJWT);};export const isCurrentUserAuthenticated=()=>{const _0x3adb21={'KTuWP':function(_0x5df0d0){return _0x5df0d0();}};return _0x3adb21[_0x138c(0x74)](isUserAuthenticated);};
|