@oxyhq/services 26.0.1 → 26.0.3
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 +33 -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
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearBackgroundSession = clearBackgroundSession;
|
|
7
|
+
exports.isBackgroundSessionSupported = isBackgroundSessionSupported;
|
|
8
|
+
exports.syncBackgroundSession = syncBackgroundSession;
|
|
9
|
+
var _expoModulesCore = require("expo-modules-core");
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
var _core = require("@oxyhq/core");
|
|
12
|
+
/**
|
|
13
|
+
* The JS half of the native background session credential.
|
|
14
|
+
*
|
|
15
|
+
* A home-screen widget or a sync job refreshes while the app process is dead:
|
|
16
|
+
* there is no JS runtime, so it cannot go through this SDK's normal session lane
|
|
17
|
+
* at all. Native code needs its own way to obtain a bearer, and this module is
|
|
18
|
+
* what gives it one — while the app runs, it provisions a purpose-built
|
|
19
|
+
* credential and hands it to the native store that `so.oxy.session.OxyBackgroundSession`
|
|
20
|
+
* reads.
|
|
21
|
+
*
|
|
22
|
+
* ## Why a separate credential rather than the device secret
|
|
23
|
+
*
|
|
24
|
+
* `POST /session/device/token` ROTATES the device secret on every mint, and the
|
|
25
|
+
* presented secret dies 60 seconds later. Native code minting with it would be a
|
|
26
|
+
* second writer to the value this SDK's whole session depends on — and since
|
|
27
|
+
* `createNativeAuthStateStore` serves JS from an in-process mirror that never
|
|
28
|
+
* re-reads storage, JS would be blind to that rotation. A worker killed between
|
|
29
|
+
* the server's rotation and its local write would sign the user out of the app.
|
|
30
|
+
* A credential that nobody rotates removes that failure mode instead of managing
|
|
31
|
+
* it.
|
|
32
|
+
*
|
|
33
|
+
* ## What this does NOT do
|
|
34
|
+
*
|
|
35
|
+
* It never reads or writes `oxy.auth.v1` / expo-secure-store. The two credentials
|
|
36
|
+
* live in different stores with one writer each, so there is nothing to keep in
|
|
37
|
+
* lockstep and no state that can disagree.
|
|
38
|
+
*
|
|
39
|
+
* ## Android only, and web is refused rather than merely unsupported
|
|
40
|
+
*
|
|
41
|
+
* Web is gated off by an explicit platform check, not by the native module being
|
|
42
|
+
* absent — provisioning in a browser origin would be a security downgrade, so it
|
|
43
|
+
* must not depend on an incidental fact. See {@link loadNativeModule}. iOS has no
|
|
44
|
+
* implementation yet and resolves to no module, so every function here degrades to
|
|
45
|
+
* a no-op: an app can enable this and lose nothing on other platforms.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The native module's surface. Deliberately write-mostly: there is no `get`,
|
|
50
|
+
* because JS has no use for the secret it just wrote and keeping native as the
|
|
51
|
+
* secret's only reader is one less place it can leak from.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Re-provision once the remaining lifetime drops below this.
|
|
56
|
+
*
|
|
57
|
+
* The server issues a 30-day credential; renewing with a week to spare means an
|
|
58
|
+
* app opened even occasionally always holds a live one, while an app left unopened
|
|
59
|
+
* for a month lets it lapse — which is the intended outcome, not a failure.
|
|
60
|
+
*/
|
|
61
|
+
const RENEW_WHEN_REMAINING_MS = 7 * 24 * 60 * 60 * 1000;
|
|
62
|
+
let nativeModule;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Resolve the native module once — and refuse outright on web.
|
|
66
|
+
*
|
|
67
|
+
* ## Web is excluded on purpose, and not merely because the module is absent
|
|
68
|
+
*
|
|
69
|
+
* The credential is deliberately NON-ROTATING and long-lived, which is safe only
|
|
70
|
+
* because native background code is its sole consumer and nobody rotates it. A
|
|
71
|
+
* browser origin already holds the ROTATING `deviceSecret`, and it has no
|
|
72
|
+
* background worker to serve — so provisioning there would add a strictly weaker
|
|
73
|
+
* long-lived secret alongside a stronger short-lived one. That is a downgrade, not
|
|
74
|
+
* a harmless no-op, and the harm lands at the PROVISION CALL (which mints a live
|
|
75
|
+
* server-side credential) regardless of whether anything manages to store it.
|
|
76
|
+
*
|
|
77
|
+
* That property must not rest on `requireOptionalNativeModule` happening to return
|
|
78
|
+
* `null` on web. It does today — the module is registered for android only — but
|
|
79
|
+
* that is an incidental fact a future web shim or a web-build native-module mock
|
|
80
|
+
* would quietly reverse. So the platform is checked FIRST, before we even ask the
|
|
81
|
+
* registry, and every entry point in this module inherits the gate.
|
|
82
|
+
*
|
|
83
|
+
* (A pre-deploy server makes this visible too: oxy-api's `sessionDevice` router
|
|
84
|
+
* applies `requireSameSiteOrigin` path-agnostically, so an unmatched path answers
|
|
85
|
+
* `404` to a native caller but `403 BAD_ORIGIN` to a browser one. Core's degrade is
|
|
86
|
+
* deliberately narrow — `404 → null` only — because a real origin misconfiguration
|
|
87
|
+
* on a CURRENT server also returns 403, and swallowing that would hide a genuine
|
|
88
|
+
* bug. Platform gating belongs here, where the platform is actually known.)
|
|
89
|
+
*
|
|
90
|
+
* `requireOptionalNativeModule` (a static import Metro always resolves) rather
|
|
91
|
+
* than a dynamic `import(moduleName)`: the latter compiles to `require(variable)`
|
|
92
|
+
* in the CJS build, which Metro cannot resolve inside a consuming app — it
|
|
93
|
+
* silently returned `null` there, which is exactly how the cross-app SSO bridge
|
|
94
|
+
* broke once. Same reasoning as `loadSharedIdentityBridge` in `@oxyhq/protocol`.
|
|
95
|
+
*/
|
|
96
|
+
function loadNativeModule() {
|
|
97
|
+
if (nativeModule === undefined) {
|
|
98
|
+
if (_reactNative.Platform.OS === 'web') {
|
|
99
|
+
nativeModule = null;
|
|
100
|
+
return nativeModule;
|
|
101
|
+
}
|
|
102
|
+
const native = (0, _expoModulesCore.requireOptionalNativeModule)('OxyBackgroundSession');
|
|
103
|
+
nativeModule = native && typeof native.put === 'function' && typeof native.clear === 'function' && typeof native.peek === 'function' ? {
|
|
104
|
+
put: native.put.bind(native),
|
|
105
|
+
clear: native.clear.bind(native),
|
|
106
|
+
peek: native.peek.bind(native)
|
|
107
|
+
} : null;
|
|
108
|
+
}
|
|
109
|
+
return nativeModule;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Whether this platform/app can hold a background credential at all. */
|
|
113
|
+
function isBackgroundSessionSupported() {
|
|
114
|
+
return loadNativeModule() !== null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Drop the stored credential. No-op where unsupported, and never throws.
|
|
119
|
+
*
|
|
120
|
+
* Called on sign-out and BEFORE an account switch's network work, so the window
|
|
121
|
+
* in which background code could still serve the previous account is as short as
|
|
122
|
+
* one local write.
|
|
123
|
+
*/
|
|
124
|
+
async function clearBackgroundSession() {
|
|
125
|
+
const native = loadNativeModule();
|
|
126
|
+
if (!native) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
await native.clear();
|
|
131
|
+
} catch (error) {
|
|
132
|
+
_core.logger.warn('[backgroundSession] could not clear the native background credential', {
|
|
133
|
+
component: 'backgroundSession',
|
|
134
|
+
error
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Fail LOUDLY when the installed `@oxyhq/core` predates
|
|
140
|
+
* `provisionBackgroundCredential`.
|
|
141
|
+
*
|
|
142
|
+
* This is the one failure here that is a build/dependency mistake rather than a
|
|
143
|
+
* runtime condition, and it is the one that must never be quiet. Everything else
|
|
144
|
+
* in `syncBackgroundSession` is caught and logged at warn, which is right for a
|
|
145
|
+
* flaky network — but applying that to a version skew would leave background
|
|
146
|
+
* refreshes permanently non-functional behind a warning nobody reads. So this
|
|
147
|
+
* throws, and logs at ERROR first so it is still visible in a release build whose
|
|
148
|
+
* rejection handler is silent.
|
|
149
|
+
*
|
|
150
|
+
* Reachable only through a runtime skew: the declared `@oxyhq/core` range covers
|
|
151
|
+
* the method, so a correctly-resolved install cannot get here, and TypeScript
|
|
152
|
+
* rules it out at compile time.
|
|
153
|
+
*/
|
|
154
|
+
function assertProvisioningAvailable(oxyServices) {
|
|
155
|
+
if (typeof oxyServices.provisionBackgroundCredential === 'function') {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const message = '[backgroundSession] the installed @oxyhq/core has no provisionBackgroundCredential, ' + 'so no background credential can be provisioned and native background refreshes will ' + 'never authenticate. Install a @oxyhq/core that satisfies this package\'s declared range.';
|
|
159
|
+
_core.logger.error(message, undefined, {
|
|
160
|
+
component: 'backgroundSession'
|
|
161
|
+
});
|
|
162
|
+
throw new Error(message);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Bring the native credential in line with the session JS currently holds.
|
|
167
|
+
*
|
|
168
|
+
* Ordering is the load-bearing part: a credential belonging to a DIFFERENT
|
|
169
|
+
* account is cleared before any network call, so a crash mid-provision leaves
|
|
170
|
+
* background code signed out rather than serving the previous account's data
|
|
171
|
+
* under the new account's name. The server enforces the same rule independently
|
|
172
|
+
* (a mint is re-authorized against the live device session, and against its ACTIVE
|
|
173
|
+
* account), so this is the fast local half of a belt-and-braces pair, not the only
|
|
174
|
+
* guard.
|
|
175
|
+
*
|
|
176
|
+
* Throws for exactly one thing — a `@oxyhq/core` too old to provision (see
|
|
177
|
+
* {@link assertProvisioningAvailable}). Every other failure is caught and logged:
|
|
178
|
+
* a background credential is an enhancement, and failing to provision one must
|
|
179
|
+
* not disturb the session that is working.
|
|
180
|
+
*/
|
|
181
|
+
async function syncBackgroundSession(input) {
|
|
182
|
+
const native = loadNativeModule();
|
|
183
|
+
if (!native) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const {
|
|
187
|
+
oxyServices,
|
|
188
|
+
userId,
|
|
189
|
+
canUsePrivateApi,
|
|
190
|
+
isCurrent
|
|
191
|
+
} = input;
|
|
192
|
+
|
|
193
|
+
// Before the try, so the catch below cannot turn a dependency skew into a
|
|
194
|
+
// warning. Signed-out is exempt: clearing needs no core method, and a sign-out
|
|
195
|
+
// must never be blocked by one.
|
|
196
|
+
if (userId) {
|
|
197
|
+
assertProvisioningAvailable(oxyServices);
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
if (!userId) {
|
|
201
|
+
// Signed out. Local-only, so it works with no bearer and no network.
|
|
202
|
+
await native.clear();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const stored = await native.peek();
|
|
206
|
+
if (stored && stored.accountId !== userId) {
|
|
207
|
+
// Identity changed under a live credential — clear FIRST, provision after.
|
|
208
|
+
await native.clear();
|
|
209
|
+
}
|
|
210
|
+
const isForCurrentAccount = stored?.accountId === userId;
|
|
211
|
+
const hasLifeLeft = isForCurrentAccount && stored.expiresAt - Date.now() > RENEW_WHEN_REMAINING_MS;
|
|
212
|
+
if (hasLifeLeft) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Everything below needs a bearer. Without one yet (cold boot still
|
|
217
|
+
// resolving) there is nothing to do but wait for the next run — the token
|
|
218
|
+
// landing re-triggers this.
|
|
219
|
+
if (!canUsePrivateApi || !isCurrent()) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const provisioned = await oxyServices.provisionBackgroundCredential();
|
|
223
|
+
if (!provisioned) {
|
|
224
|
+
// `null` means the endpoint is not deployed yet. Expected during the
|
|
225
|
+
// rollout window (api leads the SDK) and deliberately quiet.
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (!isCurrent()) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
if (provisioned.accountId !== userId) {
|
|
232
|
+
// The active account moved while the request was in flight, so this
|
|
233
|
+
// credential is already for the wrong account. Drop it; the next run
|
|
234
|
+
// provisions for the account that is actually signed in.
|
|
235
|
+
await native.clear();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const expiresAt = Date.parse(provisioned.expiresAt);
|
|
239
|
+
if (!Number.isFinite(expiresAt)) {
|
|
240
|
+
_core.logger.warn('[backgroundSession] server returned an unparseable credential expiry', {
|
|
241
|
+
component: 'backgroundSession'
|
|
242
|
+
});
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const persisted = await native.put(oxyServices.getBaseURL(), provisioned.deviceId, provisioned.secret, provisioned.accountId, expiresAt);
|
|
246
|
+
if (!persisted) {
|
|
247
|
+
_core.logger.warn('[backgroundSession] the native store did not retain the background credential; background refreshes stay signed out until the next attempt', {
|
|
248
|
+
component: 'backgroundSession'
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
} catch (error) {
|
|
252
|
+
_core.logger.warn('[backgroundSession] could not sync the native background credential', {
|
|
253
|
+
component: 'backgroundSession',
|
|
254
|
+
error
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=backgroundSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_expoModulesCore","require","_reactNative","_core","RENEW_WHEN_REMAINING_MS","nativeModule","loadNativeModule","undefined","Platform","OS","native","requireOptionalNativeModule","put","clear","peek","bind","isBackgroundSessionSupported","clearBackgroundSession","error","logger","warn","component","assertProvisioningAvailable","oxyServices","provisionBackgroundCredential","message","Error","syncBackgroundSession","input","userId","canUsePrivateApi","isCurrent","stored","accountId","isForCurrentAccount","hasLifeLeft","expiresAt","Date","now","provisioned","parse","Number","isFinite","persisted","getBaseURL","deviceId","secret"],"sourceRoot":"../../../../src","sources":["ui/session/backgroundSession.ts"],"mappings":";;;;;;;;AAmCA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAtCA;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;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,uBAAuB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAEvD,IAAIC,YAAiE;;AAErE;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;AACA;AACA;AACA,SAASC,gBAAgBA,CAAA,EAA4C;EACnE,IAAID,YAAY,KAAKE,SAAS,EAAE;IAC9B,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBJ,YAAY,GAAG,IAAI;MACnB,OAAOA,YAAY;IACrB;IACA,MAAMK,MAAM,GAAG,IAAAC,4CAA2B,EACxC,sBACF,CAAC;IACDN,YAAY,GACVK,MAAM,IACN,OAAOA,MAAM,CAACE,GAAG,KAAK,UAAU,IAChC,OAAOF,MAAM,CAACG,KAAK,KAAK,UAAU,IAClC,OAAOH,MAAM,CAACI,IAAI,KAAK,UAAU,GAC7B;MACEF,GAAG,EAAEF,MAAM,CAACE,GAAG,CAACG,IAAI,CAACL,MAAM,CAAC;MAC5BG,KAAK,EAAEH,MAAM,CAACG,KAAK,CAACE,IAAI,CAACL,MAAM,CAAC;MAChCI,IAAI,EAAEJ,MAAM,CAACI,IAAI,CAACC,IAAI,CAACL,MAAM;IAC/B,CAAC,GACD,IAAI;EACZ;EACA,OAAOL,YAAY;AACrB;;AAEA;AACO,SAASW,4BAA4BA,CAAA,EAAY;EACtD,OAAOV,gBAAgB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","ignoreList":[]}
|
|
@@ -63,9 +63,16 @@ Object.defineProperty(exports, "deviceStateToClientSessions", {
|
|
|
63
63
|
return _core.deviceStateToClientSessions;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "useBackgroundSessionSync", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _useBackgroundSessionSync.useBackgroundSessionSync;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
var _createSessionClient = require("./createSessionClient.js");
|
|
67
73
|
var _tokenTransport = require("./tokenTransport.js");
|
|
68
74
|
var _authStore = require("./authStore.js");
|
|
75
|
+
var _useBackgroundSessionSync = require("./useBackgroundSessionSync.js");
|
|
69
76
|
var _identityBinding = require("./identityBinding.js");
|
|
70
77
|
var _core = require("@oxyhq/core");
|
|
71
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_createSessionClient","require","_tokenTransport","_authStore","_identityBinding","_core"],"sourceRoot":"../../../../src","sources":["ui/session/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_createSessionClient","require","_tokenTransport","_authStore","_useBackgroundSessionSync","_identityBinding","_core"],"sourceRoot":"../../../../src","sources":["ui/session/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useBackgroundSessionSync = useBackgroundSessionSync;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _backgroundSession = require("./backgroundSession.js");
|
|
10
|
+
/**
|
|
11
|
+
* Keeps the native background credential in step with the session, so an app
|
|
12
|
+
* enables background authentication with one prop and writes no session code of
|
|
13
|
+
* its own.
|
|
14
|
+
*
|
|
15
|
+
* See `./backgroundSession` for what the credential is and why it is separate
|
|
16
|
+
* from the rotating device secret.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An effect is the right shape here, unusually for this codebase: the work is a
|
|
21
|
+
* side effect on native storage, and it has to react both to an identity change
|
|
22
|
+
* (a value) and to the app being foregrounded (a subscription). There is no
|
|
23
|
+
* derived-state or React Query formulation of "write a credential to the
|
|
24
|
+
* keystore when the user changes or the app comes back".
|
|
25
|
+
*
|
|
26
|
+
* Re-runs on identity change, which is what makes sign-out and account switching
|
|
27
|
+
* work: `syncBackgroundSession` clears a credential belonging to anyone other
|
|
28
|
+
* than `userId` before it does any network work.
|
|
29
|
+
*/
|
|
30
|
+
function useBackgroundSessionSync({
|
|
31
|
+
enabled,
|
|
32
|
+
oxyServices,
|
|
33
|
+
userId,
|
|
34
|
+
canUsePrivateApi
|
|
35
|
+
}) {
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
if (!(0, _backgroundSession.isBackgroundSessionSupported)()) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!enabled) {
|
|
41
|
+
// An app that leaves the feature off must not keep a credential THIS app
|
|
42
|
+
// provisioned earlier. The store is package-scoped (see
|
|
43
|
+
// OxyBackgroundSessionStore), so this cannot revoke a sibling Oxy app's
|
|
44
|
+
// credential under the shared UID.
|
|
45
|
+
void (0, _backgroundSession.clearBackgroundSession)();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// A run that is superseded (unmount, or another identity change) must not
|
|
50
|
+
// write the credential it was about to write.
|
|
51
|
+
let current = true;
|
|
52
|
+
// Deliberately NOT caught. `syncBackgroundSession` already handles every
|
|
53
|
+
// runtime failure internally and throws for exactly one thing: an installed
|
|
54
|
+
// `@oxyhq/core` too old to provision. That is a dependency mistake which must
|
|
55
|
+
// surface, so it is allowed to reject — adding a `.catch()` here would put it
|
|
56
|
+
// back behind the silence it was moved out of.
|
|
57
|
+
const run = () => {
|
|
58
|
+
void (0, _backgroundSession.syncBackgroundSession)({
|
|
59
|
+
oxyServices,
|
|
60
|
+
userId,
|
|
61
|
+
canUsePrivateApi,
|
|
62
|
+
isCurrent: () => current
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
run();
|
|
66
|
+
const subscription = _reactNative.AppState.addEventListener('change', state => {
|
|
67
|
+
if (state === 'active') {
|
|
68
|
+
run();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return () => {
|
|
72
|
+
current = false;
|
|
73
|
+
subscription.remove();
|
|
74
|
+
// Deliberately NOT clearing here. Unmount is the app closing, which is
|
|
75
|
+
// precisely when the credential has to survive — clearing on teardown
|
|
76
|
+
// would defeat the entire feature. Revocation happens on sign-out (via a
|
|
77
|
+
// `userId` of null), on the server, or when the credential expires.
|
|
78
|
+
};
|
|
79
|
+
}, [enabled, oxyServices, userId, canUsePrivateApi]);
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=useBackgroundSessionSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_backgroundSession","useBackgroundSessionSync","enabled","oxyServices","userId","canUsePrivateApi","useEffect","isBackgroundSessionSupported","clearBackgroundSession","current","run","syncBackgroundSession","isCurrent","subscription","AppState","addEventListener","state","remove"],"sourceRoot":"../../../../src","sources":["ui/session/useBackgroundSessionSync.ts"],"mappings":";;;;;;AAQA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,wBAAwBA,CAAC;EACvCC,OAAO;EACPC,WAAW;EACXC,MAAM;EACNC;AAC6B,CAAC,EAAQ;EACtC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAAC,IAAAC,+CAA4B,EAAC,CAAC,EAAE;MACnC;IACF;IAEA,IAAI,CAACL,OAAO,EAAE;MACZ;MACA;MACA;MACA;MACA,KAAK,IAAAM,yCAAsB,EAAC,CAAC;MAC7B;IACF;;IAEA;IACA;IACA,IAAIC,OAAO,GAAG,IAAI;IAClB;IACA;IACA;IACA;IACA;IACA,MAAMC,GAAG,GAAGA,CAAA,KAAM;MAChB,KAAK,IAAAC,wCAAqB,EAAC;QACzBR,WAAW;QACXC,MAAM;QACNC,gBAAgB;QAChBO,SAAS,EAAEA,CAAA,KAAMH;MACnB,CAAC,CAAC;IACJ,CAAC;IAEDC,GAAG,CAAC,CAAC;IACL,MAAMG,YAAY,GAAGC,qBAAQ,CAACC,gBAAgB,CAAC,QAAQ,EAAGC,KAAK,IAAK;MAClE,IAAIA,KAAK,KAAK,QAAQ,EAAE;QACtBN,GAAG,CAAC,CAAC;MACP;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXD,OAAO,GAAG,KAAK;MACfI,YAAY,CAACI,MAAM,CAAC,CAAC;MACrB;MACA;MACA;MACA;IACF,CAAC;EACH,CAAC,EAAE,CAACf,OAAO,EAAEC,WAAW,EAAEC,MAAM,EAAEC,gBAAgB,CAAC,CAAC;AACtD","ignoreList":[]}
|
|
@@ -26,11 +26,11 @@ var _reactNative = require("react-native");
|
|
|
26
26
|
* (carries a URI but is not a real DOM `File` / `Blob` instance).
|
|
27
27
|
*/
|
|
28
28
|
function isRNFileDescriptor(input) {
|
|
29
|
-
if (!input || typeof input !==
|
|
29
|
+
if (!input || typeof input !== "object") return false;
|
|
30
30
|
const obj = input;
|
|
31
|
-
if (typeof obj.uri !==
|
|
32
|
-
if (typeof File !==
|
|
33
|
-
if (typeof Blob !==
|
|
31
|
+
if (typeof obj.uri !== "string") return false;
|
|
32
|
+
if (typeof File !== "undefined" && input instanceof File) return false;
|
|
33
|
+
if (typeof Blob !== "undefined" && input instanceof Blob) return false;
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -38,9 +38,9 @@ function isRNFileDescriptor(input) {
|
|
|
38
38
|
* Format file size in bytes to human-readable string
|
|
39
39
|
*/
|
|
40
40
|
function formatFileSize(bytes) {
|
|
41
|
-
if (bytes === 0) return
|
|
41
|
+
if (bytes === 0) return "0 Bytes";
|
|
42
42
|
const k = 1024;
|
|
43
|
-
const sizes = [
|
|
43
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
44
44
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
45
45
|
return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
|
|
46
46
|
}
|
|
@@ -49,14 +49,14 @@ function formatFileSize(bytes) {
|
|
|
49
49
|
* Get icon name for file based on content type
|
|
50
50
|
*/
|
|
51
51
|
function getFileIcon(contentType) {
|
|
52
|
-
if (contentType.startsWith(
|
|
53
|
-
if (contentType.startsWith(
|
|
54
|
-
if (contentType.startsWith(
|
|
55
|
-
if (contentType.includes(
|
|
56
|
-
if (contentType.includes(
|
|
57
|
-
if (contentType.includes(
|
|
58
|
-
if (contentType.includes(
|
|
59
|
-
return
|
|
52
|
+
if (contentType.startsWith("image/")) return "image";
|
|
53
|
+
if (contentType.startsWith("video/")) return "videocam";
|
|
54
|
+
if (contentType.startsWith("audio/")) return "musical-notes";
|
|
55
|
+
if (contentType.includes("pdf")) return "document-text";
|
|
56
|
+
if (contentType.includes("word") || contentType.includes("doc")) return "document";
|
|
57
|
+
if (contentType.includes("excel") || contentType.includes("sheet")) return "grid";
|
|
58
|
+
if (contentType.includes("zip") || contentType.includes("archive")) return "archive";
|
|
59
|
+
return "document-outline";
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -73,18 +73,18 @@ function getFileIcon(contentType) {
|
|
|
73
73
|
*/
|
|
74
74
|
async function convertDocumentPickerAssetToFile(doc, index) {
|
|
75
75
|
const fileName = doc.name || `file-${index + 1}`;
|
|
76
|
-
const fileType = doc.mimeType ||
|
|
76
|
+
const fileType = doc.mimeType || "application/octet-stream";
|
|
77
77
|
|
|
78
78
|
// React Native path — return the descriptor as-is. FormData handles it.
|
|
79
|
-
if (_reactNative.Platform.OS !==
|
|
79
|
+
if (_reactNative.Platform.OS !== "web") {
|
|
80
80
|
if (!doc.uri) {
|
|
81
|
-
throw new Error(
|
|
81
|
+
throw new Error("Missing file data (no uri property)");
|
|
82
82
|
}
|
|
83
83
|
return {
|
|
84
84
|
uri: doc.uri,
|
|
85
85
|
type: fileType,
|
|
86
86
|
name: fileName,
|
|
87
|
-
size: typeof doc.size ===
|
|
87
|
+
size: typeof doc.size === "number" ? doc.size : undefined
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
try {
|
|
@@ -92,7 +92,7 @@ async function convertDocumentPickerAssetToFile(doc, index) {
|
|
|
92
92
|
|
|
93
93
|
// Priority 1: Use doc.file if available (web native File API).
|
|
94
94
|
// This is the most efficient path as it doesn't require fetching.
|
|
95
|
-
if (doc.file && typeof globalThis.File !==
|
|
95
|
+
if (doc.file && typeof globalThis.File !== "undefined" && doc.file instanceof globalThis.File) {
|
|
96
96
|
file = doc.file;
|
|
97
97
|
// Ensure file has required properties
|
|
98
98
|
if (!file.name && doc.name) {
|
|
@@ -116,22 +116,22 @@ async function convertDocumentPickerAssetToFile(doc, index) {
|
|
|
116
116
|
throw new Error(`Failed to fetch file: ${response.statusText}`);
|
|
117
117
|
}
|
|
118
118
|
const blob = await response.blob();
|
|
119
|
-
const resolvedType = doc.mimeType || blob.type ||
|
|
119
|
+
const resolvedType = doc.mimeType || blob.type || "application/octet-stream";
|
|
120
120
|
file = new globalThis.File([blob], fileName, {
|
|
121
121
|
type: resolvedType
|
|
122
122
|
});
|
|
123
123
|
file.uri = doc.uri;
|
|
124
124
|
return file;
|
|
125
125
|
} catch (error) {
|
|
126
|
-
console.error(
|
|
127
|
-
throw new Error(`Failed to load file: ${(error instanceof Error ? error.message : null) ||
|
|
126
|
+
console.error("Failed to read file from URI:", error);
|
|
127
|
+
throw new Error(`Failed to load file: ${(error instanceof Error ? error.message : null) || "Unknown error"}`);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
// No file or URI available - this shouldn't happen with Expo 54
|
|
132
|
-
throw new Error(
|
|
132
|
+
throw new Error("Missing file data (no file or uri property)");
|
|
133
133
|
} catch (error) {
|
|
134
|
-
console.error(
|
|
134
|
+
console.error("Error converting document to file:", error);
|
|
135
135
|
throw error;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","isRNFileDescriptor","input","obj","uri","File","Blob","formatFileSize","bytes","k","sizes","i","Math","floor","log","Number","parseFloat","toFixed","getFileIcon","contentType","startsWith","includes","convertDocumentPickerAssetToFile","doc","index","fileName","name","fileType","mimeType","Platform","OS","Error","type","size","undefined","file","globalThis","response","fetch","ok","statusText","blob","resolvedType","error","console","message","uploadFileRaw","userId","oxyServices","visibility","uploadRawFile"],"sourceRoot":"../../../../src","sources":["ui/utils/fileManagement.ts"],"mappings":";;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACC,KAAc,EAA6B;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","isRNFileDescriptor","input","obj","uri","File","Blob","formatFileSize","bytes","k","sizes","i","Math","floor","log","Number","parseFloat","toFixed","getFileIcon","contentType","startsWith","includes","convertDocumentPickerAssetToFile","doc","index","fileName","name","fileType","mimeType","Platform","OS","Error","type","size","undefined","file","globalThis","response","fetch","ok","statusText","blob","resolvedType","error","console","message","uploadFileRaw","userId","oxyServices","visibility","uploadRawFile"],"sourceRoot":"../../../../src","sources":["ui/utils/fileManagement.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isNetConnectivityExplicitlyOffline = isNetConnectivityExplicitlyOffline;
|
|
7
|
+
exports.isNetConnectivityOnline = isNetConnectivityOnline;
|
|
8
|
+
/**
|
|
9
|
+
* Mirrors Bloom `ConnectionStatusToasts` reachability semantics: a link that
|
|
10
|
+
* reports connected but explicitly unreachable (captive portal, no route) counts
|
|
11
|
+
* as offline.
|
|
12
|
+
*/
|
|
13
|
+
function isNetConnectivityOnline(state) {
|
|
14
|
+
return Boolean(state.isConnected && state.isInternetReachable !== false);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Conservative offline verdict for boot-path probes. Unknown / probing states
|
|
19
|
+
* (`null`, timed-out fetch) resolve to "not offline" so a flaky probe never
|
|
20
|
+
* skips a real sign-in.
|
|
21
|
+
*/
|
|
22
|
+
function isNetConnectivityExplicitlyOffline(state) {
|
|
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
|
+
}
|
|
28
|
+
//# sourceMappingURL=netConnectivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isNetConnectivityOnline","state","Boolean","isConnected","isInternetReachable","isNetConnectivityExplicitlyOffline"],"sourceRoot":"../../../../src","sources":["ui/utils/netConnectivity.ts"],"mappings":";;;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAASA,uBAAuBA,CAACC,KAAuB,EAAW;EACxE,OAAOC,OAAO,CAACD,KAAK,CAACE,WAAW,IAAIF,KAAK,CAACG,mBAAmB,KAAK,KAAK,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,kCAAkCA,CAChDJ,KAA0C,EACjC;EACT,IAAI,CAACA,KAAK,EAAE,OAAO,KAAK;EACxB,IAAIA,KAAK,CAACE,WAAW,KAAK,KAAK,EAAE,OAAO,IAAI;EAC5C,IAAIF,KAAK,CAACE,WAAW,KAAK,IAAI,IAAIF,KAAK,CAACG,mBAAmB,KAAK,KAAK,EAAE,OAAO,IAAI;EAClF,OAAO,KAAK;AACd","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.consumeHubSyncFailure = consumeHubSyncFailure;
|
|
7
6
|
exports.replaceUrlAfterOAuthReturn = replaceUrlAfterOAuthReturn;
|
|
8
7
|
exports.tryCompleteOAuthReturn = tryCompleteOAuthReturn;
|
|
9
8
|
var _core = require("@oxyhq/core");
|
|
@@ -13,12 +12,21 @@ var _isWebBrowser = require("./isWebBrowser.js");
|
|
|
13
12
|
* When the RP lands with `?code=` after signing in at auth.oxy.so, exchange the
|
|
14
13
|
* code for a device-first session before cold boot runs.
|
|
15
14
|
*
|
|
16
|
-
* This is the REDIRECT transport's return leg.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
15
|
+
* This is the REDIRECT transport's return leg. The SDK never starts a full-page
|
|
16
|
+
* authorize navigation on its own any more (#691 phase 7b), but this lane is
|
|
17
|
+
* still load-bearing: a browser-BLOCKED sign-in popup falls back to a full-page
|
|
18
|
+
* redirect (`startWebOAuthSignIn`), and that redirect comes back here.
|
|
19
|
+
*
|
|
20
|
+
* It owns only what is specific to a full-page round trip — reading the code off
|
|
21
|
+
* the URL, recovering the handshake `sessionStorage` carried across the
|
|
22
|
+
* navigation, and cleaning both up afterwards — and delegates state validation,
|
|
23
|
+
* the PKCE exchange, and the session commit to `completeOAuthCode`, the same
|
|
24
|
+
* function the popup transport runs.
|
|
25
|
+
*
|
|
26
|
+
* It is also the SINGLE cleanup path for an OAuth `error` landing on the URL:
|
|
27
|
+
* any `?error=…` (including an `error=login_required` left over from the
|
|
28
|
+
* now-deleted silent restore) is stripped along with `state` /
|
|
29
|
+
* `error_description`, and the stale PKCE handshake is cleared.
|
|
22
30
|
*/
|
|
23
31
|
async function tryCompleteOAuthReturn(opts) {
|
|
24
32
|
if (!(0, _isWebBrowser.isWebBrowser)()) return false;
|
|
@@ -42,13 +50,15 @@ async function tryCompleteOAuthReturn(opts) {
|
|
|
42
50
|
(0, _core.clearOAuthHandshake)();
|
|
43
51
|
return false;
|
|
44
52
|
}
|
|
53
|
+
const handshake = (0, _core.readOAuthHandshake)();
|
|
54
|
+
const redirectUri = (0, _core.canonicalizeOAuthRedirectUri)(handshake?.redirectUri ?? opts.authRedirectUri ?? location.origin);
|
|
45
55
|
const result = await (0, _completeOAuthCode.completeOAuthCode)({
|
|
46
56
|
oxyServices: opts.oxyServices,
|
|
47
57
|
clientId,
|
|
48
58
|
code,
|
|
49
59
|
returnedState: params.get('state'),
|
|
50
|
-
handshake
|
|
51
|
-
redirectUri
|
|
60
|
+
handshake,
|
|
61
|
+
redirectUri,
|
|
52
62
|
commitSession: opts.commitSession,
|
|
53
63
|
// Strip the params before the commit so a stale `?code=` cannot re-enter the
|
|
54
64
|
// exchange loop, and read the return path FIRST — clearOAuthHandshake drops
|
|
@@ -111,27 +121,6 @@ function stripOAuthParamsFromUrl() {
|
|
|
111
121
|
url.searchParams.delete('state');
|
|
112
122
|
url.searchParams.delete('error');
|
|
113
123
|
url.searchParams.delete('error_description');
|
|
114
|
-
url.searchParams.delete('hub_sync');
|
|
115
|
-
replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* When auth.oxy.so hub-sync redeem fails, the IdP redirects back with
|
|
120
|
-
* `?hub_sync=failed`. Strip the param and log so cold boot can continue
|
|
121
|
-
* without leaving a stale query string.
|
|
122
|
-
*/
|
|
123
|
-
function consumeHubSyncFailure() {
|
|
124
|
-
if (!(0, _isWebBrowser.isWebBrowser)()) return false;
|
|
125
|
-
const location = globalThis.location;
|
|
126
|
-
if (!location) return false;
|
|
127
|
-
const params = new URLSearchParams(location.search);
|
|
128
|
-
if (params.get('hub_sync') !== 'failed') return false;
|
|
129
|
-
_core.logger.warn('Hub sync failed — IdP device session may be out of sync', {
|
|
130
|
-
component: 'hubSync'
|
|
131
|
-
});
|
|
132
|
-
const url = new URL(location.href);
|
|
133
|
-
url.searchParams.delete('hub_sync');
|
|
134
124
|
replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
|
|
135
|
-
return true;
|
|
136
125
|
}
|
|
137
126
|
//# sourceMappingURL=oauthReturn.js.map
|