@oxyhq/services 22.13.0 → 23.0.0
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 +1 -1
- package/lib/commonjs/index.js +74 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +424 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
- 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 +3 -2
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +5 -4
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +5 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/commonjs/ui/components/ProfileButton.js +4 -3
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/SettingsIcon.js +3 -2
- package/lib/commonjs/ui/components/SettingsIcon.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +7 -7
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +65 -103
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +0 -2
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +5 -4
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +14 -10
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js +11 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +3 -2
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +3 -2
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +15 -14
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +6 -5
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +3 -2
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +6 -6
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +5 -5
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +10 -9
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +4 -3
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +6 -5
- 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 +14 -45
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +0 -43
- package/lib/commonjs/ui/context/commitSessionFlow.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/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/useAuth.js +4 -2
- package/lib/commonjs/ui/hooks/useAuth.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/screens/AccountMembersScreen.js +4 -3
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +7 -6
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -3
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +3 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +96 -96
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +19 -18
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +4 -29
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +2 -2
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -3
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +10 -9
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +1 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +12 -13
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +4 -4
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +4 -3
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +4 -3
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +5 -7
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +3 -2
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +3 -2
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +5 -4
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -3
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- 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 +15 -28
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +18 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +414 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -0
- 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/OxyAuthChooser.js +5 -4
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +5 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
- package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/module/ui/components/ProfileButton.js +1 -1
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/SettingsIcon.js +1 -1
- package/lib/module/ui/components/SettingsIcon.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInRequestView.js +66 -104
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -1
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +0 -2
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
- package/lib/module/ui/components/authChooser/primitives.js +1 -1
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/authChooser/requestSurfaces.js +13 -9
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js +11 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.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/modals/DeleteAccountModal.js +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.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/PaymentMethodStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +1 -1
- 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 +16 -47
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +0 -42
- package/lib/module/ui/context/commitSessionFlow.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/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/useAuth.js +4 -2
- package/lib/module/ui/hooks/useAuth.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/screens/AccountMembersScreen.js +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.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 +91 -90
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +2 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +4 -29
- 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/ManageAccountScreen.js +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +2 -2
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +1 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +4 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +3 -3
- 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/FileLibraryError.js +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +3 -5
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.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 +3 -3
- 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/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 +15 -27
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
- 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/OxyAuthChooser.d.ts +5 -3
- 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/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +18 -18
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +8 -4
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +18 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.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/oxyContextTypes.d.ts +4 -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/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 +4 -2
- 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/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.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/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +20 -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/module/index.d.ts +5 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
- 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/OxyAuthChooser.d.ts +5 -3
- 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/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts +1 -1
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +18 -18
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +8 -4
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +18 -0
- package/lib/typescript/module/ui/components/authChooser/types.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/oxyContextTypes.d.ts +4 -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/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 +4 -2
- 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/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.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/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +20 -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/package.json +18 -8
- package/src/index.ts +32 -0
- package/src/notifications/deviceNotifications.ts +458 -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 +1 -1
- package/src/ui/components/OxyAuthChooser.tsx +5 -4
- package/src/ui/components/OxyProvider.tsx +5 -6
- package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
- package/src/ui/components/ProfileButton.tsx +1 -1
- package/src/ui/components/SettingsIcon.tsx +1 -1
- package/src/ui/components/authChooser/AccountsMenuView.tsx +1 -1
- package/src/ui/components/authChooser/SignInEntryView.tsx +9 -3
- package/src/ui/components/authChooser/SignInRequestView.tsx +78 -111
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +3 -11
- package/src/ui/components/authChooser/primitives.tsx +1 -1
- package/src/ui/components/authChooser/requestSurfaces.tsx +15 -11
- package/src/ui/components/authChooser/types.ts +19 -0
- package/src/ui/components/fileManagement/AnimatedButton.tsx +1 -1
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +1 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/modals/DeleteAccountModal.tsx +1 -1
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
- package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +1 -1
- package/src/ui/components/payment/types.ts +24 -24
- package/src/ui/components/styles/shadow.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +15 -46
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
- package/src/ui/context/commitSessionFlow.ts +0 -61
- package/src/ui/context/oxyContextTypes.ts +4 -7
- package/src/ui/context/useOxyAccountGraph.ts +4 -4
- package/src/ui/hooks/queries/userCache.ts +169 -148
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +2 -2
- package/src/ui/hooks/useAuth.ts +4 -2
- package/src/ui/hooks/useOnlineStatus.ts +3 -2
- package/src/ui/hooks/useSessionManagement.ts +0 -2
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
- package/src/ui/screens/CreateAccountScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +740 -574
- package/src/ui/screens/FileManagementScreen.tsx +2 -1
- package/src/ui/screens/HistoryViewScreen.tsx +4 -19
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +1 -1
- package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +2 -2
- package/src/ui/screens/PrivacySettingsScreen.tsx +1 -0
- package/src/ui/screens/ProfileScreen.tsx +6 -4
- package/src/ui/screens/UserListScreen.tsx +3 -3
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/fileManagement/FileLibraryError.tsx +1 -1
- package/src/ui/screens/fileManagement/FileListSection.tsx +1 -1
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +3 -2
- package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
- package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -3
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/types/navigation.ts +20 -19
- package/src/ui/utils/fileManagement.ts +108 -92
- package/src/ui/utils/netConnectivity.ts +27 -0
- package/src/ui/utils/oauthReturn.ts +15 -30
- 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 -160
- package/src/ui/utils/crossOriginRestore.ts +0 -168
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
* It is a cache write only — zero network, one `setQueryData` per key.
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
import type {
|
|
43
|
-
import type {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
42
|
+
import type { UserNameResponse } from "@oxyhq/contracts";
|
|
43
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
44
|
+
import { useAuthStore } from "../../stores/authStore";
|
|
45
|
+
import { queryKeys } from "./queryKeys";
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* A user-shaped object that can be upserted into the cache. Intentionally
|
|
@@ -53,30 +53,30 @@ import { useAuthStore } from '../../stores/authStore';
|
|
|
53
53
|
* pass through untouched (so the upsert never has to know the full DTO shape).
|
|
54
54
|
*/
|
|
55
55
|
export interface CacheableUser {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
56
|
+
id?: string;
|
|
57
|
+
/** Some sources (post/notification actors) carry the id as Mongo `_id`. */
|
|
58
|
+
_id?: string;
|
|
59
|
+
username?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Canonical structured name (`UserNameResponse`) OR a plain display string on
|
|
62
|
+
* the looser actor objects. Normalized to the object shape on write.
|
|
63
|
+
*/
|
|
64
|
+
name?: string | UserNameResponse;
|
|
65
|
+
/** Avatar file id. `null`/`''` are treated as "no avatar" (never degrade). */
|
|
66
|
+
avatar?: string | null;
|
|
67
|
+
/** Social counts. A partial `_count` never replaces a fuller one. */
|
|
68
|
+
_count?: { followers?: number; following?: number } | null;
|
|
69
|
+
/**
|
|
70
|
+
* Viewer-relative follow relationship. Present ONLY on an authenticated
|
|
71
|
+
* single-profile fetch; `null`/absent for anon/self/bulk/feed. Never stripped
|
|
72
|
+
* from an existing entry by a source that lacks it.
|
|
73
|
+
*/
|
|
74
|
+
relationship?: { isFollowing?: boolean; followsYou?: boolean } | null;
|
|
75
|
+
[key: string]: unknown;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/** The degraded display-name sentinel (ghost-author rule). */
|
|
79
|
-
const DEGRADED_DISPLAY_NAME =
|
|
79
|
+
const DEGRADED_DISPLAY_NAME = "Unknown user";
|
|
80
80
|
|
|
81
81
|
/** A cache entry always carries a resolved string `id`. */
|
|
82
82
|
type CachedUser = CacheableUser & { id: string; name?: UserNameResponse };
|
|
@@ -88,28 +88,34 @@ type CachedUser = CacheableUser & { id: string; name?: UserNameResponse };
|
|
|
88
88
|
* meaningful (a real `verified: false` or `_count.followers: 0`).
|
|
89
89
|
*/
|
|
90
90
|
function isMeaningful(value: unknown): boolean {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
if (value === undefined || value === null) return false;
|
|
92
|
+
if (typeof value === "string") return value.trim() !== "";
|
|
93
|
+
return true;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/** A display name is meaningful only when non-empty AND not the degraded sentinel. */
|
|
97
97
|
function isMeaningfulDisplayName(value: unknown): value is string {
|
|
98
|
-
|
|
98
|
+
return (
|
|
99
|
+
typeof value === "string" &&
|
|
100
|
+
value.trim() !== "" &&
|
|
101
|
+
value !== DEGRADED_DISPLAY_NAME
|
|
102
|
+
);
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
102
|
-
|
|
106
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
/** Normalize the polymorphic `name` (string | object | nullish) to the canonical object shape. */
|
|
106
|
-
function normalizeName(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
function normalizeName(
|
|
111
|
+
name: CacheableUser["name"],
|
|
112
|
+
): UserNameResponse | undefined {
|
|
113
|
+
if (name === undefined || name === null) return undefined;
|
|
114
|
+
if (typeof name === "string") {
|
|
115
|
+
const trimmed = name.trim();
|
|
116
|
+
return trimmed ? { displayName: trimmed } : undefined;
|
|
117
|
+
}
|
|
118
|
+
return name;
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
/**
|
|
@@ -119,12 +125,12 @@ function normalizeName(name: CacheableUser['name']): UserNameResponse | undefine
|
|
|
119
125
|
* object so the cache never holds a bare-string name).
|
|
120
126
|
*/
|
|
121
127
|
function toCachedUser(user: CacheableUser, fallbackId: string): CachedUser {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
const { name: rawName, ...rest } = user;
|
|
129
|
+
const id = String(user.id ?? user._id ?? fallbackId);
|
|
130
|
+
const name = normalizeName(rawName);
|
|
131
|
+
const normalized: CachedUser = { ...rest, id };
|
|
132
|
+
if (name !== undefined) normalized.name = name;
|
|
133
|
+
return normalized;
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
/**
|
|
@@ -132,39 +138,43 @@ function toCachedUser(user: CacheableUser, fallbackId: string): CachedUser {
|
|
|
132
138
|
* when no id can be resolved (nothing to key on).
|
|
133
139
|
*/
|
|
134
140
|
function normalizeIncoming(user: CacheableUser): CachedUser | null {
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
const cached = toCachedUser(user, "");
|
|
142
|
+
return cached.id ? cached : null;
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
/** Merge two `name` objects field-by-field, with anti-degradation on `displayName`. */
|
|
140
146
|
function mergeName(
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
existing: UserNameResponse | undefined,
|
|
148
|
+
incoming: UserNameResponse | undefined,
|
|
143
149
|
): UserNameResponse | undefined {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
if (incoming === undefined) return existing;
|
|
151
|
+
if (existing === undefined) return incoming;
|
|
152
|
+
const merged: UserNameResponse = { ...existing };
|
|
153
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
154
|
+
if (key === "displayName") continue;
|
|
155
|
+
if (isMeaningful(value)) merged[key] = value;
|
|
156
|
+
}
|
|
157
|
+
// Never let an empty / `'Unknown user'` displayName overwrite a real one.
|
|
158
|
+
if (isMeaningfulDisplayName(incoming.displayName)) {
|
|
159
|
+
merged.displayName = incoming.displayName;
|
|
160
|
+
}
|
|
161
|
+
return merged;
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
/** Merge `_count` field-by-field so a partial count never replaces a fuller one. */
|
|
159
165
|
function mergeCount(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
): CacheableUser[
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
existing: CacheableUser["_count"],
|
|
167
|
+
incoming: CacheableUser["_count"],
|
|
168
|
+
): CacheableUser["_count"] {
|
|
169
|
+
if (!isPlainObject(incoming)) return existing;
|
|
170
|
+
const merged: { followers?: number; following?: number } = {
|
|
171
|
+
...(isPlainObject(existing) ? existing : {}),
|
|
172
|
+
};
|
|
173
|
+
if (typeof incoming.followers === "number")
|
|
174
|
+
merged.followers = incoming.followers;
|
|
175
|
+
if (typeof incoming.following === "number")
|
|
176
|
+
merged.following = incoming.following;
|
|
177
|
+
return merged;
|
|
168
178
|
}
|
|
169
179
|
|
|
170
180
|
/**
|
|
@@ -172,16 +182,18 @@ function mergeCount(
|
|
|
172
182
|
* or an anon/self/bulk `null`) must NEVER strip an existing viewer relationship.
|
|
173
183
|
*/
|
|
174
184
|
function mergeRelationship(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
): CacheableUser[
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
existing: CacheableUser["relationship"],
|
|
186
|
+
incoming: CacheableUser["relationship"],
|
|
187
|
+
): CacheableUser["relationship"] {
|
|
188
|
+
if (!isPlainObject(incoming)) return existing;
|
|
189
|
+
const merged: { isFollowing?: boolean; followsYou?: boolean } = {
|
|
190
|
+
...(isPlainObject(existing) ? existing : {}),
|
|
191
|
+
};
|
|
192
|
+
if (typeof incoming.isFollowing === "boolean")
|
|
193
|
+
merged.isFollowing = incoming.isFollowing;
|
|
194
|
+
if (typeof incoming.followsYou === "boolean")
|
|
195
|
+
merged.followsYou = incoming.followsYou;
|
|
196
|
+
return merged;
|
|
185
197
|
}
|
|
186
198
|
|
|
187
199
|
/**
|
|
@@ -193,54 +205,63 @@ function mergeRelationship(
|
|
|
193
205
|
* only the by-username key carries it (`useUserByUsername`).
|
|
194
206
|
*/
|
|
195
207
|
function mergeUsers(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
208
|
+
existing: CachedUser,
|
|
209
|
+
incoming: CachedUser,
|
|
210
|
+
options?: { includeRelationship?: boolean },
|
|
199
211
|
): CachedUser {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
212
|
+
const includeRelationship = options?.includeRelationship ?? true;
|
|
213
|
+
const merged: CachedUser = { ...existing };
|
|
214
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
215
|
+
if (key === "name" || key === "_count" || key === "relationship") continue;
|
|
216
|
+
if (key === "id") {
|
|
217
|
+
merged.id = incoming.id;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (isMeaningful(value)) merged[key] = value;
|
|
221
|
+
}
|
|
222
|
+
const name = mergeName(existing.name, incoming.name);
|
|
223
|
+
if (name !== undefined) merged.name = name;
|
|
224
|
+
const count = mergeCount(existing._count, incoming._count);
|
|
225
|
+
if (count !== undefined) merged._count = count;
|
|
226
|
+
if (includeRelationship) {
|
|
227
|
+
const relationship = mergeRelationship(
|
|
228
|
+
existing.relationship,
|
|
229
|
+
incoming.relationship,
|
|
230
|
+
);
|
|
231
|
+
if (relationship !== undefined) merged.relationship = relationship;
|
|
232
|
+
} else {
|
|
233
|
+
merged.relationship = undefined;
|
|
234
|
+
}
|
|
235
|
+
return merged;
|
|
221
236
|
}
|
|
222
237
|
|
|
223
238
|
/** Merge-upsert a normalized user into one cache key (see module docs for semantics). */
|
|
224
239
|
function upsertOneKey(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
240
|
+
queryClient: QueryClient,
|
|
241
|
+
key: readonly unknown[],
|
|
242
|
+
incoming: CachedUser,
|
|
243
|
+
options: { includeRelationship: boolean },
|
|
229
244
|
): void {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
245
|
+
const mergeOpts = { includeRelationship: options.includeRelationship };
|
|
246
|
+
const existing = queryClient.getQueryData<CacheableUser>(key);
|
|
247
|
+
if (existing === undefined) {
|
|
248
|
+
// Cold slot: seed the full incoming object, STALE, so react-query refetches
|
|
249
|
+
// the full authoritative profile (relationship, counts, createdAt, …).
|
|
250
|
+
const seeded = mergeUsers({ id: incoming.id }, incoming, mergeOpts);
|
|
251
|
+
queryClient.setQueryData<CachedUser>(key, seeded, { updatedAt: 0 });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
// Existing entry: merge and leave its freshness lifecycle untouched. The
|
|
255
|
+
// existing entry is keyed by `incoming.id`, so use it as the fallback id.
|
|
256
|
+
const merged = mergeUsers(
|
|
257
|
+
toCachedUser(existing, incoming.id),
|
|
258
|
+
incoming,
|
|
259
|
+
mergeOpts,
|
|
260
|
+
);
|
|
261
|
+
const dataUpdatedAt = queryClient.getQueryState(key)?.dataUpdatedAt ?? 0;
|
|
262
|
+
queryClient.setQueryData<CachedUser>(key, merged, {
|
|
263
|
+
updatedAt: dataUpdatedAt,
|
|
264
|
+
});
|
|
244
265
|
}
|
|
245
266
|
|
|
246
267
|
/**
|
|
@@ -251,7 +272,7 @@ function upsertOneKey(
|
|
|
251
272
|
* empty string is honoured (anonymous scope).
|
|
252
273
|
*/
|
|
253
274
|
function resolveViewerId(viewerId?: string): string {
|
|
254
|
-
|
|
275
|
+
return viewerId ?? useAuthStore.getState().user?.id ?? "";
|
|
255
276
|
}
|
|
256
277
|
|
|
257
278
|
/**
|
|
@@ -265,29 +286,29 @@ function resolveViewerId(viewerId?: string): string {
|
|
|
265
286
|
* the current auth-store user id.
|
|
266
287
|
*/
|
|
267
288
|
export function upsertCachedUser(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
289
|
+
queryClient: QueryClient,
|
|
290
|
+
user: CacheableUser,
|
|
291
|
+
viewerId?: string,
|
|
271
292
|
): void {
|
|
272
|
-
|
|
273
|
-
|
|
293
|
+
const incoming = normalizeIncoming(user);
|
|
294
|
+
if (!incoming) return;
|
|
274
295
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
296
|
+
// By-id identity entry (read by `useUserById`). Not viewer-scoped — never store
|
|
297
|
+
// the viewer-relative `relationship` here or one viewer's follow state leaks
|
|
298
|
+
// into every other viewer's by-id cache entry.
|
|
299
|
+
upsertOneKey(queryClient, queryKeys.users.detail(incoming.id), incoming, {
|
|
300
|
+
includeRelationship: false,
|
|
301
|
+
});
|
|
281
302
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
303
|
+
const username = incoming.username;
|
|
304
|
+
if (typeof username === "string" && username.trim() !== "") {
|
|
305
|
+
// By-username entry (read by `useUserByUsername`). Viewer-scoped because the
|
|
306
|
+
// authenticated single-profile fetch embeds the viewer `relationship`. Build
|
|
307
|
+
// the key through the SAME helper the hook uses so username normalization
|
|
308
|
+
// (`trim().toLowerCase()`) matches byte-for-byte.
|
|
309
|
+
const key = queryKeys.users.byUsername(username, resolveViewerId(viewerId));
|
|
310
|
+
upsertOneKey(queryClient, key, incoming, { includeRelationship: true });
|
|
311
|
+
}
|
|
291
312
|
}
|
|
292
313
|
|
|
293
314
|
/**
|
|
@@ -296,13 +317,13 @@ export function upsertCachedUser(
|
|
|
296
317
|
* appears twice merges both slices into the single cache entry.
|
|
297
318
|
*/
|
|
298
319
|
export function upsertCachedUsers(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
320
|
+
queryClient: QueryClient,
|
|
321
|
+
users: readonly CacheableUser[] | null | undefined,
|
|
322
|
+
viewerId?: string,
|
|
302
323
|
): void {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
324
|
+
if (!Array.isArray(users) || users.length === 0) return;
|
|
325
|
+
const resolvedViewerId = resolveViewerId(viewerId);
|
|
326
|
+
for (const user of users) {
|
|
327
|
+
if (user) upsertCachedUser(queryClient, user, resolvedViewerId);
|
|
328
|
+
}
|
|
308
329
|
}
|
|
@@ -48,7 +48,7 @@ export const useAssets = () => {
|
|
|
48
48
|
// Upload asset with progress tracking
|
|
49
49
|
const upload = useCallback(async (
|
|
50
50
|
file: File,
|
|
51
|
-
metadata?: Record<string,
|
|
51
|
+
metadata?: Record<string, unknown>
|
|
52
52
|
): Promise<Asset | null> => {
|
|
53
53
|
if (!oxyInstance) {
|
|
54
54
|
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
@@ -7,11 +7,11 @@ interface UseAsyncActionOptions<T> {
|
|
|
7
7
|
/** Success message to display */
|
|
8
8
|
successMessage?: string;
|
|
9
9
|
/** Error message to display (or function to get message from error) */
|
|
10
|
-
errorMessage?: string | ((error:
|
|
10
|
+
errorMessage?: string | ((error: unknown) => string);
|
|
11
11
|
/** Callback on success */
|
|
12
12
|
onSuccess?: (result: T) => void;
|
|
13
13
|
/** Callback on error */
|
|
14
|
-
onError?: (error:
|
|
14
|
+
onError?: (error: unknown) => void;
|
|
15
15
|
/** Show loading toast */
|
|
16
16
|
showLoadingToast?: boolean;
|
|
17
17
|
/** Loading message */
|
package/src/ui/hooks/useAuth.ts
CHANGED
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
* }
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* - Web:
|
|
20
|
+
* Session restore (zero cookies):
|
|
21
|
+
* - Web: this origin's own persisted `{deviceId, deviceSecret}` — a signed-out
|
|
22
|
+
* origin stays signed out until the user presses "Continue with Oxy". There is
|
|
23
|
+
* no cross-origin silent SSO: the SDK never navigates the tab on its own.
|
|
22
24
|
* - Native: shared Keychain / app-group identity (Commons)
|
|
23
25
|
* - Realtime sync: Socket.IO `session_state` on `device:<deviceId>` once authenticated
|
|
24
26
|
* - Manual sign-in: signIn() opens the in-app account dialog (web + native)
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* useOnlineStatus
|
|
3
3
|
*
|
|
4
4
|
* Reactive boolean reflecting TanStack Query's `onlineManager` state.
|
|
5
|
-
* Mirrors browser `online`/`offline` events on web and NetInfo
|
|
6
|
-
* native (both wired up in `OxyProvider
|
|
5
|
+
* Mirrors browser `online`/`offline` events on web and NetInfo reachability
|
|
6
|
+
* updates on native (both wired up in `OxyProvider`, aligned with Bloom's
|
|
7
|
+
* `ConnectionStatusToasts` semantics).
|
|
7
8
|
*
|
|
8
9
|
* Use this for surfacing offline UI — an OfflineBanner, a disabled "Sync"
|
|
9
10
|
* button, an inline "queued" badge on pending writes, etc. For pending /
|
|
@@ -9,7 +9,6 @@ import type { OxyServices } from '@oxyhq/core';
|
|
|
9
9
|
import type { QueryClient } from '@tanstack/react-query';
|
|
10
10
|
import { clearQueryCache } from './queryClient';
|
|
11
11
|
import { isWebBrowser } from '../utils/isWebBrowser';
|
|
12
|
-
import { clearCrossOriginRestoreGuards } from '../utils/crossOriginRestore';
|
|
13
12
|
import { resetSessionScopedStores } from '../stores/resetSessionScopedStores';
|
|
14
13
|
|
|
15
14
|
export interface UseSessionManagementOptions {
|
|
@@ -197,7 +196,6 @@ export const useSessionManagement = ({
|
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
await clearSessionStorage();
|
|
200
|
-
clearCrossOriginRestoreGuards();
|
|
201
199
|
onAuthStateChange?.(null);
|
|
202
200
|
}, [clearSessionStorage, logoutStore, onAuthStateChange, oxyServices, queryClient, storage, logger]);
|
|
203
201
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TouchableOpacity,
|
|
6
6
|
ActivityIndicator,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import
|
|
8
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
9
9
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
10
10
|
import { toast } from '@oxyhq/bloom';
|
|
11
11
|
import { surfaces } from '@oxyhq/bloom/surfaces';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { useState, useCallback, useRef, useEffect } from 'react';
|
|
3
3
|
import { View, ActivityIndicator } from 'react-native';
|
|
4
|
-
import
|
|
4
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
5
5
|
import type { AccountKind, CreateAccountInput, OrganizationCategory } from '@oxyhq/core';
|
|
6
6
|
import { ORGANIZATION_CATEGORIES } from '@oxyhq/core';
|
|
7
7
|
import type { BaseScreenProps } from '../types/navigation';
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
type TextInputProps,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import
|
|
9
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
10
10
|
import type { BaseScreenProps } from '../types/navigation';
|
|
11
11
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
12
12
|
import { Text } from '@oxyhq/bloom/typography';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
3
3
|
import { View, ScrollView, StyleSheet } from 'react-native';
|
|
4
|
-
import
|
|
4
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
5
5
|
import { toast } from '@oxyhq/bloom';
|
|
6
6
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
7
7
|
import { Search } from '@oxyhq/bloom/search';
|