@oxyhq/services 11.0.0 → 11.1.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/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenu.js +9 -5
- package/lib/commonjs/ui/components/AccountMenu.js.map +1 -1
- package/lib/commonjs/ui/components/AnotherDeviceQR.js +51 -56
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +1 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +18 -5
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +23 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +20 -1
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +19 -9
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +4 -2
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +153 -19
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +6 -17
- package/lib/commonjs/ui/context/hooks/useAuthOperations.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 +38 -38
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +2 -2
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +3 -3
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +16 -12
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +10 -6
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queryClient.js +6 -5
- package/lib/commonjs/ui/hooks/queryClient.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +40 -2
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +1 -1
- package/lib/commonjs/ui/hooks/useProfileEditing.js +21 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +3 -3
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +100 -108
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +227 -273
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +10 -4
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +20 -37
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +89 -201
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +80 -208
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +56 -208
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +303 -352
- 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/HelpSupportScreen.js +77 -89
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +43 -58
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +67 -90
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +77 -177
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +113 -107
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +55 -114
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +67 -85
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +71 -135
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +15 -9
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +65 -83
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +378 -1023
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +294 -242
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +192 -305
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +57 -97
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +41 -41
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +17 -24
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +83 -214
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +115 -77
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +70 -57
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +136 -332
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +47 -137
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +182 -115
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +138 -214
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +54 -92
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/activeAuthuser.js +15 -9
- package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AccountMenu.js +10 -6
- package/lib/module/ui/components/AccountMenu.js.map +1 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +50 -56
- package/lib/module/ui/components/AnotherDeviceQR.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +2 -1
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +18 -5
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +23 -7
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +20 -1
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +19 -9
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +4 -2
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +154 -20
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +6 -17
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +5 -5
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +38 -38
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +2 -2
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +3 -3
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +16 -12
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +9 -6
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/queryClient.js +6 -5
- package/lib/module/ui/hooks/queryClient.js.map +1 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +40 -2
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +1 -1
- package/lib/module/ui/hooks/useProfileEditing.js +21 -0
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +4 -3
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +101 -109
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +228 -275
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +10 -4
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +19 -39
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateManagedAccountScreen.js +90 -202
- package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +77 -205
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +55 -207
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +301 -350
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +20 -20
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +78 -90
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +44 -59
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +68 -91
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +75 -177
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +116 -108
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +52 -112
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +68 -86
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +69 -134
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +16 -10
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +66 -84
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +366 -1012
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +295 -243
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +189 -302
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +58 -98
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +42 -42
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +18 -25
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +81 -212
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +114 -76
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustAboutScreen.js +69 -57
- package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +135 -332
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js +48 -138
- package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +184 -117
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +132 -208
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +58 -94
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/utils/activeAuthuser.js +15 -9
- package/lib/module/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +1 -1
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +12 -2
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.native.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +34 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +3 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +3 -3
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +22 -0
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +3 -0
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts +2 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.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/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- 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/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.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/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +2 -0
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +12 -2
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +34 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +3 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +3 -3
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +22 -0
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +3 -0
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts +2 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.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/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- 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/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.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/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/types/expo-haptics.d.ts +42 -0
- package/package.json +8 -3
- package/src/index.ts +1 -0
- package/src/types/expo-haptics.d.ts +42 -0
- package/src/ui/components/AccountMenu.tsx +11 -5
- package/src/ui/components/AnotherDeviceQR.tsx +53 -45
- package/src/ui/components/BottomSheetRouter.tsx +2 -1
- package/src/ui/components/FollowButton.tsx +24 -5
- package/src/ui/components/OxyProvider.tsx +22 -8
- package/src/ui/components/SignInModal.tsx +21 -2
- package/src/ui/components/TouchableRipple/TouchableRipple.native.tsx +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +9 -9
- package/src/ui/components/fileManagement/UploadPreview.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +178 -21
- package/src/ui/context/hooks/useAuthOperations.ts +6 -17
- package/src/ui/hooks/mutations/mutationFactory.ts +5 -5
- package/src/ui/hooks/mutations/useAccountMutations.ts +38 -38
- package/src/ui/hooks/mutations/useServicesMutations.ts +2 -2
- package/src/ui/hooks/queries/queryKeys.ts +6 -3
- package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
- package/src/ui/hooks/queries/usePaymentQueries.ts +12 -12
- package/src/ui/hooks/queries/useServicesQueries.ts +9 -6
- package/src/ui/hooks/queryClient.ts +5 -5
- package/src/ui/hooks/useOxyAuthSession.ts +76 -2
- package/src/ui/hooks/useProfileEditing.ts +24 -0
- package/src/ui/hooks/useSessionManagement.ts +9 -6
- package/src/ui/screens/AccountVerificationScreen.tsx +101 -113
- package/src/ui/screens/AppInfoScreen.tsx +200 -238
- package/src/ui/screens/AvatarCropScreen.tsx +17 -4
- package/src/ui/screens/ConnectedAppsScreen.tsx +16 -34
- package/src/ui/screens/CreateManagedAccountScreen.tsx +94 -170
- package/src/ui/screens/EditProfileFieldScreen.tsx +77 -190
- package/src/ui/screens/FAQScreen.tsx +77 -208
- package/src/ui/screens/FeedbackScreen.tsx +330 -239
- package/src/ui/screens/FileManagementScreen.tsx +20 -20
- package/src/ui/screens/HelpSupportScreen.tsx +67 -82
- package/src/ui/screens/HistoryViewScreen.tsx +32 -38
- package/src/ui/screens/LanguageSelectorScreen.tsx +79 -93
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +81 -164
- package/src/ui/screens/LegalDocumentsScreen.tsx +184 -123
- package/src/ui/screens/ManageAccountScreen.tsx +48 -114
- package/src/ui/screens/NotificationsScreen.tsx +107 -106
- package/src/ui/screens/OxyAuthScreen.tsx +76 -109
- package/src/ui/screens/PaymentGatewayScreen.tsx +16 -7
- package/src/ui/screens/PreferencesScreen.tsx +96 -116
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +419 -872
- package/src/ui/screens/PrivacySettingsScreen.tsx +203 -185
- package/src/ui/screens/ProfileScreen.tsx +158 -200
- package/src/ui/screens/SavesCollectionsScreen.tsx +78 -125
- package/src/ui/screens/SearchSettingsScreen.tsx +52 -41
- package/src/ui/screens/UserLinksScreen.tsx +18 -25
- package/src/ui/screens/UserListScreen.tsx +95 -188
- package/src/ui/screens/WelcomeNewUserScreen.tsx +109 -36
- package/src/ui/screens/trust/TrustAboutScreen.tsx +52 -41
- package/src/ui/screens/trust/TrustCenterScreen.tsx +184 -222
- package/src/ui/screens/trust/TrustFAQScreen.tsx +64 -124
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +190 -67
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +147 -182
- package/src/ui/screens/trust/TrustRulesScreen.tsx +77 -50
- package/src/ui/utils/activeAuthuser.ts +15 -9
- package/src/ui/utils/avatarUtils.ts +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js +0 -72
- package/lib/commonjs/ui/components/feedback/FormInput.js.map +0 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +0 -261
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +0 -1
- package/lib/module/ui/components/feedback/FormInput.js +0 -67
- package/lib/module/ui/components/feedback/FormInput.js.map +0 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +0 -256
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/FormInput.d.ts +0 -20
- package/lib/typescript/commonjs/ui/components/feedback/FormInput.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts +0 -279
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/feedback/FormInput.d.ts +0 -20
- package/lib/typescript/module/ui/components/feedback/FormInput.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts +0 -279
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts.map +0 -1
- package/src/ui/components/feedback/FormInput.tsx +0 -84
- package/src/ui/components/feedback/feedbackStyles.ts +0 -246
|
@@ -17,7 +17,10 @@ export const queryKeys = {
|
|
|
17
17
|
list: (sessionIds: string[]) => [...queryKeys.accounts.lists(), sessionIds] as const,
|
|
18
18
|
details: () => [...queryKeys.accounts.all, 'detail'] as const,
|
|
19
19
|
detail: (sessionId: string) => [...queryKeys.accounts.details(), sessionId] as const,
|
|
20
|
-
current: (
|
|
20
|
+
current: (sessionId?: string | null) =>
|
|
21
|
+
sessionId
|
|
22
|
+
? ([...queryKeys.accounts.all, 'current', sessionId] as const)
|
|
23
|
+
: ([...queryKeys.accounts.all, 'current'] as const),
|
|
21
24
|
settings: () => [...queryKeys.accounts.all, 'settings'] as const,
|
|
22
25
|
},
|
|
23
26
|
|
|
@@ -46,7 +49,7 @@ export const queryKeys = {
|
|
|
46
49
|
devices: {
|
|
47
50
|
all: ['devices'] as const,
|
|
48
51
|
lists: () => [...queryKeys.devices.all, 'list'] as const,
|
|
49
|
-
list: (
|
|
52
|
+
list: (accountScope?: string) => [...queryKeys.devices.lists(), accountScope] as const,
|
|
50
53
|
details: () => [...queryKeys.devices.all, 'detail'] as const,
|
|
51
54
|
detail: (deviceId: string) => [...queryKeys.devices.details(), deviceId] as const,
|
|
52
55
|
},
|
|
@@ -71,7 +74,7 @@ export const queryKeys = {
|
|
|
71
74
|
// Storage usage queries
|
|
72
75
|
storage: {
|
|
73
76
|
all: ['storage'] as const,
|
|
74
|
-
usage: () => [...queryKeys.storage.all, 'usage'] as const,
|
|
77
|
+
usage: (accountScope?: string) => [...queryKeys.storage.all, 'usage', accountScope] as const,
|
|
75
78
|
},
|
|
76
79
|
|
|
77
80
|
// Connected apps (FedCM grants the user has authorized)
|
|
@@ -65,7 +65,7 @@ export const useCurrentUser = (options?: { enabled?: boolean }) => {
|
|
|
65
65
|
const queryClient = useQueryClient();
|
|
66
66
|
|
|
67
67
|
const query = useQuery({
|
|
68
|
-
queryKey: queryKeys.accounts.current(),
|
|
68
|
+
queryKey: queryKeys.accounts.current(activeSessionId),
|
|
69
69
|
queryFn: async () => {
|
|
70
70
|
if (!activeSessionId) {
|
|
71
71
|
throw new Error('No active session');
|
|
@@ -34,10 +34,10 @@ import type {
|
|
|
34
34
|
* API's `{ plan: 'basic' }` fallback when the user has never subscribed.
|
|
35
35
|
*/
|
|
36
36
|
export const useUserSubscription = (options?: { enabled?: boolean }) => {
|
|
37
|
-
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
37
|
+
const { oxyServices, isAuthenticated, activeSessionId, user } = useOxy();
|
|
38
38
|
|
|
39
39
|
return useQuery({
|
|
40
|
-
queryKey: queryKeys.payments.subscription(),
|
|
40
|
+
queryKey: queryKeys.payments.subscription(user?.id),
|
|
41
41
|
queryFn: async () => {
|
|
42
42
|
return authenticatedApiCall<Subscription>(
|
|
43
43
|
oxyServices,
|
|
@@ -45,7 +45,7 @@ export const useUserSubscription = (options?: { enabled?: boolean }) => {
|
|
|
45
45
|
() => oxyServices.getCurrentUserSubscription(),
|
|
46
46
|
);
|
|
47
47
|
},
|
|
48
|
-
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
48
|
+
enabled: (options?.enabled !== false) && isAuthenticated && !!user?.id,
|
|
49
49
|
// Subscription state changes rarely; tolerate a longer fresh window.
|
|
50
50
|
staleTime: 5 * 60 * 1000, // 5 minutes
|
|
51
51
|
gcTime: 30 * 60 * 1000, // 30 minutes
|
|
@@ -59,10 +59,10 @@ export const useUserSubscription = (options?: { enabled?: boolean }) => {
|
|
|
59
59
|
* returns the user's `deposit` and `purchase` transactions newest-first.
|
|
60
60
|
*/
|
|
61
61
|
export const useUserPayments = (options?: { enabled?: boolean }) => {
|
|
62
|
-
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
62
|
+
const { oxyServices, isAuthenticated, activeSessionId, user } = useOxy();
|
|
63
63
|
|
|
64
64
|
return useQuery({
|
|
65
|
-
queryKey: queryKeys.payments.history(),
|
|
65
|
+
queryKey: queryKeys.payments.history(user?.id),
|
|
66
66
|
queryFn: async () => {
|
|
67
67
|
return authenticatedApiCall<Payment[]>(
|
|
68
68
|
oxyServices,
|
|
@@ -70,7 +70,7 @@ export const useUserPayments = (options?: { enabled?: boolean }) => {
|
|
|
70
70
|
() => oxyServices.getUserPayments(),
|
|
71
71
|
);
|
|
72
72
|
},
|
|
73
|
-
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
73
|
+
enabled: (options?.enabled !== false) && isAuthenticated && !!user?.id,
|
|
74
74
|
// Billing history is append-mostly; a short fresh window is fine.
|
|
75
75
|
staleTime: 2 * 60 * 1000, // 2 minutes
|
|
76
76
|
gcTime: 30 * 60 * 1000, // 30 minutes
|
|
@@ -84,10 +84,10 @@ export const useUserPayments = (options?: { enabled?: boolean }) => {
|
|
|
84
84
|
* Balance changes frequently, so the fresh window is intentionally short.
|
|
85
85
|
*/
|
|
86
86
|
export const useUserWallet = (options?: { enabled?: boolean }) => {
|
|
87
|
-
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
87
|
+
const { oxyServices, isAuthenticated, activeSessionId, user } = useOxy();
|
|
88
88
|
|
|
89
89
|
return useQuery({
|
|
90
|
-
queryKey: queryKeys.payments.wallet(),
|
|
90
|
+
queryKey: queryKeys.payments.wallet(user?.id),
|
|
91
91
|
queryFn: async () => {
|
|
92
92
|
return authenticatedApiCall<Wallet>(
|
|
93
93
|
oxyServices,
|
|
@@ -95,7 +95,7 @@ export const useUserWallet = (options?: { enabled?: boolean }) => {
|
|
|
95
95
|
() => oxyServices.getCurrentUserWallet(),
|
|
96
96
|
);
|
|
97
97
|
},
|
|
98
|
-
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
98
|
+
enabled: (options?.enabled !== false) && isAuthenticated && !!user?.id,
|
|
99
99
|
staleTime: 60 * 1000, // 1 minute (balance moves often)
|
|
100
100
|
gcTime: 10 * 60 * 1000, // 10 minutes
|
|
101
101
|
});
|
|
@@ -116,12 +116,12 @@ export const useUserWalletTransactions = (
|
|
|
116
116
|
params?: { limit?: number; offset?: number },
|
|
117
117
|
options?: { enabled?: boolean },
|
|
118
118
|
) => {
|
|
119
|
-
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
119
|
+
const { oxyServices, isAuthenticated, activeSessionId, user } = useOxy();
|
|
120
120
|
const limit = params?.limit;
|
|
121
121
|
const offset = params?.offset;
|
|
122
122
|
|
|
123
123
|
return useQuery({
|
|
124
|
-
queryKey: queryKeys.payments.walletTransactions(limit, offset),
|
|
124
|
+
queryKey: queryKeys.payments.walletTransactions(limit, offset, user?.id),
|
|
125
125
|
queryFn: async () => {
|
|
126
126
|
return authenticatedApiCall<WalletTransactionsResponse>(
|
|
127
127
|
oxyServices,
|
|
@@ -129,7 +129,7 @@ export const useUserWalletTransactions = (
|
|
|
129
129
|
() => oxyServices.getCurrentUserWalletTransactions({ limit, offset }),
|
|
130
130
|
);
|
|
131
131
|
},
|
|
132
|
-
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
132
|
+
enabled: (options?.enabled !== false) && isAuthenticated && !!user?.id,
|
|
133
133
|
staleTime: 60 * 1000, // 1 minute (ledger updates frequently)
|
|
134
134
|
gcTime: 10 * 60 * 1000, // 10 minutes
|
|
135
135
|
});
|
|
@@ -5,6 +5,9 @@ import { queryKeys } from './queryKeys';
|
|
|
5
5
|
import { useOxy } from '../../context/OxyContext';
|
|
6
6
|
import { fetchSessionsWithFallback, mapSessionsToClient } from '../../utils/sessionHelpers';
|
|
7
7
|
|
|
8
|
+
const accountQueryScope = (activeSessionId: string | null, actingAs?: string | null): string =>
|
|
9
|
+
`${activeSessionId ?? 'no-session'}:${actingAs ?? 'self'}`;
|
|
10
|
+
|
|
8
11
|
/**
|
|
9
12
|
* Get all active sessions for the current user
|
|
10
13
|
*/
|
|
@@ -90,10 +93,10 @@ export const useDeviceSessions = (options?: { enabled?: boolean }) => {
|
|
|
90
93
|
* Get user devices
|
|
91
94
|
*/
|
|
92
95
|
export const useUserDevices = (options?: { enabled?: boolean }) => {
|
|
93
|
-
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
96
|
+
const { oxyServices, isAuthenticated, activeSessionId, actingAs } = useOxy();
|
|
94
97
|
|
|
95
98
|
return useQuery({
|
|
96
|
-
queryKey: queryKeys.devices.list(),
|
|
99
|
+
queryKey: queryKeys.devices.list(accountQueryScope(activeSessionId, actingAs)),
|
|
97
100
|
queryFn: async () => {
|
|
98
101
|
return authenticatedApiCall(
|
|
99
102
|
oxyServices,
|
|
@@ -101,7 +104,7 @@ export const useUserDevices = (options?: { enabled?: boolean }) => {
|
|
|
101
104
|
() => oxyServices.getUserDevices()
|
|
102
105
|
);
|
|
103
106
|
},
|
|
104
|
-
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
107
|
+
enabled: (options?.enabled !== false) && isAuthenticated && !!activeSessionId,
|
|
105
108
|
staleTime: 5 * 60 * 1000,
|
|
106
109
|
gcTime: 30 * 60 * 1000,
|
|
107
110
|
});
|
|
@@ -132,10 +135,10 @@ export const useSecurityInfo = (options?: { enabled?: boolean }) => {
|
|
|
132
135
|
* `useEffect` fetches.
|
|
133
136
|
*/
|
|
134
137
|
export const useAccountStorageUsage = (options?: { enabled?: boolean }) => {
|
|
135
|
-
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
138
|
+
const { oxyServices, isAuthenticated, activeSessionId, actingAs } = useOxy();
|
|
136
139
|
|
|
137
140
|
return useQuery<AccountStorageUsageResponse>({
|
|
138
|
-
queryKey: queryKeys.storage.usage(),
|
|
141
|
+
queryKey: queryKeys.storage.usage(accountQueryScope(activeSessionId, actingAs)),
|
|
139
142
|
queryFn: async () => {
|
|
140
143
|
return authenticatedApiCall(
|
|
141
144
|
oxyServices,
|
|
@@ -143,7 +146,7 @@ export const useAccountStorageUsage = (options?: { enabled?: boolean }) => {
|
|
|
143
146
|
() => oxyServices.getAccountStorageUsage()
|
|
144
147
|
);
|
|
145
148
|
},
|
|
146
|
-
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
149
|
+
enabled: (options?.enabled !== false) && isAuthenticated && !!activeSessionId,
|
|
147
150
|
staleTime: 5 * 60 * 1000,
|
|
148
151
|
gcTime: 30 * 60 * 1000,
|
|
149
152
|
});
|
|
@@ -33,7 +33,7 @@ import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persi
|
|
|
33
33
|
import { isDev } from '@oxyhq/core';
|
|
34
34
|
import type { StorageInterface } from '../utils/storageHelpers';
|
|
35
35
|
|
|
36
|
-
const QUERY_CACHE_KEY = '
|
|
36
|
+
const QUERY_CACHE_KEY = 'oxy_query_cache_v3';
|
|
37
37
|
const QUERY_CACHE_MAX_AGE = 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
38
38
|
const QUERY_PERSIST_THROTTLE_MS = 1_000;
|
|
39
39
|
|
|
@@ -50,7 +50,6 @@ const PERSISTED_QUERY_PREFIXES: ReadonlyArray<string> = [
|
|
|
50
50
|
'sessions',
|
|
51
51
|
'devices',
|
|
52
52
|
'privacy',
|
|
53
|
-
'payments',
|
|
54
53
|
];
|
|
55
54
|
|
|
56
55
|
/**
|
|
@@ -209,9 +208,10 @@ export const attachQueryPersistence = (
|
|
|
209
208
|
return { unsubscribe, restored };
|
|
210
209
|
};
|
|
211
210
|
|
|
212
|
-
// Legacy
|
|
213
|
-
// written by older builds.
|
|
214
|
-
|
|
211
|
+
// Legacy cache keys — kept so we can opportunistically purge stale blobs
|
|
212
|
+
// written by older builds. v2 may contain persisted payments data, so the
|
|
213
|
+
// active key is bumped to v3 and old blobs are only removed during explicit clears.
|
|
214
|
+
const LEGACY_QUERY_CACHE_KEYS: ReadonlyArray<string> = ['oxy_query_cache_v2', 'oxy_query_cache'];
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* Remove the persisted query+mutation cache (used on full sign-out / data
|
|
@@ -53,6 +53,27 @@ export interface AuthSession {
|
|
|
53
53
|
expiresAt: number;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Extended `POST /auth/session/create` response (the "Sign in with Oxy" handoff
|
|
58
|
+
* fields, Workstream C2). Both are optional so this hook degrades gracefully
|
|
59
|
+
* when the handoff backend is not yet deployed — the legacy `oxyauth://<token>`
|
|
60
|
+
* QR (`qrData`) remains the fallback.
|
|
61
|
+
*/
|
|
62
|
+
interface AuthSessionCreateResponse {
|
|
63
|
+
/**
|
|
64
|
+
* Public, single-use authorize code carried in the QR / deep-link. NEVER the
|
|
65
|
+
* secret `sessionToken` — the approver resolves the requesting app's identity
|
|
66
|
+
* from this code server-side.
|
|
67
|
+
*/
|
|
68
|
+
authorizeCode?: string;
|
|
69
|
+
/** Ready-to-render deep-link / universal-link string (`oxycommons://approve?...`). */
|
|
70
|
+
qrPayload?: string;
|
|
71
|
+
/** Session lifecycle status (e.g. `'pending'`). */
|
|
72
|
+
status?: string;
|
|
73
|
+
/** Server-authoritative expiry (epoch ms); the client-proposed value is the fallback. */
|
|
74
|
+
expiresAt?: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
56
77
|
/** Real-time auth-session socket payload (also matches the poll status shape). */
|
|
57
78
|
interface AuthUpdatePayload {
|
|
58
79
|
status: 'authorized' | 'cancelled' | 'expired';
|
|
@@ -76,6 +97,21 @@ export interface UseOxyAuthSessionResult {
|
|
|
76
97
|
authSession: AuthSession | null;
|
|
77
98
|
/** The QR payload string (`oxyauth://<token>`), or `''` when no session. */
|
|
78
99
|
qrData: string;
|
|
100
|
+
/**
|
|
101
|
+
* The PUBLIC, single-use authorize code for the "Sign in with Oxy" handoff,
|
|
102
|
+
* or `null` when the handoff backend did not return one. The approver (the
|
|
103
|
+
* Oxy identity app) resolves the requesting app's identity from this code —
|
|
104
|
+
* it is safe to display; it is NOT the secret `sessionToken`.
|
|
105
|
+
*/
|
|
106
|
+
authorizeCode: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* The structured "Sign in with Oxy" deep-link payload
|
|
109
|
+
* (`oxycommons://approve?...`) to render in the cross-device QR and to open on
|
|
110
|
+
* the same device, or `null` when the handoff backend did not return one.
|
|
111
|
+
* Render this (preferred over `qrData`) in the QR and pass it to
|
|
112
|
+
* `Linking.openURL` for same-device approval.
|
|
113
|
+
*/
|
|
114
|
+
qrPayload: string | null;
|
|
79
115
|
/** `true` while the session is being created (initial spinner). */
|
|
80
116
|
isLoading: boolean;
|
|
81
117
|
/** A user-facing error message, or `null`. Drives the retry UI. */
|
|
@@ -89,6 +125,13 @@ export interface UseOxyAuthSessionResult {
|
|
|
89
125
|
* This is the action behind the platform-primary "Continue with Oxy" button.
|
|
90
126
|
*/
|
|
91
127
|
openAuthApproval: () => Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Same-device "Sign in with Oxy" handoff: deep-link to `qrPayload`
|
|
130
|
+
* (`oxycommons://approve?...`) so the native Oxy identity app opens directly
|
|
131
|
+
* to approve. No-op when no `qrPayload` was returned. The socket / poll still
|
|
132
|
+
* completes the sign-in once the approval lands.
|
|
133
|
+
*/
|
|
134
|
+
openSameDeviceApproval: () => Promise<void>;
|
|
92
135
|
/** Tear down the current session and create a fresh one (the retry action). */
|
|
93
136
|
retry: () => void;
|
|
94
137
|
/** Disconnect the socket and stop polling. Idempotent. */
|
|
@@ -198,6 +241,9 @@ export function useOxyAuthSession(
|
|
|
198
241
|
const [isLoading, setIsLoading] = useState(true);
|
|
199
242
|
const [error, setError] = useState<string | null>(null);
|
|
200
243
|
const [isWaiting, setIsWaiting] = useState(false);
|
|
244
|
+
// "Sign in with Oxy" handoff fields surfaced from the `create` response.
|
|
245
|
+
const [authorizeCode, setAuthorizeCode] = useState<string | null>(null);
|
|
246
|
+
const [qrPayload, setQrPayload] = useState<string | null>(null);
|
|
201
247
|
|
|
202
248
|
const socketRef = useRef<Socket | null>(null);
|
|
203
249
|
const pollingIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
|
@@ -376,6 +422,9 @@ export function useOxyAuthSession(
|
|
|
376
422
|
const generateAuthSession = useCallback(async () => {
|
|
377
423
|
setIsLoading(true);
|
|
378
424
|
setError(null);
|
|
425
|
+
// Reset the handoff fields for the fresh session (also clears them on retry).
|
|
426
|
+
setAuthorizeCode(null);
|
|
427
|
+
setQrPayload(null);
|
|
379
428
|
isProcessingRef.current = false;
|
|
380
429
|
|
|
381
430
|
// The cross-app device sign-in flow identifies the requesting app by its
|
|
@@ -393,8 +442,11 @@ export function useOxyAuthSession(
|
|
|
393
442
|
const sessionToken = generateSessionToken();
|
|
394
443
|
const expiresAt = Date.now() + AUTH_SESSION_EXPIRY_MS;
|
|
395
444
|
|
|
396
|
-
// Register the auth session with the server.
|
|
397
|
-
|
|
445
|
+
// Register the auth session with the server. The response carries the
|
|
446
|
+
// "Sign in with Oxy" handoff fields (public `authorizeCode` + structured
|
|
447
|
+
// `qrPayload`) when the handoff backend is deployed; both are optional, so
|
|
448
|
+
// the legacy `oxyauth://<token>` QR path keeps working without them.
|
|
449
|
+
const createResponse = await oxyServices.makeRequest<AuthSessionCreateResponse>(
|
|
398
450
|
'POST',
|
|
399
451
|
'/auth/session/create',
|
|
400
452
|
{ sessionToken, expiresAt, clientId },
|
|
@@ -402,6 +454,8 @@ export function useOxyAuthSession(
|
|
|
402
454
|
);
|
|
403
455
|
|
|
404
456
|
setAuthSession({ sessionToken, expiresAt });
|
|
457
|
+
setAuthorizeCode(createResponse?.authorizeCode ?? null);
|
|
458
|
+
setQrPayload(createResponse?.qrPayload ?? null);
|
|
405
459
|
setIsWaiting(true);
|
|
406
460
|
|
|
407
461
|
// Socket is the fast path; the poll is a transport-independent backstop
|
|
@@ -461,6 +515,23 @@ export function useOxyAuthSession(
|
|
|
461
515
|
}
|
|
462
516
|
}, [authSession, oxyServices]);
|
|
463
517
|
|
|
518
|
+
// Same-device "Sign in with Oxy" handoff: deep-link to the `qrPayload`
|
|
519
|
+
// (`oxycommons://approve?...`) so the native Oxy identity app opens directly
|
|
520
|
+
// to approve. The socket / poll already resolves the flow once the approval
|
|
521
|
+
// lands, so this only needs to launch the deep link. No-op when the handoff
|
|
522
|
+
// backend returned no `qrPayload`.
|
|
523
|
+
const openSameDeviceApproval = useCallback(async () => {
|
|
524
|
+
if (!qrPayload) {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
try {
|
|
528
|
+
await Linking.openURL(qrPayload);
|
|
529
|
+
} catch (err) {
|
|
530
|
+
debug.error('Unable to open the Oxy app for approval:', err);
|
|
531
|
+
setError('Unable to open the Oxy app. Scan the QR code from another device instead.');
|
|
532
|
+
}
|
|
533
|
+
}, [qrPayload]);
|
|
534
|
+
|
|
464
535
|
// Tear down and recreate the session (the retry action).
|
|
465
536
|
const retry = useCallback(() => {
|
|
466
537
|
cleanup();
|
|
@@ -546,10 +617,13 @@ export function useOxyAuthSession(
|
|
|
546
617
|
return {
|
|
547
618
|
authSession,
|
|
548
619
|
qrData,
|
|
620
|
+
authorizeCode,
|
|
621
|
+
qrPayload,
|
|
549
622
|
isLoading,
|
|
550
623
|
error,
|
|
551
624
|
isWaiting,
|
|
552
625
|
openAuthApproval,
|
|
626
|
+
openSameDeviceApproval,
|
|
553
627
|
retry,
|
|
554
628
|
cleanup,
|
|
555
629
|
};
|
|
@@ -29,6 +29,9 @@ export interface ProfileUpdateData {
|
|
|
29
29
|
links?: string[];
|
|
30
30
|
linksMetadata?: ProfileLinkMetadata[];
|
|
31
31
|
avatar?: string;
|
|
32
|
+
phone?: string;
|
|
33
|
+
address?: string;
|
|
34
|
+
birthday?: string;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
type ProfileFieldValue = string | ProfileLocation[] | ProfileLinkMetadata[];
|
|
@@ -81,6 +84,15 @@ export const useProfileEditing = () => {
|
|
|
81
84
|
if (updates.avatar !== undefined) {
|
|
82
85
|
updateData.avatar = updates.avatar;
|
|
83
86
|
}
|
|
87
|
+
if (updates.phone !== undefined) {
|
|
88
|
+
updateData.phone = updates.phone;
|
|
89
|
+
}
|
|
90
|
+
if (updates.address !== undefined) {
|
|
91
|
+
updateData.address = updates.address;
|
|
92
|
+
}
|
|
93
|
+
if (updates.birthday !== undefined) {
|
|
94
|
+
updateData.birthday = updates.birthday;
|
|
95
|
+
}
|
|
84
96
|
|
|
85
97
|
// Handle name field
|
|
86
98
|
if (updates.firstName !== undefined || updates.lastName !== undefined) {
|
|
@@ -124,6 +136,18 @@ export const useProfileEditing = () => {
|
|
|
124
136
|
if (typeof value !== 'string') return false;
|
|
125
137
|
updates.bio = value;
|
|
126
138
|
break;
|
|
139
|
+
case 'phone':
|
|
140
|
+
if (typeof value !== 'string') return false;
|
|
141
|
+
updates.phone = value;
|
|
142
|
+
break;
|
|
143
|
+
case 'address':
|
|
144
|
+
if (typeof value !== 'string') return false;
|
|
145
|
+
updates.address = value;
|
|
146
|
+
break;
|
|
147
|
+
case 'birthday':
|
|
148
|
+
if (typeof value !== 'string') return false;
|
|
149
|
+
updates.birthday = value;
|
|
150
|
+
break;
|
|
127
151
|
case 'location':
|
|
128
152
|
if (!isProfileLocationArray(value)) return false;
|
|
129
153
|
updates.locations = value;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { isDev, type ApiError, type User } from '@oxyhq/core';
|
|
3
3
|
import type { ClientSession } from '@oxyhq/core';
|
|
4
4
|
import { mergeSessions, normalizeAndSortSessions, sessionsArraysEqual } from '@oxyhq/core';
|
|
5
5
|
import { fetchSessionsWithFallback, validateSessionBatch } from '../utils/sessionHelpers';
|
|
@@ -30,7 +30,7 @@ export interface UseSessionManagementResult {
|
|
|
30
30
|
sessions: ClientSession[];
|
|
31
31
|
activeSessionId: string | null;
|
|
32
32
|
setActiveSessionId: (sessionId: string | null) => void;
|
|
33
|
-
updateSessions: (incoming: ClientSession[], options?: { merge?: boolean }) => void;
|
|
33
|
+
updateSessions: (incoming: ClientSession[], options?: { merge?: boolean; preserveSessionIds?: string[] }) => void;
|
|
34
34
|
switchSession: (sessionId: string) => Promise<User>;
|
|
35
35
|
refreshSessions: (activeUserId?: string) => Promise<void>;
|
|
36
36
|
clearSessionState: () => Promise<void>;
|
|
@@ -86,7 +86,7 @@ export const useSessionManagement = ({
|
|
|
86
86
|
} catch (error) {
|
|
87
87
|
if (logger) {
|
|
88
88
|
logger(DEFAULT_SAVE_ERROR_MESSAGE, error);
|
|
89
|
-
} else if (
|
|
89
|
+
} else if (isDev()) {
|
|
90
90
|
console.warn('Failed to save session IDs:', error);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -95,14 +95,17 @@ export const useSessionManagement = ({
|
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
const updateSessions = useCallback(
|
|
98
|
-
(incoming: ClientSession[], options: { merge?: boolean } = {}): void => {
|
|
98
|
+
(incoming: ClientSession[], options: { merge?: boolean; preserveSessionIds?: string[] } = {}): void => {
|
|
99
99
|
setSessions((prevSessions) => {
|
|
100
100
|
const processed = options.merge
|
|
101
101
|
? mergeSessions(prevSessions, incoming, activeSessionIdRef.current, false)
|
|
102
102
|
: normalizeAndSortSessions(incoming, activeSessionIdRef.current, false);
|
|
103
103
|
|
|
104
104
|
if (storage) {
|
|
105
|
-
void saveSessionIds(
|
|
105
|
+
void saveSessionIds([
|
|
106
|
+
...processed.map((session) => session.sessionId),
|
|
107
|
+
...(options.preserveSessionIds ?? []),
|
|
108
|
+
]);
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
if (sessionsArraysEqual(prevSessions, processed)) {
|
|
@@ -309,7 +312,7 @@ export const useSessionManagement = ({
|
|
|
309
312
|
});
|
|
310
313
|
updateSessions(deviceSessions, { merge: true });
|
|
311
314
|
} catch (error) {
|
|
312
|
-
if (
|
|
315
|
+
if (isDev()) {
|
|
313
316
|
console.warn('Failed to synchronize sessions after switch:', error);
|
|
314
317
|
}
|
|
315
318
|
}
|