@oxyhq/services 26.0.1 → 26.0.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 +2 -2
- package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +21 -127
- package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +184 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +162 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +116 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +179 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +61 -0
- package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +241 -0
- package/expo-module.config.json +4 -1
- package/lib/commonjs/index.js +18 -49
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +63 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/components/AvatarCameraBadge.js +2 -2
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +4 -4
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +13 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +29 -24
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +8 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +20 -26
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +68 -58
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +2 -2
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +2 -2
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +3 -1
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/logo/LogoText.js +4 -4
- package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +32 -46
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +3 -43
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +11 -11
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +9 -9
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +3 -2
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
- package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +8 -4
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +5 -5
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +68 -11
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +2 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +66 -64
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/commonjs/ui/oauth/oauthPopup.js +47 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +10 -10
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +41 -19
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +4 -4
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +9 -9
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +3 -3
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +6 -7
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +4 -4
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +46 -14
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +5 -5
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +2 -3
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +2 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +90 -89
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +7 -7
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -34
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -3
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +15 -15
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +19 -19
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +15 -15
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +17 -7
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +2 -2
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +13 -7
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +34 -24
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +3 -4
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/session/backgroundSession.js +258 -0
- package/lib/commonjs/ui/session/backgroundSession.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +7 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js +81 -0
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js.map +1 -0
- package/lib/commonjs/ui/utils/fileManagement.js +24 -24
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
- package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +19 -30
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/commonjs/ui/utils/userUtils.js +27 -28
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/module/index.js +20 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +62 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +13 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +25 -20
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +7 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +12 -18
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +68 -58
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +1 -1
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +3 -1
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/logo/LogoText.js +4 -4
- package/lib/module/ui/components/logo/LogoText.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/module/ui/components/styles/shadow.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +35 -49
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +3 -42
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +3 -2
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/userCache.js +17 -17
- package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +8 -4
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +0 -2
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/module/ui/hooks/useSurfaceHeader.js +68 -11
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +2 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +66 -64
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/module/ui/oauth/oauthPopup.js +48 -1
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +37 -15
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ChangeAvatarScreen.js +4 -5
- package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +2 -2
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +45 -13
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -4
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +3 -4
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +94 -91
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +5 -30
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +4 -4
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +11 -11
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +18 -8
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +14 -8
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +15 -5
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +4 -5
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/session/backgroundSession.js +252 -0
- package/lib/module/ui/session/backgroundSession.js.map +1 -0
- package/lib/module/ui/session/index.js +1 -0
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/useBackgroundSessionSync.js +76 -0
- package/lib/module/ui/session/useBackgroundSessionSync.js.map +1 -0
- package/lib/module/ui/utils/fileManagement.js +25 -25
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/netConnectivity.js +23 -0
- package/lib/module/ui/utils/netConnectivity.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +20 -30
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/ui/utils/userUtils.js +27 -28
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +51 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +7 -0
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +3 -0
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +6 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +26 -7
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +10 -6
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +7 -2
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +8 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +6 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts +42 -0
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +23 -0
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -19
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +17 -0
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +7 -14
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +51 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +7 -0
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +2 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +3 -0
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +6 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +26 -7
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +10 -6
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +7 -2
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +8 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +6 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +7 -0
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/backgroundSession.d.ts +42 -0
- package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +1 -0
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +23 -0
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
- package/lib/typescript/module/ui/types/navigation.d.ts +27 -19
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts +17 -0
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/userUtils.d.ts +7 -14
- package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/types/expo-image-picker.d.ts +35 -0
- package/package.json +32 -12
- package/src/index.ts +19 -16
- package/src/notifications/deviceNotifications.ts +82 -0
- package/src/types/expo-image-picker.d.ts +35 -0
- package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
- package/src/ui/boot/runProviderColdBoot.ts +24 -101
- package/src/ui/components/AvatarCameraBadge.tsx +2 -1
- package/src/ui/components/FollowButton.tsx +1 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +13 -1
- package/src/ui/components/OxyAuthChooser.tsx +31 -20
- package/src/ui/components/OxyProvider.tsx +8 -7
- package/src/ui/components/OxySignInButton.tsx +2 -1
- package/src/ui/components/ProfileButton.tsx +15 -20
- package/src/ui/components/authChooser/AccountsMenuView.tsx +66 -57
- package/src/ui/components/authChooser/types.ts +6 -0
- package/src/ui/components/authChooser/useUsernameAvailability.ts +1 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/internal/PinInput.tsx +1 -0
- package/src/ui/components/logo/LogoText.tsx +4 -4
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
- package/src/ui/components/payment/types.ts +24 -24
- package/src/ui/components/styles/shadow.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +35 -46
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +13 -89
- package/src/ui/context/commitSessionFlow.ts +3 -61
- package/src/ui/context/hooks/useAuthOperations.ts +26 -1
- package/src/ui/context/oxyContextTypes.ts +26 -7
- package/src/ui/context/useOxyAccountGraph.ts +4 -4
- package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
- package/src/ui/hooks/queries/paymentTypes.ts +3 -2
- package/src/ui/hooks/queries/usePaymentQueries.ts +3 -2
- package/src/ui/hooks/queries/userCache.ts +169 -148
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +3 -3
- package/src/ui/hooks/useAuth.ts +12 -6
- package/src/ui/hooks/useAvatarPicker.ts +1 -1
- package/src/ui/hooks/useOnlineStatus.ts +3 -2
- package/src/ui/hooks/useSessionManagement.ts +0 -2
- package/src/ui/hooks/useSettingToggle.ts +1 -1
- package/src/ui/hooks/useSurfaceHeader.ts +90 -15
- package/src/ui/navigation/accountDialogManager.ts +9 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +26 -0
- package/src/ui/oauth/browserAuthTransport.ts +55 -49
- package/src/ui/oauth/oauthPopup.ts +61 -3
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +45 -17
- package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
- package/src/ui/screens/AppInfoScreen.tsx +1 -1
- package/src/ui/screens/AvatarCropScreen.tsx +1 -1
- package/src/ui/screens/ChangeAvatarScreen.tsx +7 -4
- package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
- package/src/ui/screens/CreateAccountScreen.tsx +55 -15
- package/src/ui/screens/EditProfileFieldScreen.tsx +4 -4
- package/src/ui/screens/EditProfileScreen.tsx +6 -3
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +741 -575
- package/src/ui/screens/FileManagementScreen.tsx +1 -1
- package/src/ui/screens/FollowersListScreen.tsx +3 -0
- package/src/ui/screens/FollowingListScreen.tsx +3 -0
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +5 -20
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +9 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
- package/src/ui/screens/PrivacySettingsScreen.tsx +15 -12
- package/src/ui/screens/ProfileScreen.tsx +24 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +18 -8
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +14 -5
- package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +6 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
- package/src/ui/screens/trust/trustTier.ts +1 -1
- package/src/ui/session/__tests__/backgroundSession.test.ts +392 -0
- package/src/ui/session/backgroundSession.ts +313 -0
- package/src/ui/session/index.ts +1 -0
- package/src/ui/session/useBackgroundSessionSync.ts +92 -0
- package/src/ui/types/navigation.ts +27 -19
- package/src/ui/utils/fileManagement.ts +108 -92
- package/src/ui/utils/netConnectivity.ts +27 -0
- package/src/ui/utils/oauthReturn.ts +23 -33
- package/src/ui/utils/userUtils.ts +27 -32
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/module/ui/utils/crossOriginRestore.js +0 -131
- package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
- package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -143
- package/src/ui/utils/crossOriginRestore.ts +0 -169
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type Ionicons from
|
|
2
|
-
import type { AssetUploadInput, RNFileDescriptor } from
|
|
3
|
-
import type { ComponentProps } from
|
|
4
|
-
import { Platform } from
|
|
1
|
+
import type Ionicons from "@expo/vector-icons/Ionicons";
|
|
2
|
+
import type { AssetUploadInput, RNFileDescriptor } from "@oxyhq/core";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
4
|
+
import { Platform } from "react-native";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Extended File interface that includes a `uri` property for mobile preview support.
|
|
@@ -9,7 +9,7 @@ import { Platform } from 'react-native';
|
|
|
9
9
|
* on the File object for preview rendering.
|
|
10
10
|
*/
|
|
11
11
|
interface FileWithUri extends File {
|
|
12
|
-
|
|
12
|
+
uri?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -18,11 +18,11 @@ interface FileWithUri extends File {
|
|
|
18
18
|
* descriptor straight to FormData on React Native.
|
|
19
19
|
*/
|
|
20
20
|
export interface PickerAsset {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
file?: File | Blob;
|
|
22
|
+
uri?: string;
|
|
23
|
+
name?: string | null;
|
|
24
|
+
mimeType?: string | null;
|
|
25
|
+
size?: number | null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -30,37 +30,42 @@ export interface PickerAsset {
|
|
|
30
30
|
* (carries a URI but is not a real DOM `File` / `Blob` instance).
|
|
31
31
|
*/
|
|
32
32
|
export function isRNFileDescriptor(input: unknown): input is RNFileDescriptor {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (!input || typeof input !== "object") return false;
|
|
34
|
+
const obj = input as Record<string, unknown>;
|
|
35
|
+
if (typeof obj.uri !== "string") return false;
|
|
36
|
+
if (typeof File !== "undefined" && input instanceof File) return false;
|
|
37
|
+
if (typeof Blob !== "undefined" && input instanceof Blob) return false;
|
|
38
|
+
return true;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Format file size in bytes to human-readable string
|
|
43
43
|
*/
|
|
44
44
|
export function formatFileSize(bytes: number): string {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
if (bytes === 0) return "0 Bytes";
|
|
46
|
+
const k = 1024;
|
|
47
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
48
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
49
|
+
return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Get icon name for file based on content type
|
|
54
54
|
*/
|
|
55
|
-
export function getFileIcon(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
export function getFileIcon(
|
|
56
|
+
contentType: string,
|
|
57
|
+
): ComponentProps<typeof Ionicons>["name"] {
|
|
58
|
+
if (contentType.startsWith("image/")) return "image";
|
|
59
|
+
if (contentType.startsWith("video/")) return "videocam";
|
|
60
|
+
if (contentType.startsWith("audio/")) return "musical-notes";
|
|
61
|
+
if (contentType.includes("pdf")) return "document-text";
|
|
62
|
+
if (contentType.includes("word") || contentType.includes("doc"))
|
|
63
|
+
return "document";
|
|
64
|
+
if (contentType.includes("excel") || contentType.includes("sheet"))
|
|
65
|
+
return "grid";
|
|
66
|
+
if (contentType.includes("zip") || contentType.includes("archive"))
|
|
67
|
+
return "archive";
|
|
68
|
+
return "document-outline";
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
/**
|
|
@@ -76,79 +81,90 @@ export function getFileIcon(contentType: string): ComponentProps<typeof Ionicons
|
|
|
76
81
|
* 'ArrayBuffer' and 'ArrayBufferView' are not supported").
|
|
77
82
|
*/
|
|
78
83
|
export async function convertDocumentPickerAssetToFile(
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
doc: PickerAsset,
|
|
85
|
+
index: number,
|
|
81
86
|
): Promise<FileWithUri | RNFileDescriptor | null> {
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
const fileName = doc.name || `file-${index + 1}`;
|
|
88
|
+
const fileType = doc.mimeType || "application/octet-stream";
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
// React Native path — return the descriptor as-is. FormData handles it.
|
|
91
|
+
if (Platform.OS !== "web") {
|
|
92
|
+
if (!doc.uri) {
|
|
93
|
+
throw new Error("Missing file data (no uri property)");
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
uri: doc.uri,
|
|
97
|
+
type: fileType,
|
|
98
|
+
name: fileName,
|
|
99
|
+
size: typeof doc.size === "number" ? doc.size : undefined,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
97
102
|
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
try {
|
|
104
|
+
let file: FileWithUri | null = null;
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
// Priority 1: Use doc.file if available (web native File API).
|
|
107
|
+
// This is the most efficient path as it doesn't require fetching.
|
|
108
|
+
if (
|
|
109
|
+
doc.file &&
|
|
110
|
+
typeof globalThis.File !== "undefined" &&
|
|
111
|
+
doc.file instanceof globalThis.File
|
|
112
|
+
) {
|
|
113
|
+
file = doc.file as FileWithUri;
|
|
114
|
+
// Ensure file has required properties
|
|
115
|
+
if (!file.name && doc.name) {
|
|
116
|
+
// Create new File with proper name if missing
|
|
117
|
+
file = new globalThis.File([file], doc.name, {
|
|
118
|
+
type: file.type || fileType,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
// Preserve URI for preview if available
|
|
122
|
+
if (doc.uri) {
|
|
123
|
+
file.uri = doc.uri;
|
|
124
|
+
}
|
|
125
|
+
return file;
|
|
126
|
+
}
|
|
116
127
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
// Priority 2: Build File from URI (web blob URLs or http(s) URLs).
|
|
129
|
+
if (doc.uri) {
|
|
130
|
+
try {
|
|
131
|
+
const response = await fetch(doc.uri);
|
|
132
|
+
if (!response.ok) {
|
|
133
|
+
throw new Error(`Failed to fetch file: ${response.statusText}`);
|
|
134
|
+
}
|
|
135
|
+
const blob = await response.blob();
|
|
136
|
+
const resolvedType =
|
|
137
|
+
doc.mimeType || blob.type || "application/octet-stream";
|
|
138
|
+
file = new globalThis.File([blob], fileName, {
|
|
139
|
+
type: resolvedType,
|
|
140
|
+
}) as FileWithUri;
|
|
141
|
+
file.uri = doc.uri;
|
|
142
|
+
return file;
|
|
143
|
+
} catch (error: unknown) {
|
|
144
|
+
console.error("Failed to read file from URI:", error);
|
|
145
|
+
throw new Error(
|
|
146
|
+
`Failed to load file: ${(error instanceof Error ? error.message : null) || "Unknown error"}`,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
134
150
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
151
|
+
// No file or URI available - this shouldn't happen with Expo 54
|
|
152
|
+
throw new Error("Missing file data (no file or uri property)");
|
|
153
|
+
} catch (error: unknown) {
|
|
154
|
+
console.error("Error converting document to file:", error);
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
|
|
143
159
|
/**
|
|
144
160
|
* Upload file raw - helper function for file uploads
|
|
145
161
|
*/
|
|
146
162
|
export async function uploadFileRaw(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
163
|
+
file: AssetUploadInput,
|
|
164
|
+
userId: string,
|
|
165
|
+
// biome-ignore lint/suspicious/noExplicitAny: OxyServices type cannot be fully resolved due to mixin composition pattern
|
|
166
|
+
oxyServices: any,
|
|
167
|
+
visibility?: "private" | "public" | "unlisted",
|
|
152
168
|
) {
|
|
153
|
-
|
|
169
|
+
return await oxyServices.uploadRawFile(file, visibility);
|
|
154
170
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface NetInfoLikeState {
|
|
2
|
+
isConnected: boolean | null;
|
|
3
|
+
isInternetReachable?: boolean | null;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Mirrors Bloom `ConnectionStatusToasts` reachability semantics: a link that
|
|
8
|
+
* reports connected but explicitly unreachable (captive portal, no route) counts
|
|
9
|
+
* as offline.
|
|
10
|
+
*/
|
|
11
|
+
export function isNetConnectivityOnline(state: NetInfoLikeState): boolean {
|
|
12
|
+
return Boolean(state.isConnected && state.isInternetReachable !== false);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Conservative offline verdict for boot-path probes. Unknown / probing states
|
|
17
|
+
* (`null`, timed-out fetch) resolve to "not offline" so a flaky probe never
|
|
18
|
+
* skips a real sign-in.
|
|
19
|
+
*/
|
|
20
|
+
export function isNetConnectivityExplicitlyOffline(
|
|
21
|
+
state: NetInfoLikeState | null | undefined,
|
|
22
|
+
): boolean {
|
|
23
|
+
if (!state) return false;
|
|
24
|
+
if (state.isConnected === false) return true;
|
|
25
|
+
if (state.isConnected === true && state.isInternetReachable === false) return true;
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
clearOAuthHandshake,
|
|
4
4
|
consumeOAuthReturnPath,
|
|
5
5
|
logger,
|
|
6
|
-
|
|
6
|
+
canonicalizeOAuthRedirectUri,
|
|
7
7
|
readOAuthHandshake,
|
|
8
8
|
} from '@oxyhq/core';
|
|
9
9
|
import { completeOAuthCode } from '../oauth/completeOAuthCode';
|
|
@@ -14,12 +14,21 @@ import { isWebBrowser } from './isWebBrowser';
|
|
|
14
14
|
* When the RP lands with `?code=` after signing in at auth.oxy.so, exchange the
|
|
15
15
|
* code for a device-first session before cold boot runs.
|
|
16
16
|
*
|
|
17
|
-
* This is the REDIRECT transport's return leg.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* This is the REDIRECT transport's return leg. The SDK never starts a full-page
|
|
18
|
+
* authorize navigation on its own any more (#691 phase 7b), but this lane is
|
|
19
|
+
* still load-bearing: a browser-BLOCKED sign-in popup falls back to a full-page
|
|
20
|
+
* redirect (`startWebOAuthSignIn`), and that redirect comes back here.
|
|
21
|
+
*
|
|
22
|
+
* It owns only what is specific to a full-page round trip — reading the code off
|
|
23
|
+
* the URL, recovering the handshake `sessionStorage` carried across the
|
|
24
|
+
* navigation, and cleaning both up afterwards — and delegates state validation,
|
|
25
|
+
* the PKCE exchange, and the session commit to `completeOAuthCode`, the same
|
|
26
|
+
* function the popup transport runs.
|
|
27
|
+
*
|
|
28
|
+
* It is also the SINGLE cleanup path for an OAuth `error` landing on the URL:
|
|
29
|
+
* any `?error=…` (including an `error=login_required` left over from the
|
|
30
|
+
* now-deleted silent restore) is stripped along with `state` /
|
|
31
|
+
* `error_description`, and the stale PKCE handshake is cleared.
|
|
23
32
|
*/
|
|
24
33
|
export async function tryCompleteOAuthReturn(opts: {
|
|
25
34
|
oxyServices: OxyServices;
|
|
@@ -49,13 +58,18 @@ export async function tryCompleteOAuthReturn(opts: {
|
|
|
49
58
|
return false;
|
|
50
59
|
}
|
|
51
60
|
|
|
61
|
+
const handshake = readOAuthHandshake();
|
|
62
|
+
const redirectUri = canonicalizeOAuthRedirectUri(
|
|
63
|
+
handshake?.redirectUri ?? opts.authRedirectUri ?? location.origin,
|
|
64
|
+
);
|
|
65
|
+
|
|
52
66
|
const result = await completeOAuthCode({
|
|
53
67
|
oxyServices: opts.oxyServices,
|
|
54
68
|
clientId,
|
|
55
69
|
code,
|
|
56
70
|
returnedState: params.get('state'),
|
|
57
|
-
handshake
|
|
58
|
-
redirectUri
|
|
71
|
+
handshake,
|
|
72
|
+
redirectUri,
|
|
59
73
|
commitSession: opts.commitSession,
|
|
60
74
|
// Strip the params before the commit so a stale `?code=` cannot re-enter the
|
|
61
75
|
// exchange loop, and read the return path FIRST — clearOAuthHandshake drops
|
|
@@ -120,29 +134,5 @@ function stripOAuthParamsFromUrl(): void {
|
|
|
120
134
|
url.searchParams.delete('state');
|
|
121
135
|
url.searchParams.delete('error');
|
|
122
136
|
url.searchParams.delete('error_description');
|
|
123
|
-
url.searchParams.delete('hub_sync');
|
|
124
|
-
replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* When auth.oxy.so hub-sync redeem fails, the IdP redirects back with
|
|
129
|
-
* `?hub_sync=failed`. Strip the param and log so cold boot can continue
|
|
130
|
-
* without leaving a stale query string.
|
|
131
|
-
*/
|
|
132
|
-
export function consumeHubSyncFailure(): boolean {
|
|
133
|
-
if (!isWebBrowser()) return false;
|
|
134
|
-
const location = (globalThis as { location?: Location }).location;
|
|
135
|
-
if (!location) return false;
|
|
136
|
-
|
|
137
|
-
const params = new URLSearchParams(location.search);
|
|
138
|
-
if (params.get('hub_sync') !== 'failed') return false;
|
|
139
|
-
|
|
140
|
-
logger.warn('Hub sync failed — IdP device session may be out of sync', {
|
|
141
|
-
component: 'hubSync',
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
const url = new URL(location.href);
|
|
145
|
-
url.searchParams.delete('hub_sync');
|
|
146
137
|
replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
|
|
147
|
-
return true;
|
|
148
138
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* User display name and date formatting utilities.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Display-name helpers follow the API contract: prefer `name.displayName` when
|
|
5
|
+
* present, otherwise fall back to the normalized handle via
|
|
6
|
+
* `getNormalizedUserHandle`.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
getAccountDisplayName as coreGetAccountDisplayName,
|
|
11
|
-
type DisplayNameUserShape,
|
|
12
|
-
} from '@oxyhq/core';
|
|
9
|
+
import { getNormalizedUserHandle, type DisplayNameUserShape } from '@oxyhq/core';
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* Formats a date string to a readable format (e.g., "Feb 21, 2025")
|
|
@@ -31,44 +28,42 @@ export const formatDate = (dateString: string | undefined | null | Date): string
|
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
30
|
|
|
31
|
+
function readDisplayName(user: DisplayNameUserShape | null | undefined): string {
|
|
32
|
+
const name = user?.name;
|
|
33
|
+
if (!name || typeof name !== 'object') return '';
|
|
34
|
+
return typeof name.displayName === 'string' ? name.displayName.trim() : '';
|
|
35
|
+
}
|
|
36
|
+
|
|
34
37
|
/**
|
|
35
38
|
* Gets a display name from user data.
|
|
36
39
|
*
|
|
37
|
-
* Prefers
|
|
38
|
-
* (derived from publicKey) → translated "Unnamed".
|
|
39
|
-
*
|
|
40
|
-
* @param user - User-like object with optional name/username/publicKey
|
|
41
|
-
* @param locale - Optional locale for the final fallback label
|
|
40
|
+
* Prefers API `name.displayName`, then the normalized handle.
|
|
42
41
|
*/
|
|
43
42
|
export const getDisplayName = (
|
|
44
43
|
user: DisplayNameUserShape | null | undefined,
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
): string => {
|
|
45
|
+
const displayName = readDisplayName(user);
|
|
46
|
+
if (displayName) return displayName;
|
|
47
|
+
return getNormalizedUserHandle(user) ?? '';
|
|
48
|
+
};
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
|
-
* Gets a short display name (first
|
|
50
|
-
*
|
|
51
|
-
* Used for compact UI (e.g. greetings). Falls back to the full display name
|
|
52
|
-
* helper, which also handles publicKey-only accounts.
|
|
51
|
+
* Gets a short display name (first token) for compact UI.
|
|
53
52
|
*/
|
|
54
53
|
export const getShortDisplayName = (
|
|
55
54
|
user: DisplayNameUserShape | null | undefined,
|
|
56
|
-
locale?: string,
|
|
57
55
|
): string => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const first = typeof name.first === 'string' ? name.first.trim() : '';
|
|
63
|
-
if (first) return first;
|
|
64
|
-
const full = typeof name.full === 'string' ? name.full.trim() : '';
|
|
65
|
-
if (full) return full.split(' ')[0];
|
|
66
|
-
} else if (typeof name === 'string' && name.trim()) {
|
|
67
|
-
return name.trim().split(' ')[0];
|
|
56
|
+
const displayName = readDisplayName(user);
|
|
57
|
+
if (displayName) {
|
|
58
|
+
const firstToken = displayName.split(/\s+/).find(Boolean);
|
|
59
|
+
if (firstToken) return firstToken;
|
|
68
60
|
}
|
|
69
61
|
|
|
70
|
-
|
|
62
|
+
const handle = getNormalizedUserHandle(user);
|
|
63
|
+
if (handle) {
|
|
64
|
+
const firstToken = handle.split(/\s+/).find(Boolean);
|
|
65
|
+
return firstToken ?? handle;
|
|
66
|
+
}
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
return coreGetAccountDisplayName(user, locale);
|
|
68
|
+
return '';
|
|
74
69
|
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.allowsAutomaticIdpRedirect = allowsAutomaticIdpRedirect;
|
|
7
|
-
/**
|
|
8
|
-
* The legacy, redirect-mode-only lanes that navigate the RP's TOP-LEVEL window
|
|
9
|
-
* to the IdP without a user gesture.
|
|
10
|
-
*
|
|
11
|
-
* `webAuthMode: 'popup'` exists to guarantee exactly one thing: the relying
|
|
12
|
-
* party never leaves its route. Two mechanics in this SDK break that guarantee,
|
|
13
|
-
* because each replaces the whole document on its own initiative:
|
|
14
|
-
*
|
|
15
|
-
* 1. **Cold-boot silent restore** — a full-page `prompt=none` authorize bounce
|
|
16
|
-
* to `auth.oxy.so` when the device-secret mint finds no local session
|
|
17
|
-
* (`maybeStartSilentOAuthRestore`, called from `runProviderColdBoot`).
|
|
18
|
-
* 2. **Post-sign-in hub sync** — a full-page hop to `auth.oxy.so/sync` that
|
|
19
|
-
* plants this device's credential on the IdP hub so OTHER origins can later
|
|
20
|
-
* run lane 1 (`syncHubAfterSignIn`, called from the `commitSession` funnel).
|
|
21
|
-
*
|
|
22
|
-
* Both belong to the redirect transport and are kept only for the migration
|
|
23
|
-
* window (issue #691, "Cold boot and cross-domain behavior"). In popup mode a
|
|
24
|
-
* domain with no local credential simply resolves SIGNED OUT, and the user's
|
|
25
|
-
* next explicit "Continue with Oxy" opens the popup — from a real user gesture,
|
|
26
|
-
* never automatically.
|
|
27
|
-
*
|
|
28
|
-
* NOT covered here, and correctly enabled in BOTH modes: navigations the user
|
|
29
|
-
* asked for. When the browser blocks the popup, `startWebOAuthSignIn` still
|
|
30
|
-
* falls back to a full-page redirect rather than dead-ending the sign-in, and
|
|
31
|
-
* `tryCompleteOAuthReturn` still consumes a `?code=` that is already on the URL.
|
|
32
|
-
*
|
|
33
|
-
* PHASE 7b: once the pilot flips the default transport to `'popup'`, this
|
|
34
|
-
* predicate and BOTH lanes above are deleted outright. Grepping this symbol
|
|
35
|
-
* finds every site that has to go.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Whether a provider running `webAuthMode` may perform an SDK-initiated,
|
|
40
|
-
* non-gesture, full-page navigation to the IdP.
|
|
41
|
-
*
|
|
42
|
-
* `true` only for `'redirect'` — still the default and the compatibility path,
|
|
43
|
-
* whose behaviour must stay byte-for-byte unchanged.
|
|
44
|
-
*/
|
|
45
|
-
function allowsAutomaticIdpRedirect(webAuthMode) {
|
|
46
|
-
return webAuthMode === 'redirect';
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=legacyRedirectLanes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["allowsAutomaticIdpRedirect","webAuthMode"],"sourceRoot":"../../../../src","sources":["ui/oauth/legacyRedirectLanes.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,0BAA0BA,CAACC,WAAwB,EAAW;EAC5E,OAAOA,WAAW,KAAK,UAAU;AACnC","ignoreList":[]}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.clearCrossOriginRestoreGuards = clearCrossOriginRestoreGuards;
|
|
7
|
-
exports.consumeSilentOAuthError = consumeSilentOAuthError;
|
|
8
|
-
exports.isCrossOriginRestoreBlocked = isCrossOriginRestoreBlocked;
|
|
9
|
-
exports.isSilentRestoreEligibleOrigin = isSilentRestoreEligibleOrigin;
|
|
10
|
-
exports.markCrossOriginRestoreAttempted = markCrossOriginRestoreAttempted;
|
|
11
|
-
exports.maybeStartSilentOAuthRestore = maybeStartSilentOAuthRestore;
|
|
12
|
-
var _core = require("@oxyhq/core");
|
|
13
|
-
var _isWebBrowser = require("./isWebBrowser.js");
|
|
14
|
-
var _oauthReturn = require("./oauthReturn.js");
|
|
15
|
-
var _oauthNavigation = require("../components/oauthNavigation.js");
|
|
16
|
-
function sessionStore() {
|
|
17
|
-
return globalThis.sessionStorage;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** True when this tab already attempted cross-origin silent OAuth restore. */
|
|
21
|
-
function isCrossOriginRestoreBlocked() {
|
|
22
|
-
const store = sessionStore();
|
|
23
|
-
if (!store) return false;
|
|
24
|
-
return Boolean(store.getItem(_core.OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY) || store.getItem(_core.OXY_SILENT_OAUTH_ATTEMPTED_KEY));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Mark restore as attempted — never auto-retry until sign-out clears guards. */
|
|
28
|
-
function markCrossOriginRestoreAttempted() {
|
|
29
|
-
const store = sessionStore();
|
|
30
|
-
if (!store) return;
|
|
31
|
-
store.setItem(_core.OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY, '1');
|
|
32
|
-
store.setItem(_core.OXY_SILENT_OAUTH_ATTEMPTED_KEY, '1');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Clear all cross-origin restore loop guards (call on sign-out). */
|
|
36
|
-
function clearCrossOriginRestoreGuards() {
|
|
37
|
-
const store = sessionStore();
|
|
38
|
-
if (!store) return;
|
|
39
|
-
for (const key of [_core.OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY, _core.OXY_SILENT_OAUTH_ATTEMPTED_KEY]) {
|
|
40
|
-
store.removeItem(key);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Whether cold boot should attempt silent cross-origin OAuth restore for the
|
|
46
|
-
* given web origin.
|
|
47
|
-
*
|
|
48
|
-
* Mirrors the hub-sync WRITE gate (`syncHubAfterSignIn`): only OFFICIAL Oxy web
|
|
49
|
-
* origins participate in cross-app SSO — a random third-party / preview origin
|
|
50
|
-
* must never have its tab bounced to the IdP. Additionally, loopback / local-dev
|
|
51
|
-
* origins are EXCLUDED here even though {@link isOfficialWebOrigin} treats them
|
|
52
|
-
* as official: a developer's local app must never be redirected to a hosted IdP
|
|
53
|
-
* on cold boot (it signs in through the in-app dialog instead). The central IdP
|
|
54
|
-
* hub's own origin is excluded to avoid a wasteful self-hop.
|
|
55
|
-
*/
|
|
56
|
-
function isSilentRestoreEligibleOrigin(origin) {
|
|
57
|
-
if ((0, _core.isLoopbackOrigin)(origin)) return false;
|
|
58
|
-
if ((0, _core.isIdpHubOrigin)()) return false;
|
|
59
|
-
return (0, _core.isOfficialWebOrigin)(origin);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Top-level redirect to auth.oxy.so/authorize with `prompt=none` for silent
|
|
63
|
-
* cross-origin session restore on all web apps (official + third-party).
|
|
64
|
-
*/
|
|
65
|
-
async function maybeStartSilentOAuthRestore(opts) {
|
|
66
|
-
if (!(0, _isWebBrowser.isWebBrowser)()) return false;
|
|
67
|
-
const location = globalThis.location;
|
|
68
|
-
if (!location) return false;
|
|
69
|
-
|
|
70
|
-
// Defense-in-depth: never bounce a loopback / non-official / IdP-hub origin to
|
|
71
|
-
// a hosted authorize endpoint (the caller gates on this too).
|
|
72
|
-
if (!isSilentRestoreEligibleOrigin(location.origin)) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
if (isCrossOriginRestoreBlocked()) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
const params = new URLSearchParams(location.search);
|
|
79
|
-
if (params.has('code') || params.has('error')) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
const {
|
|
84
|
-
codeVerifier,
|
|
85
|
-
codeChallenge
|
|
86
|
-
} = await (0, _core.generatePkcePair)();
|
|
87
|
-
const state = await (0, _core.generateOAuthState)();
|
|
88
|
-
if (!(0, _core.persistOAuthHandshake)(state, codeVerifier)) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
const redirectUri = (0, _core.normalizeOAuthRedirectUri)(opts.redirectUri ?? location.origin);
|
|
92
|
-
const authorizeUrl = (0, _core.buildOAuthAuthorizeUrl)({
|
|
93
|
-
authorizeBaseUrl: opts.authorizeBaseUrl,
|
|
94
|
-
clientId: opts.clientId,
|
|
95
|
-
redirectUri,
|
|
96
|
-
state,
|
|
97
|
-
codeChallenge,
|
|
98
|
-
scope: opts.scope,
|
|
99
|
-
prompt: 'none'
|
|
100
|
-
});
|
|
101
|
-
markCrossOriginRestoreAttempted();
|
|
102
|
-
(0, _oauthNavigation.redirectToAuthorize)(authorizeUrl);
|
|
103
|
-
return true;
|
|
104
|
-
} catch (error) {
|
|
105
|
-
_core.logger.warn('Silent OAuth restore skipped', {
|
|
106
|
-
component: 'crossOriginRestore'
|
|
107
|
-
}, error);
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* When the RP lands with OAuth error params from a silent authorize attempt,
|
|
114
|
-
* strip them and return whether the error was terminal for silent restore.
|
|
115
|
-
*/
|
|
116
|
-
function consumeSilentOAuthError() {
|
|
117
|
-
if (!(0, _isWebBrowser.isWebBrowser)()) return null;
|
|
118
|
-
const location = globalThis.location;
|
|
119
|
-
const history = globalThis.history;
|
|
120
|
-
if (!location) return null;
|
|
121
|
-
const params = new URLSearchParams(location.search);
|
|
122
|
-
const error = params.get('error');
|
|
123
|
-
if (error !== 'login_required' && error !== 'consent_required') {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
markCrossOriginRestoreAttempted();
|
|
127
|
-
if (history?.replaceState) {
|
|
128
|
-
const url = new URL(location.href);
|
|
129
|
-
url.searchParams.delete('error');
|
|
130
|
-
url.searchParams.delete('error_description');
|
|
131
|
-
url.searchParams.delete('state');
|
|
132
|
-
// Silent restore failed, but the visitor still asked for a specific page.
|
|
133
|
-
// Put them back on it rather than leaving them on the bare origin the IdP
|
|
134
|
-
// redirected to.
|
|
135
|
-
(0, _oauthReturn.replaceUrlAfterOAuthReturn)(`${url.pathname}${url.search}${url.hash}`);
|
|
136
|
-
}
|
|
137
|
-
(0, _core.clearOAuthHandshake)();
|
|
138
|
-
return error;
|
|
139
|
-
}
|
|
140
|
-
//# sourceMappingURL=crossOriginRestore.js.map
|