@onairos/react-native 3.1.12 → 3.1.14
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 +403 -374
- package/lib/commonjs/api/index.js +75 -1
- package/lib/commonjs/api/index.js.map +1 -1
- 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/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +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/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -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 +27 -0
- package/lib/commonjs/components/BodyText.js.map +1 -0
- package/lib/commonjs/components/BrandMark.js +44 -0
- package/lib/commonjs/components/BrandMark.js.map +1 -0
- package/lib/commonjs/components/CodeInput.js +30 -0
- package/lib/commonjs/components/CodeInput.js.map +1 -0
- package/lib/commonjs/components/EmailInput.js +30 -0
- package/lib/commonjs/components/EmailInput.js.map +1 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +474 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/commonjs/components/GoogleButton.js +55 -0
- package/lib/commonjs/components/GoogleButton.js.map +1 -0
- package/lib/commonjs/components/HeadingGroup.js +43 -0
- package/lib/commonjs/components/HeadingGroup.js.map +1 -0
- package/lib/commonjs/components/ModalHeader.js +99 -0
- package/lib/commonjs/components/ModalHeader.js.map +1 -0
- package/lib/commonjs/components/ModalSheet.js +41 -0
- package/lib/commonjs/components/ModalSheet.js.map +1 -0
- package/lib/commonjs/components/Onairos.js +1 -3
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +171 -190
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +169 -0
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -0
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PersonaImage.js +60 -0
- package/lib/commonjs/components/PersonaImage.js.map +1 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +156 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +316 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/commonjs/components/PinCreationScreen.js +393 -0
- package/lib/commonjs/components/PinCreationScreen.js.map +1 -0
- package/lib/commonjs/components/PinInput.js +282 -120
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +828 -0
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/commonjs/components/PlatformToggle.js +180 -0
- package/lib/commonjs/components/PlatformToggle.js.map +1 -0
- package/lib/commonjs/components/PrimaryButton.js +180 -0
- package/lib/commonjs/components/PrimaryButton.js.map +1 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -0
- package/lib/commonjs/components/SignInMatchAnimation.js.map +1 -0
- package/lib/commonjs/components/SignInStep.js +179 -0
- package/lib/commonjs/components/SignInStep.js.map +1 -0
- package/lib/commonjs/components/TrainingModal.js +808 -563
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +2304 -1283
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/VerificationStep.js +154 -0
- package/lib/commonjs/components/VerificationStep.js.map +1 -0
- package/lib/commonjs/components/WelcomeScreen.js +385 -0
- package/lib/commonjs/components/WelcomeScreen.js.map +1 -0
- package/lib/commonjs/components/icons/Basicproficon.js +37 -0
- package/lib/commonjs/components/icons/Basicproficon.js.map +1 -0
- package/lib/commonjs/components/icons/Basicprofile.js +21 -0
- package/lib/commonjs/components/icons/Basicprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Checkbox.js +21 -0
- package/lib/commonjs/components/icons/Checkbox.js.map +1 -0
- package/lib/commonjs/components/icons/Checkmark.js +27 -0
- package/lib/commonjs/components/icons/Checkmark.js.map +1 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -0
- package/lib/commonjs/components/icons/Contentanalysis.js.map +1 -0
- package/lib/commonjs/components/icons/Contenticon.js +39 -0
- package/lib/commonjs/components/icons/Contenticon.js.map +1 -0
- package/lib/commonjs/components/icons/EnochE.js +41 -0
- package/lib/commonjs/components/icons/EnochE.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityicon.js +30 -0
- package/lib/commonjs/components/icons/Personalityicon.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -0
- package/lib/commonjs/components/icons/Personalityprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -0
- package/lib/commonjs/components/icons/Personalitytraits.js.map +1 -0
- package/lib/commonjs/components/icons/Userpreferences.js +21 -0
- package/lib/commonjs/components/icons/Userpreferences.js.map +1 -0
- package/lib/commonjs/components/icons/index.js +84 -0
- package/lib/commonjs/components/icons/index.js.map +1 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +134 -743
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/config/api.js +34 -0
- package/lib/commonjs/config/api.js.map +1 -0
- package/lib/commonjs/context/AuthContext.js +345 -0
- package/lib/commonjs/context/AuthContext.js.map +1 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/commonjs/hooks/useConnections.js +120 -125
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +148 -0
- package/lib/commonjs/hooks/useUserConnections.js.map +1 -0
- package/lib/commonjs/index.js +12 -100
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiClient.js +302 -0
- package/lib/commonjs/services/apiClient.js.map +1 -0
- package/lib/commonjs/services/apiKeyService.js +8 -9
- package/lib/commonjs/services/apiKeyService.js.map +1 -1
- package/lib/commonjs/services/authService.js +935 -0
- package/lib/commonjs/services/authService.js.map +1 -0
- package/lib/commonjs/services/biometricPinService.js +184 -0
- package/lib/commonjs/services/biometricPinService.js.map +1 -0
- package/lib/commonjs/services/connectedAccountsService.js +268 -0
- package/lib/commonjs/services/connectedAccountsService.js.map +1 -0
- package/lib/commonjs/services/googleAuthService.js +268 -0
- package/lib/commonjs/services/googleAuthService.js.map +1 -0
- package/lib/commonjs/services/imageCompressionService.js +260 -0
- package/lib/commonjs/services/imageCompressionService.js.map +1 -0
- package/lib/commonjs/services/jwtStorageService.js +256 -0
- package/lib/commonjs/services/jwtStorageService.js.map +1 -0
- package/lib/commonjs/services/mobileTrainingService.js +185 -0
- package/lib/commonjs/services/mobileTrainingService.js.map +1 -0
- package/lib/commonjs/services/pinEncryptionService.js +84 -0
- package/lib/commonjs/services/pinEncryptionService.js.map +1 -0
- package/lib/commonjs/services/pinStorageUtils.js +105 -0
- package/lib/commonjs/services/pinStorageUtils.js.map +1 -0
- package/lib/commonjs/services/platformAuthService.js +956 -722
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/services/storageService.js +404 -0
- package/lib/commonjs/services/storageService.js.map +1 -0
- package/lib/commonjs/services/trainingApiHelpers.js +73 -0
- package/lib/commonjs/services/trainingApiHelpers.js.map +1 -0
- package/lib/commonjs/services/userConnectionsService.js +486 -0
- package/lib/commonjs/services/userConnectionsService.js.map +1 -0
- package/lib/commonjs/services/youtubeMigrationService.js +415 -0
- package/lib/commonjs/services/youtubeMigrationService.js.map +1 -0
- package/lib/commonjs/theme/index.js +249 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/utils/eventUtils.js +288 -0
- package/lib/commonjs/utils/eventUtils.js.map +1 -0
- package/lib/commonjs/utils/haptics.js +66 -0
- package/lib/commonjs/utils/haptics.js.map +1 -0
- package/lib/commonjs/utils/imagePreloader.js +6 -0
- package/lib/commonjs/utils/imagePreloader.js.map +1 -0
- package/lib/module/api/index.js +72 -0
- package/lib/module/api/index.js.map +1 -1
- 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/farcaster.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/checkmark.svg +4 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -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 +20 -0
- package/lib/module/components/BodyText.js.map +1 -0
- package/lib/module/components/BrandMark.js +37 -0
- package/lib/module/components/BrandMark.js.map +1 -0
- package/lib/module/components/CodeInput.js +23 -0
- package/lib/module/components/CodeInput.js.map +1 -0
- package/lib/module/components/EmailInput.js +23 -0
- package/lib/module/components/EmailInput.js.map +1 -0
- package/lib/module/components/ExistingUserDataConfirmation.js +465 -0
- package/lib/module/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/module/components/GoogleButton.js +48 -0
- package/lib/module/components/GoogleButton.js.map +1 -0
- package/lib/module/components/HeadingGroup.js +36 -0
- package/lib/module/components/HeadingGroup.js.map +1 -0
- package/lib/module/components/ModalHeader.js +92 -0
- package/lib/module/components/ModalHeader.js.map +1 -0
- package/lib/module/components/ModalSheet.js +34 -0
- package/lib/module/components/ModalSheet.js.map +1 -0
- package/lib/module/components/Onairos.js +1 -3
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +172 -192
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/OnairosSignInButton.js +160 -0
- package/lib/module/components/OnairosSignInButton.js.map +1 -0
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PersonaImage.js +53 -0
- package/lib/module/components/PersonaImage.js.map +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +148 -0
- package/lib/module/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +309 -0
- package/lib/module/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/module/components/PinCreationScreen.js +386 -0
- package/lib/module/components/PinCreationScreen.js.map +1 -0
- package/lib/module/components/PinInput.js +283 -120
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +820 -0
- package/lib/module/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/module/components/PlatformToggle.js +173 -0
- package/lib/module/components/PlatformToggle.js.map +1 -0
- package/lib/module/components/PrimaryButton.js +172 -0
- package/lib/module/components/PrimaryButton.js.map +1 -0
- package/lib/module/components/SignInMatchAnimation.js +189 -0
- package/lib/module/components/SignInMatchAnimation.js.map +1 -0
- package/lib/module/components/SignInStep.js +171 -0
- package/lib/module/components/SignInStep.js.map +1 -0
- package/lib/module/components/TrainingModal.js +809 -565
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +2307 -1284
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/VerificationStep.js +146 -0
- package/lib/module/components/VerificationStep.js.map +1 -0
- package/lib/module/components/WelcomeScreen.js +378 -0
- package/lib/module/components/WelcomeScreen.js.map +1 -0
- package/lib/module/components/icons/Basicproficon.js +30 -0
- package/lib/module/components/icons/Basicproficon.js.map +1 -0
- package/lib/module/components/icons/Basicprofile.js +14 -0
- package/lib/module/components/icons/Basicprofile.js.map +1 -0
- package/lib/module/components/icons/Checkbox.js +14 -0
- package/lib/module/components/icons/Checkbox.js.map +1 -0
- package/lib/module/components/icons/Checkmark.js +20 -0
- package/lib/module/components/icons/Checkmark.js.map +1 -0
- package/lib/module/components/icons/Contentanalysis.js +14 -0
- package/lib/module/components/icons/Contentanalysis.js.map +1 -0
- package/lib/module/components/icons/Contenticon.js +32 -0
- package/lib/module/components/icons/Contenticon.js.map +1 -0
- package/lib/module/components/icons/EnochE.js +34 -0
- package/lib/module/components/icons/EnochE.js.map +1 -0
- package/lib/module/components/icons/Personalityicon.js +23 -0
- package/lib/module/components/icons/Personalityicon.js.map +1 -0
- package/lib/module/components/icons/Personalityprofile.js +14 -0
- package/lib/module/components/icons/Personalityprofile.js.map +1 -0
- package/lib/module/components/icons/Personalitytraits.js +14 -0
- package/lib/module/components/icons/Personalitytraits.js.map +1 -0
- package/lib/module/components/icons/Userpreferences.js +14 -0
- package/lib/module/components/icons/Userpreferences.js.map +1 -0
- package/lib/module/components/icons/index.js +13 -0
- package/lib/module/components/icons/index.js.map +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +136 -744
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/config/api.js +26 -0
- package/lib/module/config/api.js.map +1 -0
- package/lib/module/context/AuthContext.js +335 -0
- package/lib/module/context/AuthContext.js.map +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +106 -0
- package/lib/module/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/module/hooks/useConnections.js +119 -125
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useUserConnections.js +140 -0
- package/lib/module/hooks/useUserConnections.js.map +1 -0
- package/lib/module/index.js +51 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiClient.js +298 -0
- package/lib/module/services/apiClient.js.map +1 -0
- package/lib/module/services/apiKeyService.js +8 -9
- package/lib/module/services/apiKeyService.js.map +1 -1
- package/lib/module/services/authService.js +905 -0
- package/lib/module/services/authService.js.map +1 -0
- package/lib/module/services/biometricPinService.js +173 -0
- package/lib/module/services/biometricPinService.js.map +1 -0
- package/lib/module/services/connectedAccountsService.js +255 -0
- package/lib/module/services/connectedAccountsService.js.map +1 -0
- package/lib/module/services/googleAuthService.js +258 -0
- package/lib/module/services/googleAuthService.js.map +1 -0
- package/lib/module/services/imageCompressionService.js +250 -0
- package/lib/module/services/imageCompressionService.js.map +1 -0
- package/lib/module/services/jwtStorageService.js +239 -0
- package/lib/module/services/jwtStorageService.js.map +1 -0
- package/lib/module/services/mobileTrainingService.js +172 -0
- package/lib/module/services/mobileTrainingService.js.map +1 -0
- package/lib/module/services/pinEncryptionService.js +75 -0
- package/lib/module/services/pinEncryptionService.js.map +1 -0
- package/lib/module/services/pinStorageUtils.js +93 -0
- package/lib/module/services/pinStorageUtils.js.map +1 -0
- package/lib/module/services/platformAuthService.js +943 -704
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/services/storageService.js +383 -0
- package/lib/module/services/storageService.js.map +1 -0
- package/lib/module/services/trainingApiHelpers.js +67 -0
- package/lib/module/services/trainingApiHelpers.js.map +1 -0
- package/lib/module/services/userConnectionsService.js +476 -0
- package/lib/module/services/userConnectionsService.js.map +1 -0
- package/lib/module/services/youtubeMigrationService.js +404 -0
- package/lib/module/services/youtubeMigrationService.js.map +1 -0
- package/lib/module/theme/index.js +244 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/utils/eventUtils.js +270 -0
- package/lib/module/utils/eventUtils.js.map +1 -0
- package/lib/module/utils/haptics.js +59 -0
- package/lib/module/utils/haptics.js.map +1 -0
- package/lib/module/utils/imagePreloader.js +3 -0
- package/lib/module/utils/imagePreloader.js.map +1 -0
- package/lib/typescript/api/index.d.ts +8 -0
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/BodyText.d.ts +10 -0
- package/lib/typescript/components/BodyText.d.ts.map +1 -0
- package/lib/typescript/components/BrandMark.d.ts +11 -0
- package/lib/typescript/components/BrandMark.d.ts.map +1 -0
- package/lib/typescript/components/CodeInput.d.ts +10 -0
- package/lib/typescript/components/CodeInput.d.ts.map +1 -0
- package/lib/typescript/components/EmailInput.d.ts +8 -0
- package/lib/typescript/components/EmailInput.d.ts.map +1 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +12 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +1 -0
- package/lib/typescript/components/GoogleButton.d.ts +11 -0
- package/lib/typescript/components/GoogleButton.d.ts.map +1 -0
- package/lib/typescript/components/HeadingGroup.d.ts +11 -0
- package/lib/typescript/components/HeadingGroup.d.ts.map +1 -0
- package/lib/typescript/components/ModalHeader.d.ts +11 -0
- package/lib/typescript/components/ModalHeader.d.ts.map +1 -0
- package/lib/typescript/components/ModalSheet.d.ts +13 -0
- package/lib/typescript/components/ModalSheet.d.ts.map +1 -0
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +29 -4
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +14 -0
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -0
- package/lib/typescript/components/PersonaImage.d.ts +8 -0
- package/lib/typescript/components/PersonaImage.d.ts.map +1 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +10 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +1 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +10 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinCreationScreen.d.ts +10 -0
- package/lib/typescript/components/PinCreationScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinInput.d.ts +11 -1
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +11 -0
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +1 -0
- package/lib/typescript/components/PlatformToggle.d.ts +20 -0
- package/lib/typescript/components/PlatformToggle.d.ts.map +1 -0
- package/lib/typescript/components/PrimaryButton.d.ts +22 -0
- package/lib/typescript/components/PrimaryButton.d.ts.map +1 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts +9 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +1 -0
- package/lib/typescript/components/SignInStep.d.ts +12 -0
- package/lib/typescript/components/SignInStep.d.ts.map +1 -0
- package/lib/typescript/components/TrainingModal.d.ts +12 -1
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +14 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/VerificationStep.d.ts +13 -0
- package/lib/typescript/components/VerificationStep.d.ts.map +1 -0
- package/lib/typescript/components/WelcomeScreen.d.ts +9 -0
- package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts +5 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkbox.d.ts +5 -0
- package/lib/typescript/components/icons/Checkbox.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkmark.d.ts +5 -0
- package/lib/typescript/components/icons/Checkmark.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts +5 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contenticon.d.ts +5 -0
- package/lib/typescript/components/icons/Contenticon.d.ts.map +1 -0
- package/lib/typescript/components/icons/EnochE.d.ts +5 -0
- package/lib/typescript/components/icons/EnochE.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts +5 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +1 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts +5 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +1 -0
- package/lib/typescript/components/icons/index.d.ts +12 -0
- package/lib/typescript/components/icons/index.d.ts.map +1 -0
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/config/api.d.ts +24 -0
- package/lib/typescript/config/api.d.ts.map +1 -0
- package/lib/typescript/context/AuthContext.d.ts +34 -0
- package/lib/typescript/context/AuthContext.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +11 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnections.d.ts +10 -5
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +12 -0
- package/lib/typescript/hooks/useUserConnections.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +24 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiClient.d.ts +91 -0
- package/lib/typescript/services/apiClient.d.ts.map +1 -0
- package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
- package/lib/typescript/services/authService.d.ts +216 -0
- package/lib/typescript/services/authService.d.ts.map +1 -0
- package/lib/typescript/services/biometricPinService.d.ts +29 -0
- package/lib/typescript/services/biometricPinService.d.ts.map +1 -0
- package/lib/typescript/services/connectedAccountsService.d.ts +56 -0
- package/lib/typescript/services/connectedAccountsService.d.ts.map +1 -0
- package/lib/typescript/services/googleAuthService.d.ts +63 -0
- package/lib/typescript/services/googleAuthService.d.ts.map +1 -0
- package/lib/typescript/services/imageCompressionService.d.ts +37 -0
- package/lib/typescript/services/imageCompressionService.d.ts.map +1 -0
- package/lib/typescript/services/jwtStorageService.d.ts +86 -0
- package/lib/typescript/services/jwtStorageService.d.ts.map +1 -0
- package/lib/typescript/services/mobileTrainingService.d.ts +45 -0
- package/lib/typescript/services/mobileTrainingService.d.ts.map +1 -0
- package/lib/typescript/services/pinEncryptionService.d.ts +17 -0
- package/lib/typescript/services/pinEncryptionService.d.ts.map +1 -0
- package/lib/typescript/services/pinStorageUtils.d.ts +25 -0
- package/lib/typescript/services/pinStorageUtils.d.ts.map +1 -0
- package/lib/typescript/services/platformAuthService.d.ts +34 -109
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/services/storageService.d.ts +128 -0
- package/lib/typescript/services/storageService.d.ts.map +1 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts +38 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +1 -0
- package/lib/typescript/services/userConnectionsService.d.ts +90 -0
- package/lib/typescript/services/userConnectionsService.d.ts.map +1 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts +12 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +416 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +39 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/utils/eventUtils.d.ts +108 -0
- package/lib/typescript/utils/eventUtils.d.ts.map +1 -0
- package/lib/typescript/utils/haptics.d.ts +11 -0
- package/lib/typescript/utils/haptics.d.ts.map +1 -0
- package/lib/typescript/utils/imagePreloader.d.ts +2 -0
- package/lib/typescript/utils/imagePreloader.d.ts.map +1 -0
- package/package.json +163 -145
- package/src/api/index.ts +41 -0
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +3 -0
- package/src/assets/images/EnochE.svg +19 -0
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +3 -0
- package/src/assets/images/Personalitytraits.svg +3 -0
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +3 -0
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +20 -0
- package/src/assets/images/basicproficon.svg +43 -0
- package/src/assets/images/basicprofile.svg +3 -0
- package/src/assets/images/checkmark.svg +4 -0
- package/src/assets/images/contentanalysis.svg +3 -0
- package/src/assets/images/contenticon.svg +23 -0
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +18 -0
- package/src/assets/images/x-close.svg +3 -0
- package/src/components/BodyText.tsx +33 -0
- package/src/components/BrandMark.tsx +62 -0
- package/src/components/CodeInput.tsx +32 -0
- package/src/components/EmailInput.tsx +31 -0
- package/src/components/ExistingUserDataConfirmation.tsx +507 -0
- package/src/components/GoogleButton.tsx +55 -0
- package/src/components/HeadingGroup.tsx +49 -0
- package/src/components/ModalHeader.tsx +125 -0
- package/src/components/ModalSheet.tsx +57 -0
- package/src/components/Onairos.tsx +422 -424
- package/src/components/OnairosButton.tsx +339 -359
- package/src/components/OnairosSignInButton.tsx +166 -0
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PersonaImage.tsx +79 -0
- package/src/components/PersonaLoadingScreen.tsx +201 -0
- package/src/components/PersonalizationConsentScreen.tsx +410 -0
- package/src/components/PinCreationScreen.tsx +492 -0
- package/src/components/PinInput.tsx +555 -343
- package/src/components/PlatformConnectorsStep.tsx +892 -0
- package/src/components/PlatformToggle.tsx +226 -0
- package/src/components/PrimaryButton.tsx +214 -0
- package/src/components/SignInMatchAnimation.tsx +225 -0
- package/src/components/SignInStep.tsx +217 -0
- package/src/components/TrainingModal.tsx +1047 -737
- package/src/components/UniversalOnboarding.tsx +2888 -1820
- package/src/components/VerificationStep.tsx +198 -0
- package/src/components/WelcomeScreen.tsx +473 -0
- package/src/components/icons/Basicproficon.tsx +30 -0
- package/src/components/icons/Basicprofile.tsx +17 -0
- package/src/components/icons/Checkbox.tsx +17 -0
- package/src/components/icons/Checkmark.tsx +24 -0
- package/src/components/icons/Contentanalysis.tsx +17 -0
- package/src/components/icons/Contenticon.tsx +30 -0
- package/src/components/icons/EnochE.tsx +39 -0
- package/src/components/icons/Personalityicon.tsx +22 -0
- package/src/components/icons/Personalityprofile.tsx +17 -0
- package/src/components/icons/Personalitytraits.tsx +17 -0
- package/src/components/icons/Userpreferences.tsx +17 -0
- package/src/components/icons/index.ts +12 -0
- package/src/components/onboarding/OAuthWebView.tsx +232 -838
- package/src/config/api.ts +25 -0
- package/src/context/AuthContext.tsx +393 -0
- package/src/hooks/useConnectedAccounts.ts +139 -0
- package/src/hooks/useConnections.ts +129 -131
- package/src/hooks/useUserConnections.ts +166 -0
- package/src/index.ts +94 -49
- package/src/services/apiClient.ts +337 -0
- package/src/services/apiKeyService.ts +9 -11
- package/src/services/authService.ts +1008 -0
- package/src/services/biometricPinService.ts +193 -0
- package/src/services/connectedAccountsService.ts +290 -0
- package/src/services/googleAuthService.ts +279 -0
- package/src/services/imageCompressionService.ts +303 -0
- package/src/services/jwtStorageService.ts +257 -0
- package/src/services/mobileTrainingService.ts +204 -0
- package/src/services/pinEncryptionService.ts +76 -0
- package/src/services/pinStorageUtils.ts +97 -0
- package/src/services/platformAuthService.ts +1346 -1113
- package/src/services/storageService.ts +452 -0
- package/src/services/trainingApiHelpers.ts +67 -0
- package/src/services/userConnectionsService.ts +557 -0
- package/src/services/youtubeMigrationService.ts +454 -0
- package/src/theme/index.ts +239 -0
- package/src/types/index.ts +265 -238
- package/src/utils/eventUtils.ts +303 -0
- package/src/utils/haptics.ts +59 -0
- package/src/utils/imagePreloader.ts +2 -0
- 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/UniversalOnboarding.tsx.new +0 -455
- 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/UniversalOnboarding.tsx.new +0 -455
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/UniversalOnboarding.tsx.new +0 -455
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
import { clearStoredPin } from './pinStorageUtils';
|
|
3
|
+
|
|
4
|
+
// Storage keys
|
|
5
|
+
export const STORAGE_KEYS = {
|
|
6
|
+
// Authentication
|
|
7
|
+
AUTH_TOKEN: 'auth_token',
|
|
8
|
+
ONAIROS_JWT_TOKEN: 'onairos_jwt_token',
|
|
9
|
+
ENOCH_TOKEN: 'enoch_token',
|
|
10
|
+
|
|
11
|
+
// User data
|
|
12
|
+
USER: 'user',
|
|
13
|
+
USER_PROFILE: 'userProfile',
|
|
14
|
+
USER_PROFILE_FALLBACK: 'userProfileFallback',
|
|
15
|
+
|
|
16
|
+
// App state
|
|
17
|
+
USER_PROGRESS: 'user_progress',
|
|
18
|
+
ONBOARDING_COMPLETED: 'onboardingCompleted',
|
|
19
|
+
IS_FIRST_TIME_USER: 'isFirstTimeUser',
|
|
20
|
+
USER_ATTENDANCE_CONFIRMED: 'userAttendanceConfirmed',
|
|
21
|
+
|
|
22
|
+
// New: Token for completed onboarding with Results access
|
|
23
|
+
ONBOARDING_COMPLETE_TOKEN: 'onboarding_complete_token',
|
|
24
|
+
EVENT_ACCESS_TOKEN: 'event_access_token',
|
|
25
|
+
|
|
26
|
+
// Authentication method tracking
|
|
27
|
+
ONAIROS_USER: 'onairos_user',
|
|
28
|
+
APPLE_USER: 'apple_user',
|
|
29
|
+
AUTH_METHOD: 'auth_method',
|
|
30
|
+
|
|
31
|
+
// Session data
|
|
32
|
+
CURRENT_EVENT_DATA: 'currentEventData',
|
|
33
|
+
CONNECTED_PLATFORMS: 'connectedPlatforms',
|
|
34
|
+
PROFILE_IMAGE: 'profileImage',
|
|
35
|
+
|
|
36
|
+
// Admin status
|
|
37
|
+
USER_ADMIN_STATUS: 'user_admin_status',
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
// User progress tracking
|
|
41
|
+
export interface UserProgress {
|
|
42
|
+
lastScreen: string;
|
|
43
|
+
completedSteps: string[];
|
|
44
|
+
authMethod: 'apple' | 'onairos' | null;
|
|
45
|
+
hasProfilePhoto: boolean;
|
|
46
|
+
hasCompletedProfile: boolean;
|
|
47
|
+
hasSelectedIntentions: boolean;
|
|
48
|
+
hasViewedResults: boolean;
|
|
49
|
+
eventCode?: string;
|
|
50
|
+
hasEnteredEventCode: boolean;
|
|
51
|
+
hasRegisteredForEvent?: boolean;
|
|
52
|
+
// New: Flag to indicate user has completed entire onboarding flow
|
|
53
|
+
hasReachedEventPage: boolean;
|
|
54
|
+
// Store event data for returning users
|
|
55
|
+
eventData?: {
|
|
56
|
+
eventType?: string;
|
|
57
|
+
eventCode?: string;
|
|
58
|
+
photo?: string;
|
|
59
|
+
userProfile?: any;
|
|
60
|
+
inferenceData?: any;
|
|
61
|
+
};
|
|
62
|
+
timestamp: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Authentication state
|
|
66
|
+
export interface AuthState {
|
|
67
|
+
isAuthenticated: boolean;
|
|
68
|
+
authMethod: 'apple' | 'onairos' | null;
|
|
69
|
+
hasValidToken: boolean;
|
|
70
|
+
userEmail?: string;
|
|
71
|
+
userName?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Save user progress to track where they left off
|
|
76
|
+
*/
|
|
77
|
+
export const saveUserProgress = async (progress: Partial<UserProgress>): Promise<void> => {
|
|
78
|
+
try {
|
|
79
|
+
const existingProgress = await getUserProgress();
|
|
80
|
+
const updatedProgress: UserProgress = {
|
|
81
|
+
...existingProgress,
|
|
82
|
+
...progress,
|
|
83
|
+
timestamp: Date.now(),
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
await AsyncStorage.setItem(STORAGE_KEYS.USER_PROGRESS, JSON.stringify(updatedProgress));
|
|
87
|
+
console.log('✅ User progress saved:', updatedProgress);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.error('❌ Error saving user progress:', error);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get user progress to determine where to resume
|
|
95
|
+
*/
|
|
96
|
+
export const getUserProgress = async (): Promise<UserProgress> => {
|
|
97
|
+
try {
|
|
98
|
+
const progressData = await AsyncStorage.getItem(STORAGE_KEYS.USER_PROGRESS);
|
|
99
|
+
if (progressData) {
|
|
100
|
+
return JSON.parse(progressData);
|
|
101
|
+
}
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.error('❌ Error getting user progress:', error);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Return default progress
|
|
107
|
+
return {
|
|
108
|
+
lastScreen: 'Welcome',
|
|
109
|
+
completedSteps: [],
|
|
110
|
+
authMethod: null,
|
|
111
|
+
hasProfilePhoto: false,
|
|
112
|
+
hasCompletedProfile: false,
|
|
113
|
+
hasSelectedIntentions: false,
|
|
114
|
+
hasViewedResults: false,
|
|
115
|
+
hasEnteredEventCode: false,
|
|
116
|
+
hasRegisteredForEvent: false,
|
|
117
|
+
hasReachedEventPage: false,
|
|
118
|
+
timestamp: Date.now(),
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Save authentication state
|
|
124
|
+
*/
|
|
125
|
+
export const saveAuthState = async (authState: Partial<AuthState>): Promise<void> => {
|
|
126
|
+
try {
|
|
127
|
+
const existingState = await getAuthState();
|
|
128
|
+
const updatedState: AuthState = {
|
|
129
|
+
...existingState,
|
|
130
|
+
...authState,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Also save the auth method separately for quick access
|
|
134
|
+
if (authState.authMethod) {
|
|
135
|
+
await AsyncStorage.setItem(STORAGE_KEYS.AUTH_METHOD, authState.authMethod);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
console.log('✅ Auth state saved:', updatedState);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error('❌ Error saving auth state:', error);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Get authentication state
|
|
146
|
+
*/
|
|
147
|
+
export const getAuthState = async (): Promise<AuthState> => {
|
|
148
|
+
try {
|
|
149
|
+
const authMethod = await AsyncStorage.getItem(STORAGE_KEYS.AUTH_METHOD) as 'apple' | 'onairos' | null;
|
|
150
|
+
const hasToken = !!(await AsyncStorage.getItem(STORAGE_KEYS.AUTH_TOKEN));
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
isAuthenticated: hasToken,
|
|
154
|
+
authMethod,
|
|
155
|
+
hasValidToken: hasToken,
|
|
156
|
+
};
|
|
157
|
+
} catch (error) {
|
|
158
|
+
console.error('❌ Error getting auth state:', error);
|
|
159
|
+
return {
|
|
160
|
+
isAuthenticated: false,
|
|
161
|
+
authMethod: null,
|
|
162
|
+
hasValidToken: false,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Clear all user data (for logout)
|
|
169
|
+
*/
|
|
170
|
+
export const clearUserData = async (): Promise<void> => {
|
|
171
|
+
try {
|
|
172
|
+
const keysToRemove = [
|
|
173
|
+
STORAGE_KEYS.USER,
|
|
174
|
+
STORAGE_KEYS.USER_PROFILE,
|
|
175
|
+
STORAGE_KEYS.USER_PROFILE_FALLBACK,
|
|
176
|
+
STORAGE_KEYS.USER_PROGRESS,
|
|
177
|
+
STORAGE_KEYS.AUTH_TOKEN,
|
|
178
|
+
STORAGE_KEYS.ONAIROS_JWT_TOKEN,
|
|
179
|
+
STORAGE_KEYS.ENOCH_TOKEN,
|
|
180
|
+
STORAGE_KEYS.ONAIROS_USER,
|
|
181
|
+
STORAGE_KEYS.APPLE_USER,
|
|
182
|
+
STORAGE_KEYS.AUTH_METHOD,
|
|
183
|
+
STORAGE_KEYS.IS_FIRST_TIME_USER,
|
|
184
|
+
STORAGE_KEYS.USER_ATTENDANCE_CONFIRMED,
|
|
185
|
+
STORAGE_KEYS.PROFILE_IMAGE,
|
|
186
|
+
STORAGE_KEYS.ONBOARDING_COMPLETED,
|
|
187
|
+
// Clear the new onboarding completion tokens
|
|
188
|
+
STORAGE_KEYS.ONBOARDING_COMPLETE_TOKEN,
|
|
189
|
+
STORAGE_KEYS.EVENT_ACCESS_TOKEN,
|
|
190
|
+
];
|
|
191
|
+
|
|
192
|
+
await AsyncStorage.multiRemove(keysToRemove);
|
|
193
|
+
|
|
194
|
+
// Also clear biometrically stored PIN
|
|
195
|
+
try {
|
|
196
|
+
await clearStoredPin();
|
|
197
|
+
console.log('✅ Biometrically stored PIN cleared');
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.warn('⚠️ Error clearing stored PIN (continuing):', error);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
console.log('✅ User data cleared including onboarding completion tokens');
|
|
203
|
+
} catch (error) {
|
|
204
|
+
console.error('❌ Error clearing user data:', error);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get resume navigation target based on user progress
|
|
210
|
+
*/
|
|
211
|
+
export const getResumeTarget = async (): Promise<{ screen: string; params?: any }> => {
|
|
212
|
+
try {
|
|
213
|
+
const progress = await getUserProgress();
|
|
214
|
+
const authState = await getAuthState();
|
|
215
|
+
|
|
216
|
+
// HIGHEST PRIORITY: Check event access token first (regardless of auth state)
|
|
217
|
+
// This ensures release mode reliability when network auth fails
|
|
218
|
+
const hasEventToken = await hasEventAccessToken();
|
|
219
|
+
if (hasEventToken || (progress.hasReachedEventPage && progress.hasViewedResults)) {
|
|
220
|
+
console.log('🎯 User has completed onboarding (verified by token) - returning to Home screen');
|
|
221
|
+
|
|
222
|
+
// After completing first event, users go to Home screen instead of Results
|
|
223
|
+
// This provides a better post-event experience and central hub
|
|
224
|
+
return {
|
|
225
|
+
screen: 'Home'
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// If not authenticated, start from Welcome
|
|
230
|
+
if (!authState.isAuthenticated) {
|
|
231
|
+
return { screen: 'Welcome' };
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// If authenticated but no progress, start camera flow
|
|
235
|
+
if (progress.completedSteps.length === 0) {
|
|
236
|
+
return {
|
|
237
|
+
screen: 'Welcome',
|
|
238
|
+
params: {
|
|
239
|
+
isNewUser: true,
|
|
240
|
+
activateCamera: true
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Resume based on last completed step for users still in onboarding
|
|
246
|
+
if (!progress.hasProfilePhoto) {
|
|
247
|
+
return {
|
|
248
|
+
screen: 'Welcome',
|
|
249
|
+
params: {
|
|
250
|
+
isNewUser: true,
|
|
251
|
+
activateCamera: true
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (!progress.hasCompletedProfile) {
|
|
257
|
+
const profileImage = await AsyncStorage.getItem(STORAGE_KEYS.PROFILE_IMAGE);
|
|
258
|
+
return {
|
|
259
|
+
screen: 'CreateFreshProfile',
|
|
260
|
+
params: {
|
|
261
|
+
photo: profileImage,
|
|
262
|
+
isReviewerBypass: authState.authMethod === 'onairos'
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (!progress.hasSelectedIntentions) {
|
|
268
|
+
const userProfile = await AsyncStorage.getItem(STORAGE_KEYS.USER_PROFILE);
|
|
269
|
+
return {
|
|
270
|
+
screen: 'Intention',
|
|
271
|
+
params: {
|
|
272
|
+
userProfile: userProfile ? JSON.parse(userProfile) : null
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Default to Results if everything is complete
|
|
278
|
+
const userProfile = await AsyncStorage.getItem(STORAGE_KEYS.USER_PROFILE);
|
|
279
|
+
return {
|
|
280
|
+
screen: 'Results',
|
|
281
|
+
params: {
|
|
282
|
+
userProfile: userProfile ? JSON.parse(userProfile) : null
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
} catch (error) {
|
|
287
|
+
console.error('❌ Error determining resume target:', error);
|
|
288
|
+
return { screen: 'Welcome' };
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Check if user has completed onboarding flow
|
|
294
|
+
*/
|
|
295
|
+
export const hasCompletedOnboarding = async (): Promise<boolean> => {
|
|
296
|
+
try {
|
|
297
|
+
const progress = await getUserProgress();
|
|
298
|
+
return progress.hasCompletedProfile && progress.hasViewedResults;
|
|
299
|
+
} catch (error) {
|
|
300
|
+
console.error('❌ Error checking onboarding status:', error);
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Mark user as having reached the event page (completed full onboarding)
|
|
307
|
+
* This creates the token that ensures they always return to Results
|
|
308
|
+
*/
|
|
309
|
+
export const markEventPageReached = async (eventData?: {
|
|
310
|
+
eventType?: string;
|
|
311
|
+
eventCode?: string;
|
|
312
|
+
photo?: string;
|
|
313
|
+
userProfile?: any;
|
|
314
|
+
inferenceData?: any;
|
|
315
|
+
}): Promise<void> => {
|
|
316
|
+
try {
|
|
317
|
+
const progress = await getUserProgress();
|
|
318
|
+
const updatedProgress: UserProgress = {
|
|
319
|
+
...progress,
|
|
320
|
+
hasReachedEventPage: true,
|
|
321
|
+
hasViewedResults: true,
|
|
322
|
+
eventData: eventData || progress.eventData,
|
|
323
|
+
timestamp: Date.now(),
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
// Save the updated progress
|
|
327
|
+
await saveUserProgress(updatedProgress);
|
|
328
|
+
|
|
329
|
+
// Save the onboarding completion token for extra security
|
|
330
|
+
await AsyncStorage.setItem(STORAGE_KEYS.ONBOARDING_COMPLETE_TOKEN, 'true');
|
|
331
|
+
await AsyncStorage.setItem(STORAGE_KEYS.EVENT_ACCESS_TOKEN, JSON.stringify({
|
|
332
|
+
timestamp: Date.now(),
|
|
333
|
+
eventData: eventData,
|
|
334
|
+
hasAccess: true
|
|
335
|
+
}));
|
|
336
|
+
|
|
337
|
+
console.log('✅ User marked as having reached event page - will always return to Results');
|
|
338
|
+
} catch (error) {
|
|
339
|
+
console.error('❌ Error marking event page reached:', error);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Check if user has the event access token (completed onboarding)
|
|
345
|
+
*/
|
|
346
|
+
export const hasEventAccessToken = async (): Promise<boolean> => {
|
|
347
|
+
try {
|
|
348
|
+
const token = await AsyncStorage.getItem(STORAGE_KEYS.ONBOARDING_COMPLETE_TOKEN);
|
|
349
|
+
const progress = await getUserProgress();
|
|
350
|
+
return token === 'true' && progress.hasReachedEventPage;
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.error('❌ Error checking event access token:', error);
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Mark a step as completed
|
|
359
|
+
*/
|
|
360
|
+
export const markStepCompleted = async (step: string): Promise<void> => {
|
|
361
|
+
try {
|
|
362
|
+
const progress = await getUserProgress();
|
|
363
|
+
if (!progress.completedSteps.includes(step)) {
|
|
364
|
+
progress.completedSteps.push(step);
|
|
365
|
+
await saveUserProgress(progress);
|
|
366
|
+
}
|
|
367
|
+
} catch (error) {
|
|
368
|
+
console.error('❌ Error marking step completed:', error);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Update user's last screen
|
|
374
|
+
*/
|
|
375
|
+
export const updateLastScreen = async (screen: string, params?: any): Promise<void> => {
|
|
376
|
+
try {
|
|
377
|
+
await saveUserProgress({
|
|
378
|
+
lastScreen: screen,
|
|
379
|
+
timestamp: Date.now()
|
|
380
|
+
});
|
|
381
|
+
} catch (error) {
|
|
382
|
+
console.error('❌ Error updating last screen:', error);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Check if this is a returning user with existing progress
|
|
388
|
+
*/
|
|
389
|
+
export const isReturningUser = async (): Promise<boolean> => {
|
|
390
|
+
try {
|
|
391
|
+
const progress = await getUserProgress();
|
|
392
|
+
const authState = await getAuthState();
|
|
393
|
+
|
|
394
|
+
return authState.isAuthenticated && progress.completedSteps.length > 0;
|
|
395
|
+
} catch (error) {
|
|
396
|
+
console.error('❌ Error checking returning user status:', error);
|
|
397
|
+
return false;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Mark app as active (call this when app becomes active)
|
|
403
|
+
*/
|
|
404
|
+
export const markAppActive = async (): Promise<void> => {
|
|
405
|
+
try {
|
|
406
|
+
await saveUserProgress({
|
|
407
|
+
timestamp: Date.now()
|
|
408
|
+
});
|
|
409
|
+
console.log('✅ App marked as active');
|
|
410
|
+
} catch (error) {
|
|
411
|
+
console.error('❌ Error marking app as active:', error);
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Development utility: Get all stored progress data for debugging
|
|
417
|
+
*/
|
|
418
|
+
export const getDebugStorageInfo = async (): Promise<{
|
|
419
|
+
progress: UserProgress;
|
|
420
|
+
authState: AuthState;
|
|
421
|
+
isReturning: boolean;
|
|
422
|
+
resumeTarget: { screen: string; params?: any };
|
|
423
|
+
}> => {
|
|
424
|
+
try {
|
|
425
|
+
const progress = await getUserProgress();
|
|
426
|
+
const authState = await getAuthState();
|
|
427
|
+
const isReturning = await isReturningUser();
|
|
428
|
+
const resumeTarget = await getResumeTarget();
|
|
429
|
+
|
|
430
|
+
return {
|
|
431
|
+
progress,
|
|
432
|
+
authState,
|
|
433
|
+
isReturning,
|
|
434
|
+
resumeTarget
|
|
435
|
+
};
|
|
436
|
+
} catch (error) {
|
|
437
|
+
console.error('❌ Error getting debug storage info:', error);
|
|
438
|
+
throw error;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Development utility: Clear all progress (for testing)
|
|
444
|
+
*/
|
|
445
|
+
export const clearAllProgress = async (): Promise<void> => {
|
|
446
|
+
try {
|
|
447
|
+
await clearUserData();
|
|
448
|
+
console.log('✅ All progress data cleared');
|
|
449
|
+
} catch (error) {
|
|
450
|
+
console.error('❌ Error clearing progress data:', error);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { getEncryptedPinForAPI } from './pinEncryptionService';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helper functions for training API modifications
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Add encrypted PIN to training data if available
|
|
9
|
+
*/
|
|
10
|
+
export const addEncryptedPinToTrainingData = async (trainingData: any): Promise<any> => {
|
|
11
|
+
try {
|
|
12
|
+
// Get encrypted PIN
|
|
13
|
+
const encryptedPin = await getEncryptedPinForAPI();
|
|
14
|
+
|
|
15
|
+
if (encryptedPin) {
|
|
16
|
+
console.log('✅ Adding encrypted PIN to training data');
|
|
17
|
+
return {
|
|
18
|
+
...trainingData,
|
|
19
|
+
encryptedPin: encryptedPin,
|
|
20
|
+
hasPinData: true
|
|
21
|
+
};
|
|
22
|
+
} else {
|
|
23
|
+
console.log('⚠️ No PIN available for training data');
|
|
24
|
+
return {
|
|
25
|
+
...trainingData,
|
|
26
|
+
hasPinData: false
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error('❌ Error adding encrypted PIN to training data:', error);
|
|
31
|
+
return {
|
|
32
|
+
...trainingData,
|
|
33
|
+
hasPinData: false
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Example of how to modify the training API call to include PIN
|
|
40
|
+
*
|
|
41
|
+
* Usage in UniversalOnboarding.tsx:
|
|
42
|
+
*
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // Before sending to API
|
|
45
|
+
* const trainingData = {
|
|
46
|
+
* socketId,
|
|
47
|
+
* username: finalUsername,
|
|
48
|
+
* email: userInfo?.email || null,
|
|
49
|
+
* modelKey: null,
|
|
50
|
+
* connectedPlatforms: platformsList,
|
|
51
|
+
* platformConnections: connections
|
|
52
|
+
* };
|
|
53
|
+
*
|
|
54
|
+
* // Add encrypted PIN if needed
|
|
55
|
+
* const trainingDataWithPin = await addEncryptedPinToTrainingData(trainingData);
|
|
56
|
+
*
|
|
57
|
+
* // Send to API
|
|
58
|
+
* const response = await fetch('https://api2.onairos.uk/mobile-training/enoch', {
|
|
59
|
+
* method: 'POST',
|
|
60
|
+
* headers: {
|
|
61
|
+
* 'Content-Type': 'application/json',
|
|
62
|
+
* 'Authorization': `Bearer ${token}`
|
|
63
|
+
* },
|
|
64
|
+
* body: JSON.stringify(trainingDataWithPin)
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|